/// <summary> /// SetScreenPreviewCallback /// </summary> public void DrawFrame(IDeckLinkVideoFrame theFrame) { if (theFrame == null) { return; } try { if (!_Streaming) { return; } Interlocked.Increment(ref _PreviewCount); Run(() => previewCount.Text = _PreviewCount.ToString()); _GLHelper.SetFrame(theFrame); previewBox.MakeCurrent(); _GLHelper.PaintGL(); previewBox.SwapBuffers(); previewBox.Context.MakeCurrent(null); } finally { Marshal.ReleaseComObject(theFrame); } }
void IDeckLinkScreenPreviewCallback.DrawFrame(IDeckLinkVideoFrame theFrame) { if (!glIsInitialized) { return; } // First, pass the frame to the DeckLink screen preview helper SetTimecode(theFrame); m_previewHelper.SetFrame(theFrame); capturedFrames++; Invalidate(); System.Runtime.InteropServices.Marshal.ReleaseComObject(theFrame); }