Ejemplo n.º 1
0
        public void Flush()
        {
            if (!Ready)
            {
                return;
            }

            FDevice.FlushStreams();
        }
Ejemplo n.º 2
0
 protected override void Generate()
 {
     FDevice.GetAvailableVideoFrameCount(out FFramesAvailable);
     if (FFlush)
     {
         FFlush = false;
         FDevice.FlushStreams();
     }
 }
Ejemplo n.º 3
0
 public void Flush()
 {
     if (!Ready)
     {
         return;
     }
     WorkerThread.Singleton.PerformBlocking(() =>
     {
         FDevice.FlushStreams();
     });
 }
Ejemplo n.º 4
0
        void IDeckLinkInputCallback.VideoInputFrameArrived(IDeckLinkVideoInputFrame videoFrame, IDeckLinkAudioInputPacket audioPacket)
        {
            if (videoFrame != null)
            {
                bool inputSignalAbsent = videoFrame.GetFlags().HasFlag(_BMDFrameFlags.bmdFrameHasNoInputSource);

                // Detect change in input signal, restart stream when valid stream detected
                if (!inputSignalAbsent && m_prevInputSignalAbsent)
                {
                    m_deckLinkInput.StopStreams();
                    m_deckLinkInput.FlushStreams();
                    m_deckLinkInput.StartStreams();
                }
                m_prevInputSignalAbsent = inputSignalAbsent;

                // Register video frame received event
                var handler = VideoFrameArrivedHandler;

                // Check whether there are any subscribers to VideoFrameArrivedHandler
                if (handler != null)
                {
                    handler(this, new DeckLinkVideoFrameArrivedEventArgs(videoFrame, inputSignalAbsent));
                }
            }

            if (audioPacket != null)
            {
                // Register audio packet received event
                var handler = AudioPacketArrivedHandler;

                // Check whether there are any subscribers to AudioPacketArrivedHandler
                if (handler != null)
                {
                    handler(this, new DeckLinkAudioPacketArrivedEventArgs(audioPacket));
                }
            }

            System.Runtime.InteropServices.Marshal.ReleaseComObject(videoFrame);
        }