2.5.43 IDeckLinkVideoConversion Interface

The IDeckLinkVideoConversion interface provides the capability to copy an image from a source frame into a destination frame converting between the formats as required.

A reference to an IDeckLinkVideoConversion interface may be obtained from CoCreateInstance() on platforms with native COM support or from CreateVideoConversionInstance() on other platforms.

Related Interfaces

Interface

Interface ID

Description

IDeckLinkVideoFrame

IID_IDeckLinkVideoFrame

An IDeckLinkVideoFrame object interface is the source video frame for IDeckLinkVideoConversion::ConvertFrame()

IDeckLinkVideoFrame

IID_IDeckLinkVideoFrame

An IDeckLinkVideoFrame object interface is the destination video frame for IDeckLinkVideoConversion::ConvertFrame()

IDeckLinkVideoFrame

IID_IDeckLinkVideoFrame

IDeckLinkVideoConversion::ConvertNewFrame() outputs an IDeckLinkVideoFrame object interface

IDeckLinkVideoBuffer

IID_IDeckLinkVideoBuffer

An IDeckLinkVideoBuffer object interface is an optional destination video buffer for IDeckLinkVideoConversion::ConvertNewFrame()

2.5.43.1 IDeckLinkVideoConversion::ConvertFrame method

HRESULT IDeckLinkVideoConversion::ConvertFrame(IDeckLinkVideoFrame *srcFrame, IDeckLinkVideoFrame *dstFrame);

The ConvertFrame method copies the source frame (srcFrame) to the destination frame (dstFrame). The pixel format of the video frame will be converted if possible. The return value for this method should be checked to ensure that the desired conversion is supported.

The IDeckLinkVideoFrame object for the destination frame, with the desired properties, can be created using IDeckLinkOutput::CreateVideoFrame(). Alternatively the destination frame can be created by subclassing IDeckLinkVideoFrame and setting properties directly in the subclassed object.

Parameters:
  • srcFrame – The properties of the source frame

  • dstFrame – The properties of the destination frame

Return values:
  • E_NOTIMPL – Conversion not currently supported

  • E_OUTOFMEMORY – The provided buffer is too small

  • E_FAIL – Failure

  • S_OK – Success

2.5.43.2 IDeckLinkVideoConversion::ConvertNewFrame method

HRESULT IDeckLinkVideoConversion::ConvertNewFrame(IDeckLinkVideoFrame *srcFrame, BMDPixelFormat dstPixelFormat, BMDColorspace dstColorspace, IDeckLinkVideoBuffer *dstBuffer, IDeckLinkVideoFrame **dstFrame);

Create a new frame and convert the source frame into it. Optionally provide a buffer for the frame, otherwise one will be allocated with the default allocator.

Parameters:
  • srcFrame – The properties of the source frame

  • dstPixelFormat – Destination pixel format

  • dstColorspace – Destination colorspace. bmdColorspaceUnknown means use same as srcFrame

  • dstBuffer – Supply custom buffer for dstFrame, or nullptr for default allocation.

  • dstFrame – New converted destination frame

Return values:
  • E_NOTIMPL – Conversion not currently supported

  • E_OUTOFMEMORY – The provided buffer is too small, or destination buffer/frame could not be allocated

  • E_FAIL – Failure

  • S_OK – Success