• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* -LICENSE-START-
2 ** Copyright (c) 2019 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-
26 */
27 
28 #ifndef BMD_DECKLINKAPI_H
29 #define BMD_DECKLINKAPI_H
30 
31 
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
39 
40 #ifndef BMD_PUBLIC
41 	#define BMD_PUBLIC
42 #endif
43 
44 /* DeckLink API */
45 
46 #include <CoreFoundation/CoreFoundation.h>
47 #include <CoreFoundation/CFPlugInCOM.h>
48 #include <stdint.h>
49 
50 #include "DeckLinkAPITypes.h"
51 #include "DeckLinkAPIModes.h"
52 #include "DeckLinkAPIDiscovery.h"
53 #include "DeckLinkAPIConfiguration.h"
54 #include "DeckLinkAPIDeckControl.h"
55 
56 #include "DeckLinkAPIStreaming.h"
57 
58 #define BLACKMAGIC_DECKLINK_API_MAGIC	1
59 
60 // Type Declarations
61 
62 
63 // Interface ID Declarations
64 
65 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};
66 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};
67 BMD_CONST REFIID IID_IDeckLinkEncoderInputCallback                = /* ACF13E61-F4A0-4974-A6A7-59AFF6268B31 */ {0xAC,0xF1,0x3E,0x61,0xF4,0xA0,0x49,0x74,0xA6,0xA7,0x59,0xAF,0xF6,0x26,0x8B,0x31};
68 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};
69 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};
70 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};
71 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};
72 BMD_CONST REFIID IID_IDeckLinkOutput                              = /* 065A0F6C-C508-4D0D-B919-F5EB0EBFC96B */ {0x06,0x5A,0x0F,0x6C,0xC5,0x08,0x4D,0x0D,0xB9,0x19,0xF5,0xEB,0x0E,0xBF,0xC9,0x6B};
73 BMD_CONST REFIID IID_IDeckLinkInput                               = /* 2A88CF76-F494-4216-A7EF-DC74EEB83882 */ {0x2A,0x88,0xCF,0x76,0xF4,0x94,0x42,0x16,0xA7,0xEF,0xDC,0x74,0xEE,0xB8,0x38,0x82};
74 BMD_CONST REFIID IID_IDeckLinkHDMIInputEDID                       = /* ABBBACBC-45BC-4665-9D92-ACE6E5A97902 */ {0xAB,0xBB,0xAC,0xBC,0x45,0xBC,0x46,0x65,0x9D,0x92,0xAC,0xE6,0xE5,0xA9,0x79,0x02};
75 BMD_CONST REFIID IID_IDeckLinkEncoderInput                        = /* F222551D-13DF-4FD8-B587-9D4F19EC12C9 */ {0xF2,0x22,0x55,0x1D,0x13,0xDF,0x4F,0xD8,0xB5,0x87,0x9D,0x4F,0x19,0xEC,0x12,0xC9};
76 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};
77 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};
78 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};
79 BMD_CONST REFIID IID_IDeckLinkVideoFrameMetadataExtensions        = /* D5973DC9-6432-46D0-8F0B-2496F8A1238F */ {0xD5,0x97,0x3D,0xC9,0x64,0x32,0x46,0xD0,0x8F,0x0B,0x24,0x96,0xF8,0xA1,0x23,0x8F};
80 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};
81 BMD_CONST REFIID IID_IDeckLinkAncillaryPacket                     = /* CC5BBF7E-029C-4D3B-9158-6000EF5E3670 */ {0xCC,0x5B,0xBF,0x7E,0x02,0x9C,0x4D,0x3B,0x91,0x58,0x60,0x00,0xEF,0x5E,0x36,0x70};
82 BMD_CONST REFIID IID_IDeckLinkAncillaryPacketIterator             = /* 3FC8994B-88FB-4C17-968F-9AAB69D964A7 */ {0x3F,0xC8,0x99,0x4B,0x88,0xFB,0x4C,0x17,0x96,0x8F,0x9A,0xAB,0x69,0xD9,0x64,0xA7};
83 BMD_CONST REFIID IID_IDeckLinkVideoFrameAncillaryPackets          = /* 6C186C0F-459E-41D8-AEE2-4812D81AEE68 */ {0x6C,0x18,0x6C,0x0F,0x45,0x9E,0x41,0xD8,0xAE,0xE2,0x48,0x12,0xD8,0x1A,0xEE,0x68};
84 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};
85 BMD_CONST REFIID IID_IDeckLinkEncoderPacket                       = /* B693F36C-316E-4AF1-B6C2-F389A4BCA620 */ {0xB6,0x93,0xF3,0x6C,0x31,0x6E,0x4A,0xF1,0xB6,0xC2,0xF3,0x89,0xA4,0xBC,0xA6,0x20};
86 BMD_CONST REFIID IID_IDeckLinkEncoderVideoPacket                  = /* 4E7FD944-E8C7-4EAC-B8C0-7B77F80F5AE0 */ {0x4E,0x7F,0xD9,0x44,0xE8,0xC7,0x4E,0xAC,0xB8,0xC0,0x7B,0x77,0xF8,0x0F,0x5A,0xE0};
87 BMD_CONST REFIID IID_IDeckLinkEncoderAudioPacket                  = /* 49E8EDC8-693B-4E14-8EF6-12C658F5A07A */ {0x49,0xE8,0xED,0xC8,0x69,0x3B,0x4E,0x14,0x8E,0xF6,0x12,0xC6,0x58,0xF5,0xA0,0x7A};
88 BMD_CONST REFIID IID_IDeckLinkH265NALPacket                       = /* 639C8E0B-68D5-4BDE-A6D4-95F3AEAFF2E7 */ {0x63,0x9C,0x8E,0x0B,0x68,0xD5,0x4B,0xDE,0xA6,0xD4,0x95,0xF3,0xAE,0xAF,0xF2,0xE7};
89 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};
90 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};
91 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};
92 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};
93 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};
94 BMD_CONST REFIID IID_IDeckLinkNotification                        = /* B85DF4C8-BDF5-47C1-8064-28162EBDD4EB */ {0xB8,0x5D,0xF4,0xC8,0xBD,0xF5,0x47,0xC1,0x80,0x64,0x28,0x16,0x2E,0xBD,0xD4,0xEB};
95 BMD_CONST REFIID IID_IDeckLinkProfileAttributes                   = /* 17D4BF8E-4911-473A-80A0-731CF6FF345B */ {0x17,0xD4,0xBF,0x8E,0x49,0x11,0x47,0x3A,0x80,0xA0,0x73,0x1C,0xF6,0xFF,0x34,0x5B};
96 BMD_CONST REFIID IID_IDeckLinkProfileIterator                     = /* 29E5A8C0-8BE4-46EB-93AC-31DAAB5B7BF2 */ {0x29,0xE5,0xA8,0xC0,0x8B,0xE4,0x46,0xEB,0x93,0xAC,0x31,0xDA,0xAB,0x5B,0x7B,0xF2};
97 BMD_CONST REFIID IID_IDeckLinkProfile                             = /* 16093466-674A-432B-9DA0-1AC2C5A8241C */ {0x16,0x09,0x34,0x66,0x67,0x4A,0x43,0x2B,0x9D,0xA0,0x1A,0xC2,0xC5,0xA8,0x24,0x1C};
98 BMD_CONST REFIID IID_IDeckLinkProfileCallback                     = /* A4F9341E-97AA-4E04-8935-15F809898CEA */ {0xA4,0xF9,0x34,0x1E,0x97,0xAA,0x4E,0x04,0x89,0x35,0x15,0xF8,0x09,0x89,0x8C,0xEA};
99 BMD_CONST REFIID IID_IDeckLinkProfileManager                      = /* 30D41429-3998-4B6D-84F8-78C94A797C6E */ {0x30,0xD4,0x14,0x29,0x39,0x98,0x4B,0x6D,0x84,0xF8,0x78,0xC9,0x4A,0x79,0x7C,0x6E};
100 BMD_CONST REFIID IID_IDeckLinkStatus                              = /* 5F558200-4028-49BC-BEAC-DB3FA4A96E46 */ {0x5F,0x55,0x82,0x00,0x40,0x28,0x49,0xBC,0xBE,0xAC,0xDB,0x3F,0xA4,0xA9,0x6E,0x46};
101 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};
102 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};
103 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};
104 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};
105 
106 /* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */
107 
108 typedef uint32_t BMDVideoOutputFlags;
109 enum _BMDVideoOutputFlags {
110     bmdVideoOutputFlagDefault                                    = 0,
111     bmdVideoOutputVANC                                           = 1 << 0,
112     bmdVideoOutputVITC                                           = 1 << 1,
113     bmdVideoOutputRP188                                          = 1 << 2,
114     bmdVideoOutputDualStream3D                                   = 1 << 4,
115     bmdVideoOutputSynchronizeToPlaybackGroup                     = 1 << 6
116 };
117 
118 /* Enum BMDSupportedVideoModeFlags - Flags to describe supported video mode */
119 
120 typedef uint32_t BMDSupportedVideoModeFlags;
121 enum _BMDSupportedVideoModeFlags {
122     bmdSupportedVideoModeDefault                                 = 0,
123     bmdSupportedVideoModeKeying                                  = 1 << 0,
124     bmdSupportedVideoModeDualStream3D                            = 1 << 1,
125     bmdSupportedVideoModeSDISingleLink                           = 1 << 2,
126     bmdSupportedVideoModeSDIDualLink                             = 1 << 3,
127     bmdSupportedVideoModeSDIQuadLink                             = 1 << 4,
128     bmdSupportedVideoModeInAnyProfile                            = 1 << 5
129 };
130 
131 /* Enum BMDPacketType - Type of packet */
132 
133 typedef uint32_t BMDPacketType;
134 enum _BMDPacketType {
135     bmdPacketTypeStreamInterruptedMarker                         = 'sint',	// A packet of this type marks the time when a video stream was interrupted, for example by a disconnected cable
136     bmdPacketTypeStreamData                                      = 'sdat'	// Regular stream data
137 };
138 
139 /* Enum BMDFrameFlags - Frame flags */
140 
141 typedef uint32_t BMDFrameFlags;
142 enum _BMDFrameFlags {
143     bmdFrameFlagDefault                                          = 0,
144     bmdFrameFlagFlipVertical                                     = 1 << 0,
145     bmdFrameContainsHDRMetadata                                  = 1 << 1,
146     bmdFrameContainsCintelMetadata                               = 1 << 2,
147 
148     /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */
149 
150     bmdFrameCapturedAsPsF                                        = 1 << 30,
151     bmdFrameHasNoInputSource                                     = 1 << 31
152 };
153 
154 /* Enum BMDVideoInputFlags - Flags applicable to video input */
155 
156 typedef uint32_t BMDVideoInputFlags;
157 enum _BMDVideoInputFlags {
158     bmdVideoInputFlagDefault                                     = 0,
159     bmdVideoInputEnableFormatDetection                           = 1 << 0,
160     bmdVideoInputDualStream3D                                    = 1 << 1,
161     bmdVideoInputSynchronizeToCaptureGroup                       = 1 << 2
162 };
163 
164 /* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */
165 
166 typedef uint32_t BMDVideoInputFormatChangedEvents;
167 enum _BMDVideoInputFormatChangedEvents {
168     bmdVideoInputDisplayModeChanged                              = 1 << 0,
169     bmdVideoInputFieldDominanceChanged                           = 1 << 1,
170     bmdVideoInputColorspaceChanged                               = 1 << 2
171 };
172 
173 /* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */
174 
175 typedef uint32_t BMDDetectedVideoInputFormatFlags;
176 enum _BMDDetectedVideoInputFormatFlags {
177     bmdDetectedVideoInputYCbCr422                                = 1 << 0,
178     bmdDetectedVideoInputRGB444                                  = 1 << 1,
179     bmdDetectedVideoInputDualStream3D                            = 1 << 2
180 };
181 
182 /* Enum BMDDeckLinkCapturePassthroughMode - Enumerates whether the video output is electrically connected to the video input or if the clean switching mode is enabled */
183 
184 typedef uint32_t BMDDeckLinkCapturePassthroughMode;
185 enum _BMDDeckLinkCapturePassthroughMode {
186     bmdDeckLinkCapturePassthroughModeDisabled                    = 'pdis',
187     bmdDeckLinkCapturePassthroughModeDirect                      = 'pdir',
188     bmdDeckLinkCapturePassthroughModeCleanSwitch                 = 'pcln'
189 };
190 
191 /* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */
192 
193 typedef uint32_t BMDOutputFrameCompletionResult;
194 enum _BMDOutputFrameCompletionResult {
195     bmdOutputFrameCompleted,
196     bmdOutputFrameDisplayedLate,
197     bmdOutputFrameDropped,
198     bmdOutputFrameFlushed
199 };
200 
201 /* Enum BMDReferenceStatus - GenLock input status */
202 
203 typedef uint32_t BMDReferenceStatus;
204 enum _BMDReferenceStatus {
205     bmdReferenceNotSupportedByHardware                           = 1 << 0,
206     bmdReferenceLocked                                           = 1 << 1
207 };
208 
209 /* Enum BMDAudioFormat - Audio Format */
210 
211 typedef uint32_t BMDAudioFormat;
212 enum _BMDAudioFormat {
213     bmdAudioFormatPCM                                            = 'lpcm'	// Linear signed PCM samples
214 };
215 
216 /* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */
217 
218 typedef uint32_t BMDAudioSampleRate;
219 enum _BMDAudioSampleRate {
220     bmdAudioSampleRate48kHz                                      = 48000
221 };
222 
223 /* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */
224 
225 typedef uint32_t BMDAudioSampleType;
226 enum _BMDAudioSampleType {
227     bmdAudioSampleType16bitInteger                               = 16,
228     bmdAudioSampleType32bitInteger                               = 32
229 };
230 
231 /* Enum BMDAudioOutputStreamType - Audio output stream type */
232 
233 typedef uint32_t BMDAudioOutputStreamType;
234 enum _BMDAudioOutputStreamType {
235     bmdAudioOutputStreamContinuous,
236     bmdAudioOutputStreamContinuousDontResample,
237     bmdAudioOutputStreamTimestamped
238 };
239 
240 /* Enum BMDAncillaryPacketFormat - Ancillary packet format */
241 
242 typedef uint32_t BMDAncillaryPacketFormat;
243 enum _BMDAncillaryPacketFormat {
244     bmdAncillaryPacketFormatUInt8                                = 'ui08',
245     bmdAncillaryPacketFormatUInt16                               = 'ui16',
246     bmdAncillaryPacketFormatYCbCr10                              = 'v210'
247 };
248 
249 /* Enum BMDTimecodeFormat - Timecode formats for frame metadata */
250 
251 typedef uint32_t BMDTimecodeFormat;
252 enum _BMDTimecodeFormat {
253     bmdTimecodeRP188VITC1                                        = 'rpv1',	// RP188 timecode where DBB1 equals VITC1 (line 9)
254     bmdTimecodeRP188VITC2                                        = 'rp12',	// RP188 timecode where DBB1 equals VITC2 (line 9 for progressive or line 571 for interlaced/PsF)
255     bmdTimecodeRP188LTC                                          = 'rplt',	// RP188 timecode where DBB1 equals LTC (line 10)
256     bmdTimecodeRP188HighFrameRate                                = 'rphr',	// RP188 timecode where DBB1 is an HFRTC (SMPTE ST 12-3), the only timecode allowing the frame value to go above 30
257     bmdTimecodeRP188Any                                          = 'rp18',	// Convenience for capture, returning the first valid timecode in {HFRTC (if supported), VITC1, LTC, VITC2}
258     bmdTimecodeVITC                                              = 'vitc',
259     bmdTimecodeVITCField2                                        = 'vit2',
260     bmdTimecodeSerial                                            = 'seri'
261 };
262 
263 /* Enum BMDAnalogVideoFlags - Analog video display flags */
264 
265 typedef uint32_t BMDAnalogVideoFlags;
266 enum _BMDAnalogVideoFlags {
267     bmdAnalogVideoFlagCompositeSetup75                           = 1 << 0,
268     bmdAnalogVideoFlagComponentBetacamLevels                     = 1 << 1
269 };
270 
271 /* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */
272 
273 typedef uint32_t BMDAudioOutputAnalogAESSwitch;
274 enum _BMDAudioOutputAnalogAESSwitch {
275     bmdAudioOutputSwitchAESEBU                                   = 'aes ',
276     bmdAudioOutputSwitchAnalog                                   = 'anlg'
277 };
278 
279 /* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */
280 
281 typedef uint32_t BMDVideoOutputConversionMode;
282 enum _BMDVideoOutputConversionMode {
283     bmdNoVideoOutputConversion                                   = 'none',
284     bmdVideoOutputLetterboxDownconversion                        = 'ltbx',
285     bmdVideoOutputAnamorphicDownconversion                       = 'amph',
286     bmdVideoOutputHD720toHD1080Conversion                        = '720c',
287     bmdVideoOutputHardwareLetterboxDownconversion                = 'HWlb',
288     bmdVideoOutputHardwareAnamorphicDownconversion               = 'HWam',
289     bmdVideoOutputHardwareCenterCutDownconversion                = 'HWcc',
290     bmdVideoOutputHardware720p1080pCrossconversion               = 'xcap',
291     bmdVideoOutputHardwareAnamorphic720pUpconversion             = 'ua7p',
292     bmdVideoOutputHardwareAnamorphic1080iUpconversion            = 'ua1i',
293     bmdVideoOutputHardwareAnamorphic149To720pUpconversion        = 'u47p',
294     bmdVideoOutputHardwareAnamorphic149To1080iUpconversion       = 'u41i',
295     bmdVideoOutputHardwarePillarbox720pUpconversion              = 'up7p',
296     bmdVideoOutputHardwarePillarbox1080iUpconversion             = 'up1i'
297 };
298 
299 /* Enum BMDVideoInputConversionMode - Video input conversion mode */
300 
301 typedef uint32_t BMDVideoInputConversionMode;
302 enum _BMDVideoInputConversionMode {
303     bmdNoVideoInputConversion                                    = 'none',
304     bmdVideoInputLetterboxDownconversionFromHD1080               = '10lb',
305     bmdVideoInputAnamorphicDownconversionFromHD1080              = '10am',
306     bmdVideoInputLetterboxDownconversionFromHD720                = '72lb',
307     bmdVideoInputAnamorphicDownconversionFromHD720               = '72am',
308     bmdVideoInputLetterboxUpconversion                           = 'lbup',
309     bmdVideoInputAnamorphicUpconversion                          = 'amup'
310 };
311 
312 /* Enum BMDVideo3DPackingFormat - Video 3D packing format */
313 
314 typedef uint32_t BMDVideo3DPackingFormat;
315 enum _BMDVideo3DPackingFormat {
316     bmdVideo3DPackingSidebySideHalf                              = 'sbsh',
317     bmdVideo3DPackingLinebyLine                                  = 'lbyl',
318     bmdVideo3DPackingTopAndBottom                                = 'tabo',
319     bmdVideo3DPackingFramePacking                                = 'frpk',
320     bmdVideo3DPackingLeftOnly                                    = 'left',
321     bmdVideo3DPackingRightOnly                                   = 'righ'
322 };
323 
324 /* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */
325 
326 typedef uint32_t BMDIdleVideoOutputOperation;
327 enum _BMDIdleVideoOutputOperation {
328     bmdIdleVideoOutputBlack                                      = 'blac',
329     bmdIdleVideoOutputLastFrame                                  = 'lafa'
330 };
331 
332 /* Enum BMDVideoEncoderFrameCodingMode - Video frame coding mode */
333 
334 typedef uint32_t BMDVideoEncoderFrameCodingMode;
335 enum _BMDVideoEncoderFrameCodingMode {
336     bmdVideoEncoderFrameCodingModeInter                          = 'inte',
337     bmdVideoEncoderFrameCodingModeIntra                          = 'intr'
338 };
339 
340 /* Enum BMDDNxHRLevel - DNxHR Levels */
341 
342 typedef uint32_t BMDDNxHRLevel;
343 enum _BMDDNxHRLevel {
344     bmdDNxHRLevelSQ                                              = 'dnsq',
345     bmdDNxHRLevelLB                                              = 'dnlb',
346     bmdDNxHRLevelHQ                                              = 'dnhq',
347     bmdDNxHRLevelHQX                                             = 'dhqx',
348     bmdDNxHRLevel444                                             = 'd444'
349 };
350 
351 /* Enum BMDLinkConfiguration - Video link configuration */
352 
353 typedef uint32_t BMDLinkConfiguration;
354 enum _BMDLinkConfiguration {
355     bmdLinkConfigurationSingleLink                               = 'lcsl',
356     bmdLinkConfigurationDualLink                                 = 'lcdl',
357     bmdLinkConfigurationQuadLink                                 = 'lcql'
358 };
359 
360 /* Enum BMDDeviceInterface - Device interface type */
361 
362 typedef uint32_t BMDDeviceInterface;
363 enum _BMDDeviceInterface {
364     bmdDeviceInterfacePCI                                        = 'pci ',
365     bmdDeviceInterfaceUSB                                        = 'usb ',
366     bmdDeviceInterfaceThunderbolt                                = 'thun'
367 };
368 
369 /* Enum BMDColorspace - Colorspace */
370 
371 typedef uint32_t BMDColorspace;
372 enum _BMDColorspace {
373     bmdColorspaceRec601                                          = 'r601',
374     bmdColorspaceRec709                                          = 'r709',
375     bmdColorspaceRec2020                                         = '2020'
376 };
377 
378 /* Enum BMDDynamicRange - SDR or HDR */
379 
380 typedef uint32_t BMDDynamicRange;
381 enum _BMDDynamicRange {
382     bmdDynamicRangeSDR                                           = 0,
383     bmdDynamicRangeHDRStaticPQ                                   = 1 << 29,	// SMPTE ST 2084
384     bmdDynamicRangeHDRStaticHLG                                  = 1 << 30	// ITU-R BT.2100-0
385 };
386 
387 /* Enum BMDDeckLinkHDMIInputEDIDID - DeckLink HDMI Input EDID ID */
388 
389 typedef uint32_t BMDDeckLinkHDMIInputEDIDID;
390 enum _BMDDeckLinkHDMIInputEDIDID {
391     bmdDeckLinkHDMIInputEDIDDynamicRange                         = 'HIDy'	// Parameter is of type BMDDynamicRange. Default is (bmdDynamicRangeSDR|bmdDynamicRangeHDRStaticPQ)
392 };
393 
394 /* Enum BMDDeckLinkFrameMetadataID - DeckLink Frame Metadata ID */
395 
396 typedef uint32_t BMDDeckLinkFrameMetadataID;
397 enum _BMDDeckLinkFrameMetadataID {
398     bmdDeckLinkFrameMetadataColorspace                           = 'cspc',	// Colorspace of video frame (see BMDColorspace)
399     bmdDeckLinkFrameMetadataHDRElectroOpticalTransferFunc        = 'eotf',	// EOTF in range 0-7 as per CEA 861.3
400     bmdDeckLinkFrameMetadataCintelFilmType                       = 'cfty',	// Current film type
401     bmdDeckLinkFrameMetadataCintelFilmGauge                      = 'cfga',	// Current film gauge
402     bmdDeckLinkFrameMetadataCintelKeykodeLow                     = 'ckkl',	// Raw keykode value - low 64 bits
403     bmdDeckLinkFrameMetadataCintelKeykodeHigh                    = 'ckkh',	// Raw keykode value - high 64 bits
404     bmdDeckLinkFrameMetadataCintelTile1Size                      = 'ct1s',	// Size in bytes of compressed raw tile 1
405     bmdDeckLinkFrameMetadataCintelTile2Size                      = 'ct2s',	// Size in bytes of compressed raw tile 2
406     bmdDeckLinkFrameMetadataCintelTile3Size                      = 'ct3s',	// Size in bytes of compressed raw tile 3
407     bmdDeckLinkFrameMetadataCintelTile4Size                      = 'ct4s',	// Size in bytes of compressed raw tile 4
408     bmdDeckLinkFrameMetadataCintelImageWidth                     = 'IWPx',	// Width in pixels of image
409     bmdDeckLinkFrameMetadataCintelImageHeight                    = 'IHPx',	// Height in pixels of image
410     bmdDeckLinkFrameMetadataCintelLinearMaskingRedInRed          = 'mrir',	// Red in red linear masking parameter
411     bmdDeckLinkFrameMetadataCintelLinearMaskingGreenInRed        = 'mgir',	// Green in red linear masking parameter
412     bmdDeckLinkFrameMetadataCintelLinearMaskingBlueInRed         = 'mbir',	// Blue in red linear masking parameter
413     bmdDeckLinkFrameMetadataCintelLinearMaskingRedInGreen        = 'mrig',	// Red in green linear masking parameter
414     bmdDeckLinkFrameMetadataCintelLinearMaskingGreenInGreen      = 'mgig',	// Green in green linear masking parameter
415     bmdDeckLinkFrameMetadataCintelLinearMaskingBlueInGreen       = 'mbig',	// Blue in green linear masking parameter
416     bmdDeckLinkFrameMetadataCintelLinearMaskingRedInBlue         = 'mrib',	// Red in blue linear masking parameter
417     bmdDeckLinkFrameMetadataCintelLinearMaskingGreenInBlue       = 'mgib',	// Green in blue linear masking parameter
418     bmdDeckLinkFrameMetadataCintelLinearMaskingBlueInBlue        = 'mbib',	// Blue in blue linear masking parameter
419     bmdDeckLinkFrameMetadataCintelLogMaskingRedInRed             = 'mlrr',	// Red in red log masking parameter
420     bmdDeckLinkFrameMetadataCintelLogMaskingGreenInRed           = 'mlgr',	// Green in red log masking parameter
421     bmdDeckLinkFrameMetadataCintelLogMaskingBlueInRed            = 'mlbr',	// Blue in red log masking parameter
422     bmdDeckLinkFrameMetadataCintelLogMaskingRedInGreen           = 'mlrg',	// Red in green log masking parameter
423     bmdDeckLinkFrameMetadataCintelLogMaskingGreenInGreen         = 'mlgg',	// Green in green log masking parameter
424     bmdDeckLinkFrameMetadataCintelLogMaskingBlueInGreen          = 'mlbg',	// Blue in green log masking parameter
425     bmdDeckLinkFrameMetadataCintelLogMaskingRedInBlue            = 'mlrb',	// Red in blue log masking parameter
426     bmdDeckLinkFrameMetadataCintelLogMaskingGreenInBlue          = 'mlgb',	// Green in blue log masking parameter
427     bmdDeckLinkFrameMetadataCintelLogMaskingBlueInBlue           = 'mlbb',	// Blue in blue log masking parameter
428     bmdDeckLinkFrameMetadataCintelFilmFrameRate                  = 'cffr',	// Film frame rate
429     bmdDeckLinkFrameMetadataHDRDisplayPrimariesRedX              = 'hdrx',	// Red display primaries in range 0.0 - 1.0
430     bmdDeckLinkFrameMetadataHDRDisplayPrimariesRedY              = 'hdry',	// Red display primaries in range 0.0 - 1.0
431     bmdDeckLinkFrameMetadataHDRDisplayPrimariesGreenX            = 'hdgx',	// Green display primaries in range 0.0 - 1.0
432     bmdDeckLinkFrameMetadataHDRDisplayPrimariesGreenY            = 'hdgy',	// Green display primaries in range 0.0 - 1.0
433     bmdDeckLinkFrameMetadataHDRDisplayPrimariesBlueX             = 'hdbx',	// Blue display primaries in range 0.0 - 1.0
434     bmdDeckLinkFrameMetadataHDRDisplayPrimariesBlueY             = 'hdby',	// Blue display primaries in range 0.0 - 1.0
435     bmdDeckLinkFrameMetadataHDRWhitePointX                       = 'hdwx',	// White point in range 0.0 - 1.0
436     bmdDeckLinkFrameMetadataHDRWhitePointY                       = 'hdwy',	// White point in range 0.0 - 1.0
437     bmdDeckLinkFrameMetadataHDRMaxDisplayMasteringLuminance      = 'hdml',	// Max display mastering luminance in range 1 cd/m2 - 65535 cd/m2
438     bmdDeckLinkFrameMetadataHDRMinDisplayMasteringLuminance      = 'hmil',	// Min display mastering luminance in range 0.0001 cd/m2 - 6.5535 cd/m2
439     bmdDeckLinkFrameMetadataHDRMaximumContentLightLevel          = 'mcll',	// Maximum Content Light Level in range 1 cd/m2 - 65535 cd/m2
440     bmdDeckLinkFrameMetadataHDRMaximumFrameAverageLightLevel     = 'fall',	// Maximum Frame Average Light Level in range 1 cd/m2 - 65535 cd/m2
441     bmdDeckLinkFrameMetadataCintelOffsetToApplyHorizontal        = 'otah',	// Horizontal offset (pixels) to be applied to image
442     bmdDeckLinkFrameMetadataCintelOffsetToApplyVertical          = 'otav',	// Vertical offset (pixels) to be applied to image
443     bmdDeckLinkFrameMetadataCintelGainRed                        = 'LfRd',	// Red gain parameter to apply after log
444     bmdDeckLinkFrameMetadataCintelGainGreen                      = 'LfGr',	// Green gain parameter to apply after log
445     bmdDeckLinkFrameMetadataCintelGainBlue                       = 'LfBl',	// Blue gain parameter to apply after log
446     bmdDeckLinkFrameMetadataCintelLiftRed                        = 'GnRd',	// Red lift parameter to apply after log and gain
447     bmdDeckLinkFrameMetadataCintelLiftGreen                      = 'GnGr',	// Green lift parameter to apply after log and gain
448     bmdDeckLinkFrameMetadataCintelLiftBlue                       = 'GnBl',	// Blue lift parameter to apply after log and gain
449     bmdDeckLinkFrameMetadataCintelHDRGainRed                     = 'HGRd',	// Red gain parameter to apply to linear data for HDR Combination
450     bmdDeckLinkFrameMetadataCintelHDRGainGreen                   = 'HGGr',	// Green gain parameter to apply to linear data for HDR Combination
451     bmdDeckLinkFrameMetadataCintelHDRGainBlue                    = 'HGBl'	// Blue gain parameter to apply to linear data for HDR Combination
452 };
453 
454 /* Enum BMDProfileID - Identifies a profile */
455 
456 typedef uint32_t BMDProfileID;
457 enum _BMDProfileID {
458     bmdProfileOneSubDeviceFullDuplex                             = '1dfd',
459     bmdProfileOneSubDeviceHalfDuplex                             = '1dhd',
460     bmdProfileTwoSubDevicesFullDuplex                            = '2dfd',
461     bmdProfileTwoSubDevicesHalfDuplex                            = '2dhd',
462     bmdProfileFourSubDevicesHalfDuplex                           = '4dhd'
463 };
464 
465 /* Enum BMDHDMITimecodePacking - Packing form of timecode on HDMI */
466 
467 typedef uint32_t BMDHDMITimecodePacking;
468 enum _BMDHDMITimecodePacking {
469     bmdHDMITimecodePackingIEEEOUI000085                          = 0x00008500,
470     bmdHDMITimecodePackingIEEEOUI080046                          = 0x08004601,
471     bmdHDMITimecodePackingIEEEOUI5CF9F0                          = 0x5CF9F003
472 };
473 
474 /* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */
475 
476 typedef uint32_t BMDDeckLinkAttributeID;
477 enum _BMDDeckLinkAttributeID {
478 
479     /* Flags */
480 
481     BMDDeckLinkSupportsInternalKeying                            = 'keyi',
482     BMDDeckLinkSupportsExternalKeying                            = 'keye',
483     BMDDeckLinkSupportsInputFormatDetection                      = 'infd',
484     BMDDeckLinkHasReferenceInput                                 = 'hrin',
485     BMDDeckLinkHasSerialPort                                     = 'hspt',
486     BMDDeckLinkHasAnalogVideoOutputGain                          = 'avog',
487     BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain               = 'ovog',
488     BMDDeckLinkHasVideoInputAntiAliasingFilter                   = 'aafl',
489     BMDDeckLinkHasBypass                                         = 'byps',
490     BMDDeckLinkSupportsClockTimingAdjustment                     = 'ctad',
491     BMDDeckLinkSupportsFullFrameReferenceInputTimingOffset       = 'frin',
492     BMDDeckLinkSupportsSMPTELevelAOutput                         = 'lvla',
493     BMDDeckLinkSupportsDualLinkSDI                               = 'sdls',
494     BMDDeckLinkSupportsQuadLinkSDI                               = 'sqls',
495     BMDDeckLinkSupportsIdleOutput                                = 'idou',
496     BMDDeckLinkVANCRequires10BitYUVVideoFrames                   = 'vioY',	// Legacy product requires v210 active picture for IDeckLinkVideoFrameAncillaryPackets or 10-bit VANC
497     BMDDeckLinkHasLTCTimecodeInput                               = 'hltc',
498     BMDDeckLinkSupportsHDRMetadata                               = 'hdrm',
499     BMDDeckLinkSupportsColorspaceMetadata                        = 'cmet',
500     BMDDeckLinkSupportsHDMITimecode                              = 'htim',
501     BMDDeckLinkSupportsHighFrameRateTimecode                     = 'HFRT',
502     BMDDeckLinkSupportsSynchronizeToCaptureGroup                 = 'stcg',
503     BMDDeckLinkSupportsSynchronizeToPlaybackGroup                = 'stpg',
504 
505     /* Integers */
506 
507     BMDDeckLinkMaximumAudioChannels                              = 'mach',
508     BMDDeckLinkMaximumAnalogAudioInputChannels                   = 'iach',
509     BMDDeckLinkMaximumAnalogAudioOutputChannels                  = 'aach',
510     BMDDeckLinkNumberOfSubDevices                                = 'nsbd',
511     BMDDeckLinkSubDeviceIndex                                    = 'subi',
512     BMDDeckLinkPersistentID                                      = 'peid',
513     BMDDeckLinkDeviceGroupID                                     = 'dgid',
514     BMDDeckLinkTopologicalID                                     = 'toid',
515     BMDDeckLinkVideoOutputConnections                            = 'vocn',	// Returns a BMDVideoConnection bit field
516     BMDDeckLinkVideoInputConnections                             = 'vicn',	// Returns a BMDVideoConnection bit field
517     BMDDeckLinkAudioOutputConnections                            = 'aocn',	// Returns a BMDAudioConnection bit field
518     BMDDeckLinkAudioInputConnections                             = 'aicn',	// Returns a BMDAudioConnection bit field
519     BMDDeckLinkVideoIOSupport                                    = 'vios',	// Returns a BMDVideoIOSupport bit field
520     BMDDeckLinkDeckControlConnections                            = 'dccn',	// Returns a BMDDeckControlConnection bit field
521     BMDDeckLinkDeviceInterface                                   = 'dbus',	// Returns a BMDDeviceInterface
522     BMDDeckLinkAudioInputRCAChannelCount                         = 'airc',
523     BMDDeckLinkAudioInputXLRChannelCount                         = 'aixc',
524     BMDDeckLinkAudioOutputRCAChannelCount                        = 'aorc',
525     BMDDeckLinkAudioOutputXLRChannelCount                        = 'aoxc',
526     BMDDeckLinkProfileID                                         = 'prid',	// Returns a BMDProfileID
527     BMDDeckLinkDuplex                                            = 'dupx',
528 
529     /* Floats */
530 
531     BMDDeckLinkVideoInputGainMinimum                             = 'vigm',
532     BMDDeckLinkVideoInputGainMaximum                             = 'vigx',
533     BMDDeckLinkVideoOutputGainMinimum                            = 'vogm',
534     BMDDeckLinkVideoOutputGainMaximum                            = 'vogx',
535     BMDDeckLinkMicrophoneInputGainMinimum                        = 'migm',
536     BMDDeckLinkMicrophoneInputGainMaximum                        = 'migx',
537 
538     /* Strings */
539 
540     BMDDeckLinkSerialPortDeviceName                              = 'slpn',
541     BMDDeckLinkVendorName                                        = 'vndr',
542     BMDDeckLinkDisplayName                                       = 'dspn',
543     BMDDeckLinkModelName                                         = 'mdln',
544     BMDDeckLinkDeviceHandle                                      = 'devh'
545 };
546 
547 /* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */
548 
549 typedef uint32_t BMDDeckLinkAPIInformationID;
550 enum _BMDDeckLinkAPIInformationID {
551     BMDDeckLinkAPIVersion                                        = 'vers'
552 };
553 
554 /* Enum BMDDeckLinkStatusID - DeckLink Status ID */
555 
556 typedef uint32_t BMDDeckLinkStatusID;
557 enum _BMDDeckLinkStatusID {
558 
559     /* Integers */
560 
561     bmdDeckLinkStatusDetectedVideoInputMode                      = 'dvim',
562     bmdDeckLinkStatusDetectedVideoInputFlags                     = 'dvif',
563     bmdDeckLinkStatusCurrentVideoInputMode                       = 'cvim',
564     bmdDeckLinkStatusCurrentVideoInputPixelFormat                = 'cvip',
565     bmdDeckLinkStatusCurrentVideoInputFlags                      = 'cvif',
566     bmdDeckLinkStatusCurrentVideoOutputMode                      = 'cvom',
567     bmdDeckLinkStatusCurrentVideoOutputFlags                     = 'cvof',
568     bmdDeckLinkStatusPCIExpressLinkWidth                         = 'pwid',
569     bmdDeckLinkStatusPCIExpressLinkSpeed                         = 'plnk',
570     bmdDeckLinkStatusLastVideoOutputPixelFormat                  = 'opix',
571     bmdDeckLinkStatusReferenceSignalMode                         = 'refm',
572     bmdDeckLinkStatusReferenceSignalFlags                        = 'reff',
573     bmdDeckLinkStatusBusy                                        = 'busy',
574     bmdDeckLinkStatusInterchangeablePanelType                    = 'icpt',
575     bmdDeckLinkStatusDeviceTemperature                           = 'dtmp',
576 
577     /* Flags */
578 
579     bmdDeckLinkStatusVideoInputSignalLocked                      = 'visl',
580     bmdDeckLinkStatusReferenceSignalLocked                       = 'refl',
581     bmdDeckLinkStatusReceivedEDID                                = 'edid'
582 };
583 
584 /* Enum BMDDeckLinkVideoStatusFlags -  */
585 
586 typedef uint32_t BMDDeckLinkVideoStatusFlags;
587 enum _BMDDeckLinkVideoStatusFlags {
588     bmdDeckLinkVideoStatusPsF                                    = 1 << 0,
589     bmdDeckLinkVideoStatusDualStream3D                           = 1 << 1
590 };
591 
592 /* Enum BMDDuplexMode - Duplex of the device */
593 
594 typedef uint32_t BMDDuplexMode;
595 enum _BMDDuplexMode {
596     bmdDuplexFull                                                = 'dxfu',
597     bmdDuplexHalf                                                = 'dxha',
598     bmdDuplexSimplex                                             = 'dxsp',
599     bmdDuplexInactive                                            = 'dxin'
600 };
601 
602 /* Enum BMDPanelType - The type of interchangeable panel */
603 
604 typedef uint32_t BMDPanelType;
605 enum _BMDPanelType {
606     bmdPanelNotDetected                                          = 'npnl',
607     bmdPanelTeranexMiniSmartPanel                                = 'tmsm'
608 };
609 
610 /* Enum BMDDeviceBusyState - Current device busy state */
611 
612 typedef uint32_t BMDDeviceBusyState;
613 enum _BMDDeviceBusyState {
614     bmdDeviceCaptureBusy                                         = 1 << 0,
615     bmdDevicePlaybackBusy                                        = 1 << 1,
616     bmdDeviceSerialPortBusy                                      = 1 << 2
617 };
618 
619 /* Enum BMDVideoIOSupport - Device video input/output support */
620 
621 typedef uint32_t BMDVideoIOSupport;
622 enum _BMDVideoIOSupport {
623     bmdDeviceSupportsCapture                                     = 1 << 0,
624     bmdDeviceSupportsPlayback                                    = 1 << 1
625 };
626 
627 /* Enum BMD3DPreviewFormat - Linked Frame preview format */
628 
629 typedef uint32_t BMD3DPreviewFormat;
630 enum _BMD3DPreviewFormat {
631     bmd3DPreviewFormatDefault                                    = 'defa',
632     bmd3DPreviewFormatLeftOnly                                   = 'left',
633     bmd3DPreviewFormatRightOnly                                  = 'righ',
634     bmd3DPreviewFormatSideBySide                                 = 'side',
635     bmd3DPreviewFormatTopBottom                                  = 'topb'
636 };
637 
638 /* Enum BMDNotifications - Events that can be subscribed through IDeckLinkNotification */
639 
640 typedef uint32_t BMDNotifications;
641 enum _BMDNotifications {
642     bmdPreferencesChanged                                        = 'pref',
643     bmdStatusChanged                                             = 'stat'
644 };
645 
646 #if defined(__cplusplus)
647 
648 // Forward Declarations
649 
650 class IDeckLinkVideoOutputCallback;
651 class IDeckLinkInputCallback;
652 class IDeckLinkEncoderInputCallback;
653 class IDeckLinkMemoryAllocator;
654 class IDeckLinkAudioOutputCallback;
655 class IDeckLinkIterator;
656 class IDeckLinkAPIInformation;
657 class IDeckLinkOutput;
658 class IDeckLinkInput;
659 class IDeckLinkHDMIInputEDID;
660 class IDeckLinkEncoderInput;
661 class IDeckLinkVideoFrame;
662 class IDeckLinkMutableVideoFrame;
663 class IDeckLinkVideoFrame3DExtensions;
664 class IDeckLinkVideoFrameMetadataExtensions;
665 class IDeckLinkVideoInputFrame;
666 class IDeckLinkAncillaryPacket;
667 class IDeckLinkAncillaryPacketIterator;
668 class IDeckLinkVideoFrameAncillaryPackets;
669 class IDeckLinkVideoFrameAncillary;
670 class IDeckLinkEncoderPacket;
671 class IDeckLinkEncoderVideoPacket;
672 class IDeckLinkEncoderAudioPacket;
673 class IDeckLinkH265NALPacket;
674 class IDeckLinkAudioInputPacket;
675 class IDeckLinkScreenPreviewCallback;
676 class IDeckLinkCocoaScreenPreviewCallback;
677 class IDeckLinkGLScreenPreviewHelper;
678 class IDeckLinkNotificationCallback;
679 class IDeckLinkNotification;
680 class IDeckLinkProfileAttributes;
681 class IDeckLinkProfileIterator;
682 class IDeckLinkProfile;
683 class IDeckLinkProfileCallback;
684 class IDeckLinkProfileManager;
685 class IDeckLinkStatus;
686 class IDeckLinkKeyer;
687 class IDeckLinkVideoConversion;
688 class IDeckLinkDeviceNotificationCallback;
689 class IDeckLinkDiscovery;
690 
691 /* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */
692 
693 class BMD_PUBLIC IDeckLinkVideoOutputCallback : public IUnknown
694 {
695 public:
696     virtual HRESULT ScheduledFrameCompleted (/* in */ IDeckLinkVideoFrame *completedFrame, /* in */ BMDOutputFrameCompletionResult result) = 0;
697     virtual HRESULT ScheduledPlaybackHasStopped (void) = 0;
698 
699 protected:
~IDeckLinkVideoOutputCallback()700     virtual ~IDeckLinkVideoOutputCallback () {} // call Release method to drop reference count
701 };
702 
703 /* Interface IDeckLinkInputCallback - Frame arrival callback. */
704 
705 class BMD_PUBLIC IDeckLinkInputCallback : public IUnknown
706 {
707 public:
708     virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
709     virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket) = 0;
710 
711 protected:
~IDeckLinkInputCallback()712     virtual ~IDeckLinkInputCallback () {} // call Release method to drop reference count
713 };
714 
715 /* Interface IDeckLinkEncoderInputCallback - Frame arrival callback. */
716 
717 class BMD_PUBLIC IDeckLinkEncoderInputCallback : public IUnknown
718 {
719 public:
720     virtual HRESULT VideoInputSignalChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
721     virtual HRESULT VideoPacketArrived (/* in */ IDeckLinkEncoderVideoPacket* videoPacket) = 0;
722     virtual HRESULT AudioPacketArrived (/* in */ IDeckLinkEncoderAudioPacket* audioPacket) = 0;
723 
724 protected:
~IDeckLinkEncoderInputCallback()725     virtual ~IDeckLinkEncoderInputCallback () {} // call Release method to drop reference count
726 };
727 
728 /* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */
729 
730 class BMD_PUBLIC IDeckLinkMemoryAllocator : public IUnknown
731 {
732 public:
733     virtual HRESULT AllocateBuffer (/* in */ uint32_t bufferSize, /* out */ void **allocatedBuffer) = 0;
734     virtual HRESULT ReleaseBuffer (/* in */ void *buffer) = 0;
735 
736     virtual HRESULT Commit (void) = 0;
737     virtual HRESULT Decommit (void) = 0;
738 };
739 
740 /* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */
741 
742 class BMD_PUBLIC IDeckLinkAudioOutputCallback : public IUnknown
743 {
744 public:
745     virtual HRESULT RenderAudioSamples (/* in */ bool preroll) = 0;
746 };
747 
748 /* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */
749 
750 class BMD_PUBLIC IDeckLinkIterator : public IUnknown
751 {
752 public:
753     virtual HRESULT Next (/* out */ IDeckLink **deckLinkInstance) = 0;
754 };
755 
756 /* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */
757 
758 class BMD_PUBLIC IDeckLinkAPIInformation : public IUnknown
759 {
760 public:
761     virtual HRESULT GetFlag (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ bool *value) = 0;
762     virtual HRESULT GetInt (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ int64_t *value) = 0;
763     virtual HRESULT GetFloat (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ double *value) = 0;
764     virtual HRESULT GetString (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ CFStringRef *value) = 0;
765 
766 protected:
~IDeckLinkAPIInformation()767     virtual ~IDeckLinkAPIInformation () {} // call Release method to drop reference count
768 };
769 
770 /* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
771 
772 class BMD_PUBLIC IDeckLinkOutput : public IUnknown
773 {
774 public:
775     virtual HRESULT DoesSupportVideoMode (/* in */ BMDVideoConnection connection /* If a value of 0 is specified, the caller does not care about the connection */, /* in */ BMDDisplayMode requestedMode, /* in */ BMDPixelFormat requestedPixelFormat, /* in */ BMDSupportedVideoModeFlags flags, /* out */ BMDDisplayMode *actualMode, /* out */ bool *supported) = 0;
776     virtual HRESULT GetDisplayMode (/* in */ BMDDisplayMode displayMode, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
777     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
778 
779     virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
780 
781     /* Video Output */
782 
783     virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0;
784     virtual HRESULT DisableVideoOutput (void) = 0;
785 
786     virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
787     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;
788     virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0; // Use of IDeckLinkVideoFrameAncillaryPackets is preferred
789 
790     virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
791     virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0;
792     virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0;
793     virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0;
794 
795     /* Audio Output */
796 
797     virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0;
798     virtual HRESULT DisableAudioOutput (void) = 0;
799 
800     virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0;
801 
802     virtual HRESULT BeginAudioPreroll (void) = 0;
803     virtual HRESULT EndAudioPreroll (void) = 0;
804     virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0;
805 
806     virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0;
807     virtual HRESULT FlushBufferedAudioSamples (void) = 0;
808 
809     virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0;
810 
811     /* Output Control */
812 
813     virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0;
814     virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0;
815     virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0;
816     virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0;
817     virtual HRESULT GetReferenceStatus (/* out */ BMDReferenceStatus *referenceStatus) = 0;
818 
819     /* Hardware Timing */
820 
821     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
822     virtual HRESULT GetFrameCompletionReferenceTimestamp (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *frameCompletionTimestamp) = 0;
823 
824 protected:
~IDeckLinkOutput()825     virtual ~IDeckLinkOutput () {} // call Release method to drop reference count
826 };
827 
828 /* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
829 
830 class BMD_PUBLIC IDeckLinkInput : public IUnknown
831 {
832 public:
833     virtual HRESULT DoesSupportVideoMode (/* in */ BMDVideoConnection connection /* If a value of 0 is specified, the caller does not care about the connection */, /* in */ BMDDisplayMode requestedMode, /* in */ BMDPixelFormat requestedPixelFormat, /* in */ BMDSupportedVideoModeFlags flags, /* out */ bool *supported) = 0;
834     virtual HRESULT GetDisplayMode (/* in */ BMDDisplayMode displayMode, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
835     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
836 
837     virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
838 
839     /* Video Input */
840 
841     virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
842     virtual HRESULT DisableVideoInput (void) = 0;
843     virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0;
844     virtual HRESULT SetVideoInputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
845 
846     /* Audio Input */
847 
848     virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
849     virtual HRESULT DisableAudioInput (void) = 0;
850     virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
851 
852     /* Input Control */
853 
854     virtual HRESULT StartStreams (void) = 0;
855     virtual HRESULT StopStreams (void) = 0;
856     virtual HRESULT PauseStreams (void) = 0;
857     virtual HRESULT FlushStreams (void) = 0;
858     virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback *theCallback) = 0;
859 
860     /* Hardware Timing */
861 
862     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
863 
864 protected:
~IDeckLinkInput()865     virtual ~IDeckLinkInput () {} // call Release method to drop reference count
866 };
867 
868 /* Interface IDeckLinkHDMIInputEDID - Created by QueryInterface from IDeckLink. Releasing all references will restore EDID to default */
869 
870 class BMD_PUBLIC IDeckLinkHDMIInputEDID : public IUnknown
871 {
872 public:
873     virtual HRESULT SetInt (/* in */ BMDDeckLinkHDMIInputEDIDID cfgID, /* in */ int64_t value) = 0;
874     virtual HRESULT GetInt (/* in */ BMDDeckLinkHDMIInputEDIDID cfgID, /* out */ int64_t *value) = 0;
875     virtual HRESULT WriteToEDID (void) = 0;
876 
877 protected:
~IDeckLinkHDMIInputEDID()878     virtual ~IDeckLinkHDMIInputEDID () {} // call Release method to drop reference count
879 };
880 
881 /* Interface IDeckLinkEncoderInput - Created by QueryInterface from IDeckLink. */
882 
883 class BMD_PUBLIC IDeckLinkEncoderInput : public IUnknown
884 {
885 public:
886     virtual HRESULT DoesSupportVideoMode (/* in */ BMDVideoConnection connection /* If a value of 0 is specified, the caller does not care about the connection */, /* in */ BMDDisplayMode requestedMode, /* in */ BMDPixelFormat requestedCodec, /* in */ uint32_t requestedCodecProfile, /* in */ BMDSupportedVideoModeFlags flags, /* out */ bool *supported) = 0;
887     virtual HRESULT GetDisplayMode (/* in */ BMDDisplayMode displayMode, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
888     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
889 
890     /* Video Input */
891 
892     virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
893     virtual HRESULT DisableVideoInput (void) = 0;
894     virtual HRESULT GetAvailablePacketsCount (/* out */ uint32_t *availablePacketsCount) = 0;
895     virtual HRESULT SetMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
896 
897     /* Audio Input */
898 
899     virtual HRESULT EnableAudioInput (/* in */ BMDAudioFormat audioFormat, /* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
900     virtual HRESULT DisableAudioInput (void) = 0;
901     virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
902 
903     /* Input Control */
904 
905     virtual HRESULT StartStreams (void) = 0;
906     virtual HRESULT StopStreams (void) = 0;
907     virtual HRESULT PauseStreams (void) = 0;
908     virtual HRESULT FlushStreams (void) = 0;
909     virtual HRESULT SetCallback (/* in */ IDeckLinkEncoderInputCallback *theCallback) = 0;
910 
911     /* Hardware Timing */
912 
913     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
914 
915 protected:
~IDeckLinkEncoderInput()916     virtual ~IDeckLinkEncoderInput () {} // call Release method to drop reference count
917 };
918 
919 /* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */
920 
921 class BMD_PUBLIC IDeckLinkVideoFrame : public IUnknown
922 {
923 public:
924     virtual long GetWidth (void) = 0;
925     virtual long GetHeight (void) = 0;
926     virtual long GetRowBytes (void) = 0;
927     virtual BMDPixelFormat GetPixelFormat (void) = 0;
928     virtual BMDFrameFlags GetFlags (void) = 0;
929     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
930 
931     virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0;
932     virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) = 0; // Use of IDeckLinkVideoFrameAncillaryPackets is preferred
933 
934 protected:
~IDeckLinkVideoFrame()935     virtual ~IDeckLinkVideoFrame () {} // call Release method to drop reference count
936 };
937 
938 /* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */
939 
940 class BMD_PUBLIC IDeckLinkMutableVideoFrame : public IDeckLinkVideoFrame
941 {
942 public:
943     virtual HRESULT SetFlags (/* in */ BMDFrameFlags newFlags) = 0;
944 
945     virtual HRESULT SetTimecode (/* in */ BMDTimecodeFormat format, /* in */ IDeckLinkTimecode *timecode) = 0;
946     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;
947     virtual HRESULT SetAncillaryData (/* in */ IDeckLinkVideoFrameAncillary *ancillary) = 0;
948     virtual HRESULT SetTimecodeUserBits (/* in */ BMDTimecodeFormat format, /* in */ BMDTimecodeUserBits userBits) = 0;
949 
950 protected:
~IDeckLinkMutableVideoFrame()951     virtual ~IDeckLinkMutableVideoFrame () {} // call Release method to drop reference count
952 };
953 
954 /* Interface IDeckLinkVideoFrame3DExtensions - Optional interface implemented on IDeckLinkVideoFrame to support 3D frames */
955 
956 class BMD_PUBLIC IDeckLinkVideoFrame3DExtensions : public IUnknown
957 {
958 public:
959     virtual BMDVideo3DPackingFormat Get3DPackingFormat (void) = 0;
960     virtual HRESULT GetFrameForRightEye (/* out */ IDeckLinkVideoFrame* *rightEyeFrame) = 0;
961 
962 protected:
~IDeckLinkVideoFrame3DExtensions()963     virtual ~IDeckLinkVideoFrame3DExtensions () {} // call Release method to drop reference count
964 };
965 
966 /* Interface IDeckLinkVideoFrameMetadataExtensions - Optional interface implemented on IDeckLinkVideoFrame to support frame metadata such as HDMI HDR information */
967 
968 class BMD_PUBLIC IDeckLinkVideoFrameMetadataExtensions : public IUnknown
969 {
970 public:
971     virtual HRESULT GetInt (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ int64_t *value) = 0;
972     virtual HRESULT GetFloat (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ double *value) = 0;
973     virtual HRESULT GetFlag (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ bool* value) = 0;
974     virtual HRESULT GetString (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ CFStringRef *value) = 0;
975 
976 protected:
~IDeckLinkVideoFrameMetadataExtensions()977     virtual ~IDeckLinkVideoFrameMetadataExtensions () {} // call Release method to drop reference count
978 };
979 
980 /* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
981 
982 class BMD_PUBLIC IDeckLinkVideoInputFrame : public IDeckLinkVideoFrame
983 {
984 public:
985     virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, /* in */ BMDTimeScale timeScale) = 0;
986     virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
987 
988 protected:
~IDeckLinkVideoInputFrame()989     virtual ~IDeckLinkVideoInputFrame () {} // call Release method to drop reference count
990 };
991 
992 /* Interface IDeckLinkAncillaryPacket - On output, user needs to implement this interface */
993 
994 class BMD_PUBLIC IDeckLinkAncillaryPacket : public IUnknown
995 {
996 public:
997 
998     virtual HRESULT GetBytes (/* in */ BMDAncillaryPacketFormat format /* For output, only one format need be offered */, /* out */ const void **data /* Optional */, /* out */ uint32_t *size /* Optional */) = 0;
999     virtual uint8_t GetDID (void) = 0;
1000     virtual uint8_t GetSDID (void) = 0;
1001     virtual uint32_t GetLineNumber (void) = 0; // On output, zero is auto
1002     virtual uint8_t GetDataStreamIndex (void) = 0; // Usually zero. Can only be 1 if non-SD and the first data stream is completely full
1003 
1004 protected:
~IDeckLinkAncillaryPacket()1005     virtual ~IDeckLinkAncillaryPacket () {} // call Release method to drop reference count
1006 };
1007 
1008 /* Interface IDeckLinkAncillaryPacketIterator - Enumerates ancillary packets */
1009 
1010 class BMD_PUBLIC IDeckLinkAncillaryPacketIterator : public IUnknown
1011 {
1012 public:
1013     virtual HRESULT Next (/* out */ IDeckLinkAncillaryPacket **packet) = 0;
1014 
1015 protected:
~IDeckLinkAncillaryPacketIterator()1016     virtual ~IDeckLinkAncillaryPacketIterator () {} // call Release method to drop reference count
1017 };
1018 
1019 /* Interface IDeckLinkVideoFrameAncillaryPackets - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
1020 
1021 class BMD_PUBLIC IDeckLinkVideoFrameAncillaryPackets : public IUnknown
1022 {
1023 public:
1024 
1025     virtual HRESULT GetPacketIterator (/* out */ IDeckLinkAncillaryPacketIterator **iterator) = 0;
1026     virtual HRESULT GetFirstPacketByID (/* in */ uint8_t DID, /* in */ uint8_t SDID, /* out */ IDeckLinkAncillaryPacket **packet) = 0;
1027     virtual HRESULT AttachPacket (/* in */ IDeckLinkAncillaryPacket *packet) = 0; // Implement IDeckLinkAncillaryPacket to output your own
1028     virtual HRESULT DetachPacket (/* in */ IDeckLinkAncillaryPacket *packet) = 0;
1029     virtual HRESULT DetachAllPackets (void) = 0;
1030 
1031 protected:
~IDeckLinkVideoFrameAncillaryPackets()1032     virtual ~IDeckLinkVideoFrameAncillaryPackets () {} // call Release method to drop reference count
1033 };
1034 
1035 /* Interface IDeckLinkVideoFrameAncillary - Use of IDeckLinkVideoFrameAncillaryPackets is preferred. Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
1036 
1037 class BMD_PUBLIC IDeckLinkVideoFrameAncillary : public IUnknown
1038 {
1039 public:
1040 
1041     virtual HRESULT GetBufferForVerticalBlankingLine (/* in */ uint32_t lineNumber, /* out */ void **buffer) = 0; // Pixels/rowbytes is same as display mode, except for above HD where it's 1920 pixels for UHD modes and 2048 pixels for DCI modes
1042     virtual BMDPixelFormat GetPixelFormat (void) = 0;
1043     virtual BMDDisplayMode GetDisplayMode (void) = 0;
1044 
1045 protected:
~IDeckLinkVideoFrameAncillary()1046     virtual ~IDeckLinkVideoFrameAncillary () {} // call Release method to drop reference count
1047 };
1048 
1049 /* Interface IDeckLinkEncoderPacket - Interface to encapsulate an encoded packet. */
1050 
1051 class BMD_PUBLIC IDeckLinkEncoderPacket : public IUnknown
1052 {
1053 public:
1054     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
1055     virtual long GetSize (void) = 0;
1056     virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* in */ BMDTimeScale timeScale) = 0;
1057     virtual BMDPacketType GetPacketType (void) = 0;
1058 
1059 protected:
~IDeckLinkEncoderPacket()1060     virtual ~IDeckLinkEncoderPacket () {} // call Release method to drop reference count
1061 };
1062 
1063 /* Interface IDeckLinkEncoderVideoPacket - Provided by the IDeckLinkEncoderInput video packet arrival callback. */
1064 
1065 class BMD_PUBLIC IDeckLinkEncoderVideoPacket : public IDeckLinkEncoderPacket
1066 {
1067 public:
1068     virtual BMDPixelFormat GetPixelFormat (void) = 0;
1069     virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
1070 
1071     virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0;
1072 
1073 protected:
~IDeckLinkEncoderVideoPacket()1074     virtual ~IDeckLinkEncoderVideoPacket () {} // call Release method to drop reference count
1075 };
1076 
1077 /* Interface IDeckLinkEncoderAudioPacket - Provided by the IDeckLinkEncoderInput audio packet arrival callback. */
1078 
1079 class BMD_PUBLIC IDeckLinkEncoderAudioPacket : public IDeckLinkEncoderPacket
1080 {
1081 public:
1082     virtual BMDAudioFormat GetAudioFormat (void) = 0;
1083 
1084 protected:
~IDeckLinkEncoderAudioPacket()1085     virtual ~IDeckLinkEncoderAudioPacket () {} // call Release method to drop reference count
1086 };
1087 
1088 /* Interface IDeckLinkH265NALPacket - Obtained through QueryInterface() on an IDeckLinkEncoderVideoPacket object */
1089 
1090 class BMD_PUBLIC IDeckLinkH265NALPacket : public IDeckLinkEncoderVideoPacket
1091 {
1092 public:
1093     virtual HRESULT GetUnitType (/* out */ uint8_t *unitType) = 0;
1094     virtual HRESULT GetBytesNoPrefix (/* out */ void **buffer) = 0;
1095     virtual long GetSizeNoPrefix (void) = 0;
1096 
1097 protected:
~IDeckLinkH265NALPacket()1098     virtual ~IDeckLinkH265NALPacket () {} // call Release method to drop reference count
1099 };
1100 
1101 /* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */
1102 
1103 class BMD_PUBLIC IDeckLinkAudioInputPacket : public IUnknown
1104 {
1105 public:
1106     virtual long GetSampleFrameCount (void) = 0;
1107     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
1108     virtual HRESULT GetPacketTime (/* out */ BMDTimeValue *packetTime, /* in */ BMDTimeScale timeScale) = 0;
1109 
1110 protected:
~IDeckLinkAudioInputPacket()1111     virtual ~IDeckLinkAudioInputPacket () {} // call Release method to drop reference count
1112 };
1113 
1114 /* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */
1115 
1116 class BMD_PUBLIC IDeckLinkScreenPreviewCallback : public IUnknown
1117 {
1118 public:
1119     virtual HRESULT DrawFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
1120 
1121 protected:
~IDeckLinkScreenPreviewCallback()1122     virtual ~IDeckLinkScreenPreviewCallback () {} // call Release method to drop reference count
1123 };
1124 
1125 /* Interface IDeckLinkCocoaScreenPreviewCallback - Screen preview callback for Cocoa-based applications */
1126 
1127 class BMD_PUBLIC IDeckLinkCocoaScreenPreviewCallback : public IDeckLinkScreenPreviewCallback
1128 {
1129 public:
1130 
1131 protected:
~IDeckLinkCocoaScreenPreviewCallback()1132     virtual ~IDeckLinkCocoaScreenPreviewCallback () {} // call Release method to drop reference count
1133 };
1134 
1135 /* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */
1136 
1137 class BMD_PUBLIC IDeckLinkGLScreenPreviewHelper : public IUnknown
1138 {
1139 public:
1140 
1141     /* Methods must be called with OpenGL context set */
1142 
1143     virtual HRESULT InitializeGL (void) = 0;
1144     virtual HRESULT PaintGL (void) = 0;
1145     virtual HRESULT SetFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
1146     virtual HRESULT Set3DPreviewFormat (/* in */ BMD3DPreviewFormat previewFormat) = 0;
1147 
1148 protected:
~IDeckLinkGLScreenPreviewHelper()1149     virtual ~IDeckLinkGLScreenPreviewHelper () {} // call Release method to drop reference count
1150 };
1151 
1152 /* Interface IDeckLinkNotificationCallback - DeckLink Notification Callback Interface */
1153 
1154 class BMD_PUBLIC IDeckLinkNotificationCallback : public IUnknown
1155 {
1156 public:
1157     virtual HRESULT Notify (/* in */ BMDNotifications topic, /* in */ uint64_t param1, /* in */ uint64_t param2) = 0;
1158 };
1159 
1160 /* Interface IDeckLinkNotification - DeckLink Notification interface */
1161 
1162 class BMD_PUBLIC IDeckLinkNotification : public IUnknown
1163 {
1164 public:
1165     virtual HRESULT Subscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
1166     virtual HRESULT Unsubscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
1167 
1168 protected:
~IDeckLinkNotification()1169     virtual ~IDeckLinkNotification () {} // call Release method to drop reference count
1170 };
1171 
1172 /* Interface IDeckLinkProfileAttributes - Created by QueryInterface from an IDeckLinkProfile, or from IDeckLink. When queried from IDeckLink, interrogates the active profile */
1173 
1174 class BMD_PUBLIC IDeckLinkProfileAttributes : public IUnknown
1175 {
1176 public:
1177     virtual HRESULT GetFlag (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ bool *value) = 0;
1178     virtual HRESULT GetInt (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ int64_t *value) = 0;
1179     virtual HRESULT GetFloat (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ double *value) = 0;
1180     virtual HRESULT GetString (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ CFStringRef *value) = 0;
1181 
1182 protected:
~IDeckLinkProfileAttributes()1183     virtual ~IDeckLinkProfileAttributes () {} // call Release method to drop reference count
1184 };
1185 
1186 /* Interface IDeckLinkProfileIterator - Enumerates IDeckLinkProfile interfaces */
1187 
1188 class BMD_PUBLIC IDeckLinkProfileIterator : public IUnknown
1189 {
1190 public:
1191     virtual HRESULT Next (/* out */ IDeckLinkProfile **profile) = 0;
1192 
1193 protected:
~IDeckLinkProfileIterator()1194     virtual ~IDeckLinkProfileIterator () {} // call Release method to drop reference count
1195 };
1196 
1197 /* Interface IDeckLinkProfile - Represents the active profile when queried from IDeckLink */
1198 
1199 class BMD_PUBLIC IDeckLinkProfile : public IUnknown
1200 {
1201 public:
1202     virtual HRESULT GetDevice (/* out */ IDeckLink **device) = 0; // Device affected when this profile becomes active
1203     virtual HRESULT IsActive (/* out */ bool *isActive) = 0;
1204     virtual HRESULT SetActive (void) = 0; // Activating a profile will also change the profile on all devices enumerated by GetPeers(). Activation is not complete until IDeckLinkProfileCallback::ProfileActivated() is called
1205     virtual HRESULT GetPeers (/* out */ IDeckLinkProfileIterator **profileIterator) = 0; // Profiles of other devices activated with this profile
1206 
1207 protected:
~IDeckLinkProfile()1208     virtual ~IDeckLinkProfile () {} // call Release method to drop reference count
1209 };
1210 
1211 /* Interface IDeckLinkProfileCallback - Receive notifications about profiles related to this device */
1212 
1213 class BMD_PUBLIC IDeckLinkProfileCallback : public IUnknown
1214 {
1215 public:
1216     virtual HRESULT ProfileChanging (/* in */ IDeckLinkProfile *profileToBeActivated, /* in */ bool streamsWillBeForcedToStop) = 0; // Called before this device changes profile. User has an opportunity for teardown if streamsWillBeForcedToStop
1217     virtual HRESULT ProfileActivated (/* in */ IDeckLinkProfile *activatedProfile) = 0; // Called after this device has been activated with a new profile
1218 
1219 protected:
~IDeckLinkProfileCallback()1220     virtual ~IDeckLinkProfileCallback () {} // call Release method to drop reference count
1221 };
1222 
1223 /* Interface IDeckLinkProfileManager - Created by QueryInterface from IDeckLink when a device has multiple optional profiles */
1224 
1225 class BMD_PUBLIC IDeckLinkProfileManager : public IUnknown
1226 {
1227 public:
1228     virtual HRESULT GetProfiles (/* out */ IDeckLinkProfileIterator **profileIterator) = 0; // All available profiles for this device
1229     virtual HRESULT GetProfile (/* in */ BMDProfileID profileID, /* out */ IDeckLinkProfile **profile) = 0;
1230     virtual HRESULT SetCallback (/* in */ IDeckLinkProfileCallback *callback) = 0;
1231 
1232 protected:
~IDeckLinkProfileManager()1233     virtual ~IDeckLinkProfileManager () {} // call Release method to drop reference count
1234 };
1235 
1236 /* Interface IDeckLinkStatus - DeckLink Status interface */
1237 
1238 class BMD_PUBLIC IDeckLinkStatus : public IUnknown
1239 {
1240 public:
1241     virtual HRESULT GetFlag (/* in */ BMDDeckLinkStatusID statusID, /* out */ bool *value) = 0;
1242     virtual HRESULT GetInt (/* in */ BMDDeckLinkStatusID statusID, /* out */ int64_t *value) = 0;
1243     virtual HRESULT GetFloat (/* in */ BMDDeckLinkStatusID statusID, /* out */ double *value) = 0;
1244     virtual HRESULT GetString (/* in */ BMDDeckLinkStatusID statusID, /* out */ CFStringRef *value) = 0;
1245     virtual HRESULT GetBytes (/* in */ BMDDeckLinkStatusID statusID, /* out */ void *buffer, /* in, out */ uint32_t *bufferSize) = 0;
1246 
1247 protected:
~IDeckLinkStatus()1248     virtual ~IDeckLinkStatus () {} // call Release method to drop reference count
1249 };
1250 
1251 /* Interface IDeckLinkKeyer - DeckLink Keyer interface */
1252 
1253 class BMD_PUBLIC IDeckLinkKeyer : public IUnknown
1254 {
1255 public:
1256     virtual HRESULT Enable (/* in */ bool isExternal) = 0;
1257     virtual HRESULT SetLevel (/* in */ uint8_t level) = 0;
1258     virtual HRESULT RampUp (/* in */ uint32_t numberOfFrames) = 0;
1259     virtual HRESULT RampDown (/* in */ uint32_t numberOfFrames) = 0;
1260     virtual HRESULT Disable (void) = 0;
1261 
1262 protected:
~IDeckLinkKeyer()1263     virtual ~IDeckLinkKeyer () {} // call Release method to drop reference count
1264 };
1265 
1266 /* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */
1267 
1268 class BMD_PUBLIC IDeckLinkVideoConversion : public IUnknown
1269 {
1270 public:
1271     virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ IDeckLinkVideoFrame* dstFrame) = 0;
1272 
1273 protected:
~IDeckLinkVideoConversion()1274     virtual ~IDeckLinkVideoConversion () {} // call Release method to drop reference count
1275 };
1276 
1277 /* Interface IDeckLinkDeviceNotificationCallback - DeckLink device arrival/removal notification callbacks */
1278 
1279 class BMD_PUBLIC IDeckLinkDeviceNotificationCallback : public IUnknown
1280 {
1281 public:
1282     virtual HRESULT DeckLinkDeviceArrived (/* in */ IDeckLink* deckLinkDevice) = 0;
1283     virtual HRESULT DeckLinkDeviceRemoved (/* in */ IDeckLink* deckLinkDevice) = 0;
1284 
1285 protected:
~IDeckLinkDeviceNotificationCallback()1286     virtual ~IDeckLinkDeviceNotificationCallback () {} // call Release method to drop reference count
1287 };
1288 
1289 /* Interface IDeckLinkDiscovery - DeckLink device discovery */
1290 
1291 class BMD_PUBLIC IDeckLinkDiscovery : public IUnknown
1292 {
1293 public:
1294     virtual HRESULT InstallDeviceNotifications (/* in */ IDeckLinkDeviceNotificationCallback* deviceNotificationCallback) = 0;
1295     virtual HRESULT UninstallDeviceNotifications (void) = 0;
1296 
1297 protected:
~IDeckLinkDiscovery()1298     virtual ~IDeckLinkDiscovery () {} // call Release method to drop reference count
1299 };
1300 
1301 /* Functions */
1302 
1303 extern "C" {
1304 
1305     IDeckLinkIterator* BMD_PUBLIC CreateDeckLinkIteratorInstance (void);
1306     IDeckLinkDiscovery* BMD_PUBLIC CreateDeckLinkDiscoveryInstance (void);
1307     IDeckLinkAPIInformation* BMD_PUBLIC CreateDeckLinkAPIInformationInstance (void);
1308     IDeckLinkGLScreenPreviewHelper* BMD_PUBLIC CreateOpenGLScreenPreviewHelper (void);
1309     IDeckLinkCocoaScreenPreviewCallback* BMD_PUBLIC CreateCocoaScreenPreview (void* /* (NSView*) */ parentView);
1310     IDeckLinkVideoConversion* BMD_PUBLIC CreateVideoConversionInstance (void);
1311     IDeckLinkVideoFrameAncillaryPackets* BMD_PUBLIC CreateVideoFrameAncillaryPacketsInstance (void); // For use when creating a custom IDeckLinkVideoFrame without wrapping IDeckLinkOutput::CreateVideoFrame
1312 
1313 }
1314 
1315 
1316 #endif      // defined(__cplusplus)
1317 #endif /* defined(BMD_DECKLINKAPI_H) */
1318