private void EnumDevices() { _devices = new List <Device>(8); int numDevices = DeckLinkPlugin.GetNumDevices(); if (numDevices == 0) { uint apiVersionCode = DeckLinkPlugin.GetDeckLinkAPIVersion(); string apiVersionString = "" + ((apiVersionCode >> 24) & 255) + "." + ((apiVersionCode >> 16) & 255) + "." + ((apiVersionCode >> 8) & 255) + "." + ((apiVersionCode >> 0) & 255); Debug.LogWarning("[AVProDeckLink] Unable to find any DeckLink Devices, It is possible that your Desktop Video is out of date. Please update to version " + apiVersionString); } for (int deviceIndex = 0; deviceIndex < numDevices; deviceIndex++) { int numInputModes = DeckLinkPlugin.GetNumVideoInputModes(deviceIndex); int numOutputModes = DeckLinkPlugin.GetNumVideoOutputModes(deviceIndex); if (numInputModes > 0 || numOutputModes > 0) { string modelName = DeckLinkPlugin.GetDeviceName(deviceIndex); string displayName = DeckLinkPlugin.GetDeviceDisplayName(deviceIndex); Device device = new Device(modelName, displayName, deviceIndex); _devices.Add(device); if (_logDeviceEnumeration) { Debug.Log("[AVProDeckLink] Device" + deviceIndex + ": " + displayName + "(" + modelName + ") has " + device.NumInputModes + " video input modes, " + device.NumOutputModes + " video output modes"); if (device.SupportsInputModeAutoDetection) { Debug.Log("[AVProDeckLink]\tSupports input video mode auto-detection"); } if (device.SupportsInternalKeying) { Debug.Log("[AVProDeckLink]\tSupports internal keyer"); } if (device.SupportsExternalKeying) { Debug.Log("[AVProDeckLink]\tSupports external keyer"); } for (int modeIndex = 0; modeIndex < device.NumInputModes; modeIndex++) { DeviceMode mode = device.GetInputMode(modeIndex); Debug.Log("[AVProDeckLink]\t\tInput Mode" + modeIndex + ": " + mode.ModeDescription + " " + mode.Width + "x" + mode.Height + " @" + mode.FrameRate + " (" + mode.PixelFormatDescription + ") "); } for (int modeIndex = 0; modeIndex < device.NumOutputModes; modeIndex++) { DeviceMode mode = device.GetOutputMode(modeIndex); Debug.Log("[AVProDeckLink]\t\tOutput Mode" + modeIndex + ": " + mode.ModeDescription + " " + mode.Width + "x" + mode.Height + " @" + mode.FrameRate + " (" + mode.PixelFormatDescription + ") "); } } } } }
new void Awake() { base.Awake(); #if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN if (Init()) { Debug.Log("[AVProDeckLink] Initialised (plugin v" + DeckLinkPlugin.GetNativePluginVersion() + " script v" + Helper.Version + ")"); uint apiVersionCode = DeckLinkPlugin.GetDeckLinkAPIVersion(); string apiVersionString = "" + ((apiVersionCode >> 24) & 255) + "." + ((apiVersionCode >> 16) & 255) + "." + ((apiVersionCode >> 8) & 255) + "." + ((apiVersionCode >> 0) & 255); Debug.Log("[AVProDeckLink] Using DeckLink API version " + apiVersionString); } else { Debug.LogError("[AVProDeckLink] failed to initialise."); this.enabled = false; _isInitialised = false; } #endif }