コード例 #1
0
        private void EnumModes()
        {
            int numModes = DeckLinkPlugin.GetNumVideoInputModes(_deviceIndex);

            for (int modeIndex = 0; modeIndex < numModes; modeIndex++)
            {
                int    width, height;
                float  frameRate;
                string modeDesc;
                string pixelFormatDesc;
                long   frameDuration;
                int    fieldMode;
                if (DeckLinkPlugin.GetVideoInputModeInfo(_deviceIndex, modeIndex, out width, out height, out frameRate, out frameDuration, out fieldMode, out modeDesc, out pixelFormatDesc))
                {
                    DeviceMode mode = new DeviceMode(this, modeIndex, width, height, frameRate, frameDuration, (DeviceMode.FieldMode)fieldMode, modeDesc, pixelFormatDesc);
                    _inputModes.Add(mode);
                }
            }

            numModes = DeckLinkPlugin.GetNumVideoOutputModes(_deviceIndex);
            for (int modeIndex = 0; modeIndex < numModes; modeIndex++)
            {
                int    width, height;
                float  frameRate;
                string modeDesc;
                string pixelFormatDesc;
                long   frameDuration;
                int    fieldMode;
                if (DeckLinkPlugin.GetVideoOutputModeInfo(_deviceIndex, modeIndex, out width, out height, out frameRate, out frameDuration, out fieldMode, out modeDesc, out pixelFormatDesc))
                {
                    DeviceMode mode = new DeviceMode(this, modeIndex, width, height, frameRate, frameDuration, (DeviceMode.FieldMode)fieldMode, modeDesc, pixelFormatDesc);
                    _outputModes.Add(mode);
                }
            }
        }
コード例 #2
0
        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 + ") ");
                        }
                    }
                }
            }
        }
コード例 #3
0
        private void EnumDevices()
        {
            _devices = new List <Device>(8);
            int numDevices = DeckLinkPlugin.GetNumDevices();

            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 + ") ");
                        }
                    }
                }
            }
        }