2.4.7 Ancillary Data functionality¶
The capture or output of vertical ancillary data (VANC) is supported by certain DeckLink device models. Ancillary Data support is only available for SDI, Optical SDI, Ethernet and Optical Ethernet connections. The lines of VANC that are accessible are dependent upon the model of the DeckLink device. Currently horizontal ancillary data (HANC) access is not supported.
2.4.7.1 VANC Capture¶
An application performing VANC data capture should perform the following steps:
Call
IDeckLinkProfileAttributes::GetFlag()
with theBMDDeckLinkVANCRequires10BitYUVVideoFrames
flag to check whether the DeckLink hardware supports VANC only when the active picture and ancillary data are both 10-bit YUV pixel format.
While streams are running:
Receive calls to
IDeckLinkInputCallback::VideoInputFrameArrived()
Inside the callback:
Call
IUnknown::QueryInterface()
on theIDeckLinkVideoInputFrame
object with IID_IDeckLinkVideoFrameAncillaryPackets. As theIDeckLinkVideoFrameAncillaryPackets
object has a reference to theIDeckLinkVideoInputFrame
input frame, ensure that it is released in a timely manner, otherwise the capture will run out of available frames.If the DID/SDID for the ancillary packet is known, then call
IDeckLinkVideoFrameAncillaryPackets::GetFirstPacketByID()
. Check that S_OK is returned to confirm an ancillary packet with matching DID/SDID is found.Otherwise, enumerate the ancillary packets in the video frame by calling
IDeckLinkVideoFrameAncillaryPackets::GetPacketIterator()
.Call
IDeckLinkAncillaryPacket::GetBytes()
. The output packet payload will be converted to the requestedBMDAncillaryPacketFormat
.
2.4.7.2 VANC Output¶
Call
IDeckLinkOutput::EnableVideoOutput()
with thebmdVideoOutputVANC
flag set.Call
IDeckLinkProfileAttributes::GetFlag()
with theBMDDeckLinkVANCRequires10BitYUVVideoFrames
flag to check whether the DeckLink hardware supports VANC only when the active picture and ancillary data are both 10-bit YUV pixel format.Create an ancillary packet object that subclasses
IDeckLinkAncillaryPacket
, implementing all methods of theIDeckLinkAncillaryPacket
class.Implement
IDeckLinkAncillaryPacket::GetBytes()
to provide a pointer to packet data in playback operation. The packet payload data shall be implemented with at least oneBMDAncillaryPacketFormat
. The driver will automatically convert to the correct format on output.Create a video frame for output with
IDeckLinkOutput::CreateVideoFrame()
orIDeckLinkOutput::CreateVideoFrameWithBuffer()
.Call
IUnknown::QueryInterface()
on theIDeckLinkVideoFrame
object with IID_IDeckLinkVideoFrameAncillaryPackets. As theIDeckLinkVideoFrameAncillaryPackets
object has a reference to theIDeckLinkVideoFrame
frame, ensure that it is released in a timely manner, otherwise the playback will run out of available frames.Call
IDeckLinkVideoFrameAncillaryPackets::AttachPacket()
to attach the ancillary packet to video frame for playback.
Note
For applications outputting custom video frame objects that implement the IDeckLinkVideoFrame
interface (for example for 3D playback or HDR metadata output), the class must provide a valid object when its IUnknown::QueryInterface()
is called with IID_IDeckLinkVideoFrameAncillaryPackets. The return object interface from IUnknown::QueryInterface()
should be obtained with CoCreateInstance with CLSID_CDeckLinkVideoFrameAncillaryPackets (Windows) or CreateVideoFrameAncillaryPacketsInstance (macOS and Linux).