private void EnumDevices() { ClearDevices(); _devices = new List <AVProLiveCameraDevice>(8); int numDevices = AVProLiveCameraPlugin.GetNumDevices(); for (int i = 0; i < numDevices; i++) { string deviceName; if (!AVProLiveCameraPlugin.GetDeviceName(i, out deviceName)) { continue; } string deviceGUID; if (!AVProLiveCameraPlugin.GetDeviceGUID(i, out deviceGUID)) { continue; } int numModes = AVProLiveCameraPlugin.GetNumModes(i); if (numModes > 0) { AVProLiveCameraDevice device = new AVProLiveCameraDevice(deviceName.ToString(), deviceGUID.ToString(), i); _devices.Add(device); } } }
private void EnumModes() { int numModes = AVProLiveCameraPlugin.GetNumModes(_deviceIndex); for (int i = 0; i < numModes; i++) { int width, height; float fps; string format; if (AVProLiveCameraPlugin.GetModeInfo(_deviceIndex, i, out width, out height, out fps, out format)) { AVProLiveCameraDeviceMode mode = new AVProLiveCameraDeviceMode(this, i, width, height, fps, format.ToString()); _modes.Add(mode); } } SortModes(); }
/* * private void OnRenderObject() * { #if UNITY_5_4_OR_NEWER || (UNITY_5 && !UNITY_5_0 && !UNITY_5_1) * GL.IssuePluginEvent(_renderFunc, AVProLiveCameraPlugin.PluginID | (int)AVProLiveCameraPlugin.PluginEvent.UpdateAllTextures); #else * GL.IssuePluginEvent(AVProLiveCameraPlugin.PluginID | (int)AVProLiveCameraPlugin.PluginEvent.UpdateAllTextures); #endif * }*/ private void AddNewDevices() { bool isDeviceAdded = false; int numDevices = AVProLiveCameraPlugin.GetNumDevices(); for (int i = 0; i < numDevices; i++) { string deviceGUID; if (!AVProLiveCameraPlugin.GetDeviceGUID(i, out deviceGUID)) { continue; } AVProLiveCameraDevice device = FindDeviceWithGUID(deviceGUID); if (device == null) { string deviceName; if (!AVProLiveCameraPlugin.GetDeviceName(i, out deviceName)) { continue; } int numModes = AVProLiveCameraPlugin.GetNumModes(i); if (numModes > 0) { device = new AVProLiveCameraDevice(deviceName.ToString(), deviceGUID.ToString(), i); _devices.Add(device); isDeviceAdded = true; } } } if (isDeviceAdded) { this.SendMessage("NewDeviceAdded", null, SendMessageOptions.DontRequireReceiver); } }