2 ** Copyright (c) 2014 Blackmagic Design
4 ** Permission is hereby granted, free of charge, to any person or organization
5 ** obtaining a copy of the software and accompanying documentation covered by
6 ** this license (the "Software") to use, reproduce, display, distribute,
7 ** execute, and transmit the Software, and to prepare derivative works of the
8 ** Software, and to permit third-parties to whom the Software is furnished to
9 ** do so, all subject to the following:
11 ** The copyright notices in the Software and this entire statement, including
12 ** the above license grant, this restriction and the following disclaimer,
13 ** must be included in all copies of the Software, in whole or in part, and
14 ** all derivative works of the Software, unless such copies or derivative
15 ** works are solely in the form of machine-executable object code generated by
16 ** a source language processor.
18 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 ** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
21 ** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
22 ** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
23 ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 ** DEALINGS IN THE SOFTWARE.
28 #ifndef BMD_DECKLINKAPI_H
29 #define BMD_DECKLINKAPI_H
34 #define BMD_CONST __declspec(selectany) static const
36 #define BMD_CONST static const
45 #include "DeckLinkAPITypes.h"
46 #include "DeckLinkAPIModes.h"
47 #include "DeckLinkAPIDiscovery.h"
48 #include "DeckLinkAPIConfiguration.h"
49 #include "DeckLinkAPIDeckControl.h"
51 #define BLACKMAGIC_DECKLINK_API_MAGIC 1
56 // Interface ID Declarations
58 BMD_CONST REFIID IID_IDeckLinkVideoOutputCallback = /* 20AA5225-1958-47CB-820B-80A8D521A6EE */ {0x20,0xAA,0x52,0x25,0x19,0x58,0x47,0xCB,0x82,0x0B,0x80,0xA8,0xD5,0x21,0xA6,0xEE};
59 BMD_CONST REFIID IID_IDeckLinkInputCallback = /* DD04E5EC-7415-42AB-AE4A-E80C4DFC044A */ {0xDD,0x04,0xE5,0xEC,0x74,0x15,0x42,0xAB,0xAE,0x4A,0xE8,0x0C,0x4D,0xFC,0x04,0x4A};
60 BMD_CONST REFIID IID_IDeckLinkMemoryAllocator = /* B36EB6E7-9D29-4AA8-92EF-843B87A289E8 */ {0xB3,0x6E,0xB6,0xE7,0x9D,0x29,0x4A,0xA8,0x92,0xEF,0x84,0x3B,0x87,0xA2,0x89,0xE8};
61 BMD_CONST REFIID IID_IDeckLinkAudioOutputCallback = /* 403C681B-7F46-4A12-B993-2BB127084EE6 */ {0x40,0x3C,0x68,0x1B,0x7F,0x46,0x4A,0x12,0xB9,0x93,0x2B,0xB1,0x27,0x08,0x4E,0xE6};
62 BMD_CONST REFIID IID_IDeckLinkIterator = /* 50FB36CD-3063-4B73-BDBB-958087F2D8BA */ {0x50,0xFB,0x36,0xCD,0x30,0x63,0x4B,0x73,0xBD,0xBB,0x95,0x80,0x87,0xF2,0xD8,0xBA};
63 BMD_CONST REFIID IID_IDeckLinkAPIInformation = /* 7BEA3C68-730D-4322-AF34-8A7152B532A4 */ {0x7B,0xEA,0x3C,0x68,0x73,0x0D,0x43,0x22,0xAF,0x34,0x8A,0x71,0x52,0xB5,0x32,0xA4};
64 BMD_CONST REFIID IID_IDeckLinkOutput = /* CC5C8A6E-3F2F-4B3A-87EA-FD78AF300564 */ {0xCC,0x5C,0x8A,0x6E,0x3F,0x2F,0x4B,0x3A,0x87,0xEA,0xFD,0x78,0xAF,0x30,0x05,0x64};
65 BMD_CONST REFIID IID_IDeckLinkInput = /* AF22762B-DFAC-4846-AA79-FA8883560995 */ {0xAF,0x22,0x76,0x2B,0xDF,0xAC,0x48,0x46,0xAA,0x79,0xFA,0x88,0x83,0x56,0x09,0x95};
66 BMD_CONST REFIID IID_IDeckLinkVideoFrame = /* 3F716FE0-F023-4111-BE5D-EF4414C05B17 */ {0x3F,0x71,0x6F,0xE0,0xF0,0x23,0x41,0x11,0xBE,0x5D,0xEF,0x44,0x14,0xC0,0x5B,0x17};
67 BMD_CONST REFIID IID_IDeckLinkMutableVideoFrame = /* 69E2639F-40DA-4E19-B6F2-20ACE815C390 */ {0x69,0xE2,0x63,0x9F,0x40,0xDA,0x4E,0x19,0xB6,0xF2,0x20,0xAC,0xE8,0x15,0xC3,0x90};
68 BMD_CONST REFIID IID_IDeckLinkVideoFrame3DExtensions = /* DA0F7E4A-EDC7-48A8-9CDD-2DB51C729CD7 */ {0xDA,0x0F,0x7E,0x4A,0xED,0xC7,0x48,0xA8,0x9C,0xDD,0x2D,0xB5,0x1C,0x72,0x9C,0xD7};
69 BMD_CONST REFIID IID_IDeckLinkVideoInputFrame = /* 05CFE374-537C-4094-9A57-680525118F44 */ {0x05,0xCF,0xE3,0x74,0x53,0x7C,0x40,0x94,0x9A,0x57,0x68,0x05,0x25,0x11,0x8F,0x44};
70 BMD_CONST REFIID IID_IDeckLinkVideoFrameAncillary = /* 732E723C-D1A4-4E29-9E8E-4A88797A0004 */ {0x73,0x2E,0x72,0x3C,0xD1,0xA4,0x4E,0x29,0x9E,0x8E,0x4A,0x88,0x79,0x7A,0x00,0x04};
71 BMD_CONST REFIID IID_IDeckLinkAudioInputPacket = /* E43D5870-2894-11DE-8C30-0800200C9A66 */ {0xE4,0x3D,0x58,0x70,0x28,0x94,0x11,0xDE,0x8C,0x30,0x08,0x00,0x20,0x0C,0x9A,0x66};
72 BMD_CONST REFIID IID_IDeckLinkScreenPreviewCallback = /* B1D3F49A-85FE-4C5D-95C8-0B5D5DCCD438 */ {0xB1,0xD3,0xF4,0x9A,0x85,0xFE,0x4C,0x5D,0x95,0xC8,0x0B,0x5D,0x5D,0xCC,0xD4,0x38};
73 BMD_CONST REFIID IID_IDeckLinkGLScreenPreviewHelper = /* 504E2209-CAC7-4C1A-9FB4-C5BB6274D22F */ {0x50,0x4E,0x22,0x09,0xCA,0xC7,0x4C,0x1A,0x9F,0xB4,0xC5,0xBB,0x62,0x74,0xD2,0x2F};
74 BMD_CONST REFIID IID_IDeckLinkNotificationCallback = /* B002A1EC-070D-4288-8289-BD5D36E5FF0D */ {0xB0,0x02,0xA1,0xEC,0x07,0x0D,0x42,0x88,0x82,0x89,0xBD,0x5D,0x36,0xE5,0xFF,0x0D};
75 BMD_CONST REFIID IID_IDeckLinkNotification = /* 0A1FB207-E215-441B-9B19-6FA1575946C5 */ {0x0A,0x1F,0xB2,0x07,0xE2,0x15,0x44,0x1B,0x9B,0x19,0x6F,0xA1,0x57,0x59,0x46,0xC5};
76 BMD_CONST REFIID IID_IDeckLinkAttributes = /* ABC11843-D966-44CB-96E2-A1CB5D3135C4 */ {0xAB,0xC1,0x18,0x43,0xD9,0x66,0x44,0xCB,0x96,0xE2,0xA1,0xCB,0x5D,0x31,0x35,0xC4};
77 BMD_CONST REFIID IID_IDeckLinkKeyer = /* 89AFCAF5-65F8-421E-98F7-96FE5F5BFBA3 */ {0x89,0xAF,0xCA,0xF5,0x65,0xF8,0x42,0x1E,0x98,0xF7,0x96,0xFE,0x5F,0x5B,0xFB,0xA3};
78 BMD_CONST REFIID IID_IDeckLinkVideoConversion = /* 3BBCB8A2-DA2C-42D9-B5D8-88083644E99A */ {0x3B,0xBC,0xB8,0xA2,0xDA,0x2C,0x42,0xD9,0xB5,0xD8,0x88,0x08,0x36,0x44,0xE9,0x9A};
79 BMD_CONST REFIID IID_IDeckLinkDeviceNotificationCallback = /* 4997053B-0ADF-4CC8-AC70-7A50C4BE728F */ {0x49,0x97,0x05,0x3B,0x0A,0xDF,0x4C,0xC8,0xAC,0x70,0x7A,0x50,0xC4,0xBE,0x72,0x8F};
80 BMD_CONST REFIID IID_IDeckLinkDiscovery = /* CDBF631C-BC76-45FA-B44D-C55059BC6101 */ {0xCD,0xBF,0x63,0x1C,0xBC,0x76,0x45,0xFA,0xB4,0x4D,0xC5,0x50,0x59,0xBC,0x61,0x01};
82 /* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */
84 typedef uint32_t BMDVideoOutputFlags;
85 enum _BMDVideoOutputFlags {
86 bmdVideoOutputFlagDefault = 0,
87 bmdVideoOutputVANC = 1 << 0,
88 bmdVideoOutputVITC = 1 << 1,
89 bmdVideoOutputRP188 = 1 << 2,
90 bmdVideoOutputDualStream3D = 1 << 4
93 /* Enum BMDFrameFlags - Frame flags */
95 typedef uint32_t BMDFrameFlags;
97 bmdFrameFlagDefault = 0,
98 bmdFrameFlagFlipVertical = 1 << 0,
100 /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */
102 bmdFrameHasNoInputSource = 1 << 31
105 /* Enum BMDVideoInputFlags - Flags applicable to video input */
107 typedef uint32_t BMDVideoInputFlags;
108 enum _BMDVideoInputFlags {
109 bmdVideoInputFlagDefault = 0,
110 bmdVideoInputEnableFormatDetection = 1 << 0,
111 bmdVideoInputDualStream3D = 1 << 1
114 /* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */
116 typedef uint32_t BMDVideoInputFormatChangedEvents;
117 enum _BMDVideoInputFormatChangedEvents {
118 bmdVideoInputDisplayModeChanged = 1 << 0,
119 bmdVideoInputFieldDominanceChanged = 1 << 1,
120 bmdVideoInputColorspaceChanged = 1 << 2
123 /* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */
125 typedef uint32_t BMDDetectedVideoInputFormatFlags;
126 enum _BMDDetectedVideoInputFormatFlags {
127 bmdDetectedVideoInputYCbCr422 = 1 << 0,
128 bmdDetectedVideoInputRGB444 = 1 << 1,
129 bmdDetectedVideoInputDualStream3D = 1 << 2
132 /* Enum BMDDeckLinkCapturePassthroughMode - Enumerates whether the video output is electrically connected to the video input or if the clean switching mode is enabled */
134 typedef uint32_t BMDDeckLinkCapturePassthroughMode;
135 enum _BMDDeckLinkCapturePassthroughMode {
136 bmdDeckLinkCapturePassthroughModeDirect = /* 'pdir' */ 0x70646972,
137 bmdDeckLinkCapturePassthroughModeCleanSwitch = /* 'pcln' */ 0x70636C6E
140 /* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */
142 typedef uint32_t BMDOutputFrameCompletionResult;
143 enum _BMDOutputFrameCompletionResult {
144 bmdOutputFrameCompleted,
145 bmdOutputFrameDisplayedLate,
146 bmdOutputFrameDropped,
147 bmdOutputFrameFlushed
150 /* Enum BMDReferenceStatus - GenLock input status */
152 typedef uint32_t BMDReferenceStatus;
153 enum _BMDReferenceStatus {
154 bmdReferenceNotSupportedByHardware = 1 << 0,
155 bmdReferenceLocked = 1 << 1
158 /* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */
160 typedef uint32_t BMDAudioSampleRate;
161 enum _BMDAudioSampleRate {
162 bmdAudioSampleRate48kHz = 48000
165 /* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */
167 typedef uint32_t BMDAudioSampleType;
168 enum _BMDAudioSampleType {
169 bmdAudioSampleType16bitInteger = 16,
170 bmdAudioSampleType32bitInteger = 32
173 /* Enum BMDAudioOutputStreamType - Audio output stream type */
175 typedef uint32_t BMDAudioOutputStreamType;
176 enum _BMDAudioOutputStreamType {
177 bmdAudioOutputStreamContinuous,
178 bmdAudioOutputStreamContinuousDontResample,
179 bmdAudioOutputStreamTimestamped
182 /* Enum BMDDisplayModeSupport - Output mode supported flags */
184 typedef uint32_t BMDDisplayModeSupport;
185 enum _BMDDisplayModeSupport {
186 bmdDisplayModeNotSupported = 0,
187 bmdDisplayModeSupported,
188 bmdDisplayModeSupportedWithConversion
191 /* Enum BMDTimecodeFormat - Timecode formats for frame metadata */
193 typedef uint32_t BMDTimecodeFormat;
194 enum _BMDTimecodeFormat {
195 bmdTimecodeRP188VITC1 = /* 'rpv1' */ 0x72707631, // RP188 timecode where DBB1 equals VITC1 (line 9)
196 bmdTimecodeRP188VITC2 = /* 'rp12' */ 0x72703132, // RP188 timecode where DBB1 equals VITC2 (line 9 for progressive or line 571 for interlaced/PsF)
197 bmdTimecodeRP188LTC = /* 'rplt' */ 0x72706C74, // RP188 timecode where DBB1 equals LTC (line 10)
198 bmdTimecodeRP188Any = /* 'rp18' */ 0x72703138, // For capture: return the first valid timecode in {VITC1, LTC ,VITC2} - For playback: set the timecode as VITC1
199 bmdTimecodeVITC = /* 'vitc' */ 0x76697463,
200 bmdTimecodeVITCField2 = /* 'vit2' */ 0x76697432,
201 bmdTimecodeSerial = /* 'seri' */ 0x73657269
204 /* Enum BMDAnalogVideoFlags - Analog video display flags */
206 typedef uint32_t BMDAnalogVideoFlags;
207 enum _BMDAnalogVideoFlags {
208 bmdAnalogVideoFlagCompositeSetup75 = 1 << 0,
209 bmdAnalogVideoFlagComponentBetacamLevels = 1 << 1
212 /* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */
214 typedef uint32_t BMDAudioOutputAnalogAESSwitch;
215 enum _BMDAudioOutputAnalogAESSwitch {
216 bmdAudioOutputSwitchAESEBU = /* 'aes ' */ 0x61657320,
217 bmdAudioOutputSwitchAnalog = /* 'anlg' */ 0x616E6C67
220 /* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */
222 typedef uint32_t BMDVideoOutputConversionMode;
223 enum _BMDVideoOutputConversionMode {
224 bmdNoVideoOutputConversion = /* 'none' */ 0x6E6F6E65,
225 bmdVideoOutputLetterboxDownconversion = /* 'ltbx' */ 0x6C746278,
226 bmdVideoOutputAnamorphicDownconversion = /* 'amph' */ 0x616D7068,
227 bmdVideoOutputHD720toHD1080Conversion = /* '720c' */ 0x37323063,
228 bmdVideoOutputHardwareLetterboxDownconversion = /* 'HWlb' */ 0x48576C62,
229 bmdVideoOutputHardwareAnamorphicDownconversion = /* 'HWam' */ 0x4857616D,
230 bmdVideoOutputHardwareCenterCutDownconversion = /* 'HWcc' */ 0x48576363,
231 bmdVideoOutputHardware720p1080pCrossconversion = /* 'xcap' */ 0x78636170,
232 bmdVideoOutputHardwareAnamorphic720pUpconversion = /* 'ua7p' */ 0x75613770,
233 bmdVideoOutputHardwareAnamorphic1080iUpconversion = /* 'ua1i' */ 0x75613169,
234 bmdVideoOutputHardwareAnamorphic149To720pUpconversion = /* 'u47p' */ 0x75343770,
235 bmdVideoOutputHardwareAnamorphic149To1080iUpconversion = /* 'u41i' */ 0x75343169,
236 bmdVideoOutputHardwarePillarbox720pUpconversion = /* 'up7p' */ 0x75703770,
237 bmdVideoOutputHardwarePillarbox1080iUpconversion = /* 'up1i' */ 0x75703169
240 /* Enum BMDVideoInputConversionMode - Video input conversion mode */
242 typedef uint32_t BMDVideoInputConversionMode;
243 enum _BMDVideoInputConversionMode {
244 bmdNoVideoInputConversion = /* 'none' */ 0x6E6F6E65,
245 bmdVideoInputLetterboxDownconversionFromHD1080 = /* '10lb' */ 0x31306C62,
246 bmdVideoInputAnamorphicDownconversionFromHD1080 = /* '10am' */ 0x3130616D,
247 bmdVideoInputLetterboxDownconversionFromHD720 = /* '72lb' */ 0x37326C62,
248 bmdVideoInputAnamorphicDownconversionFromHD720 = /* '72am' */ 0x3732616D,
249 bmdVideoInputLetterboxUpconversion = /* 'lbup' */ 0x6C627570,
250 bmdVideoInputAnamorphicUpconversion = /* 'amup' */ 0x616D7570
253 /* Enum BMDVideo3DPackingFormat - Video 3D packing format */
255 typedef uint32_t BMDVideo3DPackingFormat;
256 enum _BMDVideo3DPackingFormat {
257 bmdVideo3DPackingSidebySideHalf = /* 'sbsh' */ 0x73627368,
258 bmdVideo3DPackingLinebyLine = /* 'lbyl' */ 0x6C62796C,
259 bmdVideo3DPackingTopAndBottom = /* 'tabo' */ 0x7461626F,
260 bmdVideo3DPackingFramePacking = /* 'frpk' */ 0x6672706B,
261 bmdVideo3DPackingLeftOnly = /* 'left' */ 0x6C656674,
262 bmdVideo3DPackingRightOnly = /* 'righ' */ 0x72696768
265 /* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */
267 typedef uint32_t BMDIdleVideoOutputOperation;
268 enum _BMDIdleVideoOutputOperation {
269 bmdIdleVideoOutputBlack = /* 'blac' */ 0x626C6163,
270 bmdIdleVideoOutputLastFrame = /* 'lafa' */ 0x6C616661,
271 bmdIdleVideoOutputDesktop = /* 'desk' */ 0x6465736B
274 /* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */
276 typedef uint32_t BMDDeckLinkAttributeID;
277 enum _BMDDeckLinkAttributeID {
281 BMDDeckLinkSupportsInternalKeying = /* 'keyi' */ 0x6B657969,
282 BMDDeckLinkSupportsExternalKeying = /* 'keye' */ 0x6B657965,
283 BMDDeckLinkSupportsHDKeying = /* 'keyh' */ 0x6B657968,
284 BMDDeckLinkSupportsInputFormatDetection = /* 'infd' */ 0x696E6664,
285 BMDDeckLinkHasReferenceInput = /* 'hrin' */ 0x6872696E,
286 BMDDeckLinkHasSerialPort = /* 'hspt' */ 0x68737074,
287 BMDDeckLinkHasAnalogVideoOutputGain = /* 'avog' */ 0x61766F67,
288 BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain = /* 'ovog' */ 0x6F766F67,
289 BMDDeckLinkHasVideoInputAntiAliasingFilter = /* 'aafl' */ 0x6161666C,
290 BMDDeckLinkHasBypass = /* 'byps' */ 0x62797073,
291 BMDDeckLinkSupportsDesktopDisplay = /* 'extd' */ 0x65787464,
292 BMDDeckLinkSupportsClockTimingAdjustment = /* 'ctad' */ 0x63746164,
293 BMDDeckLinkSupportsFullDuplex = /* 'fdup' */ 0x66647570,
294 BMDDeckLinkSupportsFullFrameReferenceInputTimingOffset = /* 'frin' */ 0x6672696E,
298 BMDDeckLinkMaximumAudioChannels = /* 'mach' */ 0x6D616368,
299 BMDDeckLinkMaximumAnalogAudioChannels = /* 'aach' */ 0x61616368,
300 BMDDeckLinkNumberOfSubDevices = /* 'nsbd' */ 0x6E736264,
301 BMDDeckLinkSubDeviceIndex = /* 'subi' */ 0x73756269,
302 BMDDeckLinkPersistentID = /* 'peid' */ 0x70656964,
303 BMDDeckLinkTopologicalID = /* 'toid' */ 0x746F6964,
304 BMDDeckLinkVideoOutputConnections = /* 'vocn' */ 0x766F636E,
305 BMDDeckLinkVideoInputConnections = /* 'vicn' */ 0x7669636E,
306 BMDDeckLinkAudioOutputConnections = /* 'aocn' */ 0x616F636E,
307 BMDDeckLinkAudioInputConnections = /* 'aicn' */ 0x6169636E,
308 BMDDeckLinkDeviceBusyState = /* 'dbst' */ 0x64627374,
309 BMDDeckLinkVideoIOSupport = /* 'vios' */ 0x76696F73, // Returns a BMDVideoIOSupport bit field
313 BMDDeckLinkVideoInputGainMinimum = /* 'vigm' */ 0x7669676D,
314 BMDDeckLinkVideoInputGainMaximum = /* 'vigx' */ 0x76696778,
315 BMDDeckLinkVideoOutputGainMinimum = /* 'vogm' */ 0x766F676D,
316 BMDDeckLinkVideoOutputGainMaximum = /* 'vogx' */ 0x766F6778,
320 BMDDeckLinkSerialPortDeviceName = /* 'slpn' */ 0x736C706E
323 /* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */
325 typedef uint32_t BMDDeckLinkAPIInformationID;
326 enum _BMDDeckLinkAPIInformationID {
327 BMDDeckLinkAPIVersion = /* 'vers' */ 0x76657273
330 /* Enum BMDDeviceBusyState - Current device busy state */
332 typedef uint32_t BMDDeviceBusyState;
333 enum _BMDDeviceBusyState {
334 bmdDeviceCaptureBusy = 1 << 0,
335 bmdDevicePlaybackBusy = 1 << 1,
336 bmdDeviceSerialPortBusy = 1 << 2
339 /* Enum BMDVideoIOSupport - Device video input/output support */
341 typedef uint32_t BMDVideoIOSupport;
342 enum _BMDVideoIOSupport {
343 bmdDeviceSupportsCapture = 1 << 0,
344 bmdDeviceSupportsPlayback = 1 << 1
347 /* Enum BMD3DPreviewFormat - Linked Frame preview format */
349 typedef uint32_t BMD3DPreviewFormat;
350 enum _BMD3DPreviewFormat {
351 bmd3DPreviewFormatDefault = /* 'defa' */ 0x64656661,
352 bmd3DPreviewFormatLeftOnly = /* 'left' */ 0x6C656674,
353 bmd3DPreviewFormatRightOnly = /* 'righ' */ 0x72696768,
354 bmd3DPreviewFormatSideBySide = /* 'side' */ 0x73696465,
355 bmd3DPreviewFormatTopBottom = /* 'topb' */ 0x746F7062
358 /* Enum BMDNotifications - Events that can be subscribed through IDeckLinkNotification */
360 typedef uint32_t BMDNotifications;
361 enum _BMDNotifications {
362 bmdPreferencesChanged = /* 'pref' */ 0x70726566
365 #if defined(__cplusplus)
367 // Forward Declarations
369 class IDeckLinkVideoOutputCallback;
370 class IDeckLinkInputCallback;
371 class IDeckLinkMemoryAllocator;
372 class IDeckLinkAudioOutputCallback;
373 class IDeckLinkIterator;
374 class IDeckLinkAPIInformation;
375 class IDeckLinkOutput;
376 class IDeckLinkInput;
377 class IDeckLinkVideoFrame;
378 class IDeckLinkMutableVideoFrame;
379 class IDeckLinkVideoFrame3DExtensions;
380 class IDeckLinkVideoInputFrame;
381 class IDeckLinkVideoFrameAncillary;
382 class IDeckLinkAudioInputPacket;
383 class IDeckLinkScreenPreviewCallback;
384 class IDeckLinkGLScreenPreviewHelper;
385 class IDeckLinkNotificationCallback;
386 class IDeckLinkNotification;
387 class IDeckLinkAttributes;
388 class IDeckLinkKeyer;
389 class IDeckLinkVideoConversion;
390 class IDeckLinkDeviceNotificationCallback;
391 class IDeckLinkDiscovery;
393 /* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */
395 class IDeckLinkVideoOutputCallback : public IUnknown
398 virtual HRESULT ScheduledFrameCompleted (/* in */ IDeckLinkVideoFrame *completedFrame, /* in */ BMDOutputFrameCompletionResult result) = 0;
399 virtual HRESULT ScheduledPlaybackHasStopped (void) = 0;
402 virtual ~IDeckLinkVideoOutputCallback () {} // call Release method to drop reference count
405 /* Interface IDeckLinkInputCallback - Frame arrival callback. */
407 class IDeckLinkInputCallback : public IUnknown
410 virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
411 virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket) = 0;
414 virtual ~IDeckLinkInputCallback () {} // call Release method to drop reference count
417 /* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */
419 class IDeckLinkMemoryAllocator : public IUnknown
422 virtual HRESULT AllocateBuffer (/* in */ uint32_t bufferSize, /* out */ void **allocatedBuffer) = 0;
423 virtual HRESULT ReleaseBuffer (/* in */ void *buffer) = 0;
425 virtual HRESULT Commit (void) = 0;
426 virtual HRESULT Decommit (void) = 0;
429 /* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */
431 class IDeckLinkAudioOutputCallback : public IUnknown
434 virtual HRESULT RenderAudioSamples (/* in */ bool preroll) = 0;
437 /* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */
439 class IDeckLinkIterator : public IUnknown
442 virtual HRESULT Next (/* out */ IDeckLink **deckLinkInstance) = 0;
445 /* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */
447 class IDeckLinkAPIInformation : public IUnknown
450 virtual HRESULT GetFlag (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ bool *value) = 0;
451 virtual HRESULT GetInt (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ int64_t *value) = 0;
452 virtual HRESULT GetFloat (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ double *value) = 0;
453 virtual HRESULT GetString (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ const char **value) = 0;
456 virtual ~IDeckLinkAPIInformation () {} // call Release method to drop reference count
459 /* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
461 class IDeckLinkOutput : public IUnknown
464 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoOutputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
465 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
467 virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
471 virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0;
472 virtual HRESULT DisableVideoOutput (void) = 0;
474 virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
475 virtual HRESULT CreateVideoFrame (/* in */ int32_t width, /* in */ int32_t height, /* in */ int32_t rowBytes, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDFrameFlags flags, /* out */ IDeckLinkMutableVideoFrame **outFrame) = 0;
476 virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0;
478 virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
479 virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0;
480 virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0;
481 virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0;
485 virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0;
486 virtual HRESULT DisableAudioOutput (void) = 0;
488 virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0;
490 virtual HRESULT BeginAudioPreroll (void) = 0;
491 virtual HRESULT EndAudioPreroll (void) = 0;
492 virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0;
494 virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0;
495 virtual HRESULT FlushBufferedAudioSamples (void) = 0;
497 virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0;
501 virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0;
502 virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0;
503 virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0;
504 virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0;
505 virtual HRESULT GetReferenceStatus (/* out */ BMDReferenceStatus *referenceStatus) = 0;
507 /* Hardware Timing */
509 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
510 virtual HRESULT GetFrameCompletionReferenceTimestamp (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *frameCompletionTimestamp) = 0;
513 virtual ~IDeckLinkOutput () {} // call Release method to drop reference count
516 /* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
518 class IDeckLinkInput : public IUnknown
521 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
522 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
524 virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
528 virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
529 virtual HRESULT DisableVideoInput (void) = 0;
530 virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0;
531 virtual HRESULT SetVideoInputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
535 virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
536 virtual HRESULT DisableAudioInput (void) = 0;
537 virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
541 virtual HRESULT StartStreams (void) = 0;
542 virtual HRESULT StopStreams (void) = 0;
543 virtual HRESULT PauseStreams (void) = 0;
544 virtual HRESULT FlushStreams (void) = 0;
545 virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback *theCallback) = 0;
547 /* Hardware Timing */
549 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
552 virtual ~IDeckLinkInput () {} // call Release method to drop reference count
555 /* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */
557 class IDeckLinkVideoFrame : public IUnknown
560 virtual long GetWidth (void) = 0;
561 virtual long GetHeight (void) = 0;
562 virtual long GetRowBytes (void) = 0;
563 virtual BMDPixelFormat GetPixelFormat (void) = 0;
564 virtual BMDFrameFlags GetFlags (void) = 0;
565 virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
567 virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0;
568 virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) = 0;
571 virtual ~IDeckLinkVideoFrame () {} // call Release method to drop reference count
574 /* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */
576 class IDeckLinkMutableVideoFrame : public IDeckLinkVideoFrame
579 virtual HRESULT SetFlags (/* in */ BMDFrameFlags newFlags) = 0;
581 virtual HRESULT SetTimecode (/* in */ BMDTimecodeFormat format, /* in */ IDeckLinkTimecode *timecode) = 0;
582 virtual HRESULT SetTimecodeFromComponents (/* in */ BMDTimecodeFormat format, /* in */ uint8_t hours, /* in */ uint8_t minutes, /* in */ uint8_t seconds, /* in */ uint8_t frames, /* in */ BMDTimecodeFlags flags) = 0;
583 virtual HRESULT SetAncillaryData (/* in */ IDeckLinkVideoFrameAncillary *ancillary) = 0;
584 virtual HRESULT SetTimecodeUserBits (/* in */ BMDTimecodeFormat format, /* in */ BMDTimecodeUserBits userBits) = 0;
587 virtual ~IDeckLinkMutableVideoFrame () {} // call Release method to drop reference count
590 /* Interface IDeckLinkVideoFrame3DExtensions - Optional interface implemented on IDeckLinkVideoFrame to support 3D frames */
592 class IDeckLinkVideoFrame3DExtensions : public IUnknown
595 virtual BMDVideo3DPackingFormat Get3DPackingFormat (void) = 0;
596 virtual HRESULT GetFrameForRightEye (/* out */ IDeckLinkVideoFrame* *rightEyeFrame) = 0;
599 virtual ~IDeckLinkVideoFrame3DExtensions () {} // call Release method to drop reference count
602 /* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
604 class IDeckLinkVideoInputFrame : public IDeckLinkVideoFrame
607 virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, /* in */ BMDTimeScale timeScale) = 0;
608 virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
611 virtual ~IDeckLinkVideoInputFrame () {} // call Release method to drop reference count
614 /* Interface IDeckLinkVideoFrameAncillary - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
616 class IDeckLinkVideoFrameAncillary : public IUnknown
620 virtual HRESULT GetBufferForVerticalBlankingLine (/* in */ uint32_t lineNumber, /* out */ void **buffer) = 0;
621 virtual BMDPixelFormat GetPixelFormat (void) = 0;
622 virtual BMDDisplayMode GetDisplayMode (void) = 0;
625 virtual ~IDeckLinkVideoFrameAncillary () {} // call Release method to drop reference count
628 /* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */
630 class IDeckLinkAudioInputPacket : public IUnknown
633 virtual long GetSampleFrameCount (void) = 0;
634 virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
635 virtual HRESULT GetPacketTime (/* out */ BMDTimeValue *packetTime, /* in */ BMDTimeScale timeScale) = 0;
638 virtual ~IDeckLinkAudioInputPacket () {} // call Release method to drop reference count
641 /* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */
643 class IDeckLinkScreenPreviewCallback : public IUnknown
646 virtual HRESULT DrawFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
649 virtual ~IDeckLinkScreenPreviewCallback () {} // call Release method to drop reference count
652 /* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */
654 class IDeckLinkGLScreenPreviewHelper : public IUnknown
658 /* Methods must be called with OpenGL context set */
660 virtual HRESULT InitializeGL (void) = 0;
661 virtual HRESULT PaintGL (void) = 0;
662 virtual HRESULT SetFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
663 virtual HRESULT Set3DPreviewFormat (/* in */ BMD3DPreviewFormat previewFormat) = 0;
666 virtual ~IDeckLinkGLScreenPreviewHelper () {} // call Release method to drop reference count
669 /* Interface IDeckLinkNotificationCallback - DeckLink Notification Callback Interface */
671 class IDeckLinkNotificationCallback : public IUnknown
674 virtual HRESULT Notify (/* in */ BMDNotifications topic, /* in */ uint64_t param1, /* in */ uint64_t param2) = 0;
677 /* Interface IDeckLinkNotification - DeckLink Notification interface */
679 class IDeckLinkNotification : public IUnknown
682 virtual HRESULT Subscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
683 virtual HRESULT Unsubscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
686 /* Interface IDeckLinkAttributes - DeckLink Attribute interface */
688 class IDeckLinkAttributes : public IUnknown
691 virtual HRESULT GetFlag (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ bool *value) = 0;
692 virtual HRESULT GetInt (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ int64_t *value) = 0;
693 virtual HRESULT GetFloat (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ double *value) = 0;
694 virtual HRESULT GetString (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ const char **value) = 0;
697 virtual ~IDeckLinkAttributes () {} // call Release method to drop reference count
700 /* Interface IDeckLinkKeyer - DeckLink Keyer interface */
702 class IDeckLinkKeyer : public IUnknown
705 virtual HRESULT Enable (/* in */ bool isExternal) = 0;
706 virtual HRESULT SetLevel (/* in */ uint8_t level) = 0;
707 virtual HRESULT RampUp (/* in */ uint32_t numberOfFrames) = 0;
708 virtual HRESULT RampDown (/* in */ uint32_t numberOfFrames) = 0;
709 virtual HRESULT Disable (void) = 0;
712 virtual ~IDeckLinkKeyer () {} // call Release method to drop reference count
715 /* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */
717 class IDeckLinkVideoConversion : public IUnknown
720 virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ IDeckLinkVideoFrame* dstFrame) = 0;
723 virtual ~IDeckLinkVideoConversion () {} // call Release method to drop reference count
726 /* Interface IDeckLinkDeviceNotificationCallback - DeckLink device arrival/removal notification callbacks */
728 class IDeckLinkDeviceNotificationCallback : public IUnknown
731 virtual HRESULT DeckLinkDeviceArrived (/* in */ IDeckLink* deckLinkDevice) = 0;
732 virtual HRESULT DeckLinkDeviceRemoved (/* in */ IDeckLink* deckLinkDevice) = 0;
735 virtual ~IDeckLinkDeviceNotificationCallback () {} // call Release method to drop reference count
738 /* Interface IDeckLinkDiscovery - DeckLink device discovery */
740 class IDeckLinkDiscovery : public IUnknown
743 virtual HRESULT InstallDeviceNotifications (/* in */ IDeckLinkDeviceNotificationCallback* deviceNotificationCallback) = 0;
744 virtual HRESULT UninstallDeviceNotifications (void) = 0;
747 virtual ~IDeckLinkDiscovery () {} // call Release method to drop reference count
754 IDeckLinkIterator* CreateDeckLinkIteratorInstance (void);
755 IDeckLinkDiscovery* CreateDeckLinkDiscoveryInstance (void);
756 IDeckLinkAPIInformation* CreateDeckLinkAPIInformationInstance (void);
757 IDeckLinkGLScreenPreviewHelper* CreateOpenGLScreenPreviewHelper (void);
758 IDeckLinkVideoConversion* CreateVideoConversionInstance (void);
763 #endif // defined(__cplusplus)
764 #endif /* defined(BMD_DECKLINKAPI_H) */