]> git.sesse.net Git - nageru/blob - nageru/decklink/DeckLinkAPI.h
e113fc38aaf74f48a58277fde9def9a577dd3e0a
[nageru] / nageru / decklink / DeckLinkAPI.h
1 /* -LICENSE-START-
2 ** Copyright (c) 2018 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 <stdint.h>
47 #include "LinuxCOM.h"
48
49 #include "DeckLinkAPITypes.h"
50 #include "DeckLinkAPIModes.h"
51 #include "DeckLinkAPIDiscovery.h"
52 #include "DeckLinkAPIConfiguration.h"
53 #include "DeckLinkAPIDeckControl.h"
54
55 #define BLACKMAGIC_DECKLINK_API_MAGIC   1
56
57 // Type Declarations
58
59
60 // Interface ID Declarations
61
62 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};
63 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};
64 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};
65 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};
66 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};
67 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};
68 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};
69 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};
70 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};
71 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};
72 BMD_CONST REFIID IID_IDeckLinkEncoderInput                        = /* 270587DA-6B7D-42E7-A1F0-6D853F581185 */ {0x27,0x05,0x87,0xDA,0x6B,0x7D,0x42,0xE7,0xA1,0xF0,0x6D,0x85,0x3F,0x58,0x11,0x85};
73 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};
74 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};
75 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};
76 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};
77 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};
78 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};
79 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};
80 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};
81 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};
82 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};
83 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};
84 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};
85 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};
86 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};
87 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};
88 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};
89 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};
90 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};
91 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};
92 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};
93 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};
94 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};
95 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};
96 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};
97
98 /* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */
99
100 typedef uint32_t BMDVideoOutputFlags;
101 enum _BMDVideoOutputFlags {
102     bmdVideoOutputFlagDefault                                    = 0,
103     bmdVideoOutputVANC                                           = 1 << 0,
104     bmdVideoOutputVITC                                           = 1 << 1,
105     bmdVideoOutputRP188                                          = 1 << 2,
106     bmdVideoOutputDualStream3D                                   = 1 << 4
107 };
108
109 /* Enum BMDPacketType - Type of packet */
110
111 typedef uint32_t BMDPacketType;
112 enum _BMDPacketType {
113     bmdPacketTypeStreamInterruptedMarker                         = /* 'sint' */ 0x73696E74,     // A packet of this type marks the time when a video stream was interrupted, for example by a disconnected cable
114     bmdPacketTypeStreamData                                      = /* 'sdat' */ 0x73646174      // Regular stream data
115 };
116
117 /* Enum BMDFrameFlags - Frame flags */
118
119 typedef uint32_t BMDFrameFlags;
120 enum _BMDFrameFlags {
121     bmdFrameFlagDefault                                          = 0,
122     bmdFrameFlagFlipVertical                                     = 1 << 0,
123     bmdFrameContainsHDRMetadata                                  = 1 << 1,
124     bmdFrameContainsCintelMetadata                               = 1 << 2,
125
126     /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */
127
128     bmdFrameCapturedAsPsF                                        = 1 << 30,
129     bmdFrameHasNoInputSource                                     = 1 << 31
130 };
131
132 /* Enum BMDVideoInputFlags - Flags applicable to video input */
133
134 typedef uint32_t BMDVideoInputFlags;
135 enum _BMDVideoInputFlags {
136     bmdVideoInputFlagDefault                                     = 0,
137     bmdVideoInputEnableFormatDetection                           = 1 << 0,
138     bmdVideoInputDualStream3D                                    = 1 << 1
139 };
140
141 /* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */
142
143 typedef uint32_t BMDVideoInputFormatChangedEvents;
144 enum _BMDVideoInputFormatChangedEvents {
145     bmdVideoInputDisplayModeChanged                              = 1 << 0,
146     bmdVideoInputFieldDominanceChanged                           = 1 << 1,
147     bmdVideoInputColorspaceChanged                               = 1 << 2
148 };
149
150 /* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */
151
152 typedef uint32_t BMDDetectedVideoInputFormatFlags;
153 enum _BMDDetectedVideoInputFormatFlags {
154     bmdDetectedVideoInputYCbCr422                                = 1 << 0,
155     bmdDetectedVideoInputRGB444                                  = 1 << 1,
156     bmdDetectedVideoInputDualStream3D                            = 1 << 2
157 };
158
159 /* Enum BMDDeckLinkCapturePassthroughMode - Enumerates whether the video output is electrically connected to the video input or if the clean switching mode is enabled */
160
161 typedef uint32_t BMDDeckLinkCapturePassthroughMode;
162 enum _BMDDeckLinkCapturePassthroughMode {
163     bmdDeckLinkCapturePassthroughModeDisabled                    = /* 'pdis' */ 0x70646973,
164     bmdDeckLinkCapturePassthroughModeDirect                      = /* 'pdir' */ 0x70646972,
165     bmdDeckLinkCapturePassthroughModeCleanSwitch                 = /* 'pcln' */ 0x70636C6E
166 };
167
168 /* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */
169
170 typedef uint32_t BMDOutputFrameCompletionResult;
171 enum _BMDOutputFrameCompletionResult {
172     bmdOutputFrameCompleted,                                    
173     bmdOutputFrameDisplayedLate,                                
174     bmdOutputFrameDropped,                                      
175     bmdOutputFrameFlushed                                       
176 };
177
178 /* Enum BMDReferenceStatus - GenLock input status */
179
180 typedef uint32_t BMDReferenceStatus;
181 enum _BMDReferenceStatus {
182     bmdReferenceNotSupportedByHardware                           = 1 << 0,
183     bmdReferenceLocked                                           = 1 << 1
184 };
185
186 /* Enum BMDAudioFormat - Audio Format */
187
188 typedef uint32_t BMDAudioFormat;
189 enum _BMDAudioFormat {
190     bmdAudioFormatPCM                                            = /* 'lpcm' */ 0x6C70636D      // Linear signed PCM samples
191 };
192
193 /* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */
194
195 typedef uint32_t BMDAudioSampleRate;
196 enum _BMDAudioSampleRate {
197     bmdAudioSampleRate48kHz                                      = 48000
198 };
199
200 /* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */
201
202 typedef uint32_t BMDAudioSampleType;
203 enum _BMDAudioSampleType {
204     bmdAudioSampleType16bitInteger                               = 16,
205     bmdAudioSampleType32bitInteger                               = 32
206 };
207
208 /* Enum BMDAudioOutputStreamType - Audio output stream type */
209
210 typedef uint32_t BMDAudioOutputStreamType;
211 enum _BMDAudioOutputStreamType {
212     bmdAudioOutputStreamContinuous,                             
213     bmdAudioOutputStreamContinuousDontResample,                 
214     bmdAudioOutputStreamTimestamped                             
215 };
216
217 /* Enum BMDDisplayModeSupport - Output mode supported flags */
218
219 typedef uint32_t BMDDisplayModeSupport;
220 enum _BMDDisplayModeSupport {
221     bmdDisplayModeNotSupported                                   = 0,
222     bmdDisplayModeSupported,                                    
223     bmdDisplayModeSupportedWithConversion                       
224 };
225
226 /* Enum BMDAncillaryPacketFormat - Ancillary packet format */
227
228 typedef uint32_t BMDAncillaryPacketFormat;
229 enum _BMDAncillaryPacketFormat {
230     bmdAncillaryPacketFormatUInt8                                = /* 'ui08' */ 0x75693038,
231     bmdAncillaryPacketFormatUInt16                               = /* 'ui16' */ 0x75693136,
232     bmdAncillaryPacketFormatYCbCr10                              = /* 'v210' */ 0x76323130
233 };
234
235 /* Enum BMDTimecodeFormat - Timecode formats for frame metadata */
236
237 typedef uint32_t BMDTimecodeFormat;
238 enum _BMDTimecodeFormat {
239     bmdTimecodeRP188VITC1                                        = /* 'rpv1' */ 0x72707631,     // RP188 timecode where DBB1 equals VITC1 (line 9)
240     bmdTimecodeRP188VITC2                                        = /* 'rp12' */ 0x72703132,     // RP188 timecode where DBB1 equals VITC2 (line 9 for progressive or line 571 for interlaced/PsF)
241     bmdTimecodeRP188LTC                                          = /* 'rplt' */ 0x72706C74,     // RP188 timecode where DBB1 equals LTC (line 10)
242     bmdTimecodeRP188Any                                          = /* 'rp18' */ 0x72703138,     // For capture: return the first valid timecode in {VITC1, LTC ,VITC2} - For playback: set the timecode as VITC1
243     bmdTimecodeVITC                                              = /* 'vitc' */ 0x76697463,
244     bmdTimecodeVITCField2                                        = /* 'vit2' */ 0x76697432,
245     bmdTimecodeSerial                                            = /* 'seri' */ 0x73657269
246 };
247
248 /* Enum BMDAnalogVideoFlags - Analog video display flags */
249
250 typedef uint32_t BMDAnalogVideoFlags;
251 enum _BMDAnalogVideoFlags {
252     bmdAnalogVideoFlagCompositeSetup75                           = 1 << 0,
253     bmdAnalogVideoFlagComponentBetacamLevels                     = 1 << 1
254 };
255
256 /* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */
257
258 typedef uint32_t BMDAudioOutputAnalogAESSwitch;
259 enum _BMDAudioOutputAnalogAESSwitch {
260     bmdAudioOutputSwitchAESEBU                                   = /* 'aes ' */ 0x61657320,
261     bmdAudioOutputSwitchAnalog                                   = /* 'anlg' */ 0x616E6C67
262 };
263
264 /* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */
265
266 typedef uint32_t BMDVideoOutputConversionMode;
267 enum _BMDVideoOutputConversionMode {
268     bmdNoVideoOutputConversion                                   = /* 'none' */ 0x6E6F6E65,
269     bmdVideoOutputLetterboxDownconversion                        = /* 'ltbx' */ 0x6C746278,
270     bmdVideoOutputAnamorphicDownconversion                       = /* 'amph' */ 0x616D7068,
271     bmdVideoOutputHD720toHD1080Conversion                        = /* '720c' */ 0x37323063,
272     bmdVideoOutputHardwareLetterboxDownconversion                = /* 'HWlb' */ 0x48576C62,
273     bmdVideoOutputHardwareAnamorphicDownconversion               = /* 'HWam' */ 0x4857616D,
274     bmdVideoOutputHardwareCenterCutDownconversion                = /* 'HWcc' */ 0x48576363,
275     bmdVideoOutputHardware720p1080pCrossconversion               = /* 'xcap' */ 0x78636170,
276     bmdVideoOutputHardwareAnamorphic720pUpconversion             = /* 'ua7p' */ 0x75613770,
277     bmdVideoOutputHardwareAnamorphic1080iUpconversion            = /* 'ua1i' */ 0x75613169,
278     bmdVideoOutputHardwareAnamorphic149To720pUpconversion        = /* 'u47p' */ 0x75343770,
279     bmdVideoOutputHardwareAnamorphic149To1080iUpconversion       = /* 'u41i' */ 0x75343169,
280     bmdVideoOutputHardwarePillarbox720pUpconversion              = /* 'up7p' */ 0x75703770,
281     bmdVideoOutputHardwarePillarbox1080iUpconversion             = /* 'up1i' */ 0x75703169
282 };
283
284 /* Enum BMDVideoInputConversionMode - Video input conversion mode */
285
286 typedef uint32_t BMDVideoInputConversionMode;
287 enum _BMDVideoInputConversionMode {
288     bmdNoVideoInputConversion                                    = /* 'none' */ 0x6E6F6E65,
289     bmdVideoInputLetterboxDownconversionFromHD1080               = /* '10lb' */ 0x31306C62,
290     bmdVideoInputAnamorphicDownconversionFromHD1080              = /* '10am' */ 0x3130616D,
291     bmdVideoInputLetterboxDownconversionFromHD720                = /* '72lb' */ 0x37326C62,
292     bmdVideoInputAnamorphicDownconversionFromHD720               = /* '72am' */ 0x3732616D,
293     bmdVideoInputLetterboxUpconversion                           = /* 'lbup' */ 0x6C627570,
294     bmdVideoInputAnamorphicUpconversion                          = /* 'amup' */ 0x616D7570
295 };
296
297 /* Enum BMDVideo3DPackingFormat - Video 3D packing format */
298
299 typedef uint32_t BMDVideo3DPackingFormat;
300 enum _BMDVideo3DPackingFormat {
301     bmdVideo3DPackingSidebySideHalf                              = /* 'sbsh' */ 0x73627368,
302     bmdVideo3DPackingLinebyLine                                  = /* 'lbyl' */ 0x6C62796C,
303     bmdVideo3DPackingTopAndBottom                                = /* 'tabo' */ 0x7461626F,
304     bmdVideo3DPackingFramePacking                                = /* 'frpk' */ 0x6672706B,
305     bmdVideo3DPackingLeftOnly                                    = /* 'left' */ 0x6C656674,
306     bmdVideo3DPackingRightOnly                                   = /* 'righ' */ 0x72696768
307 };
308
309 /* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */
310
311 typedef uint32_t BMDIdleVideoOutputOperation;
312 enum _BMDIdleVideoOutputOperation {
313     bmdIdleVideoOutputBlack                                      = /* 'blac' */ 0x626C6163,
314     bmdIdleVideoOutputLastFrame                                  = /* 'lafa' */ 0x6C616661
315 };
316
317 /* Enum BMDVideoEncoderFrameCodingMode - Video frame coding mode */
318
319 typedef uint32_t BMDVideoEncoderFrameCodingMode;
320 enum _BMDVideoEncoderFrameCodingMode {
321     bmdVideoEncoderFrameCodingModeInter                          = /* 'inte' */ 0x696E7465,
322     bmdVideoEncoderFrameCodingModeIntra                          = /* 'intr' */ 0x696E7472
323 };
324
325 /* Enum BMDDNxHRLevel - DNxHR Levels */
326
327 typedef uint32_t BMDDNxHRLevel;
328 enum _BMDDNxHRLevel {
329     bmdDNxHRLevelSQ                                              = /* 'dnsq' */ 0x646E7371,
330     bmdDNxHRLevelLB                                              = /* 'dnlb' */ 0x646E6C62,
331     bmdDNxHRLevelHQ                                              = /* 'dnhq' */ 0x646E6871,
332     bmdDNxHRLevelHQX                                             = /* 'dhqx' */ 0x64687178,
333     bmdDNxHRLevel444                                             = /* 'd444' */ 0x64343434
334 };
335
336 /* Enum BMDLinkConfiguration - Video link configuration */
337
338 typedef uint32_t BMDLinkConfiguration;
339 enum _BMDLinkConfiguration {
340     bmdLinkConfigurationSingleLink                               = /* 'lcsl' */ 0x6C63736C,
341     bmdLinkConfigurationDualLink                                 = /* 'lcdl' */ 0x6C63646C,
342     bmdLinkConfigurationQuadLink                                 = /* 'lcql' */ 0x6C63716C
343 };
344
345 /* Enum BMDDeviceInterface - Device interface type */
346
347 typedef uint32_t BMDDeviceInterface;
348 enum _BMDDeviceInterface {
349     bmdDeviceInterfacePCI                                        = /* 'pci ' */ 0x70636920,
350     bmdDeviceInterfaceUSB                                        = /* 'usb ' */ 0x75736220,
351     bmdDeviceInterfaceThunderbolt                                = /* 'thun' */ 0x7468756E
352 };
353
354 /* Enum BMDColorspace - Colorspace */
355
356 typedef uint32_t BMDColorspace;
357 enum _BMDColorspace {
358     bmdColorspaceRec601                                          = /* 'r601' */ 0x72363031,
359     bmdColorspaceRec709                                          = /* 'r709' */ 0x72373039,
360     bmdColorspaceRec2020                                         = /* '2020' */ 0x32303230
361 };
362
363 /* Enum BMDDynamicRange - SDR or HDR */
364
365 typedef uint32_t BMDDynamicRange;
366 enum _BMDDynamicRange {
367     bmdDynamicRangeSDR                                           = 0,
368     bmdDynamicRangeHDRStaticPQ                                   = 1 << 29,     // SMPTE ST 2084
369     bmdDynamicRangeHDRStaticHLG                                  = 1 << 30      // ITU-R BT.2100-0
370 };
371
372 /* Enum BMDDeckLinkHDMIInputEDIDID - DeckLink HDMI Input EDID ID */
373
374 typedef uint32_t BMDDeckLinkHDMIInputEDIDID;
375 enum _BMDDeckLinkHDMIInputEDIDID {
376     bmdDeckLinkHDMIInputEDIDDynamicRange                         = /* 'HIDy' */ 0x48494479      // Parameter is of type BMDDynamicRange. Default is (bmdDynamicRangeSDR|bmdDynamicRangeHDRStaticPQ)
377 };
378
379 /* Enum BMDDeckLinkFrameMetadataID - DeckLink Frame Metadata ID */
380
381 typedef uint32_t BMDDeckLinkFrameMetadataID;
382 enum _BMDDeckLinkFrameMetadataID {
383     bmdDeckLinkFrameMetadataColorspace                           = /* 'cspc' */ 0x63737063,     // Colorspace of video frame (see BMDColorspace)
384     bmdDeckLinkFrameMetadataHDRElectroOpticalTransferFunc        = /* 'eotf' */ 0x656F7466,     // EOTF in range 0-7 as per CEA 861.3
385     bmdDeckLinkFrameMetadataCintelFilmType                       = /* 'cfty' */ 0x63667479,     // Current film type
386     bmdDeckLinkFrameMetadataCintelFilmGauge                      = /* 'cfga' */ 0x63666761,     // Current film gauge
387     bmdDeckLinkFrameMetadataCintelOffsetDetectedHorizontal       = /* 'odfh' */ 0x6F646668,     // Horizontal offset (pixels) detected in image
388     bmdDeckLinkFrameMetadataCintelOffsetDetectedVertical         = /* 'odfv' */ 0x6F646676,     // Vertical offset (pixels) detected in image
389     bmdDeckLinkFrameMetadataCintelKeykodeLow                     = /* 'ckkl' */ 0x636B6B6C,     // Raw keykode value - low 64 bits
390     bmdDeckLinkFrameMetadataCintelKeykodeHigh                    = /* 'ckkh' */ 0x636B6B68,     // Raw keykode value - high 64 bits
391     bmdDeckLinkFrameMetadataCintelTile1Size                      = /* 'ct1s' */ 0x63743173,     // Size in bytes of compressed raw tile 1
392     bmdDeckLinkFrameMetadataCintelTile2Size                      = /* 'ct2s' */ 0x63743273,     // Size in bytes of compressed raw tile 2
393     bmdDeckLinkFrameMetadataCintelTile3Size                      = /* 'ct3s' */ 0x63743373,     // Size in bytes of compressed raw tile 3
394     bmdDeckLinkFrameMetadataCintelTile4Size                      = /* 'ct4s' */ 0x63743473,     // Size in bytes of compressed raw tile 4
395     bmdDeckLinkFrameMetadataCintelImageWidth                     = /* 'IWPx' */ 0x49575078,     // Width in pixels of image
396     bmdDeckLinkFrameMetadataCintelImageHeight                    = /* 'IHPx' */ 0x49485078,     // Height in pixels of image
397     bmdDeckLinkFrameMetadataCintelLinearMaskingRedInRed          = /* 'mrir' */ 0x6D726972,     // Red in red linear masking parameter
398     bmdDeckLinkFrameMetadataCintelLinearMaskingGreenInRed        = /* 'mgir' */ 0x6D676972,     // Green in red linear masking parameter
399     bmdDeckLinkFrameMetadataCintelLinearMaskingBlueInRed         = /* 'mbir' */ 0x6D626972,     // Blue in red linear masking parameter
400     bmdDeckLinkFrameMetadataCintelLinearMaskingRedInGreen        = /* 'mrig' */ 0x6D726967,     // Red in green linear masking parameter
401     bmdDeckLinkFrameMetadataCintelLinearMaskingGreenInGreen      = /* 'mgig' */ 0x6D676967,     // Green in green linear masking parameter
402     bmdDeckLinkFrameMetadataCintelLinearMaskingBlueInGreen       = /* 'mbig' */ 0x6D626967,     // Blue in green linear masking parameter
403     bmdDeckLinkFrameMetadataCintelLinearMaskingRedInBlue         = /* 'mrib' */ 0x6D726962,     // Red in blue linear masking parameter
404     bmdDeckLinkFrameMetadataCintelLinearMaskingGreenInBlue       = /* 'mgib' */ 0x6D676962,     // Green in blue linear masking parameter
405     bmdDeckLinkFrameMetadataCintelLinearMaskingBlueInBlue        = /* 'mbib' */ 0x6D626962,     // Blue in blue linear masking parameter
406     bmdDeckLinkFrameMetadataCintelLogMaskingRedInRed             = /* 'mlrr' */ 0x6D6C7272,     // Red in red log masking parameter
407     bmdDeckLinkFrameMetadataCintelLogMaskingGreenInRed           = /* 'mlgr' */ 0x6D6C6772,     // Green in red log masking parameter
408     bmdDeckLinkFrameMetadataCintelLogMaskingBlueInRed            = /* 'mlbr' */ 0x6D6C6272,     // Blue in red log masking parameter
409     bmdDeckLinkFrameMetadataCintelLogMaskingRedInGreen           = /* 'mlrg' */ 0x6D6C7267,     // Red in green log masking parameter
410     bmdDeckLinkFrameMetadataCintelLogMaskingGreenInGreen         = /* 'mlgg' */ 0x6D6C6767,     // Green in green log masking parameter
411     bmdDeckLinkFrameMetadataCintelLogMaskingBlueInGreen          = /* 'mlbg' */ 0x6D6C6267,     // Blue in green log masking parameter
412     bmdDeckLinkFrameMetadataCintelLogMaskingRedInBlue            = /* 'mlrb' */ 0x6D6C7262,     // Red in blue log masking parameter
413     bmdDeckLinkFrameMetadataCintelLogMaskingGreenInBlue          = /* 'mlgb' */ 0x6D6C6762,     // Green in blue log masking parameter
414     bmdDeckLinkFrameMetadataCintelLogMaskingBlueInBlue           = /* 'mlbb' */ 0x6D6C6262,     // Blue in blue log masking parameter
415     bmdDeckLinkFrameMetadataCintelFilmFrameRate                  = /* 'cffr' */ 0x63666672,     // Film frame rate
416     bmdDeckLinkFrameMetadataHDRDisplayPrimariesRedX              = /* 'hdrx' */ 0x68647278,     // Red display primaries in range 0.0 - 1.0
417     bmdDeckLinkFrameMetadataHDRDisplayPrimariesRedY              = /* 'hdry' */ 0x68647279,     // Red display primaries in range 0.0 - 1.0
418     bmdDeckLinkFrameMetadataHDRDisplayPrimariesGreenX            = /* 'hdgx' */ 0x68646778,     // Green display primaries in range 0.0 - 1.0
419     bmdDeckLinkFrameMetadataHDRDisplayPrimariesGreenY            = /* 'hdgy' */ 0x68646779,     // Green display primaries in range 0.0 - 1.0
420     bmdDeckLinkFrameMetadataHDRDisplayPrimariesBlueX             = /* 'hdbx' */ 0x68646278,     // Blue display primaries in range 0.0 - 1.0
421     bmdDeckLinkFrameMetadataHDRDisplayPrimariesBlueY             = /* 'hdby' */ 0x68646279,     // Blue display primaries in range 0.0 - 1.0
422     bmdDeckLinkFrameMetadataHDRWhitePointX                       = /* 'hdwx' */ 0x68647778,     // White point in range 0.0 - 1.0
423     bmdDeckLinkFrameMetadataHDRWhitePointY                       = /* 'hdwy' */ 0x68647779,     // White point in range 0.0 - 1.0
424     bmdDeckLinkFrameMetadataHDRMaxDisplayMasteringLuminance      = /* 'hdml' */ 0x68646D6C,     // Max display mastering luminance in range 1 cd/m2 - 65535 cd/m2
425     bmdDeckLinkFrameMetadataHDRMinDisplayMasteringLuminance      = /* 'hmil' */ 0x686D696C,     // Min display mastering luminance in range 0.0001 cd/m2 - 6.5535 cd/m2
426     bmdDeckLinkFrameMetadataHDRMaximumContentLightLevel          = /* 'mcll' */ 0x6D636C6C,     // Maximum Content Light Level in range 1 cd/m2 - 65535 cd/m2
427     bmdDeckLinkFrameMetadataHDRMaximumFrameAverageLightLevel     = /* 'fall' */ 0x66616C6C,     // Maximum Frame Average Light Level in range 1 cd/m2 - 65535 cd/m2
428     bmdDeckLinkFrameMetadataCintelOffsetToApplyHorizontal        = /* 'otah' */ 0x6F746168,     // Horizontal offset (pixels) to be applied to image
429     bmdDeckLinkFrameMetadataCintelOffsetToApplyVertical          = /* 'otav' */ 0x6F746176,     // Vertical offset (pixels) to be applied to image
430     bmdDeckLinkFrameMetadataCintelGainRed                        = /* 'LfRd' */ 0x4C665264,     // Red gain parameter to apply after log
431     bmdDeckLinkFrameMetadataCintelGainGreen                      = /* 'LfGr' */ 0x4C664772,     // Green gain parameter to apply after log
432     bmdDeckLinkFrameMetadataCintelGainBlue                       = /* 'LfBl' */ 0x4C66426C,     // Blue gain parameter to apply after log
433     bmdDeckLinkFrameMetadataCintelLiftRed                        = /* 'GnRd' */ 0x476E5264,     // Red lift parameter to apply after log and gain
434     bmdDeckLinkFrameMetadataCintelLiftGreen                      = /* 'GnGr' */ 0x476E4772,     // Green lift parameter to apply after log and gain
435     bmdDeckLinkFrameMetadataCintelLiftBlue                       = /* 'GnBl' */ 0x476E426C      // Blue lift parameter to apply after log and gain
436 };
437
438 /* Enum BMDDuplexMode - Duplex for configurable ports */
439
440 typedef uint32_t BMDDuplexMode;
441 enum _BMDDuplexMode {
442     bmdDuplexModeFull                                            = /* 'fdup' */ 0x66647570,
443     bmdDuplexModeHalf                                            = /* 'hdup' */ 0x68647570
444 };
445
446 /* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */
447
448 typedef uint32_t BMDDeckLinkAttributeID;
449 enum _BMDDeckLinkAttributeID {
450
451     /* Flags */
452
453     BMDDeckLinkSupportsInternalKeying                            = /* 'keyi' */ 0x6B657969,
454     BMDDeckLinkSupportsExternalKeying                            = /* 'keye' */ 0x6B657965,
455     BMDDeckLinkSupportsHDKeying                                  = /* 'keyh' */ 0x6B657968,
456     BMDDeckLinkSupportsInputFormatDetection                      = /* 'infd' */ 0x696E6664,
457     BMDDeckLinkHasReferenceInput                                 = /* 'hrin' */ 0x6872696E,
458     BMDDeckLinkHasSerialPort                                     = /* 'hspt' */ 0x68737074,
459     BMDDeckLinkHasAnalogVideoOutputGain                          = /* 'avog' */ 0x61766F67,
460     BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain               = /* 'ovog' */ 0x6F766F67,
461     BMDDeckLinkHasVideoInputAntiAliasingFilter                   = /* 'aafl' */ 0x6161666C,
462     BMDDeckLinkHasBypass                                         = /* 'byps' */ 0x62797073,
463     BMDDeckLinkSupportsClockTimingAdjustment                     = /* 'ctad' */ 0x63746164,
464     BMDDeckLinkSupportsFullDuplex                                = /* 'fdup' */ 0x66647570,
465     BMDDeckLinkSupportsFullFrameReferenceInputTimingOffset       = /* 'frin' */ 0x6672696E,
466     BMDDeckLinkSupportsSMPTELevelAOutput                         = /* 'lvla' */ 0x6C766C61,
467     BMDDeckLinkSupportsDualLinkSDI                               = /* 'sdls' */ 0x73646C73,
468     BMDDeckLinkSupportsQuadLinkSDI                               = /* 'sqls' */ 0x73716C73,
469     BMDDeckLinkSupportsIdleOutput                                = /* 'idou' */ 0x69646F75,
470     BMDDeckLinkHasLTCTimecodeInput                               = /* 'hltc' */ 0x686C7463,
471     BMDDeckLinkSupportsDuplexModeConfiguration                   = /* 'dupx' */ 0x64757078,
472     BMDDeckLinkSupportsHDRMetadata                               = /* 'hdrm' */ 0x6864726D,
473     BMDDeckLinkSupportsColorspaceMetadata                        = /* 'cmet' */ 0x636D6574,
474
475     /* Integers */
476
477     BMDDeckLinkMaximumAudioChannels                              = /* 'mach' */ 0x6D616368,
478     BMDDeckLinkMaximumAnalogAudioInputChannels                   = /* 'iach' */ 0x69616368,
479     BMDDeckLinkMaximumAnalogAudioOutputChannels                  = /* 'aach' */ 0x61616368,
480     BMDDeckLinkNumberOfSubDevices                                = /* 'nsbd' */ 0x6E736264,
481     BMDDeckLinkSubDeviceIndex                                    = /* 'subi' */ 0x73756269,
482     BMDDeckLinkPersistentID                                      = /* 'peid' */ 0x70656964,
483     BMDDeckLinkDeviceGroupID                                     = /* 'dgid' */ 0x64676964,
484     BMDDeckLinkTopologicalID                                     = /* 'toid' */ 0x746F6964,
485     BMDDeckLinkVideoOutputConnections                            = /* 'vocn' */ 0x766F636E,     // Returns a BMDVideoConnection bit field
486     BMDDeckLinkVideoInputConnections                             = /* 'vicn' */ 0x7669636E,     // Returns a BMDVideoConnection bit field
487     BMDDeckLinkAudioOutputConnections                            = /* 'aocn' */ 0x616F636E,     // Returns a BMDAudioConnection bit field
488     BMDDeckLinkAudioInputConnections                             = /* 'aicn' */ 0x6169636E,     // Returns a BMDAudioConnection bit field
489     BMDDeckLinkVideoIOSupport                                    = /* 'vios' */ 0x76696F73,     // Returns a BMDVideoIOSupport bit field
490     BMDDeckLinkDeckControlConnections                            = /* 'dccn' */ 0x6463636E,     // Returns a BMDDeckControlConnection bit field
491     BMDDeckLinkDeviceInterface                                   = /* 'dbus' */ 0x64627573,     // Returns a BMDDeviceInterface
492     BMDDeckLinkAudioInputRCAChannelCount                         = /* 'airc' */ 0x61697263,
493     BMDDeckLinkAudioInputXLRChannelCount                         = /* 'aixc' */ 0x61697863,
494     BMDDeckLinkAudioOutputRCAChannelCount                        = /* 'aorc' */ 0x616F7263,
495     BMDDeckLinkAudioOutputXLRChannelCount                        = /* 'aoxc' */ 0x616F7863,
496     BMDDeckLinkPairedDevicePersistentID                          = /* 'ppid' */ 0x70706964,
497
498     /* Floats */
499
500     BMDDeckLinkVideoInputGainMinimum                             = /* 'vigm' */ 0x7669676D,
501     BMDDeckLinkVideoInputGainMaximum                             = /* 'vigx' */ 0x76696778,
502     BMDDeckLinkVideoOutputGainMinimum                            = /* 'vogm' */ 0x766F676D,
503     BMDDeckLinkVideoOutputGainMaximum                            = /* 'vogx' */ 0x766F6778,
504     BMDDeckLinkMicrophoneInputGainMinimum                        = /* 'migm' */ 0x6D69676D,
505     BMDDeckLinkMicrophoneInputGainMaximum                        = /* 'migx' */ 0x6D696778,
506
507     /* Strings */
508
509     BMDDeckLinkSerialPortDeviceName                              = /* 'slpn' */ 0x736C706E,
510     BMDDeckLinkVendorName                                        = /* 'vndr' */ 0x766E6472,
511     BMDDeckLinkDisplayName                                       = /* 'dspn' */ 0x6473706E,
512     BMDDeckLinkModelName                                         = /* 'mdln' */ 0x6D646C6E,
513     BMDDeckLinkDeviceHandle                                      = /* 'devh' */ 0x64657668
514 };
515
516 /* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */
517
518 typedef uint32_t BMDDeckLinkAPIInformationID;
519 enum _BMDDeckLinkAPIInformationID {
520     BMDDeckLinkAPIVersion                                        = /* 'vers' */ 0x76657273
521 };
522
523 /* Enum BMDDeckLinkStatusID - DeckLink Status ID */
524
525 typedef uint32_t BMDDeckLinkStatusID;
526 enum _BMDDeckLinkStatusID {
527
528     /* Integers */
529
530     bmdDeckLinkStatusDetectedVideoInputMode                      = /* 'dvim' */ 0x6476696D,
531     bmdDeckLinkStatusDetectedVideoInputFlags                     = /* 'dvif' */ 0x64766966,
532     bmdDeckLinkStatusCurrentVideoInputMode                       = /* 'cvim' */ 0x6376696D,
533     bmdDeckLinkStatusCurrentVideoInputPixelFormat                = /* 'cvip' */ 0x63766970,
534     bmdDeckLinkStatusCurrentVideoInputFlags                      = /* 'cvif' */ 0x63766966,
535     bmdDeckLinkStatusCurrentVideoOutputMode                      = /* 'cvom' */ 0x63766F6D,
536     bmdDeckLinkStatusCurrentVideoOutputFlags                     = /* 'cvof' */ 0x63766F66,
537     bmdDeckLinkStatusPCIExpressLinkWidth                         = /* 'pwid' */ 0x70776964,
538     bmdDeckLinkStatusPCIExpressLinkSpeed                         = /* 'plnk' */ 0x706C6E6B,
539     bmdDeckLinkStatusLastVideoOutputPixelFormat                  = /* 'opix' */ 0x6F706978,
540     bmdDeckLinkStatusReferenceSignalMode                         = /* 'refm' */ 0x7265666D,
541     bmdDeckLinkStatusReferenceSignalFlags                        = /* 'reff' */ 0x72656666,
542     bmdDeckLinkStatusDuplexMode                                  = /* 'dupx' */ 0x64757078,
543     bmdDeckLinkStatusBusy                                        = /* 'busy' */ 0x62757379,
544     bmdDeckLinkStatusInterchangeablePanelType                    = /* 'icpt' */ 0x69637074,
545     bmdDeckLinkStatusDeviceTemperature                           = /* 'dtmp' */ 0x64746D70,
546
547     /* Flags */
548
549     bmdDeckLinkStatusVideoInputSignalLocked                      = /* 'visl' */ 0x7669736C,
550     bmdDeckLinkStatusReferenceSignalLocked                       = /* 'refl' */ 0x7265666C,
551     bmdDeckLinkStatusReceivedEDID                                = /* 'edid' */ 0x65646964
552 };
553
554 /* Enum BMDDeckLinkVideoStatusFlags -  */
555
556 typedef uint32_t BMDDeckLinkVideoStatusFlags;
557 enum _BMDDeckLinkVideoStatusFlags {
558     bmdDeckLinkVideoStatusPsF                                    = 1 << 0,
559     bmdDeckLinkVideoStatusDualStream3D                           = 1 << 1
560 };
561
562 /* Enum BMDDuplexStatus - Duplex status of the device */
563
564 typedef uint32_t BMDDuplexStatus;
565 enum _BMDDuplexStatus {
566     bmdDuplexStatusFullDuplex                                    = /* 'fdup' */ 0x66647570,
567     bmdDuplexStatusHalfDuplex                                    = /* 'hdup' */ 0x68647570,
568     bmdDuplexStatusSimplex                                       = /* 'splx' */ 0x73706C78,
569     bmdDuplexStatusInactive                                      = /* 'inac' */ 0x696E6163
570 };
571
572 /* Enum BMDPanelType - The type of interchangeable panel */
573
574 typedef uint32_t BMDPanelType;
575 enum _BMDPanelType {
576     bmdPanelNotDetected                                          = /* 'npnl' */ 0x6E706E6C,
577     bmdPanelTeranexMiniSmartPanel                                = /* 'tmsm' */ 0x746D736D
578 };
579
580 /* Enum BMDDeviceBusyState - Current device busy state */
581
582 typedef uint32_t BMDDeviceBusyState;
583 enum _BMDDeviceBusyState {
584     bmdDeviceCaptureBusy                                         = 1 << 0,
585     bmdDevicePlaybackBusy                                        = 1 << 1,
586     bmdDeviceSerialPortBusy                                      = 1 << 2
587 };
588
589 /* Enum BMDVideoIOSupport - Device video input/output support */
590
591 typedef uint32_t BMDVideoIOSupport;
592 enum _BMDVideoIOSupport {
593     bmdDeviceSupportsCapture                                     = 1 << 0,
594     bmdDeviceSupportsPlayback                                    = 1 << 1
595 };
596
597 /* Enum BMD3DPreviewFormat - Linked Frame preview format */
598
599 typedef uint32_t BMD3DPreviewFormat;
600 enum _BMD3DPreviewFormat {
601     bmd3DPreviewFormatDefault                                    = /* 'defa' */ 0x64656661,
602     bmd3DPreviewFormatLeftOnly                                   = /* 'left' */ 0x6C656674,
603     bmd3DPreviewFormatRightOnly                                  = /* 'righ' */ 0x72696768,
604     bmd3DPreviewFormatSideBySide                                 = /* 'side' */ 0x73696465,
605     bmd3DPreviewFormatTopBottom                                  = /* 'topb' */ 0x746F7062
606 };
607
608 /* Enum BMDNotifications - Events that can be subscribed through IDeckLinkNotification */
609
610 typedef uint32_t BMDNotifications;
611 enum _BMDNotifications {
612     bmdPreferencesChanged                                        = /* 'pref' */ 0x70726566,
613     bmdStatusChanged                                             = /* 'stat' */ 0x73746174
614 };
615
616 #if defined(__cplusplus)
617
618 // Forward Declarations
619
620 class IDeckLinkVideoOutputCallback;
621 class IDeckLinkInputCallback;
622 class IDeckLinkEncoderInputCallback;
623 class IDeckLinkMemoryAllocator;
624 class IDeckLinkAudioOutputCallback;
625 class IDeckLinkIterator;
626 class IDeckLinkAPIInformation;
627 class IDeckLinkOutput;
628 class IDeckLinkInput;
629 class IDeckLinkHDMIInputEDID;
630 class IDeckLinkEncoderInput;
631 class IDeckLinkVideoFrame;
632 class IDeckLinkMutableVideoFrame;
633 class IDeckLinkVideoFrame3DExtensions;
634 class IDeckLinkVideoFrameMetadataExtensions;
635 class IDeckLinkVideoInputFrame;
636 class IDeckLinkAncillaryPacket;
637 class IDeckLinkAncillaryPacketIterator;
638 class IDeckLinkVideoFrameAncillaryPackets;
639 class IDeckLinkVideoFrameAncillary;
640 class IDeckLinkEncoderPacket;
641 class IDeckLinkEncoderVideoPacket;
642 class IDeckLinkEncoderAudioPacket;
643 class IDeckLinkH265NALPacket;
644 class IDeckLinkAudioInputPacket;
645 class IDeckLinkScreenPreviewCallback;
646 class IDeckLinkGLScreenPreviewHelper;
647 class IDeckLinkNotificationCallback;
648 class IDeckLinkNotification;
649 class IDeckLinkAttributes;
650 class IDeckLinkStatus;
651 class IDeckLinkKeyer;
652 class IDeckLinkVideoConversion;
653 class IDeckLinkDeviceNotificationCallback;
654 class IDeckLinkDiscovery;
655
656 /* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */
657
658 class BMD_PUBLIC IDeckLinkVideoOutputCallback : public IUnknown
659 {
660 public:
661     virtual HRESULT ScheduledFrameCompleted (/* in */ IDeckLinkVideoFrame *completedFrame, /* in */ BMDOutputFrameCompletionResult result) = 0;
662     virtual HRESULT ScheduledPlaybackHasStopped (void) = 0;
663
664 protected:
665     virtual ~IDeckLinkVideoOutputCallback () {} // call Release method to drop reference count
666 };
667
668 /* Interface IDeckLinkInputCallback - Frame arrival callback. */
669
670 class BMD_PUBLIC IDeckLinkInputCallback : public IUnknown
671 {
672 public:
673     virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
674     virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket) = 0;
675
676 protected:
677     virtual ~IDeckLinkInputCallback () {} // call Release method to drop reference count
678 };
679
680 /* Interface IDeckLinkEncoderInputCallback - Frame arrival callback. */
681
682 class BMD_PUBLIC IDeckLinkEncoderInputCallback : public IUnknown
683 {
684 public:
685     virtual HRESULT VideoInputSignalChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
686     virtual HRESULT VideoPacketArrived (/* in */ IDeckLinkEncoderVideoPacket* videoPacket) = 0;
687     virtual HRESULT AudioPacketArrived (/* in */ IDeckLinkEncoderAudioPacket* audioPacket) = 0;
688
689 protected:
690     virtual ~IDeckLinkEncoderInputCallback () {} // call Release method to drop reference count
691 };
692
693 /* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */
694
695 class BMD_PUBLIC IDeckLinkMemoryAllocator : public IUnknown
696 {
697 public:
698     virtual HRESULT AllocateBuffer (/* in */ uint32_t bufferSize, /* out */ void **allocatedBuffer) = 0;
699     virtual HRESULT ReleaseBuffer (/* in */ void *buffer) = 0;
700
701     virtual HRESULT Commit (void) = 0;
702     virtual HRESULT Decommit (void) = 0;
703 };
704
705 /* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */
706
707 class BMD_PUBLIC IDeckLinkAudioOutputCallback : public IUnknown
708 {
709 public:
710     virtual HRESULT RenderAudioSamples (/* in */ bool preroll) = 0;
711 };
712
713 /* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */
714
715 class BMD_PUBLIC IDeckLinkIterator : public IUnknown
716 {
717 public:
718     virtual HRESULT Next (/* out */ IDeckLink **deckLinkInstance) = 0;
719 };
720
721 /* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */
722
723 class BMD_PUBLIC IDeckLinkAPIInformation : public IUnknown
724 {
725 public:
726     virtual HRESULT GetFlag (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ bool *value) = 0;
727     virtual HRESULT GetInt (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ int64_t *value) = 0;
728     virtual HRESULT GetFloat (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ double *value) = 0;
729     virtual HRESULT GetString (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ const char **value) = 0;
730
731 protected:
732     virtual ~IDeckLinkAPIInformation () {} // call Release method to drop reference count
733 };
734
735 /* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
736
737 class BMD_PUBLIC IDeckLinkOutput : public IUnknown
738 {
739 public:
740     virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoOutputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
741     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
742
743     virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
744
745     /* Video Output */
746
747     virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0;
748     virtual HRESULT DisableVideoOutput (void) = 0;
749
750     virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
751     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;
752     virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0; // Use of IDeckLinkVideoFrameAncillaryPackets is preferred
753
754     virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
755     virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0;
756     virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0;
757     virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0;
758
759     /* Audio Output */
760
761     virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0;
762     virtual HRESULT DisableAudioOutput (void) = 0;
763
764     virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0;
765
766     virtual HRESULT BeginAudioPreroll (void) = 0;
767     virtual HRESULT EndAudioPreroll (void) = 0;
768     virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0;
769
770     virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0;
771     virtual HRESULT FlushBufferedAudioSamples (void) = 0;
772
773     virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0;
774
775     /* Output Control */
776
777     virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0;
778     virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0;
779     virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0;
780     virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0;
781     virtual HRESULT GetReferenceStatus (/* out */ BMDReferenceStatus *referenceStatus) = 0;
782
783     /* Hardware Timing */
784
785     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
786     virtual HRESULT GetFrameCompletionReferenceTimestamp (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *frameCompletionTimestamp) = 0;
787
788 protected:
789     virtual ~IDeckLinkOutput () {} // call Release method to drop reference count
790 };
791
792 /* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
793
794 class BMD_PUBLIC IDeckLinkInput : public IUnknown
795 {
796 public:
797     virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
798     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
799
800     virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
801
802     /* Video Input */
803
804     virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
805     virtual HRESULT DisableVideoInput (void) = 0;
806     virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0;
807     virtual HRESULT SetVideoInputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
808
809     /* Audio Input */
810
811     virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
812     virtual HRESULT DisableAudioInput (void) = 0;
813     virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
814
815     /* Input Control */
816
817     virtual HRESULT StartStreams (void) = 0;
818     virtual HRESULT StopStreams (void) = 0;
819     virtual HRESULT PauseStreams (void) = 0;
820     virtual HRESULT FlushStreams (void) = 0;
821     virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback *theCallback) = 0;
822
823     /* Hardware Timing */
824
825     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
826
827 protected:
828     virtual ~IDeckLinkInput () {} // call Release method to drop reference count
829 };
830
831 /* Interface IDeckLinkHDMIInputEDID - Created by QueryInterface from IDeckLink. Releasing all references will restore EDID to default */
832
833 class BMD_PUBLIC IDeckLinkHDMIInputEDID : public IUnknown
834 {
835 public:
836     virtual HRESULT SetInt (/* in */ BMDDeckLinkHDMIInputEDIDID cfgID, /* in */ int64_t value) = 0;
837     virtual HRESULT GetInt (/* in */ BMDDeckLinkHDMIInputEDIDID cfgID, /* out */ int64_t *value) = 0;
838     virtual HRESULT WriteToEDID (void) = 0;
839
840 protected:
841     virtual ~IDeckLinkHDMIInputEDID () {} // call Release method to drop reference count
842 };
843
844 /* Interface IDeckLinkEncoderInput - Created by QueryInterface from IDeckLink. */
845
846 class BMD_PUBLIC IDeckLinkEncoderInput : public IUnknown
847 {
848 public:
849     virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
850     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
851
852     /* Video Input */
853
854     virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
855     virtual HRESULT DisableVideoInput (void) = 0;
856     virtual HRESULT GetAvailablePacketsCount (/* out */ uint32_t *availablePacketsCount) = 0;
857     virtual HRESULT SetMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
858
859     /* Audio Input */
860
861     virtual HRESULT EnableAudioInput (/* in */ BMDAudioFormat audioFormat, /* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
862     virtual HRESULT DisableAudioInput (void) = 0;
863     virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
864
865     /* Input Control */
866
867     virtual HRESULT StartStreams (void) = 0;
868     virtual HRESULT StopStreams (void) = 0;
869     virtual HRESULT PauseStreams (void) = 0;
870     virtual HRESULT FlushStreams (void) = 0;
871     virtual HRESULT SetCallback (/* in */ IDeckLinkEncoderInputCallback *theCallback) = 0;
872
873     /* Hardware Timing */
874
875     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
876
877 protected:
878     virtual ~IDeckLinkEncoderInput () {} // call Release method to drop reference count
879 };
880
881 /* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */
882
883 class BMD_PUBLIC IDeckLinkVideoFrame : public IUnknown
884 {
885 public:
886     virtual long GetWidth (void) = 0;
887     virtual long GetHeight (void) = 0;
888     virtual long GetRowBytes (void) = 0;
889     virtual BMDPixelFormat GetPixelFormat (void) = 0;
890     virtual BMDFrameFlags GetFlags (void) = 0;
891     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
892
893     virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0;
894     virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) = 0; // Use of IDeckLinkVideoFrameAncillaryPackets is preferred
895
896 protected:
897     virtual ~IDeckLinkVideoFrame () {} // call Release method to drop reference count
898 };
899
900 /* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */
901
902 class BMD_PUBLIC IDeckLinkMutableVideoFrame : public IDeckLinkVideoFrame
903 {
904 public:
905     virtual HRESULT SetFlags (/* in */ BMDFrameFlags newFlags) = 0;
906
907     virtual HRESULT SetTimecode (/* in */ BMDTimecodeFormat format, /* in */ IDeckLinkTimecode *timecode) = 0;
908     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;
909     virtual HRESULT SetAncillaryData (/* in */ IDeckLinkVideoFrameAncillary *ancillary) = 0;
910     virtual HRESULT SetTimecodeUserBits (/* in */ BMDTimecodeFormat format, /* in */ BMDTimecodeUserBits userBits) = 0;
911
912 protected:
913     virtual ~IDeckLinkMutableVideoFrame () {} // call Release method to drop reference count
914 };
915
916 /* Interface IDeckLinkVideoFrame3DExtensions - Optional interface implemented on IDeckLinkVideoFrame to support 3D frames */
917
918 class BMD_PUBLIC IDeckLinkVideoFrame3DExtensions : public IUnknown
919 {
920 public:
921     virtual BMDVideo3DPackingFormat Get3DPackingFormat (void) = 0;
922     virtual HRESULT GetFrameForRightEye (/* out */ IDeckLinkVideoFrame* *rightEyeFrame) = 0;
923
924 protected:
925     virtual ~IDeckLinkVideoFrame3DExtensions () {} // call Release method to drop reference count
926 };
927
928 /* Interface IDeckLinkVideoFrameMetadataExtensions - Optional interface implemented on IDeckLinkVideoFrame to support frame metadata such as HDMI HDR information */
929
930 class BMD_PUBLIC IDeckLinkVideoFrameMetadataExtensions : public IUnknown
931 {
932 public:
933     virtual HRESULT GetInt (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ int64_t *value) = 0;
934     virtual HRESULT GetFloat (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ double *value) = 0;
935     virtual HRESULT GetFlag (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ bool* value) = 0;
936     virtual HRESULT GetString (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ const char **value) = 0;
937
938 protected:
939     virtual ~IDeckLinkVideoFrameMetadataExtensions () {} // call Release method to drop reference count
940 };
941
942 /* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
943
944 class BMD_PUBLIC IDeckLinkVideoInputFrame : public IDeckLinkVideoFrame
945 {
946 public:
947     virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, /* in */ BMDTimeScale timeScale) = 0;
948     virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
949
950 protected:
951     virtual ~IDeckLinkVideoInputFrame () {} // call Release method to drop reference count
952 };
953
954 /* Interface IDeckLinkAncillaryPacket - On output, user needs to implement this interface */
955
956 class BMD_PUBLIC IDeckLinkAncillaryPacket : public IUnknown
957 {
958 public:
959
960     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;
961     virtual uint8_t GetDID (void) = 0;
962     virtual uint8_t GetSDID (void) = 0;
963     virtual uint32_t GetLineNumber (void) = 0; // On output, zero is auto
964     virtual uint8_t GetDataStreamIndex (void) = 0; // Usually zero. Can only be 1 if non-SD and the first data stream is completely full
965
966 protected:
967     virtual ~IDeckLinkAncillaryPacket () {} // call Release method to drop reference count
968 };
969
970 /* Interface IDeckLinkAncillaryPacketIterator - Enumerates ancillary packets */
971
972 class BMD_PUBLIC IDeckLinkAncillaryPacketIterator : public IUnknown
973 {
974 public:
975     virtual HRESULT Next (/* out */ IDeckLinkAncillaryPacket **packet) = 0;
976
977 protected:
978     virtual ~IDeckLinkAncillaryPacketIterator () {} // call Release method to drop reference count
979 };
980
981 /* Interface IDeckLinkVideoFrameAncillaryPackets - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
982
983 class BMD_PUBLIC IDeckLinkVideoFrameAncillaryPackets : public IUnknown
984 {
985 public:
986
987     virtual HRESULT GetPacketIterator (/* out */ IDeckLinkAncillaryPacketIterator **iterator) = 0;
988     virtual HRESULT GetFirstPacketByID (/* in */ uint8_t DID, /* in */ uint8_t SDID, /* out */ IDeckLinkAncillaryPacket **packet) = 0;
989     virtual HRESULT AttachPacket (/* in */ IDeckLinkAncillaryPacket *packet) = 0; // Implement IDeckLinkAncillaryPacket to output your own
990     virtual HRESULT DetachPacket (/* in */ IDeckLinkAncillaryPacket *packet) = 0;
991     virtual HRESULT DetachAllPackets (void) = 0;
992
993 protected:
994     virtual ~IDeckLinkVideoFrameAncillaryPackets () {} // call Release method to drop reference count
995 };
996
997 /* Interface IDeckLinkVideoFrameAncillary - Use of IDeckLinkVideoFrameAncillaryPackets is preferred. Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
998
999 class BMD_PUBLIC IDeckLinkVideoFrameAncillary : public IUnknown
1000 {
1001 public:
1002
1003     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
1004     virtual BMDPixelFormat GetPixelFormat (void) = 0;
1005     virtual BMDDisplayMode GetDisplayMode (void) = 0;
1006
1007 protected:
1008     virtual ~IDeckLinkVideoFrameAncillary () {} // call Release method to drop reference count
1009 };
1010
1011 /* Interface IDeckLinkEncoderPacket - Interface to encapsulate an encoded packet. */
1012
1013 class BMD_PUBLIC IDeckLinkEncoderPacket : public IUnknown
1014 {
1015 public:
1016     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
1017     virtual long GetSize (void) = 0;
1018     virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* in */ BMDTimeScale timeScale) = 0;
1019     virtual BMDPacketType GetPacketType (void) = 0;
1020
1021 protected:
1022     virtual ~IDeckLinkEncoderPacket () {} // call Release method to drop reference count
1023 };
1024
1025 /* Interface IDeckLinkEncoderVideoPacket - Provided by the IDeckLinkEncoderInput video packet arrival callback. */
1026
1027 class BMD_PUBLIC IDeckLinkEncoderVideoPacket : public IDeckLinkEncoderPacket
1028 {
1029 public:
1030     virtual BMDPixelFormat GetPixelFormat (void) = 0;
1031     virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
1032
1033     virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0;
1034
1035 protected:
1036     virtual ~IDeckLinkEncoderVideoPacket () {} // call Release method to drop reference count
1037 };
1038
1039 /* Interface IDeckLinkEncoderAudioPacket - Provided by the IDeckLinkEncoderInput audio packet arrival callback. */
1040
1041 class BMD_PUBLIC IDeckLinkEncoderAudioPacket : public IDeckLinkEncoderPacket
1042 {
1043 public:
1044     virtual BMDAudioFormat GetAudioFormat (void) = 0;
1045
1046 protected:
1047     virtual ~IDeckLinkEncoderAudioPacket () {} // call Release method to drop reference count
1048 };
1049
1050 /* Interface IDeckLinkH265NALPacket - Obtained through QueryInterface() on an IDeckLinkEncoderVideoPacket object */
1051
1052 class BMD_PUBLIC IDeckLinkH265NALPacket : public IDeckLinkEncoderVideoPacket
1053 {
1054 public:
1055     virtual HRESULT GetUnitType (/* out */ uint8_t *unitType) = 0;
1056     virtual HRESULT GetBytesNoPrefix (/* out */ void **buffer) = 0;
1057     virtual long GetSizeNoPrefix (void) = 0;
1058
1059 protected:
1060     virtual ~IDeckLinkH265NALPacket () {} // call Release method to drop reference count
1061 };
1062
1063 /* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */
1064
1065 class BMD_PUBLIC IDeckLinkAudioInputPacket : public IUnknown
1066 {
1067 public:
1068     virtual long GetSampleFrameCount (void) = 0;
1069     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
1070     virtual HRESULT GetPacketTime (/* out */ BMDTimeValue *packetTime, /* in */ BMDTimeScale timeScale) = 0;
1071
1072 protected:
1073     virtual ~IDeckLinkAudioInputPacket () {} // call Release method to drop reference count
1074 };
1075
1076 /* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */
1077
1078 class BMD_PUBLIC IDeckLinkScreenPreviewCallback : public IUnknown
1079 {
1080 public:
1081     virtual HRESULT DrawFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
1082
1083 protected:
1084     virtual ~IDeckLinkScreenPreviewCallback () {} // call Release method to drop reference count
1085 };
1086
1087 /* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */
1088
1089 class BMD_PUBLIC IDeckLinkGLScreenPreviewHelper : public IUnknown
1090 {
1091 public:
1092
1093     /* Methods must be called with OpenGL context set */
1094
1095     virtual HRESULT InitializeGL (void) = 0;
1096     virtual HRESULT PaintGL (void) = 0;
1097     virtual HRESULT SetFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
1098     virtual HRESULT Set3DPreviewFormat (/* in */ BMD3DPreviewFormat previewFormat) = 0;
1099
1100 protected:
1101     virtual ~IDeckLinkGLScreenPreviewHelper () {} // call Release method to drop reference count
1102 };
1103
1104 /* Interface IDeckLinkNotificationCallback - DeckLink Notification Callback Interface */
1105
1106 class BMD_PUBLIC IDeckLinkNotificationCallback : public IUnknown
1107 {
1108 public:
1109     virtual HRESULT Notify (/* in */ BMDNotifications topic, /* in */ uint64_t param1, /* in */ uint64_t param2) = 0;
1110 };
1111
1112 /* Interface IDeckLinkNotification - DeckLink Notification interface */
1113
1114 class BMD_PUBLIC IDeckLinkNotification : public IUnknown
1115 {
1116 public:
1117     virtual HRESULT Subscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
1118     virtual HRESULT Unsubscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
1119 };
1120
1121 /* Interface IDeckLinkAttributes - DeckLink Attribute interface */
1122
1123 class BMD_PUBLIC IDeckLinkAttributes : public IUnknown
1124 {
1125 public:
1126     virtual HRESULT GetFlag (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ bool *value) = 0;
1127     virtual HRESULT GetInt (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ int64_t *value) = 0;
1128     virtual HRESULT GetFloat (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ double *value) = 0;
1129     virtual HRESULT GetString (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ const char **value) = 0;
1130
1131 protected:
1132     virtual ~IDeckLinkAttributes () {} // call Release method to drop reference count
1133 };
1134
1135 /* Interface IDeckLinkStatus - DeckLink Status interface */
1136
1137 class BMD_PUBLIC IDeckLinkStatus : public IUnknown
1138 {
1139 public:
1140     virtual HRESULT GetFlag (/* in */ BMDDeckLinkStatusID statusID, /* out */ bool *value) = 0;
1141     virtual HRESULT GetInt (/* in */ BMDDeckLinkStatusID statusID, /* out */ int64_t *value) = 0;
1142     virtual HRESULT GetFloat (/* in */ BMDDeckLinkStatusID statusID, /* out */ double *value) = 0;
1143     virtual HRESULT GetString (/* in */ BMDDeckLinkStatusID statusID, /* out */ const char **value) = 0;
1144     virtual HRESULT GetBytes (/* in */ BMDDeckLinkStatusID statusID, /* out */ void *buffer, /* in, out */ uint32_t *bufferSize) = 0;
1145
1146 protected:
1147     virtual ~IDeckLinkStatus () {} // call Release method to drop reference count
1148 };
1149
1150 /* Interface IDeckLinkKeyer - DeckLink Keyer interface */
1151
1152 class BMD_PUBLIC IDeckLinkKeyer : public IUnknown
1153 {
1154 public:
1155     virtual HRESULT Enable (/* in */ bool isExternal) = 0;
1156     virtual HRESULT SetLevel (/* in */ uint8_t level) = 0;
1157     virtual HRESULT RampUp (/* in */ uint32_t numberOfFrames) = 0;
1158     virtual HRESULT RampDown (/* in */ uint32_t numberOfFrames) = 0;
1159     virtual HRESULT Disable (void) = 0;
1160
1161 protected:
1162     virtual ~IDeckLinkKeyer () {} // call Release method to drop reference count
1163 };
1164
1165 /* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */
1166
1167 class BMD_PUBLIC IDeckLinkVideoConversion : public IUnknown
1168 {
1169 public:
1170     virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ IDeckLinkVideoFrame* dstFrame) = 0;
1171
1172 protected:
1173     virtual ~IDeckLinkVideoConversion () {} // call Release method to drop reference count
1174 };
1175
1176 /* Interface IDeckLinkDeviceNotificationCallback - DeckLink device arrival/removal notification callbacks */
1177
1178 class BMD_PUBLIC IDeckLinkDeviceNotificationCallback : public IUnknown
1179 {
1180 public:
1181     virtual HRESULT DeckLinkDeviceArrived (/* in */ IDeckLink* deckLinkDevice) = 0;
1182     virtual HRESULT DeckLinkDeviceRemoved (/* in */ IDeckLink* deckLinkDevice) = 0;
1183
1184 protected:
1185     virtual ~IDeckLinkDeviceNotificationCallback () {} // call Release method to drop reference count
1186 };
1187
1188 /* Interface IDeckLinkDiscovery - DeckLink device discovery */
1189
1190 class BMD_PUBLIC IDeckLinkDiscovery : public IUnknown
1191 {
1192 public:
1193     virtual HRESULT InstallDeviceNotifications (/* in */ IDeckLinkDeviceNotificationCallback* deviceNotificationCallback) = 0;
1194     virtual HRESULT UninstallDeviceNotifications (void) = 0;
1195
1196 protected:
1197     virtual ~IDeckLinkDiscovery () {} // call Release method to drop reference count
1198 };
1199
1200 /* Functions */
1201
1202 extern "C" {
1203
1204     IDeckLinkIterator* BMD_PUBLIC CreateDeckLinkIteratorInstance (void);
1205     IDeckLinkDiscovery* BMD_PUBLIC CreateDeckLinkDiscoveryInstance (void);
1206     IDeckLinkAPIInformation* BMD_PUBLIC CreateDeckLinkAPIInformationInstance (void);
1207     IDeckLinkGLScreenPreviewHelper* BMD_PUBLIC CreateOpenGLScreenPreviewHelper (void);
1208     IDeckLinkVideoConversion* BMD_PUBLIC CreateVideoConversionInstance (void);
1209     IDeckLinkVideoFrameAncillaryPackets* BMD_PUBLIC CreateVideoFrameAncillaryPacketsInstance (void); // For use when creating a custom IDeckLinkVideoFrame without wrapping IDeckLinkOutput::CreateVideoFrame
1210
1211 }
1212
1213
1214 #endif      // defined(__cplusplus)
1215 #endif /* defined(BMD_DECKLINKAPI_H) */