Blackmagic Decklink SDK PDF
Blackmagic Decklink SDK PDF
Blackmagic Decklink SDK PDF
Mac OS X™
Windows™
Linux™
August 2016
Table of Contents
1 Introduction 15
1.1 Welcome 15
1.2 Overview 15
1.3.1 Supported Products 16
1.3.2 Supported Operating Systems 16
1.3.3 3rd Party Product and Feature Support 16
1.3.3.1 NVIDIA GPUDirect support 16
1.3.3.2 AMD DirectGMA support 16
1.3.4 Object Interfaces 17
1.3.5 Reference Counting 18
1.3.6 Interface Stability 18
1.3.6.1 New Interfaces 18
1.3.6.2 Updated Interfaces 19
1.3.6.3 Deprecated Interfaces 19
1.3.6.4 Removed Interfaces 19
1.4 Interface Reference 20
1.4.1 IUnknown Interface 20
1.4.1.1 IUnknown::QueryInterface method 21
1.4.1.2 IUnknown::AddRef method 22
1.4.1.3 IUnknown::Release method 22
2 DeckLink API 23
2.1 Using the DeckLink API in a project 23
2.2 Sandboxing support on Mac OS X 24
2.3 Accessing DeckLink devices 25
2.3.1 Windows 25
2.3.2 Mac OS X and Linux 25
2.4 High level interface 26
2.4.1 Capture 26
2.4.2 Playback 27
2.4.3 3D Functionality 28
2.4.3.1 3D Capture 28
2.4.3.2 3D Playback 29
SECTION
1 Introduction
1.1 Welcome
Thanks for downloading the Blackmagic Design DeckLink Software Developers Kit.
1.2 Overview
The DeckLink SDK provides a stable, cross-platform interface to Blackmagic Design capture and playback products.
The SDK provides both low-level control of hardware and high-level interfaces to allow developers to easily perform common tasks.
The SDK consists of a set of interface descriptions & sample applications which demonstrate the use of the basic features of the hardware.
The details of the SDK are described in this document. The SDK supports Microsoft Windows, Mac OS X and Linux platforms.
The libraries supporting the Blackmagic SDK are shipped as part of the product installers for each supported product line. Applications built
against the interfaces shipped in the SDK will dynamically link against the library installed on the end-user’s system.
The SDK interface is modeled on Microsoft’s Component Object Model (COM). On Microsoft Windows platforms, it is provided as a native
COM interface registered with the operating system. On other platforms application code is provided to allow the same COM style interface
to be used.
The COM model provides a paradigm for creating flexible and extensible interfaces with minimal overhead.
You can download the Decklink SDK from the Blackmagic Design support center at: www.blackmagicdesign.com/support
The product family is Capture and Playback.
If you’re looking for detailed answers regarding technologies used by Blackmagic Design, such as codecs, core media, APIs, SDK and more, visit
the Blackmagic Software Developers Forum. The forum is a helpful place for you to engage with both Blackmagic support staff and other forum
members who can answer developer specific questions and provide further information. The Software Developers forum can be found within
the Blackmagic Design Forum at forum.blackmagicdesign.com
If you wish to ask questions outside of the software developers forum, please contact us at: developer@blackmagicdesign.com
API Design
Playback and Capture support is provided for devices in the DeckLink, Intensity, UltraStudio and Teranex product lines. Capture support is
provided for the Cinema Camera and HyperDeck Studio products.
See the LoopThroughWithOpenGLCompositing for a detailed example of integrating the DeckLink API and NVIDIA GPUDirect.
See the LoopThroughWithOpenGLCompositing for a detailed example of integrating the DeckLink API and AMD DirectGMA.
API Design
Functionality within the API is accessed via “object interfaces”. Each object in the system may inherit from and be accessed via a number of
object interfaces. Typically the developer is able to interact with object interfaces and leave the underlying objects to manage themselves.
Each object interface class has a Globally Unique ID (GUID) called an “Interface ID”. On platforms with native COM support, an IID may be used
to obtain a handle to an exported interface object from the OS, which is effectively an entry point to an installed API.
Each interface may have related interfaces that are accessed by providing an IID to an existing object interface (see
IUnknown::QueryInterface). This mechanism allows new interfaces to be added to the API without breaking API or ABI compatibility.
API Design
Developers can choose to either reduce the functionality of their application when an interface is not available, or to notify the user that they
must install a later version of the Blackmagic drivers.
API Design
It is recommended that developers update their applications to use the most recent SDK interfaces when they release a new version of their
applications. As an interim measure, developers may include the deprecated interface descriptions, and updating the names of the interfaces
in their application to access the original interface functionality.
API Design
Method Description
QueryInterface Provides access to supported child interfaces of the object.
API Design
Syntax
HRESULT QueryInterface(REFIID id, void **outputInterface);
Parameters
Return Values
Value Description
E_NOINTERFACE Interface was not found
S_OK Success
API Design
Syntax
ULONG AddRef();
Parameters
none.
Return Values
Value Description
Count New reference count – for debug purposes only.
Syntax
ULONG Release();
Parameters
none.
Return Values
Value Description
Count New reference count – for debug purposes only.
SECTION
2 DeckLink API
To use the DeckLink API in your project, one or more files need to be included:
You can also include the optional header file “DeckLinkAPIVersion.h”. It defines two macros containing the SDK version numbers which can be
used at runtime by your application to compare the version of the DeckLink API it is linked to with the version of the SDK used at compile time.
DeckLink API
Further information can be found in the App Sandbox Design Guide available on Apple’s Mac Developer Library website.
DeckLink API
2.3.1 Windows
The main entry point to the DeckLink API is the IDeckLinkIterator interface.
This interface should be obtained from COM using CoCreateInstance:
On success, deckLinkIterator will point to a new IDeckLinkIterator object interface otherwise it will be set to NULL.
DeckLink API
2.4.1 Capture
An application performing a standard streaming capture operation should perform the following steps:
• If desired, enumerate the supported capture video modes by calling IDeckLinkInput::GetDisplayModeIterator. For each reported capture
mode, call IDeckLinkInput::DoesSupportVideoMode to check if the combination of the video mode and pixel format is supported.
• IDeckLinkInput::EnableVideoInput
• IDeckLinkInput::EnableAudioInput
• IDeckLinkInput::SetCallback
• IDeckLinkInput::StartStreams
• While streams are running:
- receive calls to IDeckLinkInputCallback::VideoInputFrameArrived with video frame and corresponding audio packet
IDeckLinkInput::StopStreams
If audio is not required, the call to IDeckLinkInput::EnableAudioInput may be omitted and the IDeckLinkInputCallback::VideoInputFrameArrived
callback will receive NULL audio packets.
DeckLink API
2.4.2 Playback
An application performing a standard streaming playback operation should perform the following steps:
• IDeckLinkOutput::DoesSupportVideoMode to check if the combination of the video mode and pixel format is supported.
• IDeckLinkOutput::EnableVideoOutput
• IDeckLinkOutput::EnableAudioOutput
• IDeckLinkOutput::SetScheduledFrameCompletionCallback
• IDeckLinkOutput::SetAudioCallback
• IDeckLinkOutput::BeginAudioPreroll
• While more frames or audio need to be pre-rolled:
- IDeckLinkOutput::ScheduleVideoFrame
- Return audio data from IDeckLinkAudioOutputCallback::RenderAudioSamples
- When audio preroll is complete, call IDeckLinkOutput::EndAudioPreroll
• IDeckLinkOutput::StartScheduledPlayback
• 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 and IDeckLinkOutput::BeginAudioPreroll may be omitted.
DeckLink API
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.
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 the bmdDisplayModeSupports3D flag in the return value of IDeckLinkDisplayMode::GetFlag
indicating that this mode is supported for 3D capture. Call IDeckLinkInput::DoesSupportVideoMode with the
bmdVideoInputDualStream3D flag to check if the combination of the video mode and pixel format is supported.
• Call IDeckLinkInput::EnableVideoInput with the bmdVideoInputDualStream3D flag.
• IDeckLinkInput::EnableAudioInput
• IDeckLinkInput::SetCallback
• IDeckLinkInput::StartStreams
• While streams are running:
- Receive calls to IDeckLinkInputCallback::VideoInputFrameArrived with left eye video frame and corresponding audio packet.
Inside the callback:
- Call IDeckLinkVideoInputFrame::QueryInterface with IIDIDeckLinkVideoFrame3DExtensions.
- IDeckLinkVideoFrame3DExtensions::GetFrameForRightEye
The returned frame object must be released by the caller when no longer required.
• IDeckLinkInput::StopStreams
DeckLink API
2.4.3.2 3D Playback
To support 3D playback, your application must provide the API with a video frame object which implements the IDeckLinkVideoFrame
interface and returns a valid object implementing the IDeckLinkVideoFrame3DExtensions interface when its QueryInterface method is
called with IID_IDecklinkVideoFrame3DExtensions. This can be achieved by providing your own class which:
DeckLink API
If pre-roll is not required initial IDeckLinkOutput::ScheduleVideoFrame calls and the call to IDeckLinkOutput::BeginAudioPreroll and
IDeckLinkOutput::EndAudioPreroll may be omitted.
DeckLink API
An application that supports connection notification should perform the following steps:
• Create a callback class that subclasses IDeckLinkDeviceNotificationCallback and implements all of its methods. The callback class will be
called asynchronously from an API private thread. Create an instance of the callback class.
• Call IDeckLinkDiscovery::InstallDeviceNotifications and provide the IDeckLinkDeviceNotificationCallback object.
• IDeckLinkDeviceNotificationCallback::DeckLinkDeviceArrived is called for all currently-connected devices.
• When a DeckLink device is connected after the initial reporting of devices then
IDeckLinkDeviceNotificationCallback::DeckLinkDeviceArrived will be called.
• When a DeckLink device is removed, IDeckLinkDeviceNotificationCallback::DeckLinkDeviceRemoved is called on an API-private thread.
• Before the application exits, call IDeckLinkDiscovery::UninstallDeviceNotifications.
DeckLink API
DeckLink API
DeckLink API
• IDeckLinkInput::EnableVideoInput
The pixel format that is specified will apply to both active picture and ancillary data with non-4K DeckLink devices.
When capturing ancillary data with a 4K DeckLink device, the ancillary data will always be in the 10-bit YUV pixel format.
• IDeckLinkInput::EnableAudioInput
• IDeckLinkInput::SetCallback
• IDeckLinkInput::StartStreams
• While streams are running:
- Receive calls to IDeckLinkInputCallback::VideoInputFrameArrived
Inside the callback:
- IDeckLinkVideoInputFrame::GetAncillaryData
- IDeckLinkVideoFrameAncillary:: GetBufferForVerticalBlankingLine
Check that S_OK is returned to ensure that the line number is supported and valid.
The IDeckLinkVideoFrameAncillary object has a reference to the input frame, so if AddRef is called on it, ensure that it is released
in a timely manner otherwise capture will run out of available frames.
DeckLink API
For an example of performing VANC output, please refer the VancOutput sample in the DeckLink SDK.
DeckLink API
2.4.8 Keying
Alpha keying allows an application to either superimpose a key frame over an incoming video feed (internal keying) or to send fill and key to an
external keyer (external keying). The alpha keying functionality is supported on certain DeckLink models.
For an example of using the keying functionality please refer to GdiKeyer sample application in the DeckLink SDK.
DeckLink API
• IDeckLinkInput::EnableVideoInput
• IDeckLinkInput::EnableAudioInput
• IDeckLinkInput::SetCallback
• IDeckLinkInput::StartStreams
• While streams are running:
- Receive calls to IDeckLinkInputCallback::VideoInputFrameArrived with video frame and corresponding audio packet
- Call IDeckLinkVideoInputFrame::GetTimecode
- IDeckLinkTimecode::GetFlags
- IDeckLinkTimecode::GetTimecodeUserBits
• IDeckLinkInput::StopStreams
• IDeckLinkInput::DisableVideoInput
DeckLink API
DeckLink API
Note that the Encoded Capture interface is distinct from the H.264 only ‘Streaming Encoder’ interface.
DeckLink API
• A sub-device configured as full-duplex will use two connectors, which allows simultaneous capture and playback, internal keying, and fill & key scenarios.
• A half-duplex sub-device will use a single connector as an individual capture or playback channel.
• A sub-device pair shares two connectors, therefore a sub-device configured as full-duplex will cause the paired sub-device to become inactive.
The table and illustration below demonstrate the pairing between sub-devices, and how the relationship to physical connectors varies in some
common duplex mode configurations.
DeckLink API
Sub-device index Connector mapping Connector mapping Configurable Duplex Mode Paired sub-device index
in Half-Duplex in Full-Duplex
0 SDI 1 SDI 1 (in/key) & SDI 2 (out/fill) Yes 4
4 SDI 2 - 0
5 SDI 4 - 1
6 SDI 6 - 2
7 SDI 8 - 3
DeckLink API
Sub-device index Connector mapping Connector mapping Configurable Duplex Mode Paired sub-device index
in Half-Duplex in Full-Duplex
0 SDI 1 SDI 1 (in/key) & SDI 2 (out/fill) Yes 2
2 SDI 2 - 0
3 SDI 4 - 1
Sub-device and Paired sub-device index reference the value of the BMDDeckLinkSubDeviceIndex attribute. The Paired sub-device is identified
by the value of the BMDDeckLinkPairedDevicePersistentID attribute (see IDeckLinkAttributes interface for details).
• DeckLink Quad 2 sub-device 0 is paired with sub-device 4. DeckLink Duo 2 sub-device 0 is pared with sub-device 2.
• Configuring sub-device 0 as half-duplex causes sub-device 0 to use connector SDI 1 and the paired sub-device to use connector SDI 2.
• Alternatively, configuring sub-device 0 as full-duplex causes sub-device 0 to use connectors SDI 1 and SDI 2, and the paired sub-device
to use none.
DeckLink API
• Call IDeckLinkAttributes::GetFlag with the BMDDeckLinkSupportsDuplexModeConfiguration flag to check that the DeckLink
sub-device supports duplex mode configuration.
• If desired, call IDeckLinkAttributes::GetInt with the BMDDeckLinkPairedDevicePersistentID attribute to identify the paired sub-
device which will be affected by the duplex mode configuration change, or which sub-device can be used to change the duplex
mode for the current device.
• Call IDeckLinkConfiguration::SetInt with the bmdDeckLinkConfigDuplexMode configuration ID, along with the desired
BMDDuplexMode setting to change the Duplex Mode.
DeckLink API
A reference to an IDeckLinkIterator object interface may be obtained from CoCreateInstance on platforms with native COM support or from
CreateDeckLinkIteratorInstance on other platforms.
The IDeckLink interface(s) returned may be used to access the related interfaces which provide access to the core API functionality.
Related Interfaces
Interface Interface ID Description
IDeckLinkIterator::Next returns IDeckLink interfaces representing each
IDeckLink IID_IDeckLink
attached DeckLink device.
DeckLink API
Syntax
HRESULT Next (IDeckLink **decklinkInstance);
Parameters
Name Direction Description
decklinkInstance out Next IDeckLink object interface
Return Values
Value Description
S_FALSE No (more) devices found
E_FAIL Failure
S_OK Success
DeckLink API
IDeckLink object interfaces are obtained from IDeckLinkIterator. IDeckLink may be queried to obtain the related
IDeckLinkOutput, IDeckLinkInput and IDeckLinkConfiguration interfaces.
Related Interfaces
Interface Interface ID Description
IDeckLinkIterator IID_IDeckLinkIterator IDeckLinkIterator::Next returns IDeckLink interfaces representing each
attached DeckLink device.
IDeckLinkOutput IID_IDeckLinkOutput An IDeckLinkOutput object interface may be obtained from IDeckLink using
QueryInterface
IDeckLinkInput IID_IDeckLinkInput An IDeckLinkInput object interface may be obtained from IDeckLink using
QueryInterface
IDeckLinkConfiguration IID_IDeckLinkConfiguration An IDeckLinkConfiguration object interface may be obtained from
IDeckLink using QueryInterface
IDeckLinkAttributes IID_IDeckLinkAttributes An IDeckLinkAttributes object interface may be obtained from IDeckLink
using QueryInterface.
IDeckLinkKeyer IID_IDeckLinkKeyer An IDeckLinkKeyer object interface may be obtained from IDeckLink using
QueryInterface.
IDeckLinkDeck Control IID_IDeckLinkDeckControl An IDeckLinkDeckControl object may be obtained from IDeckLink using
QueryInterface
DeckLink API
Syntax
HRESULT GetModelName (string *modelName);
Parameters
Name Direction Description
modelName out Hardware model name. This allocated string must be freed by the caller when
no longer required.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Otherwise, the string is made of the model name (as returned by GetModelName) followed by an increasing number (starting from 1)
if more than one instance of a device is present in the system. If not, the returned string is simply the model name.
Syntax
HRESULT GetDisplayName (string *displayName);
Parameters
Name Direction Description
displayName out The device’s display name. This allocated string must be freed by caller
when no longer required
Return Values
Value Description
E_FAIL Failed to allocate the string
S_OK Success
DeckLink API
An IDeckLinkOutput interface can be obtained from an IDeckLink object interface using QueryInterface. If QueryInterface for an output
interface is called on an input only device, then QueryInterface will fail and return E_NOINTERFACE.
Related Interfaces
Interface Interface ID Description
IDeckLinkOutput IID_IDeckLinkOutput An IDeckLinkOutput object interface may be obtained from IDeckLink
using QueryInterface
IDeckLinkDisplayModeIterator IID_IDeckLinkDisplayModeIterator IDeckLinkOutput::GetDisplayModeIterator returns an
IDeckLinkDisplayModeIterator object interface
IDeckLinkVideoFrame IID_DeckLinkVideoFrame IDeckLinkOutput::CreateVideoFrame may be used to create a new
IDeckLinkVideoFrame object interface
IDeckLinkVideoOutputCallback IID_DeckLinkVideoOutputCallback An IDeckLinkVideoOutputCallback object interface may be registered
with IDeckLinkOutput::SetScheduledFrameCompletionCallback
IDeckLinkAudioOutputCallback IID_DeckLinkAudioOutputCallback An IDeckLinkAudioOutputCallback object interface may be
registered with IDeckLinkOutput::SetAudioCallback
DeckLink API
GetBufferedAudioSampleFrameCount Returns the number of audio sample frames currently buffered for output
DeckLink API
Note: If a pixel format is not natively supported in the card’s hardware it will be converted by software.
Syntax
HRESULT DoesSupportVideoMode
(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat,
BMDVideoOutputFlags flags, BMDDisplayModeSupport *support,
IDeckLinkDisplayMode **resultDisplayMode);
Parameters
Name Direction Description
displayMode in Display mode to check
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT IsScheduledPlaybackRunning (boolean *active)
Parameters
Name Direction Description
active out Active status of driver video output scheduler
Return Values
Value Description
E_INVALIDARG Parameter active status variable is NULL
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetDisplayModeIterator (IDeckLinkDisplayModeIterator **iterator);
Parameters
Name Direction Description
iterator out Display mode iterator
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SetScreenPreviewCallback (IDeckLinkScreenPreviewCallback *previewCallback)
Parameters
Name Direction Description
previewCallback in The IDeckLinkScreenPreview object to be registered.
Return Values
Value Description
E_OUTOFMEMORY Unable to create kernel event (Windows only)
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT EnableVideoOutput (BMDDisplayMode displayMode, BMDVideoOutputFlags flags);
Parameters
Name Direction Description
displayMode in Display mode for video output
flags in Flags to control ancillary data and video output features.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT DisableVideoOutput ();
Return Values
Value Description
E_FAIL Failure
S_OK Success
Syntax
HRESULT SetVideoOutputFrameMemoryAllocator (IDeckLinkMemoryAllocator *theAllocator);
Parameters
Name Direction Description
theAllocator in Allocator object with an IDeckLinkMemoryAllocator interface
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT CreateVideoFrame (
long width, long height, long rowBytes, BMDPixelFormat pixelFormat,
BMDFrameFlags flags, IDeckLinkMutableVideoFrame **outFrame);
Parameters
Name Direction Description
width in frame width in pixels
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT CreateAncillaryData (BMDPixelFormat pixelFormat, IDeckLinkVideoFrameAncillary** outBuffer);
Parameters
Name Direction Description
pixelFormat in Pixel format for ancillary data
outBuffer out New video frame ancillary buffer
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Video output must be enabled with EnableVideoOutput before frames can be displayed.
Syntax
HRESULT DisplayVideoFrameSync (IDeckLinkVideoFrame *theFrame);
Parameters
Name Direction Description
theFrame in frame to display – after call return, the frame may be released
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Video output must be enabled with EnableVideoOutput before frames can be displayed. Frames may be scheduled before calling
StartScheduledPlayback to preroll. Once playback is initiated, new frames can be scheduled from IDeckLinkVideoOutputCallback.
Syntax
HRESULT ScheduleVideoFrame
(IDeckLinkVideoFrame *theFrame, BMDTimeValue displayTime,
BMDTimeValue displayDuration, BMDTimeScale timeScale);
Parameters
Name Direction Description
theFrame in frame to display
displayTime in time at which to display the frame in timeScale units
displayDuration in duration for which to display the frame in timeScale units
timeScale in time scale for displayTime and displayDuration
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SetScheduledFrameCompletionCallback (IDeckLinkVideoOutputCallback *theCallback);
Parameters
Name Direction Description
theCallBack in Callback object implementing the IDeckLinkVideoOutputCallback object
interface
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetBufferedVideoFrameCount (uint32_t *bufferedFrameCount);
Parameters
Name Direction Description
bufferedFrameCount out The frame count.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT EnableAudioOutput
(BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType,
uint32_t channelCount, BMDAudioOutputStreamType streamType);
Parameters
Name Direction Description
sampleRate in Sample rate to output
sampleType in Sample type to output
channelCount in Number of audio channels to output – only 2, 8 or 16 channel output is
supported.
streamType in Type of audio output stream.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT DisableAudioOutput ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT WriteAudioSamplesSync (
void *buffer, uint32_t sampleFrameCount, uint32_t
*sampleFramesWritten);
Parameters
Name Direction Description
buffer in Buffer containing audio sample frames. Audio channel samples must be
interleaved into a sample frame and sample frames must be contiguous.
sampleFrameCount in Number of sample frames available
sampleFramesWritten out Actual number of sample frames queued
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT BeginAudioPreroll ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
Syntax
HRESULT EndAudioPreroll ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT ScheduleAudioSamples (
void *buffer, uint32_t sampleFrameCount, BMDTimeValue streamTime,
BMDTimeScale timeScale, uint32_t *sampleFramesWritten);
Parameters
Name Direction Description
buffer in Buffer containing audio sample frames. Audio channel samples must be
interleaved into a sample frame and sample frames must be contiguous.
sampleFrameCount in Number of sample frames available
streamTime in Time for audio playback in units of timeScale.
To queue samples to play back immediately after currently buffered
samples both streamTime and timeScale may be set to zero when using
bmdAudioOutputStreamContinuous.
timeScale in Time scale for the audio stream.
sampleFramesWritten out Actual number of sample frames scheduled
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_ACCESSDENIED Either audio output has not been enabled or an audio sample write is in
progress.
E_INVALIDARG No timescale has been provided.
A timescale is necessary as the audio packets are time-stamped.
DeckLink API
Syntax
HRESULT GetBufferedAudioSampleFrameCount (uint32_t *bufferedSampleFrameCount)
Parameters
Name Direction Description
bufferedSampleFrameCount out Number of audio frames currently buffered.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
FlushBufferedAudioSamples should be called when changing playback direction. Buffered audio is implicitly flushed when stopping audio
playback with StopScheduledPlayback or DisableAudioOutput.
Syntax
HRESULT FlushBufferedAudioSamples ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Use of this method is optional – audio may alternately be queued from IDeckLinkVideoOutputCallback::ScheduledFrameCompleted.
Syntax
HRESULT SetAudioCallback (IDeckLinkAudioOutputCallback *theCallback);
Parameters
Name Direction Description
theCallBack in callback object implementing the IDeckLinkAudioOutputCallback object
interface
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Playback starts immediately when StartScheduledPlayback is called but at a specified “playback start time”.
Scheduled frames are output as the playback time reaches the time at which the frames were scheduled.
Syntax
HRESULT StartScheduledPlayback (
BMDTimeValue playbackStartTime, BMDTimeScale timeScale,
double playbackSpeed);
Parameters
Name Direction Description
playbackStartTime in Time at which the playback starts in units of timeScale
timeScale in Time scale for playbackStartTime and playbackSpeed.
playbackSpeed in Speed at which to play back : 1.0 is normal playback, -1.0 is reverse playback.
Fast or slow forward or reverse playback may also be specified.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT StopScheduledPlayback
(BMDTimeValue stopPlaybackAtTime, BMDTimeValue *actualStopTime,
BMDTimeScale timeScale);
Parameters
Name Direction Description
stopPlaybackAtTime in Playback time at which to stop in units of timeScale. Specify 0 to stop
immediately.
actualStopTime out Playback time at which playback actually stopped in units of timeScale. Specify
NULL to stop immediately
timeScale in Time scale for stopPlaybackAtTime and actualStopTime. Specify 0 to stop
immediately.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetScheduledStreamTime
(BMDTimeScale desiredTimeScale, BMDTimeValue *streamTime,
double *playbackSpeed);
Parameters
Name Direction Description
desiredTimeScale in Time scale for elapsedTimeSinceSchedulerBegan
streamTime out Frame time
playbackSpeed out Scheduled playback speed
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetReferenceStatus (BMDReferenceStatus *referenceStatus)
Parameters
Name Direction Description
referenceStatus out A bit-mask of the reference status.
See BMDReferenceStatus for more details.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetHardwareReferenceClock (
BMDTimeScale desiredTimeScale, BMDTimeValue *hardwareTime,
BMDTimeValue *timeInFrame, BMDTimeValue *ticksPerFrame);
Parameters
Name Direction Description
desiredTimeScale in Desired time scale
hardwareTime out Hardware reference time (in units of desiredTimeScale)
timeInFrame out Time in frame (in units of desiredTimeScale)
ticksPerFrame out Number of ticks for a frame (in units of desiredTimeScale)
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
The timestamp is valid if this method is called within the ScheduledFrameCompleted callback and if the frame referenced by the Frame
pointer has not been re-scheduled.
Syntax
HRESULT GetFrameCompletionReferenceTimestamp (
IDeckLinkVideoFrame *theFrame,
BMDTimeScale desiredTimeScale, BMDTimeValue
*frameCompletionTimestamp)
Parameters
Name Direction Description
desiredTimeScale in Desired time scale
Return Values
Value Description
E_UNEXPECTED A timestamp for the specified frame is not available.
S_OK Success
DeckLink API
An IDeckLinkInput interface can be obtained from an IDeckLink object interface using QueryInterface. If QueryInterface for an input interface
is called on an output only device, then QueryInterface will fail and return E_NOINTERFACE.
Video capture operates in a push model with each video frame being delivered to an IDeckLinkInputCallback object interface. Audio capture
is optional and can be handled by using the same callback.
Please note that non-4K DeckLink devices and sub-devices are half-duplex. Therefore either capture or render can be enabled, but not simultaneously.
Related Interfaces
Interface Interface ID Description
IDeckLink IID_IDeckLink An IDeckLinkInput object interface may be obtained from
IDeckLink using QueryInterface
IDeckLinkDisplayModeIterator IID_IDeckLinkDisplayModeIterator IDeckLinkInput::GetDisplayModeIterator returns an
IDeckLinkDisplayModeIterator object interface
IDeckLinkInputCallback IID_DeckLinkInputCallback An IDeckLinkInputCallback object interface may be
registered with IDeckLinkInput::SetCallback
Method Description
DoesSupportVideoMode Check whether a given video mode is supported for input
DeckLink API
Method Description
DisableVideoInput Disable video input
DeckLink API
Syntax
HRESULT DoesSupportVideoMode
(BMDDisplayMode displayMode, BMDPixelFormat pixelFormat,
BMDVideoInputFlags flags, BMDDisplayModeSupport *support,
IDeckLinkDisplayMode **resultDisplayMode);
Parameters
Name Direction Description
displayMode in Display mode to check
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetDisplayModeIterator (IDeckLinkDisplayModeIterator **iterator);
Parameters
Name Direction Description
iterator out display mode iterator
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SetScreenPreviewCallback (IDeckLinkScreenPreviewCallback *previewCallback)
Parameters
Name Direction Description
previewCallback in The IDeckLinkScreenPreview object to be registered.
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT EnableVideoInput (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat,
BMDVideoInputFlags flags);
Parameters
Name Direction Description
displayMode in Video mode to capture
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetAvailableVideoFrameCount (uint32_t *availableFrameCount);
Parameters
Name Direction Description
availableFrameCount out Number of available input frames.
Return Values
Value Description
S_OK Success
Syntax
HRESULT DisableVideoInput ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT EnableAudioInput
(BMDAudioSampleRate sampleRate, BMDAudioSampleType sampleType,
uint32_t channelCount);
Parameters
Name Direction Description
sampleRate in Sample rate to capture
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT DisableAudioInput ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Use of this method is only required when using pull model audio – the same audio data is made available to
IDeckLinkInputCallback and may be ignored.
Syntax
HRESULT GetAvailableAudioSampleFrameCount (uint32_t *availableSampleFrameCount);
Parameters
Name Direction Description
availableSampleFrameCount out The number of buffered audio frames currently available.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SetVideoInputFrameMemoryAllocator (IDeckLinkMemoryAllocator *theAllocator);
Parameters
Name Direction Description
theAllocator in Allocator object with an IDeckLinkMemoryAllocator interface
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT StartStreams ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT StopStreams ();
Parameters
none.
Return Values
Value Description
S_OK Success
Syntax
HRESULT FlushStreams ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT PauseStreams ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SetCallback (IDeckLinkInputCallback *theCallback);
Parameters
Name Direction Description
theCallBack in callback object implementing the IDeckLinkInputCallback object interface
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetHardwareReferenceClock (
BMDTimeScale desiredTimeScale, BMDTimeValue *hardwareTime,
BMDTimeValue *timeInFrame, BMDTimeValue *ticksPerFrame);
Parameters
Name Direction Description
desiredTimeScale in Desired time scale
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
The GetWidth, GetHeight methods may be used to determine the pixel dimensions of the frame buffer. Pixels on a given row are packed
according to the pixel format returned by GetPixelFormat - see BMDPixelFormat for details. Note that in some formats (HD720 formats,
for example), there is padding between rows - always use GetRowBytes to account for the row length, including padding.
Developers may sub-class IDeckLinkVideoFrame to provide an implementation which fits well with their application’s structure.
Related Interfaces
Interface Interface ID Description
IDeckLinkMutableVideoFrame IID_IDeckLinkMutableVideoFrame IDeckLinkMutableVideoFrame subclasses
IDeckLinkVideoFrame
IDeckLinkVideoInputFrame IID_IDeckLinkVideoInputFrame IDeckLinkVideoInputFrame subclasses
IDeckLinkVideoFrame
Method Description
GetWidth Get video frame width in pixels
DeckLink API
Syntax
long GetWidth ();
Return Values
Value Description
Width Video frame width in pixels
Syntax
long GetHeight ();
Return Values
Value Description
Height Video frame height in pixels
DeckLink API
Syntax
long GetRowBytes ();
Return Values
Value Description
BytesCount Number of bytes per row of video frame
Syntax
BMDPixelFormat GetPixelFormat ();
Return Values
Value Description
PixelFormat Pixel format of video frame (BMDPixelFormat)
DeckLink API
Syntax
BMDFrameFlags GetFlags ();
Return Values
Value Description
FrameFlags Video frame flags (BMDFrameFlags)
Syntax
HRESULT GetBytes (void **buffer);
Parameters
Name Direction Description
buffer out Pointer to raw frame buffer – only valid while object remains valid.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetTimecode (BMDTimecodeFormat format, IDeckLinkTimecode **timecode)
Parameters
Name Direction Description
format in BMDTimecodeFormat to query
Return Values
Value Description
E_FAIL Failure
S_OK Success
S_FALSE The requested timecode format was not present or valid in the ancillary data.
DeckLink API
Syntax
HRESULT GetAncillaryData (IDeckLinkVideoFrameAncillary **ancillary)
Parameters
Name Direction Description
ancillary out Pointer to a new IDeckLinkVideoFrameAncillary object. This object must be
released by the caller when no longer required.
Return Values
Value Description
S_OK Success
DeckLink API
An object with an IDeckLinkVideoOutputCallback object interface may be registered as a callback with the IDeckLinkOutput object
interface.
IDeckLinkVideoOutputCallback should be used to monitor frame output statuses and queue a replacement frame to maintain streaming playback.
If the application is managing its own frame buffers, they should be disposed or reused inside the ScheduledFrameCompleted callback.
Related Interfaces
Interface Interface ID Description
IDeckLinkOutput IID_IDeckLinkOutput An IDeckLinkVideoOutputCallback object interface may
be registered with IDeckLinkOutput::SetScheduledFrame
CompletionCallback
Method Description
ScheduledFrameCompleted Called when playback of a scheduled frame is completed
DeckLink API
The IDeckLinkVideoOutputCallback methods are called on a dedicated callback thread. To prevent video frames from being either dropped
or delayed, ensure that any application processing on the callback thread takes less time than a frame time. If the application processing time
is greater than a frame time, multiple threads should be used.
Syntax
HRESULT ScheduledFrameCompleted
(IDeckLinkVideoFrame* completedFrame,
BMDOutputFrameCompletionResult result);
Parameters
Name Direction Description
completedFrame in Completed frame
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT ScheduledPlaybackHasStopped(void)
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
IDeckLinkMutableVideoFrame is a subclass of IDeckLinkVideoFrame and inherits all its methods. It is created by the
IDeckLinkOutput::CreateVideoFrame method.
Related Interfaces
Interface Interface ID Description
IDeckLinkVideoFrame IID_IDeckLinkVideoFrame IDeckLinkMutableVideoFrame subclasses
IDeckLinkVideoFrame
DeckLink API
Syntax
HRESULT SetFlags (BMDFrameFlags newFlags);
Parameters
Name Direction Description
newFlags in BMDFrameFlags to set - see BMDFrameFlags
for details.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SetTimecode (BMDTimecodeFormat format, IDeckLinkTimecode* timecode);
Parameters
Name Direction Description
format in BMDTimecodeFormat to update
Return Values
Value Description
E_UNEXPECTED Unexpected timecode. Ensure that VITC1 has been set.
S_OK Success
DeckLink API
Syntax
HRESULT SetTimecodeFromComponents
(BMDTimecodeFormat format, uint8_t hours, uint8_t minutes,
uint8_t seconds, uint8_t frames, BMDTimecodeFlags flags);
Parameters
Name Direction Description
format in BMDTimecodeFormat to update
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SetAncillaryData (IDeckLinkVideoFrameAncillary* ancillary);
Parameters
Name Direction Description
ancillary in IDeckLinkVideoFrameAncillary data to output with the frame.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SetTimecodeUserBits (BMDTimecodeFormat format, BMDTimecodeUserBits userBits)
Parameters
Return Values
Value Description
E_NOTIMPL Not implemented
E_INVALIDARG The format parameter is invalid.
E_UNEXPECTED Timecode object is not present. See:
IDeckLinkMutableVideoFrame::SetTimecode
DeckLink API
This interface is applicable only to DeckLink devices which support 3D features, such the DeckLink 4K Extreme. All frames belonging to a 3D
stream carry an IDeckLinkVideoFrame3DExtensions object, which indicates whether this frame is a left- or right-eye frame and allows access
to the right eye frame if this frame is a left eye frame.
When outputting in a 3D video mode, your application must provide video frame objects which implement the IDeckLinkVideoFrame interface and
return a valid IDeckLinkVideoFrame3DExtensions object. See section 2.3.3.
• From IDeckLinkVideoInputFrame using QueryInterface, if capturing in 3D mode has been enabled (see IDeckLinkInput::Enable
and bmdVideoInputDualStream3D for details) or by subclassing IDeckLinkVideoInputFrame. By subclassing
IDeckLinkVideoFrame3DExtensions.
Related Interfaces
Interface Interface ID Description
IDeckLinkVideoFrame IID_IDeckLinkVideoFrame When capturing in a 3D mode, an
IDeckLinkVideoFrame3DExtensions may be obtained from
IDeckLinkVideoFrame using QueryInterface
DeckLink API
Syntax
BMDVideo3DPackingFormat Get3DPackingFormat (void)
Return Values
Value Description
Packing format Either bmdVideo3DPackingRightOnly
or bmdVideo3DPackingLeftOnly.
See BMDVideo3DPackingFormat for
more details.
DeckLink API
Syntax
HRESULT GetFrameForRightEye (IDeckLinkVideoFrame* *rightEyeFrame)
Parameters
Return Values
Value Description
E_INVALIDARG The parameter is invalid.
S_FALSE This frame is the right eye frame.
S_OK Success
DeckLink API
Related Interfaces
DeckLink API
During preroll (preroll is TRUE) call IDeckLinkOutput::ScheduleAudioSamples to schedule sufficient audio samples for the number of video
frames that have scheduled.
During playback (preroll is FALSE) check the count of buffered audio samples with IDeckLinkOutput::GetBufferedAudioSampleFrameCount
and when required, schedule more audio samples with IDeckLinkOutput::ScheduleAudioSamples.
Syntax
HRESULT RenderAudioSamples (boolean preroll);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
An object with an IDeckLinkInputCallback interface may be registered as a callback with the IDeckLinkInput object interface.
Related Interfaces
DeckLink API
Syntax
HRESULT VideoInputFrameArrived
(IDeckLinkVideoInputFrame *videoFrame, IDeckLinkAudioInputPacket
*audioPacket);
Parameters
DeckLink API
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
To enable this feature, the bmdVideoInputEnableFormatDetection flag must set when calling IDeckLinkInput::EnableVideoInput().
Note: The video format change detection feature is not currently supported on all hardware. Check the
BMDDeckLinkSupportsInputFormatDetection attribute to determine if this feature is supported for a given device and driver (see
IDeckLinkAttributes Interface for details).
Syntax
HRESULT VideoInputFormatChanged (
BMDVideoInputFormatChangedEvents notificationEvents,
IDeckLinkDisplayMode *newDisplayMode,
BMDDetectedVideoInputFormatFlags detectedSignalFlags);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Related Interfaces
DeckLink API
Syntax
HRESULT GetStreamTime (
BMDTimeValue *frameTime, BMDTimeValue *frameDuration, BMDTimeScale
timeScale);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetHardwareReferenceTimestamp (
BMDTimeScale timeScale, BMDTimeValue *frameTime,
BMDTimeValue *frameDuration);
Parameters
Return Values
Value Description
E_INVALIDARG Timescale is not set
S_OK Success
DeckLink API
Objects with an IDeckLinkAudioInputPacket object interface are passed to the IDeckLinkInputCallback::VideoInputFrameArrived callback.
Audio channel samples are interleaved into a sample frame and sample frames are contiguous.
Related Interfaces
DeckLink API
Syntax
Long GetSampleCount ();
Return Values
Value Description
Count Audio packet size in sample frames
Syntax
HRESULT GetBytes (void **buffer);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetPacketTime(BMDTimeValue *packetTime, BMDTimeScale timeScale);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
An IDeckLinkDisplayModeIterator object interface may be obtained from an IDeckLinkInput or IDeckLinkOutput object interface using
the GetDisplayModeIterator method.
Related Interfaces
DeckLink API
Syntax
HRESULT Next (IDeckLinkDisplayMode **displayMode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
The IDeckLinkDisplayModeIterator object interface enumerates supported display modes, returning IDeckLinkDisplayMode object interfaces.
Related Interfaces
DeckLink API
Syntax
long GetWidth ();
Return Values
Value Description
Width Video frame width in pixels
Syntax
long GetHeight ();
Return Values
Value Description
Height Video frame height in pixels
DeckLink API
Syntax
HRESULT GetName (string *name);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
Syntax
BMDDisplayMode GetDisplayMode ();
Return Values
Value Description
mode BMDDisplayMode corresponding to the display
mode
DeckLink API
Syntax
HRESULT GetFrameRate (BMDTimeValue *timeValue, BMDTimeScale *timeScale);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
BMDFieldDominance GetFieldDominance ();
Return Values
Value Description
FieldDominance The field dominance -
see BMDFieldDominance for details.
Syntax
BMDDisplayModeFlags GetFlags ();
Return Values
Value Description
Flags The display mode flags -
see BMDDisplaymodeFlags for details.
DeckLink API
An IDeckLinkConfiguration object interface can be obtained from the IDeckLink interface using QueryInterface.
The configuration settings are globally visible (not limited to the current process). Changes will persist until the IDeckLinkConfiguration object is
released, unless WriteConfigurationToPreferences is called. In which case, the changes will be made permanent and will persist across restarts.
Related Interfaces
DeckLink API
DeckLink API
Syntax
HRESULT SetFlag (BMDDeckLinkConfigurationID cfgID, boolean value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no flag type configuration setting
for this operation corresponding to the given
BMDDeckLinkConfigurationID.
DeckLink API
Syntax
HRESULT GetFlag (BMDDeckLinkConfigurationID cfgID, boolean *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no flag type configuration setting
for this operation corresponding to the given
BMDDeckLinkConfigurationID.
DeckLink API
Syntax
HRESULT SetInt (BMDDeckLinkConfigurationID cfgID, int64_t value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no integer type configuration setting
for this operation corresponding to the given
BMDDeckLinkConfigurationID.
DeckLink API
Syntax
HRESULT GetInt (BMDDeckLinkConfigurationID cfgID, int64_t *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no integer type configuration setting
for this operation corresponding to the given
BMDDeckLinkConfigurationID.
DeckLink API
Syntax
HRESULT SetFloat (BMDDeckLinkConfigurationID cfgID, double value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no float type configuration setting
for this operation corresponding to the given
BMDDeckLinkConfigurationID.
DeckLink API
Syntax
HRESULT GetFloat (BMDDeckLinkConfigurationID cfgID, double *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no float type configuration setting
for this operation corresponding to the given
BMDDeckLinkConfigurationID.
DeckLink API
Syntax
HRESULT SetString (BMDDeckLinkConfigurationID cfgID, string value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no string type configuration setting
for this operation corresponding to the given
BMDDeckLinkConfigurationID.
DeckLink API
Syntax
HRESULT GetString (BMDDeckLinkConfigurationID cfgID, string *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no string type configuration setting
for this operation corresponding to the given
BMDDeckLinkConfigurationID.
DeckLink API
Syntax
HRESULT WriteConfigurationToPreferences ();
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_ACCESSDENIED Insufficient privileges to write to system
preferences.
DeckLink API
DeckLink API
Syntax
HRESULT GetFlag (BMDDeckLinkAPIInformationID cfgID, bool *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no flag type attribute corresponding to
cfgID.
DeckLink API
Syntax
HRESULT GetInt (BMDDeckLinkAPIInformationID cfgID, int64_t *value);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG There is no int type attribute corresponding to
cfgID.
DeckLink API
Syntax
HRESULT GetFloat (BMDDeckLinkAPIInformationID cfgID, double *value);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG There is no float type attribute corresponding to
cfgID.
DeckLink API
Syntax
HRESULT GetString (BMDDeckLinkAPIInformationID cfgID, String *value);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG There is no string type attribute corresponding to
cfgID.
E_OUTOFMEMORY Unable to allocate memory for string
DeckLink API
Related Interfaces
DeckLink API
Syntax
HRESULT GetFlag (BMDDeckLinkAttributeID cfgID, boolean *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no flag type attribute corresponding to
cfgID.
DeckLink API
Syntax
HRESULT GetInt (BMDDeckLinkAttributeID cfgID, int64_t *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no int type attribute corresponding to
cfgID.
DeckLink API
Syntax
HRESULT GetFloat (BMDDeckLinkAttributeID cfgID, double *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no float type attribute corresponding to
cfgID.
DeckLink API
Syntax
HRESULT GetString (BMDDeckLinkAttributeID cfgID, string *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no string type attribute corresponding to
cfgID.
DeckLink API
During playback or capture, calls will be made to this interface object to manage memory buffers for storing video frame data.
Memory buffers may be allocated and released more frequently than once per video frame played back or captured, such as
when video format conversion is performed.
Implementation of this interface is optional - if this callback is not registered, a default allocator will be used.
Related Interfaces
DeckLink API
DeckLink API
Syntax
HRESULT AllocateBuffer (unsigned long bufferSize, void **allocatedBuffer);
Parameters
Return Values
Value Description
S_OK Success
E_OUTOFMEMORY There is insufficient memory to allocate a buffer of
the requested size.
DeckLink API
Syntax
HRESULT ReleaseBuffer (void *buffer);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT Commit ();
Parameters
none.
Return Values
Value Description
S_OK Success
E_OUTOFMEMORY There is insufficient memory to allocate a buffer of
the requested size.
DeckLink API
Syntax
HRESULT Decommit ();
Parameters
none.
Return Values
Value Description
S_OK Success
DeckLink API
Related Interfaces
DeckLink API
The following table displays hardware which supports the keyer functionality.
DeckLink API
Syntax
HRESULT Enable (boolean isExternal);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
Syntax
HRESULT SetLevel (uint8_t level);
Parameters
Name Direction Description
level in The level that the image is to be blended onto the frame.
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT RampUp (uint32_t numberOfFrames);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT RampDown (uint32_t numberOfFrames);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
Syntax
HRESULT Disable();
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Related Interfaces
DeckLink API
Syntax
BMDPixelFormat GetPixelFormat ();
Return Values
Value Description
PixelFormat Pixel format of video frame (BMDPixelFormat)
Syntax
BMDDisplayMode GetDisplayMode ();
Return Values
Value Description
mode BMDDisplayMode corresponding to the display
mode.
DeckLink API
Ancillary lines are numbered from one. For NTSC video, the top ancillary lines are numbered starting from four, with lines 1 to 3 referring to the
ancillary lines at the bottom of the picture, as per convention.
The pointer returned by GetBufferForVerticalBlankingLine is in the same format as the associated active picture data and is valid while the
IDeckLinkVideoFrameAncillary object interface is valid.
Syntax
HRESULT GetBufferForVerticalBlankingLine (uint32_t lineNumber, void* *buffer)
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG An invalid ancillary line number was requested
DeckLink API
Related Interfaces
DeckLink API
Syntax
BMDTimecodeBCD GetBCD();
Return Values
Value Description
Timecode Timecode value in BCD format
(See BMDTimecodeBCD for details)
DeckLink API
Syntax
HRESULT GetComponents(uint8_t *hours, uint8_t *minutes, uint8_t *seconds, uint8_t *frames);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT GetString(string *timecode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
Syntax
HRESULT BMDTimecodeFlags GetFlags();
Return Values
Value Description
timecodeFlags Timecode flags
(see BMDTimecodeFlags for details)
DeckLink API
Syntax
HRESULT GetTimecodeUserBits (BMDTimecodeUserBits *userBits);
Parameters
Return Values
Value Description
E_POINTER The userBits parameter is NULL.
S_OK Success
DeckLink API
An object with the IDeckLinkScreenPreviewCallback object interface may be registered as a callback with the IDeckLinkInput or
IDeckLinkOutput interfaces.
During playback or capture, frames will be delivered to the preview callback. A dedicated preview thread waits for the next available frame
before calling the callback. The frame delivery rate may be rate limited by the preview callback - it is not required to maintain full frame rate
and missing frames in preview will have no impact on capture or playback.
Related Interfaces
DeckLink API
For example: Scheduled NTSC which runs at 29.97 frames per second, will result in the preview callback’s DrawFrame() method being called
29.97 times per second while scheduled playback is running.
Note: If the frame to be drawn to the preview hasn’t changed since the last time the callback was called, the frame parameter will be NULL.
Syntax
HRESULT DrawFrame(IDeckLinkVideoFrame *theFrame);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
A reference to an IDeckLinkGLScreenPreviewHelper object interface may be obtained from CoCreateInstance on platforms with native COM
support or from CreateOpenGLScreenPreviewHelper on other platforms.
• Configure an OpenGL context as an orthographic projection using code similar to the following:
glViewport(0, 0, (GLsizei)newSize.width, (GLsizei)newSize.height);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
glMatrixMode(GL_MODELVIEW);
• Create an IDeckLinkGLScreenPreviewHelper object interface using CoCreateInstance or CreateOpenGLScreenPreviewHelper
Call IDeckLinkGLScreenPreviewHelper::InitializeGL from the OpenGL context
• When repainting the OpenGL context, call IDeckLinkGLScreenPreviewHelper::PaintGL.
The preview image will be drawn between (-1,-1) and (1,1) in the GL space.
• Add any graphical overlays on the preview window as desired.
• Create a subclass of IDeckLinkScreenPreviewCallback which calls IDeckLinkGLScreenPreviewHelper::SetFrame from
IDeckLinkScreenPreviewCallback::DrawFrame
• Register an instance of the IDeckLinkScreenPreviewCallback subclass with IDeckLinkInput::SetScreenPreviewCallback or
IDeckLinkOutput::SetScreenPreviewCallback as appropriate.
DeckLink API
Related Interfaces
Interface Interface ID Description
IDeckLinkScreenPreview IID_IDeckLinkScreenPreview IDeckLinkGLScreenPreviewHelper::SetFrame may be called
from IDeckLinkScreenPreview::DrawFrame
DeckLink API
Syntax
HRESULT InitializeGL();
Return Values
Value Description
E_FAIL Failure
S_OK Success
PaintGL and SetFrame allow OpenGL updates to be decoupled from new frame availability.
Syntax
HRESULT PaintGL();
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Depending on the rate and timing of calls to SetFrame and PaintGL, some frames may not be displayed or may be displayed multiple times.
Syntax
HRESULT SetFrame(IDeckLinkVideoFrame *theFrame)
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.23.4 IDeckLinkGLScreenPreviewHelper::Set3DPreviewFormat
The Set3DPreviewFormat method is used to set the 3D preview format.
Syntax
HRESULT Set3DPreviewFormat(BMD3DPreviewFormat *previewFormat);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
An IDeckLinkCocoaScreenPreviewCallback object can be created by calling CreateCocoaScreenPreview. This object can registered as a
callback with IDeckLinkInput::SetScreenPreviewCallback or IDeckLinkOutput::SetScreenPreviewCallback as appropriate.
During playback or capture, frames will be delivered to the preview callback. A dedicated preview thread waits for the next available frame
before calling the callback. The frame delivery rate may be rate limited by the preview callback - it is not required to maintain full frame rate
and missing frames in preview will have no impact on capture or playback.
Related Interfaces
DeckLink API
DeckLink API
DeckLink API
Syntax
HRESULT Initialize(void *device);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT Render(RECT *rc)
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT SetFrame(IDeckLinkVideoFrame *primaryFrame);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT Set3DPreviewFormat(BMD3DPreviewFormat previewFormat);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
DeckLink API
The IDeckLinkVideoFrame object for the destination frame, with the desired properties, can be created using IDeckLinkOutput::CreateVideoFra
me. Alternatively the destination frame can be created by subclassing IDeckLinkVideoFrame and setting properties directly in the subclassed object.
Syntax
HRESULT ConvertFrame (IDeckLinkVideoFrame* srcFrame, IDeckLinkVideoFrame* dstFrame)
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_NOTIMPL Conversion not currently supported
DeckLink API
An IDeckLinkDeckControl object interface can be obtained from the IDeckLink interface using QueryInterface.
Related Interfaces
DeckLink API
DeckLink API
The application should wait for a IDeckLinkDeckControlStatusCallback::DeckControlStatusChanged callback notification with the
bmdDeckControlStatusDeckConnected bit set before using the rest of the deck control functionality.
Syntax
HRESULT Open (
BMDTimeScale timeScale, BMDTimeValue timeValue, boolean timecodeIsDropFrame,
BMDDeckControlError *error)
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT Close (boolean standbyOn)
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT GetCurrentState
(BMDDeckControlMode *mode, BMDDeckControlVTRControlState *vtrControlState,
BMDDeckControlStatusFlags *flags);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT SetStandby (boolean standbyOn);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT SendCommand
(uint8_t *inBuffer, uint32_t inBufferSize, uint8_t *outBuffer, uint32_t
*outDataSize, uint32_t outBufferSize, BMDDeckControlError *error);
Parameters
outBufferSize out The size of the buffer that will contain the response
packet.
error out The error code sent by the deck - see
BMDDeckControlError for details.
DeckLink API
Return Values
Value Description
E_INVALIDARG One or more parameters are invalid.
E_UNEXPECTED A previous custom command is still being
processed.
E_FAIL Failure - check error parameter
S_OK Success
Syntax
HRESULT Play (BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT Stop (BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT TogglePlayStop (BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT Eject (BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT GoToTimecode (BMDTimecodeBCD timecode, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT FastForward (boolean viewTape, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT Rewind (boolean viewTape, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT StepForward (BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT StepBack (BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT Jog (double rate, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT Shuttle (double rate, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT GetTimecodeString (string currentTimeCode, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT GetTimecode (IDeckLinkTimecode currentTimecode, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT GetTimecodeBCD (BMDTimecodeBCD *currentTimecode, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT SetPreroll (uint32_t prerollSeconds);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT GetPreroll (uint32_t *prerollSeconds);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT SetCaptureOffset (int32_t captureOffsetFields);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT GetCaptureOffset (int32_t *captureOffsetFields);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT SetExportOffset (int32_t exportOffsetFields);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT GetExportOffset (int32_t * exportOffsetFields);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT GetManualExportOffset (int32_t * deckManualExportOffsetFields);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
After StartExport is called, the export will commence when the current time code equals the “inTimecode”. Scheduled frames are exported
until the current timecode equals the “outTimecode”. During this period the IDeckLinkDeckControlStatusCallback will be called when deck
control events occur.
Syntax
HRESULT StartExport
(BMDTimecodeBCD inTimecode, BMDTimecodeBCD outTimecode,
BMDDeckControlExportModeOpsFlags exportModeOps, BMDDeckControlError *error);
DeckLink API
Parameters
Name Direction Description
inTimecode in The timecode to start the export sequence.
outTimecode in The timecode to stop the export sequence.
exportModeOps in The export mode operations - see
BMDDeckControlExportModeOpsFlags for details.
error out The error code sent by the deck - see
BMDDeckControlError for details.
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
A callback object should be set using IDeckLinkDeckControl::SetCallback and an offset period set using IDeckLinkDeckControl::SetCaptureOffset.
After StartCapture is called, the application must wait until the bmdDeckControlPrepareForCaptureEvent event is received via
IDeckLinkDeckControlStatusCallback::DeckControlEventReceived callback. Reception of that event signals that the serial timecodes
attached to the IDeckLinkVideoFrame objects (received via IDeckLinkInputCallback::VideoInputFrameArrived) can be used to determine
if the frame is between the inTimecode and outTimecode timecodes.
The application must take into account that the serial timecode values should be adjusted by the value set using
IDeckLinkDeckControl::SetCaptureOffset.
During this period IDeckLinkDeckControlStatusCallback will be called when deck control events occur.
At the completion of the capture operation the bmdDeckControlCaptureCompleteEvent event in the IDeckLinkDeckControlStatus
Callback::DeckControlEventReceived method will occur several frames from the “outTimecode”. Resources may be released at this point.
IDeckLinkDeckControl will return to VTR control mode.
DeckLink API
Syntax
HRESULT StartCapture
(boolean useVITC, BMDTimecodeBCD inTimecode, BMDTimecodeBCD outTimecode,
BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT GetDeviceID (uint16_t *deviceId, BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT Abort (void);
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT CrashRecordStart (BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT CrashRecordStop (BMDDeckControlError *error);
Parameters
Return Values
Value Description
E_FAIL Failure - check error parameter.
S_OK Success
E_INVALIDARG The parameter is invalid.
DeckLink API
Syntax
HRESULT SetCallback (IDeckLinkDeckControlStatusCallback *callback);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
An object with the IDeckLinkDeckControlStatusCallback object interface may be registered as a callback with the IDeckLinkDeckControl interface.
Related Interfaces
DeckLink API
Timecodes may be missed when playing at non 1x speed. This method will not be called during capture, and the serial timecode attached to
each frame delivered by the API should be used instead.
Syntax
HRESULT TimecodeUpdate (BMDTimecodeBCD currentTimecode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT VTRControlStateChanged (BMDDeckControlVTRControlState newState, BMDDeckControlError error);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT DeckControlEventReceived (BMDDeckControlEvent event, BMDDeckControlError error);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT DeckControlStatusChanged (BMDDeckControlStatusFlags flags, uint32_t mask);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Related Interfaces
DeckLink API
Syntax
HRESULT InstallDeviceNotifications (IDeckLinkDeviceNotificationCallback* deviceCallback);
Parameters
Return Values
Value Description
E_INVALIDARG The parameter variable is NULL
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT UninstallDeviceNotifications (void);
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.29 IDeckLinkDeviceNotificationCallback
The IDeckLinkDeviceNotificationCallback object interface is callback which is called when a DeckLink device arrives or is removed.
Public Member Functions
Method Description
DeckLinkDeviceArrived A DeckLink device has arrived.
DeckLinkDeviceRemoved A DeckLink device has been removed.
DeckLink API
This method is abstract in the base interface and must be implemented by the application developer. The result parameter (required by COM)
is ignored by the caller.
Syntax
HRESULT DeckLinkDeviceArrived (IDeckLink* deckLinkDevice);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
This method is abstract in the base interface and must be implemented by the application developer. The result parameter (required by COM)
is ignored by the caller.
Syntax
HRESULT DeckLinkDeviceRemoved (IDeckLink* deckLinkDevice);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Related Interfaces
DeckLink API
Syntax
HRESULT Subscribe (BMDNotifications topic, IDeckLinkNotificationCallback *theCallback);
Parameters
Return Values
Value Description
E_INVALIDARG The callback parameter variable is NULL
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT Unsubscribe (BMDNotifications topic, IDeckLinkNotificationCallback *theCallback);
Parameters
Return Values
Value Description
E_INVALIDARG The callback parameter variable is NULL
E_FAIL Failure
S_OK Success
DeckLink API
Related Interfaces
DeckLink API
This method is abstract in the base interface and must be implemented by the application developer.
The result parameter (required by COM) is ignored by the caller.
Syntax
HRESULT Notify (BMDNotifications topic, uint64_t param1, uint64_t param2);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
An IDeckLinkEncoderInput interface can be obtained from an IDeckLink object interface using QueryInterface. If QueryInterface for an input
interface is called on a device which does not support encoded capture, then QueryInterface will fail and return E_NOINTERFACE.
Encoded Video capture operates in a push model with encoded video data delivered to an IDeckLinkEncoderInputCallback object interface.
Audio capture is optional and can be handled by using the same callback object.
Related Interfaces
Interface Interface ID Description
IDeckLink IID_IDeckLink An IDeckLinkEncoderInput object interface may be
obtained from IDeckLink using QueryInterface
DeckLink API
DeckLink API
2.5.32.1 IDeckLinkEncoderInput::DoesSupportVideoMode
The DoesSupportVideoMode method indicates whether a given display mode is supported on encoder input.
Syntax
HRESULT DoesSupportVideoMode (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat,
BMDVideoInputFlags flags, BMDDisplayModeSupport *result, IDeckLinkDisplayMode
**resultDisplayMode);
Parameters
Name Direction Description
displayMode in Display mode to check
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.2 IDeckLinkEncoderInput::GetDisplayModeIterator
The GetDisplayModeIterator method returns an iterator which enumerates the available display modes.
Syntax
HRESULT GetDisplayModeIterator (IDeckLinkDisplayModeIterator **iterator);
Parameters
Name Direction Description
iterator out display mode iterator
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.3 IDeckLinkEncoderInput::EnableVideoInput
The EnableVideoInput method configures video input and puts the hardware into encoded video capture mode. Video input (and optionally
audio input) is started by calling StartStreams.
Syntax
HRESULT EnableVideoInput (BMDDisplayMode displayMode, BMDPixelFormat pixelFormat,
BMDVideoInputFlags flags);
Parameters
Name Direction Description
displayMode in Video mode to capture
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG Is returned on invalid mode or video flags
E_ACCESSDENIED Unable to access the hardware or input stream
currently active
DeckLink API
2.5.32.4 IDeckLinkEncoderInput::DisableVideoInput
The DisableVideoInput method disables the hardware video capture mode.
Syntax
HRESULT DisableVideoInput ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.5 IDeckLinkEncoderInput::EnableAudioInput
The EnableAudioInput method configures audio input and puts the hardware into audio capture mode. Encoded audio and video input is
started by calling StartStreams.
Syntax
HRESULT EnableAudioInput (BMDAudioFormat audioFormat, BMDAudioSampleRate
sampleRate, BMDAudioSampleType sampleType, uint32_t channelCount);
Parameters
Name Direction Description
audioFormat in Audio format to encode.
Return Values
Value Description
E_FAIL Failure
E_INVALIDARG Invalid audio format or number of channels
requested
S_OK Success
DeckLink API
2.5.32.6 IDeckLinkEncoderInput::DisableAudioInput
The DisableAudioInput method disables the hardware audio capture mode.
Syntax
HRESULT DisableAudioInput ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.7 IDeckLinkEncoderInput::StartStreams
The StartStreams method starts encoded video and audio capture as configured with EnableVideoInput and optionally EnableAudioInput.
Syntax
HRESULT StartStreams ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_ACCESSDENIED Input stream is already running.
E_UNEXPECTED Video and Audio inputs are not enabled.
DeckLink API
2.5.32.8 IDeckLinkEncoderInput::StopStreams
The StopStreams method stops encoded video and audio capture.
Syntax
HRESULT StopStreams ();
Parameters
none.
Return Values
Value Description
E_ACCESSDENIED Input stream already stopped.
S_OK Success
DeckLink API
2.5.32.9 IDeckLinkEncoderInput::PauseStreams
The PauseStreams method pauses encoded video and audio capture. Capture time continues while the streams are paused but no video or
audio will be captured. Paused capture may be resumed by calling PauseStreams again. Capture may also be resumed by calling StartStreams
but capture time will be reset.
Syntax
HRESULT PauseStreams ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.10 IDeckLinkEncoderInput::FlushStreams
The FlushStreams method removes any buffered video packets and audio frames.
Syntax
HRESULT FlushStreams ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.11 IDeckLinkEncoderInput::SetCallback
The SetCallback method configures a callback which will be called as new encoded video, and audio packets become available. Encoder
capture is started with StartStreams, stopped with StopStreams and may be paused with PauseStreams.
Syntax
HRESULT SetCallback (IDeckLinkEncoderInputCallback *theCallback);
Parameters
Name Direction Description
theCallback in Callback object implementing the
IDeckLinkEncoderInputCallback object interface
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.12 IDeckLinkEncoderInput::GetHardwareReferenceClock
The GetHardwareReferenceClock method returns a clock that is locked to the system clock. The absolute values returned by this method are
meaningless, however the relative differences between subsequent calls can be used to determine elapsed time. This method can be called
while video input is enabled (see IDeckLinkEncoderInput::EnableVideoInput for details).
Syntax
HRESULT GetHardwareReferenceClock (BMDTimeScale desiredTimeScale, BMDTimeValue *hardwareTime,
BMDTimeValue *timeInFrame, BMDTimeValue *ticksPerFrame);
Parameters
Name Direction Description
desiredTimeScale in Desired time scale
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.13 IDeckLinkEncoderInput::SetMemoryAllocator
The SetMemoryAllocator method sets a custom memory allocator for encoded video packet allocations during capture. Use of a custom
memory allocator is optional.
Syntax
HRESULT SetMemoryAllocator (IDeckLinkMemoryAllocator *theAllocator);
Parameters
Name Direction Description
theAllocator in Allocator object with an IDeckLinkMemoryAllocator
interface
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.32.14 IDeckLinkEncoderInput::GetAvailableAudioSampleFrameCount
The GetAvailableAudioSampleFrameCount method returns the number of audio sample frames currently buffered. Use of this method is only
required when using pull model audio – the same audio data is made available via IDeckLinkEncoderInputCallback and may be ignored.
Syntax
HRESULT GetAvailableAudioSampleFrameCount (uint32_t *availableSampleFrameCount);
Parameters
Name Direction Description
availableSampleFrameCount out The number of buffered audio frames currently
available.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Related Interfaces
Interface Interface ID Description
IDeckLinkEncoderInput IID_IDeckLinkEncoderInput An IDeckLinkEncoderInputCallback object interface may be
registered with IDeckLinkEncoderInput::SetCallback
DeckLink API
To enable this feature, the bmdVideoInputEnableFormatDetection flag must be set when calling IDeckLinkEncoderInput::EnableVideoInput().
Syntax
HRESULT VideoInputSignalChanged (BMDVideoInputFormatChangedEvents notificationEvents,
IDeckLinkDisplayMode *newDisplayMode, BMDDetectedVideoInputFormatFlags detectedSignalFlags);
Parameters
Name Direction Description
notificationEvents in The notification events
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.33.2 IDeckLinkEncoderInputCallback::VideoPacketArrived
The VideoPacketArrived method is called when an encoded packet has arrived. The method is abstract in the base interface and must be
implemented by the application developer. The result parameter (required by COM) is ignored by the caller.
When encoded capture is started using bmdFormatH265, this callback is used to deliver VCL and non-VCL NAL units.
Syntax
HRESULT VideoPacketArrived (IDeckLinkEncoderVideoPacket* videoPacket);
Parameters
Name Direction Description
videoPacket in The encoded packet that has arrived.
The packet is only valid for the duration of the
callback. To hold on to the packet beyond the
callback call AddRef, and to release the packet
when it is no longer required call Release.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
2.5.33.3 IDeckLinkEncoderInputCallback::AudioPacketArrived
The AudioPacketArrived method is called when audio capture is enabled with IDeckLinkEncoderInput::EnableAudioInput, and an audio
packet has arrived. The method is abstract in the base interface and must be implemented by the application developer.
Syntax
HRESULT AudioPacketArrived (IDeckLinkEncoderAudioPacket* audioPacket);
Parameters
Name Direction Description
audioPacket in The audio packet that has arrived.
The audio packet is only valid for the duration of the
callback. To hold on to the audio packet beyond
the callback call AddRef, and to release the audio
packet when it is no longer required call Release.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
The GetSize method may be used to determine the size of the encoded packet.
Related Interfaces
Interface Interface ID Description
IDeckLinkEncoderVideoPacket IID_IDeckLinkEncoderVideoPacket IDeckLinkEncoderVideoPacket subclasses
IDeckLinkEncoderPacket
DeckLink API
Syntax
HRESULT GetBytes (void **buffer);
Parameters
Name Direction Description
buffer out Pointer to raw encoded buffer – only valid while
object remains valid.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
long GetSize ();
Return Values
Value Description
BytesCount Number of bytes in the encoded packet buffer
DeckLink API
Syntax
HRESULT GetStreamTime (BMDTimeValue *frameTime, BMDTimeScale timeScale);
Parameters
Name Direction Description
frameTime out Frame time (in units of timeScale)
timeScale in Time scale for output parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
BMDPacketType GetPacketType ();
Return Values
Value Description
PacketType Packet type of encoded packet (BMDPacketType)
DeckLink API
The data in the encoded packet is encoded according to the pixel format returned by GetPixelFormat – see BMDPixelFormat for details.
Related Interfaces
Interface Interface ID Description
IDeckLinkEncoderInput IID_IDeckLinkEncoderInput Encoded input packets are passed to IDeckLinkEn
coderInputCallback::VideoPacketArrived by the
IDeckLinkEncoderInput interface
DeckLink API
Syntax
BMDPixelFormat GetPixelFormat ();
Return Values
Value Description
PixelFormat Pixel format of encoded packet
(BMDPixelFormat)
DeckLink API
Syntax
HRESULT GetHardwareReferenceTimestamp (BMDTimeScale timeScale, BMDTimeValue *frameTime,
BMDTimeValue *frameDuration);
Parameters
Name Direction Description
timeScale in The time scale - see BMDTimeScale
for details.
Return Values
Value Description
E_INVALIDARG Timescale is not set
S_OK Success
DeckLink API
Syntax
HRESULT GetTimecode (BMDTimecodeFormat format, IDeckLinkTimecode **timecode);
Parameters
Name Direction Description
format in BMDTimecodeFormat to query
timecode out New IDeckLinkTimecode object interface
containing the requested timecode or NULL if
requested timecode is not available.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_ACCESSDENIED An invalid or unsupported timecode format was
requested.
DeckLink API
The data in the encoded packet is encoded according to the audio format returned by GetAudioFormat - see BMDAudioFormat for details.
Related Interfaces
Interface Interface ID Description
IDeckLinkEncoderInput IID_IDeckLinkEncoderInput Encoded audio packets are passed to IDeckLinkEn
coderInputCallback::AudioPacketArrived by the
IDeckLinkEncoderInput interface
DeckLink API
Syntax
BMDAudioFormat GetAudioFormat ();
Return Values
Value Description
AudioFormat Audio format of encoded packet
(BMDAudioFormat)
DeckLink API
Related Interfaces
Interface Interface ID Description
IDeckLinkEncoderVideoPacket IID_IDeckLinkEncoderVideoPacket IDeckLinkH265NALPacket is available from
IDeckLinkEncoderVideoPacket via QueryInterface
DeckLink API
Syntax
HRESULT GetUnitType (uint8_t *unitType);
Parameters
Name Direction Description
unitType out H.265 NAL unit type
Return Values
Value Description
E_INVALIDARG If unitType is not provided
S_OK Success
DeckLink API
Syntax
HRESULT GetBytesNoPrefix (void **buffer);
Parameters
Name Direction Description
buffer out Pointer to raw encoded buffer without
start code prefix – only valid while object remains
valid.
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
long GetSizeNoPrefix ();
Return Values
Value Description
BytesCount Number of bytes in the encoded packet buffer
without the start code prefix
DeckLink API
An IDeckLinkEncoderConfiguration object interface can be obtained from the IDeckLinkEncoderInput interface using QueryInterface.
Related Interfaces
Interface Interface ID Description
IDeckLinkEncoderInput IID_IDeckLinkEncoderInput DeckLink encoder input interface
GetFlag Gets the current boolean value of a setting associated with the given
BMDDeckLinkEncoderConfigurationID.
SetInt Sets the current int64_t value into the configuration setting associated with the given
BMDDeckLinkEncoderConfigurationID.
GetInt Gets the current int64_t value of a setting associated with the given
BMDDeckLinkEncoderConfigurationID.
SetFloat Sets the current double value into the configuration setting associated with the given
BMDDeckLinkEncoderConfigurationID.
GetFloat Gets the current double value of a setting associated with the given
BMDDeckLinkEncoderConfigurationID.
SetString Sets the current string value into the configuration setting with the given
BMDDeckLinkEncoderConfigurationID.
GetString Gets the current string value of a setting associated with the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
Syntax
HRESULT SetFlag (BMDDeckLinkEncoderConfigurationID cfgID, bool value);
Parameters
Name Direction Description
cfgID in The ID of the configuration setting.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no flag type configuration setting
for this operation corresponding to the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
Syntax
HRESULT GetFlag (BMDDeckLinkEncoderConfigurationID cfgID, bool *value);
Parameters
Name Direction Description
cfgID in The ID of the configuration setting.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no flag type configuration setting
for this operation corresponding to the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
Syntax
HRESULT SetInt (BMDDeckLinkEncoderConfigurationID cfgID, int64_t value);
Parameters
Name Direction Description
cfgID in The ID of the configuration setting.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no integer type configuration setting
for this operation corresponding to the given
IDeckLinkEncoderConfiguration.
DeckLink API
Syntax
HRESULT GetInt (BMDDeckLinkEncoderConfigurationID cfgID, int64_t *value);
Parameters
Name Direction Description
cfgID in The ID of the configuration setting.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no integer type configuration setting
for this operation corresponding to the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
Syntax
HRESULT SetFloat (BMDDeckLinkEncoderConfigurationID cfgID, double value);
Parameters
Name Direction Description
cfgID in The ID of the configuration setting.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no float type configuration setting
for this operation corresponding to the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
Syntax
HRESULT GetFloat (BMDDeckLinkEncoderConfigurationID cfgID, double *value);
Parameters
Name Direction Description
cfgID in The ID of the configuration setting.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no float type configuration setting
for this operation corresponding to the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
Syntax
HRESULT SetString (BMDDeckLinkEncoderConfigurationID cfgID, string value);
Parameters
Name Direction Description
cfgID in The ID of the configuration setting.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no string type configuration setting
for this operation corresponding to the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
Syntax
HRESULT GetString (BMDDeckLinkEncoderConfigurationID cfgID, string *value);
Parameters
Name Direction Description
cfgID in The ID of the configuration setting.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no string type configuration setting
for this operation corresponding to the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
Syntax
HRESULT GetBytes (BMDDeckLinkEncoderConfigurationID cfgID, void *buffer, uint32_t *bufferSize);
Parameters
Name Direction Description
cfgID in The ID of the configuration data format.
buffer out The buffer in which to return the configuration
data, or NULL to determine the required buffer
size.
bufferSize in, out The size of the provided buffer. Will be updated
to the number of bytes returned.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no encoder configuration data
format corresponding to the given
BMDDeckLinkEncoderConfigurationID.
DeckLink API
The DeckLink Status ID section lists the status information and associated identifiers that can be queried using this object interface. An
IDeckLinkStatus object interface can be obtained from an IDeckLink object interface using QueryInterface.
An application may be notified of changes to status information by subscribing to the bmdStatusChanged topic using the
IDeckLinkNotification interface. See BMDNotifications for more information.
For an example demonstrating how status information can be queried and monitored, please see the StatusMonitor sample in the DeckLink
SDK.
Related Interfaces
Interface Interface ID Description
IDeckLink IID_IDeckLink An IDeckLinkStatus object interface may be obtained from
IDeckLink using QueryInterface
DeckLink API
Syntax
HRESULT GetFlag (BMDDeckLinkStatusID statusID, bool *value);
Parameters
Name Direction Description
statusID in The BMDDeckLinkStatusID of the status information item.
value out The boolean value corresponding to the statusID.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no flag type status corresponding to the
given BMDDeckLinkStatusID.
DeckLink API
Syntax
HRESULT GetInt (BMDDeckLinkStatusID statusID, int64_t *value);
Parameters
Name Direction Description
statusID in The BMDDeckLinkStatusID of the status information item.
value out The integer value corresponding to the statusID.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no integer type status corresponding to
the given BMDDeckLinkStatusID.
DeckLink API
Syntax
HRESULT GetFloat (BMDDeckLinkStatusID statusID, double *value);
Parameters
Name Direction Description
statusID in The BMDDeckLinkStatusID of the status information item.
value out The double value corresponding to the statusID.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no float type status corresponding to the
given BMDDeckLinkStatusID.
DeckLink API
Syntax
HRESULT GetString (BMDDeckLinkStatusID statusID, string *value);
Parameters
Name Direction Description
statusID in The BMDDeckLinkStatusID of the status information item.
value out The string value corresponding to the statusID. This allocated
string must be freed by the caller when no longer required.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no string type status corresponding to
the given BMDDeckLinkStatusID.
DeckLink API
Note: If the size of the buffer is not sufficient, bufferSize will be updated to the required buffer size.
Syntax
HRESULT GetBytes (BMDDeckLinkStatusID statusID, void *buffer, uint32_t *bufferSize);
Parameters
Name Direction Description
statusID in The BMDDeckLinkStatusID of the status information item.
buffer out The buffer in which to return the status data.
bufferSize in, out The size of the provided buffer. Will be updated to the number
of bytes returned.
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no byte array type status corresponding
to the given BMDDeckLinkStatusID.
DeckLink API
An IDeckLinkVideoFrameMetadataExtensions object interface may be obtained from an IDeckLinkVideoFrame object interface using
QueryInterface if the IDeckLinkVideoFrame implements this optional interface.
An IDeckLinkVideoFrame object interface with the bmdFrameContainsHDRMetadata flag may use this interface to query the HDR metadata
parameters associated with the video frame.
Related Interfaces
DeckLink API
Syntax
HRESULT GetInt (BMDDeckLinkFrameMetadataID metadataID, int64_t *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no integer type metadata
item corresponding to the given
BMDDeckLinkFrameMetadataID.
DeckLink API
Syntax
HRESULT GetFloat (BMDDeckLinkFrameMetadataID metadataID, double *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no float type metadata
item corresponding to the given
BMDDeckLinkFrameMetadataID.
DeckLink API
Syntax
HRESULT GetFlag (BMDDeckLinkFrameMetadataID metadataID, bool* value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no flag type metadata
item corresponding to the given
BMDDeckLinkFrameMetadataID.
DeckLink API
Syntax
HRESULT GetString (BMDDeckLinkFrameMetadataID metadataID, string *value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG There is no string type metadata
item corresponding to the given
BMDDeckLinkFrameMetadataID.
DeckLink API
A reference to an IBMDStreamingDiscovery object interface may be obtained from CoCreateInstance on platforms with native COM support
or from CreateBMDStreamingDiscoveryInstance on other platforms.
DeckLink API
Syntax
HRESULT InstallDeviceNotifications (IBMDStreamingDeviceNotificationCallback* theCallback);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG The callback parameter is invalid.
E_UNEXPECTED An unexpected internal error has occurred.
DeckLink API
Syntax
HRESULT UninstallDeviceNotifications ();
Return Values
Value Description
S_OK Success
E_UNEXPECTED An unexpected internal error has occurred.
DeckLink API
Related Interfaces
DeckLink API
Syntax
HRESULT StreamingDeviceArrived (IDeckLink* device);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT StreamingDeviceRemoved (IDeckLink* device);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT StreamingDeviceModeChanged (IDeckLink* device, BMDStreamingDeviceMode mode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
The encoding mode encapsulates all the available encoder settings such as video codec settings and audio codec settings.
To make changes to encoder settings use the IBMDStreamingMutableVideoEncodingMode object interface obtained via
the CreateMutableVideoEncodingMode method.
Related Interfaces
DeckLink API
DeckLink API
Syntax
HRESULT GetName (string name);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_POINTER The name parameter is invalid.
Syntax
unsigned int GetPresetID ();
Return Values
Value Description
id Unique ID of preset video mode.
DeckLink API
Syntax
unsigned int GetSourcePositionX ();
Return Values
Value Description
xPosition The x coordindate in pixels for source rectangle
origin.
Syntax
unsigned int GetSourcePositionY ();
Return Values
Value Description
yPosition The y coordindate in pixels for source rectangle
origin.
DeckLink API
Syntax
unsigned int GetSourceWidth ();
Return Values
Value Description
width Width in pixels of the source rectangle.
Syntax
unsigned int GetSourceHeight ();
Return Values
Value Description
height Height in pixels of the source rectangle.
DeckLink API
Syntax
unsigned int GetDestWidth ();
Return Values
Value Description
width Width in pixels of the destination rectangle.
Syntax
unsigned int GetDestHeight ();
Return Values
Value Description
height Height in pixels of the destination rectangle.
DeckLink API
Syntax
HRESULT GetFlag (BMDStreamingEncodingModePropertyID cfgID, boolean* value);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT GetInt (BMDStreamingEncodingModePropertyID cfgID, int64_t* value);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT GetFloat (BMDStreamingEncodingModePropertyID cfgID, double* value);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT GetString (BMDStreamingEncodingModePropertyID cfgID, string value);
Parameters
Return Values
Value Description
S_OK Success
E_INVALIDARG One or more parameters are invalid.
E_OUTOFMEMORY Unable to allocate memory for string.
DeckLink API
Syntax
HRESULT CreateMutableVideoEncodingMode (IBMDStreamingMutableVideoEncodingMode** newEncodingMode);
Parameters
Return Values
Value Description
S_OK Success
E_POINTER The newEncodingMode parameter is invalid.
E_OUTOFMEMORY Unable to allocate memory for new
object interface.
DeckLink API
Methods are provided to set video codec settings and audio codec settings. Use this object interface if you wish to perform cropping
or scaling of the input video frame, adjust the video or audio bit rate and to change other video or audio codec settings.
Related Interfaces
DeckLink API
Cropping of the input video frame can be achieved by using a source rectangle that is different to the input video frame dimensions.
When no source rectangle is set, the source rectangle of the parent IBMDStreamingVideoEncodingMode object interface will be used
by the encoder.
Syntax
HRESULT SetSourceRect (uint32_t posX, uint32_t posY, uint32_t width, uint32_t height);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
When the destination rectangle size is set to a different size to the source rectangle size, scaling will be performed by the encoder.
When no destination rectangle size is set, the source rectangle size of the parent IBMDStreamingVideoEncodingMode object interface
will be used by the encoder.
Syntax
HRESULT SetDestSize (uint32_t width, uint32_t height);
Parameters
Return Values
Value Description
S_OK Success
DeckLink API
Syntax
HRESULT SetFlag (BMDStreamingEncodingModePropertyID cfgID, boolean value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT SetInt (BMDStreamingEncodingModePropertyID cfgID, int64_t value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT SetFloat (BMDStreamingEncodingModePropertyID cfgID, double value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
Syntax
HRESULT SetString (BMDStreamingEncodingModePropertyID cfgID, string value);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG One or more parameters are invalid.
DeckLink API
A device may have a number of preset encoding modes. These are convenient encoding modes which can be used to encode video and audio
into formats suitable for a number of commonly available playback devices.
Related Interfaces
DeckLink API
Syntax
HRESULT Next (IBMDStreamingVideoEncodingMode** videoEncodingMode);
Parameters
Return Values
Value Description
S_OK Success
S_FALSE No (more) preset encoding modes
are available.
E_POINTER The videoEncodingMode parameter
is invalid.
DeckLink API
Related Interfaces
DeckLink API
Syntax
HRESULT DoesSupportVideoInputMode (BMDDisplayMode inputMode, boolean* result);
Parameters
Return Values
Value Description
S_OK Success
E_POINTER The result parameter is invalid.
E_INVALIDARG The inputMode parameter is invalid
DeckLink API
Syntax
HRESULT GetVideoInputModeIterator (IDeckLinkDisplayModeIterator** iterator);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_POINTER The iterator parameter is invalid.
DeckLink API
Syntax
HRESULT SetVideoInputMode (BMDDisplayMode inputMode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG The inputMode parameter is invalid.
DeckLink API
Syntax
HRESULT GetCurrentDetectedVideoInputMode (BMDDisplayMode* detectedMode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG The detectedMode parameter is invalid.
DeckLink API
Syntax
HRESULT GetVideoEncodingMode (IBMDStreamingVideoEncodingMode** encodingMode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG The encodingMode parameter is invalid.
DeckLink API
Different video display modes may have different encoding mode presets.
Syntax
HRESULT GetVideoEncodingModePresetIterator
(BMDDisplayMode inputMode,
IBMDStreamingVideoEncodingModePresetIterator** iterator);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG The iterator parameter is invalid.
DeckLink API
Syntax
HRESULT DoesSupportVideoEncodingMode
(BMDDisplayMode inputMode, IBMDStreamingVideoEncodingMode*
encodingMode, BMDStreamingEncodingSupport* result,
IBMDStreamingVideoEncodingMode** changedEncodingMode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_POINTER One or more out parameters are invalid
E_INVALIDARG The encodingMode parameter is invalid
DeckLink API
Syntax
HRESULT SetVideoEncodingMode (IBMDStreamingVideoEncodingMode* encodingMode);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_INVALIDARG The encodingMode parameter is invalid
DeckLink API
If a callback implementing the IBMDStreamingH264InputCallback object interface has been set by the SetCallback method,
calls will be made as new compressed video and audio packets are made available by the device.
Syntax
HRESULT StartCapture ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT StopCapture ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
An object shall be passed implementing the IBMDStreamingH264InputCallback object interface as the callback to receive callbacks
for new video and audio packets.
Syntax
HRESULT SetCallback (IUnknown* theCallback);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Once a capture has been started with the IBMDStreamingDeviceInput::StartCapture method, compressed video and audio packets will
become available asynchronously.
This callback object interface can also be used to detect changes to the video input display mode and changes to the video input connector,
whether or not a capture is in progress.
Related Interfaces
DeckLink API
Syntax
HRESULT H264NALPacketArrived (IBMDStreamingH264NALPacket* nalPacket);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT H264AudioPacketArrived (IBMDStreamingAudioPacket* audioPacket);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT MPEG2TSPacketArrived (IBMDStreamingMPEG2TSPacket* tsPacket);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT H264VideoInputConnectorScanningChanged ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT H264VideoInputConnectorChanged ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
Syntax
HRESULT H264VideoInputModeChanged ();
Parameters
none.
Return Values
Value Description
E_FAIL Failure
S_OK Success
DeckLink API
The MPEG-4 AVC/H.264 NAL packet contains the compressed H.264 video bitstream which can be passed to a suitable H.264 video decoder
for decoding and display. For some applications it may be more convenient to process NAL video packets instead of processing video carried
in transport stream packets.
Related Interfaces
Interface Interface ID Description
IBMDStreamingH264Input IID_IBMDStreamingH264Input New MPEG-4 AVC/H.264 NAL packets are passed to the
Callback Callback IBMDStreamingH264InputCallback::H264NALPacketArrived callback
DeckLink API
Syntax
long GetPayloadSize ();
Return Values
Value Description
Count NAL packet size in bytes
Syntax
HRESULT GetBytes (void** buffer);
Parameters
Return Values
Value Description
S_OK Success
E_POINTER The parameter is invalid.
DeckLink API
Note: The size of the data buffer returned by GetBytesWithSizePrefix is 4 bytes larger than the size of the data buffer returned by GetBytes.
Syntax
HRESULT GetBytesWithSizePrefix (void** buffer);
Parameters
Name Direction Description
buffer out Pointer to NAL packet data buffer prefixed by size value –
only valid while object remains
Return Values
Value Description
S_OK Success
E_POINTER The parameter is invalid.
DeckLink API
Syntax
HRESULT GetDisplayTime (uint64_t requestedTimeScale, uint64_t* displayTime);
Parameters
Return Values
Value Description
S_OK Success
E_POINTER The displayTime parameter is invalid.
DeckLink API
The audio packet can contain compressed audio, such as MPEG-2 AAC audio, which can be passed to a suitable audio decoder for decoding
and playback. For some applications it may be more convenient to process audio packets instead of processing audio carried in transport
stream packets.
Related Interfaces
DeckLink API
Syntax
BMDStreamingAudioCodec GetCodec ();
Return Values
Value Description
Codec The codec for the audio in the packet.
Syntax
long GetPayloadSize ();
Return Values
Value Description
Count Audio packet size in bytes.
DeckLink API
Syntax
HRESULT GetBytes (void** buffer);
Parameters
Return Values
Value Description
S_OK Success
E_POINTER The parameter is invalid.
DeckLink API
Syntax
HRESULT GetPlayTime (uint64_t requestedTimeScale, uint64_t* playTime);
Parameters
Return Values
Value Description
S_OK Success
E_POINTER The parameter is invalid.
DeckLink API
The MPEG-2 transport stream packet can contain compressed audio or video together with metadata for decoding and synchronizing audio
and video streams. For some applications it may be more convenient to process transport stream packets as an alternative to processing NAL
video packets and audio packets separately.
Related Interfaces
DeckLink API
Syntax
long GetPayloadSize ();
Return Values
Value Description
Count The size of the MPEG TS packet in bytes.
Syntax
HRESULT GetBytes (void** buffer);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_POINTER The parameter is invalid
DeckLink API
A reference to an IBMDStreamingH264NALParser object interface may be obtained from CoCreateInstance on platforms with native COM
support or from CreateBMDStreamingH264NALParser on other platforms.
Related Interfaces
DeckLink API
Syntax
HRESULT IsNALSequenceParameterSet (IBMDStreamingH264NALPacket* nal);
Parameters
Return Values
Value Description
S_OK The sequence parameter of the NAL packet is set.
DeckLink API
Syntax
HRESULT IsNALPictureParameterSet (IBMDStreamingH264NALPacket* nal);
Parameters
Return Values
Value Description
S_OK The picture parameter of the NAL packet is set.
E_FALSE The picture parameter of the NAL packet is not
set.
DeckLink API
Syntax
HRESULT GetProfileAndLevelFromSPS (
IBMDStreamingH264NALPacket* nal, uint32_t* profileIdc,
uint32_t* profileCompatability, uint32_t* levelIdc);
Parameters
Return Values
Value Description
E_FAIL Failure
S_OK Success
E_POINTER One or more parameters are invalid.
DeckLink API
Windows BOOL
Mac OS X bool
Linux bool
Strings
Strings are represented differently on each platform, using the most appropriate system type:
Windows BSTR
Mac OS X CFStringRef
Linux char *
int64_t
The 64 bit integer type is represented differently on each platform, using the most appropriate system type:
Windows LONGLONG
Mac OS X int64_t
Linux int64_t
DeckLink API
uint64_t
The 64 bit unsigned integer type is represented differently on each platform, using the most appropriate system type:
Windows ULONGLONG
Mac OS X uint64_t
Linux uint64_t
uint32_t
The 32 bit unsigned integer type is represented differently on each platform, using the most appropriate system type:
Mac OS X uint32_t
Linux uint32_t
int32_t
The 32 bit integer type is represented differently on each platform, using the most appropriate system type:
Windows int
Mac OS X int32_t
Linux int32_t
DeckLink API
uint16_t
The 16 bit unsigned integer type is represented differently on each platform, using the most appropriate system type:
Mac OS X uint16_t
Linux uint16_t
uint8_t
The 8 bit unsigned integer type is represented differently on each platform, using the most appropriate system type:
Mac OS X uint8_t
Linux uint8_t
DeckLink API
BMDTimeScale
BMDTimeScale is a large integer type which specifies the time scale for a time measurement in ticks per second.
BMDTimeValue
BMDTimecodeUserBits
DeckLink API
Mode Width Height Frames perSecond Fields per Frame Suggested Time Scale Display Duration
bmdModeNTSC 720 486 30/1.001 2 30000 1001
bmdModeNTSC2398 720 486 30/1.001* 2 24000* 1001
bmdModeNTSCp 720 486 60/1.001 1 60000 1001
bmdModePAL 720 576 25 2 25000 1000
bmdModePALp 720 576 50 1 50000 1000
bmdModeHD720p50 1280 720 50 1 50000 1000
bmdModeHD720p5994 1280 720 60/1.001 1 60000 1001
bmdModeHD720p60 1280 720 60 1 60000 1000
bmdModeHD1080p2398 1920 1080 24/1.001 1 24000 1001
bmdModeHD1080p24 1920 1080 24 1 24000 1000
bmdModeHD1080p25 1920 1080 25 1 25000 1000
bmdModeHD1080p2997 1920 1080 30/1.001 1 30000 1001
bmdModeHD1080p30 1920 1080 30 1 30000 1000
bmdModeHD1080i50 1920 1080 25 2 25000 1000
bmdModeHD1080i5994 1920 1080 30/1.001 2 30000 1001
bmdModeHD1080i6000 1920 1080 30 2 30000 1000
bmdModeHD1080p50 1920 1080 50 1 50000 1000
bmdModeHD1080p5994 1920 1080 60/1.001 1 60000 1001
bmdModeHD1080p6000 1920 1080 60 1 60000 1000
bmdMode2k2398 2048 1556 24/1.001 1 24000 1001
bmdMode2k24 2048 1556 24 1 24000 1000
bmdMode2k25 2048 1556 25 1 25000 1000
bmdMode2kDCI2398 2048 1080 24/1.001 1 24000 1001
DeckLink API
Mode Width Height Frames perSecond Fields per Frame Suggested Time Scale Display Duration
bmdMode2kDCI24 2048 1080 24 1 24000 1000
bmdMode2kDCI25 2048 1080 25 1 25000 1000
bmdMode4K2160p2398 3840 2160 24/1.001 1 24000 1001
bmdMode4K2160p24 3840 2160 24 1 24000 1000
bmdMode4K2160p25 3840 2160 25 1 25000 1000
bmdMode4K2160p2997 3840 2160 30/1.001 1 30000 1001
bmdMode4K2160p30 3840 2160 30 1 30000 1000
bmdMode4K2160p50 3840 2160 50 1 50000 1000
bmdMode4K2160p5994 3840 2160 60/1.001 1 60000 1001
bmdMode4K2160p60 3840 2160 60 1 60000 1000
bmdMode4kDCI2398 4096 2160 24/1.001 1 24000 1001
bmdMode4kDCI24 4096 2160 24 1 24000 1000
bmdMode4kDCI25 4096 2160 25 1 25000 1000
Note: bmdModeNTSC2398 mode will be played out on the SDI output with a frame rate of 29.97 frames per second with 3:2 pull down.
Some cards may not support all of these modes.
DeckLink API
Word
Decreasing Address Order
Byte 3 Byte 2 Byte 1 B yte 0
Y’ 1 Cr 0 Y’ 0 Cb 0
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
In this format, two pixels fit into 32 bits or 4 bytes, so one pixel fits into 16 bits or 2 bytes.
For the row bytes calculation, the image width is multiplied by the number of bytes per pixel.
For the frame size calculation, the row bytes are simply multiplied by the number of rows in the frame.
Twelve 10-bit unsigned components are packed into four 32-bit little-endian words.
Word 0
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
Cr 0 Y’ 0 Cb 0
X X
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
DeckLink API
Word 1
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
Y’ 2 Cb 2 Y’ 1
X X
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
Word 2
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
Cb 4 Y’3 Cr 2
X X
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
Word 3
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
Y’ 5 Cr 4 Y’ 4
X X
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
In this format, each line of video must be aligned on a 128 byte boundary. Six pixels fit into16 bytes so 48 pixels fit in 128 bytes.
For the row bytes calculation the image width is rounded to the nearest 48 pixel boundary and multiplied by 128.
For the frame size calculation the row bytes are simply multiplied by the number of rows in the frame.
DeckLink API
Four 8-bit unsigned components are packed into one 32-bit little-endian word.
Alpha channel is valid.
Word
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B G R A
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
In this format, each pixel fits into 32 bits or 4 bytes. For the row bytes calculation the image width is multiplied by the number of bytes per pixel.
For the frame size calculation, the row bytes are simply multiplied by the number of rows in the frame.
Four 8-bit unsigned components are packed into one 32-bit little-endian word.
The alpha channel may be valid.
Word
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
X R G B
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
DeckLink API
In this format, each pixel fits into 32 bits or 4 bytes. For the row bytes calculation, the image width is multiplied by the number of bytes per
pixel. For the frame size calculation, the row bytes are simply multiplied by the number of rows in the frame.
Three 10-bit unsigned components are packed into one 32-bit big-endian word.
Word
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B Lo G Lo B Hi R Lo G Hi X X R Hi
7 6 5 4 3 2 1 0 5 4 3 2 1 0 9 8 3 2 1 0 9 8 7 6 x x 9 8 7 6 5 4
In this format each line of video must be aligned a 256 byte boundary. One pixel fits into 4 bytes so 64 pixels fit into 256 bytes.
For the row bytes calculation, the image width is rounded to the nearest 64 pixel boundary and multiplied by 256.
For the frame size calculation, the row bytes are simply multiplied by the number of rows in the frame.
bmdFormat12BitRGB : ‘R12B’
Big-endian RGB 12-bit per component with full range (0-4095). Packed as 12-bit per component.
This 12-bit pixel format is compatible with SMPTE 268M Digital Moving-Picture Exchange version 1, Annex C, Method C4 packing.
int framesize = ((Width * 36) / 8) * Height
= rowbytes * Height
DeckLink API
Word 0
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B0 G0 G0 R0 R0
7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0
Word 1
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B1 G1 G1 R1 R1 B0
3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8
Word 2
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
G2 G2 R2 R2 B1
11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4
Word 3
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
G3 R3 R3 B2 B2
7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0
DeckLink API
Word 4
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
G4 R4 R4 B3 B3 G3
3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8
Word 5
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
R5 R5 B4 B4 G4
11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4
Word 6
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
R6 B5 B5 G5 G5
7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0
Word 7
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
R7 B6 B6 G6 G6 R6
3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8
DeckLink API
Word 8
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B7 B7 G7 G7 R7
11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4 3 2 1 0 11 10 9 8 7 6 5 4
bmdFormat12BitRGBLE : ‘R12L’
Little-endian RGB 12-bit per component with full range (0-4095). Packed as 12-bit per component.
This 12-bit pixel format is compatible with SMPTE 268M Digital Moving-Picture Exchange version 1, Annex C, Method C4 packing.
Word 0
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
R0 G0 R0 G0 B0
7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0
Word 1
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
R1 B0 R1 G1 B1 G1
3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8
DeckLink API
Word 2
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B1 R2 G2 R2 G2
11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4
Word 3
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B2 R3 B2 R3 G3
7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0
Word 4
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B3 G3 B3 R4 G4 R4
3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8
Word 5
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
G4 B4 R5 B4 R5
11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4
DeckLink API
Word 6
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
G5 B5 G5 B5 R6
7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0
Word 7
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
G6 R6 G6 B6 R7 B6
3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8
Word 8
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
R7 G7 B7 G7 B7
11 10 9 8 7 6 5 4 7 6 5 4 3 2 1 0 3 2 1 0 11 10 9 8 11 10 9 8 7 6 5 4
Three 10-bit unsigned components are packed into one 32-bit little-endian word.
Word
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
R R G G B B X X
9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 x x
DeckLink API
In this format each line of video must be aligned a 256 byte boundary. One pixel fits into 4 bytes so 64 pixels fit into 256 bytes.
For the row bytes calculation, the image width is rounded to the nearest 64 pixel boundary and multiplied by 256.
For the frame size calculation, the row bytes are simply multiplied by the number of rows in the frame.
Three 10-bit unsigned components are packed into one 32-bit big-endian word.
Word
Decreasing Address Order
Byte 3 Byte 2 Byte 1 Byte 0
B X X G B R G R
5 4 3 2 1 0 x x 3 2 1 0 9 8 7 6 1 0 9 8 7 6 5 4 9 8 7 6 5 4 3 2
In this format each line of video must be aligned a 256 byte boundary. One pixel fits into 4 bytes so 64 pixels fit into 256 bytes.
For the row bytes calculation, the image width is rounded to the nearest 64 pixel boundary and multiplied by 256.
For the frame size calculation, the row bytes are simply multiplied by the number of rows in the frame.
bmdFormatH265 : ‘hev1’
This pixel format is compatible with ITU-T H.265 High Efficiency Video Coding.
bmdFormatDNxHR : ‘AVdh’
DeckLink API
DeckLink API
DeckLink API
DeckLink API
bmdLinkConfigurationSingleLink A single link video connection. A single video stream uses one connector.
bmdLinkConfigurationDualLink A dual-link video connection. A single video stream uses two connectors.
bmdLinkConfigurationQuadLink A quad-link video connection. A single video stream uses four connectors
DeckLink API
Word
Decreasing Adress Order
Byte 4 Byte 3 Byte 2 Byte 1
DeckLink API
DeckLink API
DeckLink API
DeckLink API
DeckLink API
DeckLink API
DeckLink API
DeckLink API
DeckLink API
DeckLink API
bmdAnalogVideoFlagCompositeSetup75
This flag is only applicable to NTSC composite video and sets the black level to 7.5 IRE, which is used in the USA,
rather than the default of 0.0 IRE which is used in Japan.
bmdAnalogVideoFlagComponentBetacamLevels
This flag is only applicable to the component analog video levels. It sets the levels of the color difference channels in accordance
to the SMPTE standard or boosts them by a factor of 4/3 for the Betacam format.
DeckLink API
DeckLink API
bmdVideoInputDisplayModeChanged Video input display mode has changed (see BMDDisplayMode for details)
bmdVideoInputFieldDominanceChanged Video input field dominance has changed
(see BMDFieldDominance for details)
bmdVideoInputColorspaceChanged Video input color space has changed
(see BMDDetectedVideoInputFormatFlags for details)
DeckLink API
bmdDeckLinkCapturePassthroughModeDirect In direct mode the monitoring video output is directly electrically connected
to the video input.
bmdDeckLinkCapturePassthroughModeCleanSwitch In clean switch mode, the captured video is played back out the monitoring
outputs allowing a clean switch between monitoring and playback if the
video modes are compatible. The monitoring output signal is affected by the
options specified on capture and some latency is introduced between capture
and monitoring.
bmdDeckLinkCapturePassthroughModeDisabled In disabled mode the video input is not displayed out the monitoring outputs,
which instead display black frames or the last frame played, dependant on the
configuration of the Idle Output setting (see BMDIdleVideoOutputOperation).
DeckLink API
bmdVideo3DPackingLinebyLine The two eye frames are packed on alternating lines of the source frame.
bmdVideo3DPackingTopAndBottom The two eye frames are packed into the top and bottom half of the source frame.
bmdVideo3DPackingFramePacking Frame packing is a standard HDMI 1.4a 3D mode (Top / Bottom full).
bmdVideo3DPackingLeftOnly Only the left eye frame is displayed.
bmdVideo3DPackingRightOnly Only the right eye frame is displayed.
2.7.31 BMDTimecodeFormat
BMDTimecodeFormat enumerates the possible video frame timecode formats.
DeckLink API
2.7.32 BMDTimecodeFlags
BMDTimecodeFlags enumerates the possible flags that accompany a timecode.
2.7.33 BMDTimecodeBCD
Each four bits represent a single decimal digit:
Word
Decreasing Address Order
Byte 4 Byte 3 Byte 2 Byte 1
Tens of hours hours Tens of minutes minutes Tens of seconds seconds Tens of frames frames
7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0 7 6 5 4 3 2 1 0
DeckLink API
DeckLink API
DeckLink API
bmdDeckControlNoError
bmdDeckControlModeError The deck is not in the correct mode for the desired operation.
Eg. A play command is issued, but the current mode is not VTRControlMode
bmdDeckControlMissedInPointError The in point was missed while prerolling as the current timecode has passed the begin in /
capture timecode.
bmdDeckControlDeckTimeoutError Deck control timeout error.
bmdDeckControlCommandFailedError A deck control command request has failed.
DeckLink API
bmdReferenceNotSupportedByHardware The DeckLink device does not have a genlock input connector.
bmdReferenceLocked Genlock reference lock has been achieved.
bmdIdleVideoOutputBlack When not playing video, the device will output black frames.
bmdIdleVideoOutputLastFrame When not playing video, the device will output the last frame played.
DeckLink API
DeckLink API
DeckLink API
bmdStreamingH264Level12
Level 1.2
bmdStreamingH264Level13
Level 1.3
bmdStreamingH264Level2
Level 2
bmdStreamingH264Level21
Level 2.1
bmdStreamingH264Level22
Level 2.2
bmdStreamingH264Level3
Level 3
bmdStreamingH264Level31
Level 3.1
bmdStreamingH264Level32
Level 3.2
bmdStreamingH264Level4
Level 4
bmdStreamingH264Level41
Level 4.1
bmdStreamingH264Level42
Level 4.2
DeckLink API
DeckLink API
bmdVideoEncoderFrameCodingModeInter Video frame data is compressed with reference to neighbouring video frame data.
BmdVideoEncoderFrameCodingModeIntra Video frame data is compressed relative to the current frame only.
DeckLink API
DeckLink API
bmdDeviceInterfacePCI PCI
bmdDeviceInterfaceUSB USB
bmdDeviceInterfaceThunderbolt Thunderbolt
bmdPacketTypeStreamInterruptedMarker A packet of this type marks when a video stream was interrupted.
bmdPacketTypeStreamData Regular stream data.
DeckLink API
bmdDeckLinkStatusReferenceSignalMode Int The detected reference input mode (BMDDisplayMode), available on devices which support
reference input format detection.
bmdDeckLinkStatusDuplexMode Int The duplex status (BMDDuplexStatus) of the DeckLink device / sub-device.
bmdDeckLinkStatusBusy Int The current busy state of the device. (See BMDDeviceBusyState for more information).
bmdDeckLinkStatusReferenceSignalFlags Int The detected reference input flags (BMDDeckLinkVideoStatusFlags), available on devices
which support reference input format detection.
bmdDuplexModeFull Configure this sub-device to use two connectors (full-duplex). Note that the paired
sub-device will become inactive.
bmdDuplexModeHalf Configure this sub-device to use a single connector (half-duplex).
DeckLink API
DeckLink API
bmdDeckLinkFrameMetadataHDRMaximumFrameAverageLightLevel Float Maximum Frame Average Light Level in range 1 cd/m2 - 65535 cd/m2