Пример #1
0
        void IDeckLinkInputCallback.VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
        {
            // Restart capture with the new video mode if told to
            if (!m_applyDetectedInputMode)
            {
                return;
            }

            var pixelFormat = _BMDPixelFormat.bmdFormat10BitYUV;

            if (detectedSignalFlags.HasFlag(_BMDDetectedVideoInputFormatFlags.bmdDetectedVideoInputRGB444))
            {
                pixelFormat = _BMDPixelFormat.bmdFormat10BitRGB;
            }

            // Stop the capture
            m_deckLinkInput.StopStreams();

            // Set the video input mode
            m_deckLinkInput.EnableVideoInput(newDisplayMode.GetDisplayMode(), pixelFormat, _BMDVideoInputFlags.bmdVideoInputEnableFormatDetection);

            // Start the capture
            m_deckLinkInput.StartStreams();

            InputFormatChanged(newDisplayMode);
        }
Пример #2
0
 // Video Input Format Changed
 public void VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
 {
 }
Пример #3
0
		public void VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
		{
			Reinitialise = true;
		}
Пример #4
0
        void IDeckLinkInputCallback.VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
        {
            // Restart capture with the new video mode if told to
            if (!m_applyDetectedInputMode)
            {
                return;
            }

            var pixelFormat = _BMDPixelFormat.bmdFormat8BitYUV;

            if (detectedSignalFlags.HasFlag(_BMDDetectedVideoInputFormatFlags.bmdDetectedVideoInputRGB444))
            {
                pixelFormat = _BMDPixelFormat.bmdFormat8BitBGRA;
            }

            // Stop the capture
            m_deckLinkInput.StopStreams();

            var displayMode = newDisplayMode.GetDisplayMode();

            // Set the video input mode
            m_deckLinkInput.EnableVideoInput(displayMode, pixelFormat, _BMDVideoInputFlags.bmdVideoInputEnableFormatDetection);

            // Start the capture
            m_deckLinkInput.StartStreams();

            // Register input format changed event
            var handler = InputFormatChangedHandler;

            // Check whether there are any subscribers to InputFormatChangedHandler
            if (handler != null)
            {
                handler(this, new DeckLinkInputFormatChangedEventArgs(notificationEvents, displayMode, pixelFormat));
            }
        }
Пример #5
0
        /// <summary>
        /// SetCallback
        /// </summary>
        public void VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
        {
            if (newDisplayMode == null)
            {
                return;
            }

            Run(() => notifications.Text = string.Format("Video format changed: mode={0}", newDisplayMode.GetDisplayMode()));
            Marshal.ReleaseComObject(newDisplayMode);
        }
Пример #6
0
 public void VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
 {
     MessageBox.Show("format changed");
 }
Пример #7
0
		void IDeckLinkInputCallback.VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
		{
		}
Пример #8
0
        void IDeckLinkInputCallback.VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
        {
            logger.Debug("IDeckLinkInputCallback.VideoInputFormatChanged(...) " + notificationEvents);

            // Restart capture with the new video mode if told to
            if (!applyDetectedInputMode)
            {
                return;
            }

            //var pixelFormat = _BMDPixelFormat.bmdFormat10BitYUV;
            //if ((detectedSignalFlags & _BMDDetectedVideoInputFormatFlags.bmdDetectedVideoInputRGB444) != 0)
            //{
            //    pixelFormat = _BMDPixelFormat.bmdFormat10BitRGB;
            //}


            var pixelFormat = _BMDPixelFormat.bmdFormat8BitYUV;//bmdFormat8BitYUV; //!!!!!!!!!!
            var dispMode    = newDisplayMode.GetDisplayMode();

            deckLinkInput.DoesSupportVideoMode(_BMDVideoConnection.bmdVideoConnectionHDMI, dispMode, pixelFormat, _BMDSupportedVideoModeFlags.bmdSupportedVideoModeDefault, out int supported);

            logger.Debug(pixelFormat + " " + supported);



            // Stop the capture
            deckLinkInput.StopStreams();

            // Set the video input mode
            deckLinkInput.EnableVideoInput(dispMode, pixelFormat, _BMDVideoInputFlags.bmdVideoInputEnableFormatDetection);

            // Start the capture
            deckLinkInput.StartStreams();

            logger.Debug("NewDisplayMode: " + newDisplayMode.GetDisplayMode());
            InputFormatChanged?.Invoke(newDisplayMode);
        }
Пример #9
0
        void IDeckLinkInputCallback.VideoInputFormatChanged(_BMDVideoInputFormatChangedEvents notificationEvents, IDeckLinkDisplayMode newDisplayMode, _BMDDetectedVideoInputFormatFlags detectedSignalFlags)
        {
            // Restart capture with the new video mode if told to
            if (!m_applyDetectedInputMode)
            {
                return;
            }

            var pixelFormat = _BMDPixelFormat.bmdFormat10BitYUV;

            if (detectedSignalFlags.HasFlag(_BMDDetectedVideoInputFormatFlags.bmdDetectedVideoInputRGB444))
            {
                m_pxFormat  = "10 bit RGB";
                pixelFormat = _BMDPixelFormat.bmdFormat10BitRGB;
            }
            if (detectedSignalFlags.HasFlag(_BMDDetectedVideoInputFormatFlags.bmdDetectedVideoInputYCbCr422))
            {
                m_pxFormat  = "10 bit YUV";
                pixelFormat = _BMDPixelFormat.bmdFormat10BitYUV;
            }
            if (detectedSignalFlags.HasFlag(_BMDDetectedVideoInputFormatFlags.bmdDetectedVideoInputDualStream3D))
            {
                m_pxFormat  = "Dual Stream 3D";
                pixelFormat = _BMDPixelFormat.bmdFormat10BitYUV;
            }

            // Stop the capture
            m_deckLinkInput.StopStreams();

            // Set the video input mode
            //For upload to GPU we need 8bitYUV
            //   m_deckLinkInput.EnableVideoInput(newDisplayMode.GetDisplayMode(), pixelFormat, _BMDVideoInputFlags.bmdVideoInputEnableFormatDetection);
            m_deckLinkInput.EnableVideoInput(newDisplayMode.GetDisplayMode(), _BMDPixelFormat.bmdFormat8BitYUV, _BMDVideoInputFlags.bmdVideoInputEnableFormatDetection);
            m_deckLinkInput.EnableAudioInput(_BMDAudioSampleRate.bmdAudioSampleRate48kHz, _BMDAudioSampleType.bmdAudioSampleType16bitInteger, 16);

            // Start the capture
            m_deckLinkInput.StartStreams();

            InputFormatChanged(newDisplayMode);
        }