Page 1 of 1

C# and GetBufferForVerticalBlankingLine

PostPosted: Sun Aug 20, 2017 1:09 pm
by matt.hardiman

I'm trying to extract VANC data using a C# application. I have got as far as capturing the video fine but I'm unable to work out the correct way to extract the VANC

Following the examples, I can get the Frame in "VideoInputFrameArrived" callback and also get the ancilliary data using

Code: Select all
                IDeckLinkVideoFrameAncillary ancilliary;
                aFrame.GetAncillaryData(out ancilliary);

but, when I try to get the VBI information using

Code: Select all
 ancilliary.GetBufferForVerticalBlankingLine(i, out pVancData);

the application hangs and visual studio shows no exceptions. I am lost at how I declare and reserve memory for the pVancData variable and have tried several different approaches but am clearly out of my depth.

The import of the DeckLinkAPI.dll shows the following for the IDeckLinkVideoFrameAncillary structure...

Code: Select all
namespace DeckLinkAPI
    public interface IDeckLinkVideoFrameAncillary
        void GetBufferForVerticalBlankingLine(uint lineNumber, out IntPtr buffer);
        _BMDDisplayMode GetDisplayMode();
        _BMDPixelFormat GetPixelFormat();

I'm unsure how to use this method in C# and really would appreciate any pointers