2.4.3 3D Functionality¶
3D (dual-stream) capture and playback is supported by certain DeckLink devices such as the DeckLink 4K Extreme. The 3D functionality is only available over HDMI or SDI, where Channel A and Channel B represent the left and right eyes. The 3D packing must be manually set when connecting to
pre-HDMI 1.4 devices. When capturing from an HDMI 1.4 compliant source, the 3D packing format will automatically detected, and cannot be overridden. When outputting to an HDMI 1.4 compliant device / monitor, the packing format will be adjusted according to the device / monitor’s capabilities, but can be manually changed. Refer to the IDeckLinkConfiguration
Interface and
BMDVideo3DPackingFormat
sections for more information on getting and setting the packing format.
Note
Automatic mode detection is not available for UHD and DCI 4K 3D dual-link SDI modes.
2.4.3.1 3D Capture¶
An application performing a streaming 3D capture operation should perform the following steps:
If desired, enumerate the supported capture video modes by calling
IDeckLinkInput::GetDisplayModeIterator()
. For each reported capture mode, check for the presence of thebmdDisplayModeSupports3D
flag in the return value ofIDeckLinkDisplayMode::GetFlags()
indicating that this mode is supported for 3D capture. CallIDeckLinkInput::DoesSupportVideoMode()
with thebmdVideoInputDualStream3D
flag to check if the combination of the video mode and pixel format is supported.Call
IDeckLinkInput::EnableVideoInput()
with thebmdVideoInputDualStream3D
flag.
While streams are running:
Receive calls to
IDeckLinkInputCallback::VideoInputFrameArrived()
with left eye video frame and corresponding audio packet.
Inside the callback:
Call
IUnknown::QueryInterface()
on theIDeckLinkVideoInputFrame
object with IID_IDeckLinkVideoFrame3DExtensions.IDeckLinkVideoFrame3DExtensions::GetFrameForRightEye()
The returned frame object must be released by the caller when no longer required.
2.4.3.2 3D Playback¶
To support 3D playback, your application must provide the API with a video frame 3D object which implements the IDeckLinkVideoFrame3DExtensions
interface. This can be achieved by providing your own class which:
Subclasses the
IDeckLinkVideoFrame3DExtensions
interface.Returns a pointer to itself (cast to
IDeckLinkVideoFrame3DExtensions
) when itsIUnknown::QueryInterface()
method is called with IID_IDeckLinkVideoFrame3DExtensions.Implements all the methods in the
IDeckLinkVideoFrame3DExtensions
class.Returns an instantiated provider object that implements
IUnknown
to provide the DeckLink API access to the class’IUnknown::QueryInterface()
method. Refer to theIDeckLinkMutableVideoFrame::SetInterfaceProvider()
method for further information.
An application performing a streaming 3D playback operation should perform the following steps:
Check if 3D is supported for the desired video mode with
IDeckLinkOutput::DoesSupportVideoMode()
called withbmdVideoOutputDualStream3D
.Call
IDeckLinkOutput::EnableVideoOutput()
with thebmdVideoOutputDualStream3D
flag set.
While more frames or audio need to be pre-rolled:
Create a video frame object with
IDeckLinkOutput::CreateVideoFrame()
orIDeckLinkOutput::CreateVideoFrameWithBuffer()
.Create a video frame 3D extensions object that subclasses
IDeckLinkVideoFrame3DExtensions
as explained above.Associate the video frame to its 3D extensions provider by calling
IDeckLinkMutableVideoFrame::SetInterfaceProvider()
with IID_IDeckLinkVideoFrame3DExtensions.Return audio data from
IDeckLinkAudioOutputCallback::RenderAudioSamples()
.When audio preroll is complete, call
IDeckLinkOutput::EndAudioPreroll()
.
While playback is running:
Schedule more video frames from
IDeckLinkVideoOutputCallback::ScheduledFrameCompleted()
.Schedule more audio from
IDeckLinkAudioOutputCallback::RenderAudioSamples()
.If audio is not required, the call to
IDeckLinkOutput::EnableAudioOutput()
,IDeckLinkOutput::SetAudioCallback()
andIDeckLinkOutput::BeginAudioPreroll()
may be omitted.If pre-roll is not required initial
IDeckLinkOutput::ScheduleVideoFrame()
calls and the call toIDeckLinkOutput::BeginAudioPreroll()
andIDeckLinkOutput::EndAudioPreroll()
may be omitted.