コード例 #1
0
        public void Update()
        {
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
            if (_isStreamingInput)
            {
                // Check if the input mode has changed
                if (DeckLinkPlugin.IsNoInputSignal(_deviceIndex))
                {
                    _receivedSignal = false;
                    DroppedInputSignalCount++;
                    return;
                }
                else
                {
                    _receivedSignal = true;
                }

                int modeIndex = DeckLinkPlugin.GetVideoInputModeIndex(_deviceIndex);
                if (modeIndex != _currentMode.Index)
                {
                    var newMode = _inputModes[modeIndex];

                    if (!FormatConverter.InputFormatSupported(newMode.PixelFormat))
                    {
                        Debug.LogWarning("Auto detected format for input device not currently supported");
                    }

                    if (modeIndex >= 0 && modeIndex < _inputModes.Count)
                    {
                        // If the device has changed mode we may need to rebuild buffers
                        ChangeInput(modeIndex, true);
                        return;
                    }
                }

                if (EnableAncillaryDataInput)
                {
                    UpdateAncillaryData();
                }
                if (EnableTimeCodeInput)
                {
                    UpdateTimeCode();
                }

                // Update textures
                if (_formatConverter != null)
                {
                    UpdateFPS(_formatConverter.Update());
                }
            }
#endif
        }