Beispiel #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);
        }
        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));
            }
        }
Beispiel #3
0
        public void Close()
        {
            try
            {
                this.Lock.AcquireWriterLock(10000);
            }
            catch
            {
            }
            try
            {
                if (!Ready)
                {
                    return;
                }

                Ready = false;
                FDevice.StopStreams();
                FDevice.DisableVideoInput();
            }
            finally
            {
                this.Lock.ReleaseWriterLock();
            }
        }
Beispiel #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.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);
        }
Beispiel #5
0
 protected override void Close()
 {
     try
     {
         FDevice.StopStreams();
         FDevice.DisableVideoInput();
         Status = "Closed";
     }
     catch (Exception e)
     {
         Status = e.Message;
     }
 }
        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);
        }
Beispiel #7
0
 public void Stop(bool reportError = true)
 {
     try
     {
         recorder.StopStreams();
         recorder.DisableAudioInput();
         recorder.DisableVideoInput();
     }
     catch (Exception ex)
     {
         if (reportError)
         {
             MessageBox.Show($"Cannot stop fingerprinting: {ex.Message}", "Error", MessageBoxButton.OK);
         }
     }
 }
Beispiel #8
0
        public void Close()
        {
            WorkerThread.Singleton.PerformBlocking(() =>
            {
                this.Lock.AcquireWriterLock(10000);
                try
                {
                    if (!Ready)
                    {
                        return;
                    }

                    Ready = false;
                    FDevice.StopStreams();
                    FDevice.DisableVideoInput();
                }
                finally
                {
                    this.Lock.ReleaseWriterLock();
                }
            });
        }