Re-subimission of https://codereview.chromium.org/1041213003/
[chromium-blink-merge.git] / third_party / decklink / mac / include / DeckLinkAPI.h
blob8c334c0b330407f6c3826b8ad91c850999bad933
1 /* -LICENSE-START-
2 ** Copyright (c) 2014 Blackmagic Design
3 **
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:
10 **
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.
17 **
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.
25 ** -LICENSE-END-
28 #ifndef BMD_DECKLINKAPI_H
29 #define BMD_DECKLINKAPI_H
32 #ifndef BMD_CONST
33 #if defined(_MSC_VER)
34 #define BMD_CONST __declspec(selectany) static const
35 #else
36 #define BMD_CONST static const
37 #endif
38 #endif
40 /* DeckLink API */
42 #include <CoreFoundation/CoreFoundation.h>
43 #include <CoreFoundation/CFPlugInCOM.h>
44 #include <stdint.h>
46 #include "DeckLinkAPITypes.h"
47 #include "DeckLinkAPIModes.h"
48 #include "DeckLinkAPIDiscovery.h"
49 #include "DeckLinkAPIConfiguration.h"
50 #include "DeckLinkAPIDeckControl.h"
52 #include "DeckLinkAPIStreaming.h"
54 #define BLACKMAGIC_DECKLINK_API_MAGIC 1
56 // Type Declarations
59 // Interface ID Declarations
61 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};
62 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};
63 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};
64 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};
65 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};
66 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};
67 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};
68 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};
69 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};
70 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};
71 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};
72 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};
73 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};
74 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};
75 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};
76 BMD_CONST REFIID IID_IDeckLinkCocoaScreenPreviewCallback = /* D174152F-8F96-4C07-83A5-DD5F5AF0A2AA */ {0xD1,0x74,0x15,0x2F,0x8F,0x96,0x4C,0x07,0x83,0xA5,0xDD,0x5F,0x5A,0xF0,0xA2,0xAA};
77 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};
78 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};
79 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};
80 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};
81 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};
82 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};
83 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};
84 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};
86 /* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */
88 typedef uint32_t BMDVideoOutputFlags;
89 enum _BMDVideoOutputFlags {
90 bmdVideoOutputFlagDefault = 0,
91 bmdVideoOutputVANC = 1 << 0,
92 bmdVideoOutputVITC = 1 << 1,
93 bmdVideoOutputRP188 = 1 << 2,
94 bmdVideoOutputDualStream3D = 1 << 4
97 /* Enum BMDFrameFlags - Frame flags */
99 typedef uint32_t BMDFrameFlags;
100 enum _BMDFrameFlags {
101 bmdFrameFlagDefault = 0,
102 bmdFrameFlagFlipVertical = 1 << 0,
104 /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */
106 bmdFrameHasNoInputSource = 1 << 31
109 /* Enum BMDVideoInputFlags - Flags applicable to video input */
111 typedef uint32_t BMDVideoInputFlags;
112 enum _BMDVideoInputFlags {
113 bmdVideoInputFlagDefault = 0,
114 bmdVideoInputEnableFormatDetection = 1 << 0,
115 bmdVideoInputDualStream3D = 1 << 1
118 /* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */
120 typedef uint32_t BMDVideoInputFormatChangedEvents;
121 enum _BMDVideoInputFormatChangedEvents {
122 bmdVideoInputDisplayModeChanged = 1 << 0,
123 bmdVideoInputFieldDominanceChanged = 1 << 1,
124 bmdVideoInputColorspaceChanged = 1 << 2
127 /* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */
129 typedef uint32_t BMDDetectedVideoInputFormatFlags;
130 enum _BMDDetectedVideoInputFormatFlags {
131 bmdDetectedVideoInputYCbCr422 = 1 << 0,
132 bmdDetectedVideoInputRGB444 = 1 << 1,
133 bmdDetectedVideoInputDualStream3D = 1 << 2
136 /* Enum BMDDeckLinkCapturePassthroughMode - Enumerates whether the video output is electrically connected to the video input or if the clean switching mode is enabled */
138 typedef uint32_t BMDDeckLinkCapturePassthroughMode;
139 enum _BMDDeckLinkCapturePassthroughMode {
140 bmdDeckLinkCapturePassthroughModeDirect = 'pdir',
141 bmdDeckLinkCapturePassthroughModeCleanSwitch = 'pcln'
144 /* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */
146 typedef uint32_t BMDOutputFrameCompletionResult;
147 enum _BMDOutputFrameCompletionResult {
148 bmdOutputFrameCompleted,
149 bmdOutputFrameDisplayedLate,
150 bmdOutputFrameDropped,
151 bmdOutputFrameFlushed
154 /* Enum BMDReferenceStatus - GenLock input status */
156 typedef uint32_t BMDReferenceStatus;
157 enum _BMDReferenceStatus {
158 bmdReferenceNotSupportedByHardware = 1 << 0,
159 bmdReferenceLocked = 1 << 1
162 /* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */
164 typedef uint32_t BMDAudioSampleRate;
165 enum _BMDAudioSampleRate {
166 bmdAudioSampleRate48kHz = 48000
169 /* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */
171 typedef uint32_t BMDAudioSampleType;
172 enum _BMDAudioSampleType {
173 bmdAudioSampleType16bitInteger = 16,
174 bmdAudioSampleType32bitInteger = 32
177 /* Enum BMDAudioOutputStreamType - Audio output stream type */
179 typedef uint32_t BMDAudioOutputStreamType;
180 enum _BMDAudioOutputStreamType {
181 bmdAudioOutputStreamContinuous,
182 bmdAudioOutputStreamContinuousDontResample,
183 bmdAudioOutputStreamTimestamped
186 /* Enum BMDDisplayModeSupport - Output mode supported flags */
188 typedef uint32_t BMDDisplayModeSupport;
189 enum _BMDDisplayModeSupport {
190 bmdDisplayModeNotSupported = 0,
191 bmdDisplayModeSupported,
192 bmdDisplayModeSupportedWithConversion
195 /* Enum BMDTimecodeFormat - Timecode formats for frame metadata */
197 typedef uint32_t BMDTimecodeFormat;
198 enum _BMDTimecodeFormat {
199 bmdTimecodeRP188VITC1 = 'rpv1', // RP188 timecode where DBB1 equals VITC1 (line 9)
200 bmdTimecodeRP188VITC2 = 'rp12', // RP188 timecode where DBB1 equals VITC2 (line 9 for progressive or line 571 for interlaced/PsF)
201 bmdTimecodeRP188LTC = 'rplt', // RP188 timecode where DBB1 equals LTC (line 10)
202 bmdTimecodeRP188Any = 'rp18', // For capture: return the first valid timecode in {VITC1, LTC ,VITC2} - For playback: set the timecode as VITC1
203 bmdTimecodeVITC = 'vitc',
204 bmdTimecodeVITCField2 = 'vit2',
205 bmdTimecodeSerial = 'seri'
208 /* Enum BMDAnalogVideoFlags - Analog video display flags */
210 typedef uint32_t BMDAnalogVideoFlags;
211 enum _BMDAnalogVideoFlags {
212 bmdAnalogVideoFlagCompositeSetup75 = 1 << 0,
213 bmdAnalogVideoFlagComponentBetacamLevels = 1 << 1
216 /* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */
218 typedef uint32_t BMDAudioOutputAnalogAESSwitch;
219 enum _BMDAudioOutputAnalogAESSwitch {
220 bmdAudioOutputSwitchAESEBU = 'aes ',
221 bmdAudioOutputSwitchAnalog = 'anlg'
224 /* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */
226 typedef uint32_t BMDVideoOutputConversionMode;
227 enum _BMDVideoOutputConversionMode {
228 bmdNoVideoOutputConversion = 'none',
229 bmdVideoOutputLetterboxDownconversion = 'ltbx',
230 bmdVideoOutputAnamorphicDownconversion = 'amph',
231 bmdVideoOutputHD720toHD1080Conversion = '720c',
232 bmdVideoOutputHardwareLetterboxDownconversion = 'HWlb',
233 bmdVideoOutputHardwareAnamorphicDownconversion = 'HWam',
234 bmdVideoOutputHardwareCenterCutDownconversion = 'HWcc',
235 bmdVideoOutputHardware720p1080pCrossconversion = 'xcap',
236 bmdVideoOutputHardwareAnamorphic720pUpconversion = 'ua7p',
237 bmdVideoOutputHardwareAnamorphic1080iUpconversion = 'ua1i',
238 bmdVideoOutputHardwareAnamorphic149To720pUpconversion = 'u47p',
239 bmdVideoOutputHardwareAnamorphic149To1080iUpconversion = 'u41i',
240 bmdVideoOutputHardwarePillarbox720pUpconversion = 'up7p',
241 bmdVideoOutputHardwarePillarbox1080iUpconversion = 'up1i'
244 /* Enum BMDVideoInputConversionMode - Video input conversion mode */
246 typedef uint32_t BMDVideoInputConversionMode;
247 enum _BMDVideoInputConversionMode {
248 bmdNoVideoInputConversion = 'none',
249 bmdVideoInputLetterboxDownconversionFromHD1080 = '10lb',
250 bmdVideoInputAnamorphicDownconversionFromHD1080 = '10am',
251 bmdVideoInputLetterboxDownconversionFromHD720 = '72lb',
252 bmdVideoInputAnamorphicDownconversionFromHD720 = '72am',
253 bmdVideoInputLetterboxUpconversion = 'lbup',
254 bmdVideoInputAnamorphicUpconversion = 'amup'
257 /* Enum BMDVideo3DPackingFormat - Video 3D packing format */
259 typedef uint32_t BMDVideo3DPackingFormat;
260 enum _BMDVideo3DPackingFormat {
261 bmdVideo3DPackingSidebySideHalf = 'sbsh',
262 bmdVideo3DPackingLinebyLine = 'lbyl',
263 bmdVideo3DPackingTopAndBottom = 'tabo',
264 bmdVideo3DPackingFramePacking = 'frpk',
265 bmdVideo3DPackingLeftOnly = 'left',
266 bmdVideo3DPackingRightOnly = 'righ'
269 /* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */
271 typedef uint32_t BMDIdleVideoOutputOperation;
272 enum _BMDIdleVideoOutputOperation {
273 bmdIdleVideoOutputBlack = 'blac',
274 bmdIdleVideoOutputLastFrame = 'lafa',
275 bmdIdleVideoOutputDesktop = 'desk'
278 /* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */
280 typedef uint32_t BMDDeckLinkAttributeID;
281 enum _BMDDeckLinkAttributeID {
283 /* Flags */
285 BMDDeckLinkSupportsInternalKeying = 'keyi',
286 BMDDeckLinkSupportsExternalKeying = 'keye',
287 BMDDeckLinkSupportsHDKeying = 'keyh',
288 BMDDeckLinkSupportsInputFormatDetection = 'infd',
289 BMDDeckLinkHasReferenceInput = 'hrin',
290 BMDDeckLinkHasSerialPort = 'hspt',
291 BMDDeckLinkHasAnalogVideoOutputGain = 'avog',
292 BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain = 'ovog',
293 BMDDeckLinkHasVideoInputAntiAliasingFilter = 'aafl',
294 BMDDeckLinkHasBypass = 'byps',
295 BMDDeckLinkSupportsDesktopDisplay = 'extd',
296 BMDDeckLinkSupportsClockTimingAdjustment = 'ctad',
297 BMDDeckLinkSupportsFullDuplex = 'fdup',
298 BMDDeckLinkSupportsFullFrameReferenceInputTimingOffset = 'frin',
300 /* Integers */
302 BMDDeckLinkMaximumAudioChannels = 'mach',
303 BMDDeckLinkMaximumAnalogAudioChannels = 'aach',
304 BMDDeckLinkNumberOfSubDevices = 'nsbd',
305 BMDDeckLinkSubDeviceIndex = 'subi',
306 BMDDeckLinkPersistentID = 'peid',
307 BMDDeckLinkTopologicalID = 'toid',
308 BMDDeckLinkVideoOutputConnections = 'vocn',
309 BMDDeckLinkVideoInputConnections = 'vicn',
310 BMDDeckLinkAudioOutputConnections = 'aocn',
311 BMDDeckLinkAudioInputConnections = 'aicn',
312 BMDDeckLinkDeviceBusyState = 'dbst',
313 BMDDeckLinkVideoIOSupport = 'vios', // Returns a BMDVideoIOSupport bit field
315 /* Floats */
317 BMDDeckLinkVideoInputGainMinimum = 'vigm',
318 BMDDeckLinkVideoInputGainMaximum = 'vigx',
319 BMDDeckLinkVideoOutputGainMinimum = 'vogm',
320 BMDDeckLinkVideoOutputGainMaximum = 'vogx',
322 /* Strings */
324 BMDDeckLinkSerialPortDeviceName = 'slpn'
327 /* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */
329 typedef uint32_t BMDDeckLinkAPIInformationID;
330 enum _BMDDeckLinkAPIInformationID {
331 BMDDeckLinkAPIVersion = 'vers'
334 /* Enum BMDDeviceBusyState - Current device busy state */
336 typedef uint32_t BMDDeviceBusyState;
337 enum _BMDDeviceBusyState {
338 bmdDeviceCaptureBusy = 1 << 0,
339 bmdDevicePlaybackBusy = 1 << 1,
340 bmdDeviceSerialPortBusy = 1 << 2
343 /* Enum BMDVideoIOSupport - Device video input/output support */
345 typedef uint32_t BMDVideoIOSupport;
346 enum _BMDVideoIOSupport {
347 bmdDeviceSupportsCapture = 1 << 0,
348 bmdDeviceSupportsPlayback = 1 << 1
351 /* Enum BMD3DPreviewFormat - Linked Frame preview format */
353 typedef uint32_t BMD3DPreviewFormat;
354 enum _BMD3DPreviewFormat {
355 bmd3DPreviewFormatDefault = 'defa',
356 bmd3DPreviewFormatLeftOnly = 'left',
357 bmd3DPreviewFormatRightOnly = 'righ',
358 bmd3DPreviewFormatSideBySide = 'side',
359 bmd3DPreviewFormatTopBottom = 'topb'
362 /* Enum BMDNotifications - Events that can be subscribed through IDeckLinkNotification */
364 typedef uint32_t BMDNotifications;
365 enum _BMDNotifications {
366 bmdPreferencesChanged = 'pref'
369 #if defined(__cplusplus)
371 // Forward Declarations
373 class IDeckLinkVideoOutputCallback;
374 class IDeckLinkInputCallback;
375 class IDeckLinkMemoryAllocator;
376 class IDeckLinkAudioOutputCallback;
377 class IDeckLinkIterator;
378 class IDeckLinkAPIInformation;
379 class IDeckLinkOutput;
380 class IDeckLinkInput;
381 class IDeckLinkVideoFrame;
382 class IDeckLinkMutableVideoFrame;
383 class IDeckLinkVideoFrame3DExtensions;
384 class IDeckLinkVideoInputFrame;
385 class IDeckLinkVideoFrameAncillary;
386 class IDeckLinkAudioInputPacket;
387 class IDeckLinkScreenPreviewCallback;
388 class IDeckLinkCocoaScreenPreviewCallback;
389 class IDeckLinkGLScreenPreviewHelper;
390 class IDeckLinkNotificationCallback;
391 class IDeckLinkNotification;
392 class IDeckLinkAttributes;
393 class IDeckLinkKeyer;
394 class IDeckLinkVideoConversion;
395 class IDeckLinkDeviceNotificationCallback;
396 class IDeckLinkDiscovery;
398 /* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */
400 class IDeckLinkVideoOutputCallback : public IUnknown
402 public:
403 virtual HRESULT ScheduledFrameCompleted (/* in */ IDeckLinkVideoFrame *completedFrame, /* in */ BMDOutputFrameCompletionResult result) = 0;
404 virtual HRESULT ScheduledPlaybackHasStopped (void) = 0;
406 protected:
407 virtual ~IDeckLinkVideoOutputCallback () {} // call Release method to drop reference count
410 /* Interface IDeckLinkInputCallback - Frame arrival callback. */
412 class IDeckLinkInputCallback : public IUnknown
414 public:
415 virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
416 virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket) = 0;
418 protected:
419 virtual ~IDeckLinkInputCallback () {} // call Release method to drop reference count
422 /* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */
424 class IDeckLinkMemoryAllocator : public IUnknown
426 public:
427 virtual HRESULT AllocateBuffer (/* in */ uint32_t bufferSize, /* out */ void **allocatedBuffer) = 0;
428 virtual HRESULT ReleaseBuffer (/* in */ void *buffer) = 0;
430 virtual HRESULT Commit (void) = 0;
431 virtual HRESULT Decommit (void) = 0;
434 /* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */
436 class IDeckLinkAudioOutputCallback : public IUnknown
438 public:
439 virtual HRESULT RenderAudioSamples (/* in */ bool preroll) = 0;
442 /* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */
444 class IDeckLinkIterator : public IUnknown
446 public:
447 virtual HRESULT Next (/* out */ IDeckLink **deckLinkInstance) = 0;
450 /* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */
452 class IDeckLinkAPIInformation : public IUnknown
454 public:
455 virtual HRESULT GetFlag (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ bool *value) = 0;
456 virtual HRESULT GetInt (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ int64_t *value) = 0;
457 virtual HRESULT GetFloat (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ double *value) = 0;
458 virtual HRESULT GetString (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ CFStringRef *value) = 0;
460 protected:
461 virtual ~IDeckLinkAPIInformation () {} // call Release method to drop reference count
464 /* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
466 class IDeckLinkOutput : public IUnknown
468 public:
469 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoOutputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
470 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
472 virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
474 /* Video Output */
476 virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0;
477 virtual HRESULT DisableVideoOutput (void) = 0;
479 virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
480 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;
481 virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0;
483 virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
484 virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0;
485 virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0;
486 virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0;
488 /* Audio Output */
490 virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0;
491 virtual HRESULT DisableAudioOutput (void) = 0;
493 virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0;
495 virtual HRESULT BeginAudioPreroll (void) = 0;
496 virtual HRESULT EndAudioPreroll (void) = 0;
497 virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0;
499 virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0;
500 virtual HRESULT FlushBufferedAudioSamples (void) = 0;
502 virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0;
504 /* Output Control */
506 virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0;
507 virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0;
508 virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0;
509 virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0;
510 virtual HRESULT GetReferenceStatus (/* out */ BMDReferenceStatus *referenceStatus) = 0;
512 /* Hardware Timing */
514 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
515 virtual HRESULT GetFrameCompletionReferenceTimestamp (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *frameCompletionTimestamp) = 0;
517 protected:
518 virtual ~IDeckLinkOutput () {} // call Release method to drop reference count
521 /* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
523 class IDeckLinkInput : public IUnknown
525 public:
526 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
527 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
529 virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
531 /* Video Input */
533 virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
534 virtual HRESULT DisableVideoInput (void) = 0;
535 virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0;
536 virtual HRESULT SetVideoInputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
538 /* Audio Input */
540 virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
541 virtual HRESULT DisableAudioInput (void) = 0;
542 virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
544 /* Input Control */
546 virtual HRESULT StartStreams (void) = 0;
547 virtual HRESULT StopStreams (void) = 0;
548 virtual HRESULT PauseStreams (void) = 0;
549 virtual HRESULT FlushStreams (void) = 0;
550 virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback *theCallback) = 0;
552 /* Hardware Timing */
554 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
556 protected:
557 virtual ~IDeckLinkInput () {} // call Release method to drop reference count
560 /* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */
562 class IDeckLinkVideoFrame : public IUnknown
564 public:
565 virtual long GetWidth (void) = 0;
566 virtual long GetHeight (void) = 0;
567 virtual long GetRowBytes (void) = 0;
568 virtual BMDPixelFormat GetPixelFormat (void) = 0;
569 virtual BMDFrameFlags GetFlags (void) = 0;
570 virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
572 virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0;
573 virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) = 0;
575 protected:
576 virtual ~IDeckLinkVideoFrame () {} // call Release method to drop reference count
579 /* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */
581 class IDeckLinkMutableVideoFrame : public IDeckLinkVideoFrame
583 public:
584 virtual HRESULT SetFlags (/* in */ BMDFrameFlags newFlags) = 0;
586 virtual HRESULT SetTimecode (/* in */ BMDTimecodeFormat format, /* in */ IDeckLinkTimecode *timecode) = 0;
587 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;
588 virtual HRESULT SetAncillaryData (/* in */ IDeckLinkVideoFrameAncillary *ancillary) = 0;
589 virtual HRESULT SetTimecodeUserBits (/* in */ BMDTimecodeFormat format, /* in */ BMDTimecodeUserBits userBits) = 0;
591 protected:
592 virtual ~IDeckLinkMutableVideoFrame () {} // call Release method to drop reference count
595 /* Interface IDeckLinkVideoFrame3DExtensions - Optional interface implemented on IDeckLinkVideoFrame to support 3D frames */
597 class IDeckLinkVideoFrame3DExtensions : public IUnknown
599 public:
600 virtual BMDVideo3DPackingFormat Get3DPackingFormat (void) = 0;
601 virtual HRESULT GetFrameForRightEye (/* out */ IDeckLinkVideoFrame* *rightEyeFrame) = 0;
603 protected:
604 virtual ~IDeckLinkVideoFrame3DExtensions () {} // call Release method to drop reference count
607 /* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
609 class IDeckLinkVideoInputFrame : public IDeckLinkVideoFrame
611 public:
612 virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, /* in */ BMDTimeScale timeScale) = 0;
613 virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
615 protected:
616 virtual ~IDeckLinkVideoInputFrame () {} // call Release method to drop reference count
619 /* Interface IDeckLinkVideoFrameAncillary - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
621 class IDeckLinkVideoFrameAncillary : public IUnknown
623 public:
625 virtual HRESULT GetBufferForVerticalBlankingLine (/* in */ uint32_t lineNumber, /* out */ void **buffer) = 0;
626 virtual BMDPixelFormat GetPixelFormat (void) = 0;
627 virtual BMDDisplayMode GetDisplayMode (void) = 0;
629 protected:
630 virtual ~IDeckLinkVideoFrameAncillary () {} // call Release method to drop reference count
633 /* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */
635 class IDeckLinkAudioInputPacket : public IUnknown
637 public:
638 virtual long GetSampleFrameCount (void) = 0;
639 virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
640 virtual HRESULT GetPacketTime (/* out */ BMDTimeValue *packetTime, /* in */ BMDTimeScale timeScale) = 0;
642 protected:
643 virtual ~IDeckLinkAudioInputPacket () {} // call Release method to drop reference count
646 /* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */
648 class IDeckLinkScreenPreviewCallback : public IUnknown
650 public:
651 virtual HRESULT DrawFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
653 protected:
654 virtual ~IDeckLinkScreenPreviewCallback () {} // call Release method to drop reference count
657 /* Interface IDeckLinkCocoaScreenPreviewCallback - Screen preview callback for Cocoa-based applications */
659 class IDeckLinkCocoaScreenPreviewCallback : public IDeckLinkScreenPreviewCallback
661 public:
663 protected:
664 virtual ~IDeckLinkCocoaScreenPreviewCallback () {} // call Release method to drop reference count
667 /* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */
669 class IDeckLinkGLScreenPreviewHelper : public IUnknown
671 public:
673 /* Methods must be called with OpenGL context set */
675 virtual HRESULT InitializeGL (void) = 0;
676 virtual HRESULT PaintGL (void) = 0;
677 virtual HRESULT SetFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
678 virtual HRESULT Set3DPreviewFormat (/* in */ BMD3DPreviewFormat previewFormat) = 0;
680 protected:
681 virtual ~IDeckLinkGLScreenPreviewHelper () {} // call Release method to drop reference count
684 /* Interface IDeckLinkNotificationCallback - DeckLink Notification Callback Interface */
686 class IDeckLinkNotificationCallback : public IUnknown
688 public:
689 virtual HRESULT Notify (/* in */ BMDNotifications topic, /* in */ uint64_t param1, /* in */ uint64_t param2) = 0;
692 /* Interface IDeckLinkNotification - DeckLink Notification interface */
694 class IDeckLinkNotification : public IUnknown
696 public:
697 virtual HRESULT Subscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
698 virtual HRESULT Unsubscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
701 /* Interface IDeckLinkAttributes - DeckLink Attribute interface */
703 class IDeckLinkAttributes : public IUnknown
705 public:
706 virtual HRESULT GetFlag (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ bool *value) = 0;
707 virtual HRESULT GetInt (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ int64_t *value) = 0;
708 virtual HRESULT GetFloat (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ double *value) = 0;
709 virtual HRESULT GetString (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ CFStringRef *value) = 0;
711 protected:
712 virtual ~IDeckLinkAttributes () {} // call Release method to drop reference count
715 /* Interface IDeckLinkKeyer - DeckLink Keyer interface */
717 class IDeckLinkKeyer : public IUnknown
719 public:
720 virtual HRESULT Enable (/* in */ bool isExternal) = 0;
721 virtual HRESULT SetLevel (/* in */ uint8_t level) = 0;
722 virtual HRESULT RampUp (/* in */ uint32_t numberOfFrames) = 0;
723 virtual HRESULT RampDown (/* in */ uint32_t numberOfFrames) = 0;
724 virtual HRESULT Disable (void) = 0;
726 protected:
727 virtual ~IDeckLinkKeyer () {} // call Release method to drop reference count
730 /* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */
732 class IDeckLinkVideoConversion : public IUnknown
734 public:
735 virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ IDeckLinkVideoFrame* dstFrame) = 0;
737 protected:
738 virtual ~IDeckLinkVideoConversion () {} // call Release method to drop reference count
741 /* Interface IDeckLinkDeviceNotificationCallback - DeckLink device arrival/removal notification callbacks */
743 class IDeckLinkDeviceNotificationCallback : public IUnknown
745 public:
746 virtual HRESULT DeckLinkDeviceArrived (/* in */ IDeckLink* deckLinkDevice) = 0;
747 virtual HRESULT DeckLinkDeviceRemoved (/* in */ IDeckLink* deckLinkDevice) = 0;
749 protected:
750 virtual ~IDeckLinkDeviceNotificationCallback () {} // call Release method to drop reference count
753 /* Interface IDeckLinkDiscovery - DeckLink device discovery */
755 class IDeckLinkDiscovery : public IUnknown
757 public:
758 virtual HRESULT InstallDeviceNotifications (/* in */ IDeckLinkDeviceNotificationCallback* deviceNotificationCallback) = 0;
759 virtual HRESULT UninstallDeviceNotifications (void) = 0;
761 protected:
762 virtual ~IDeckLinkDiscovery () {} // call Release method to drop reference count
765 /* Functions */
767 extern "C" {
769 IDeckLinkIterator* CreateDeckLinkIteratorInstance (void);
770 IDeckLinkDiscovery* CreateDeckLinkDiscoveryInstance (void);
771 IDeckLinkAPIInformation* CreateDeckLinkAPIInformationInstance (void);
772 IDeckLinkGLScreenPreviewHelper* CreateOpenGLScreenPreviewHelper (void);
773 IDeckLinkCocoaScreenPreviewCallback* CreateCocoaScreenPreview (void* /* (NSView*) */ parentView);
774 IDeckLinkVideoConversion* CreateVideoConversionInstance (void);
779 #endif // defined(__cplusplus)
780 #endif /* defined(BMD_DECKLINKAPI_H) */