Пример #1
0
        private void AdjustPlaybackFramerate()
        {
            int numWaitingOutputFrames = DeckLinkPlugin.GetOutputBufferedFramesCount(_device.DeviceIndex);

            // Dynamically adjust frame rate so we get a smooth output
            int target = _targetFrameRate;

            if (numWaitingOutputFrames < _bufferBalance)
            {
                target = Mathf.CeilToInt(_targetFrameRate + 1);
            }
            else if (numWaitingOutputFrames > _bufferBalance)
            {
                target = Mathf.CeilToInt(_targetFrameRate - 1);
            }

            if (!DeckLinkSettings.Instance._multiOutput)
            {
                Time.captureFramerate = Application.targetFrameRate = target;
            }
            else
            {
                _outputFrameRate = target;
            }
        }