]> git.sesse.net Git - nageru/blob - nageru/decklink/DeckLinkAPI.h
2a0f90adbbc5ac7cc451afd24ae9bef4f9ce7b69
[nageru] / nageru / decklink / DeckLinkAPI.h
1 /* -LICENSE-START-
2 ** Copyright (c) 2015 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 /* DeckLink API */
41
42 #include <stdint.h>
43 #include "LinuxCOM.h"
44
45 #include "DeckLinkAPITypes.h"
46 #include "DeckLinkAPIModes.h"
47 #include "DeckLinkAPIDiscovery.h"
48 #include "DeckLinkAPIConfiguration.h"
49 #include "DeckLinkAPIDeckControl.h"
50
51 #define BLACKMAGIC_DECKLINK_API_MAGIC   1
52
53 // Type Declarations
54
55
56 // Interface ID Declarations
57
58 BMD_CONST REFIID IID_IDeckLinkVideoOutputCallback                 = /* 20AA5225-1958-47CB-820B-80A8D521A6EE */ {0x20,0xAA,0x52,0x25,0x19,0x58,0x47,0xCB,0x82,0x0B,0x80,0xA8,0xD5,0x21,0xA6,0xEE};
59 BMD_CONST REFIID IID_IDeckLinkInputCallback                       = /* DD04E5EC-7415-42AB-AE4A-E80C4DFC044A */ {0xDD,0x04,0xE5,0xEC,0x74,0x15,0x42,0xAB,0xAE,0x4A,0xE8,0x0C,0x4D,0xFC,0x04,0x4A};
60 BMD_CONST REFIID IID_IDeckLinkEncoderInputCallback                = /* ACF13E61-F4A0-4974-A6A7-59AFF6268B31 */ {0xAC,0xF1,0x3E,0x61,0xF4,0xA0,0x49,0x74,0xA6,0xA7,0x59,0xAF,0xF6,0x26,0x8B,0x31};
61 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};
62 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};
63 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};
64 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};
65 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};
66 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};
67 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};
68 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};
69 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};
70 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};
71 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};
72 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};
73 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};
74 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};
75 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};
76 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};
77 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};
78 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};
79 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};
80 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};
81 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};
82 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};
83 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};
84 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};
85 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};
86 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};
87
88 /* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */
89
90 typedef uint32_t BMDVideoOutputFlags;
91 enum _BMDVideoOutputFlags {
92     bmdVideoOutputFlagDefault                                    = 0,
93     bmdVideoOutputVANC                                           = 1 << 0,
94     bmdVideoOutputVITC                                           = 1 << 1,
95     bmdVideoOutputRP188                                          = 1 << 2,
96     bmdVideoOutputDualStream3D                                   = 1 << 4
97 };
98
99 /* Enum BMDPacketType - Type of packet */
100
101 typedef uint32_t BMDPacketType;
102 enum _BMDPacketType {
103     bmdPacketTypeStreamInterruptedMarker                         = /* 'sint' */ 0x73696E74,     // A packet of this type marks the time when a video stream was interrupted, for example by a disconnected cable
104     bmdPacketTypeStreamData                                      = /* 'sdat' */ 0x73646174      // Regular stream data
105 };
106
107 /* Enum BMDFrameFlags - Frame flags */
108
109 typedef uint32_t BMDFrameFlags;
110 enum _BMDFrameFlags {
111     bmdFrameFlagDefault                                          = 0,
112     bmdFrameFlagFlipVertical                                     = 1 << 0,
113
114     /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */
115
116     bmdFrameHasNoInputSource                                     = 1 << 31
117 };
118
119 /* Enum BMDVideoInputFlags - Flags applicable to video input */
120
121 typedef uint32_t BMDVideoInputFlags;
122 enum _BMDVideoInputFlags {
123     bmdVideoInputFlagDefault                                     = 0,
124     bmdVideoInputEnableFormatDetection                           = 1 << 0,
125     bmdVideoInputDualStream3D                                    = 1 << 1
126 };
127
128 /* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */
129
130 typedef uint32_t BMDVideoInputFormatChangedEvents;
131 enum _BMDVideoInputFormatChangedEvents {
132     bmdVideoInputDisplayModeChanged                              = 1 << 0,
133     bmdVideoInputFieldDominanceChanged                           = 1 << 1,
134     bmdVideoInputColorspaceChanged                               = 1 << 2
135 };
136
137 /* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */
138
139 typedef uint32_t BMDDetectedVideoInputFormatFlags;
140 enum _BMDDetectedVideoInputFormatFlags {
141     bmdDetectedVideoInputYCbCr422                                = 1 << 0,
142     bmdDetectedVideoInputRGB444                                  = 1 << 1,
143     bmdDetectedVideoInputDualStream3D                            = 1 << 2
144 };
145
146 /* Enum BMDDeckLinkCapturePassthroughMode - Enumerates whether the video output is electrically connected to the video input or if the clean switching mode is enabled */
147
148 typedef uint32_t BMDDeckLinkCapturePassthroughMode;
149 enum _BMDDeckLinkCapturePassthroughMode {
150     bmdDeckLinkCapturePassthroughModeDirect                      = /* 'pdir' */ 0x70646972,
151     bmdDeckLinkCapturePassthroughModeCleanSwitch                 = /* 'pcln' */ 0x70636C6E
152 };
153
154 /* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */
155
156 typedef uint32_t BMDOutputFrameCompletionResult;
157 enum _BMDOutputFrameCompletionResult {
158     bmdOutputFrameCompleted,                                    
159     bmdOutputFrameDisplayedLate,                                
160     bmdOutputFrameDropped,                                      
161     bmdOutputFrameFlushed                                       
162 };
163
164 /* Enum BMDReferenceStatus - GenLock input status */
165
166 typedef uint32_t BMDReferenceStatus;
167 enum _BMDReferenceStatus {
168     bmdReferenceNotSupportedByHardware                           = 1 << 0,
169     bmdReferenceLocked                                           = 1 << 1
170 };
171
172 /* Enum BMDAudioFormat - Audio Format */
173
174 typedef uint32_t BMDAudioFormat;
175 enum _BMDAudioFormat {
176     bmdAudioFormatPCM                                            = /* 'lpcm' */ 0x6C70636D      // Linear signed PCM samples
177 };
178
179 /* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */
180
181 typedef uint32_t BMDAudioSampleRate;
182 enum _BMDAudioSampleRate {
183     bmdAudioSampleRate48kHz                                      = 48000
184 };
185
186 /* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */
187
188 typedef uint32_t BMDAudioSampleType;
189 enum _BMDAudioSampleType {
190     bmdAudioSampleType16bitInteger                               = 16,
191     bmdAudioSampleType32bitInteger                               = 32
192 };
193
194 /* Enum BMDAudioOutputStreamType - Audio output stream type */
195
196 typedef uint32_t BMDAudioOutputStreamType;
197 enum _BMDAudioOutputStreamType {
198     bmdAudioOutputStreamContinuous,                             
199     bmdAudioOutputStreamContinuousDontResample,                 
200     bmdAudioOutputStreamTimestamped                             
201 };
202
203 /* Enum BMDDisplayModeSupport - Output mode supported flags */
204
205 typedef uint32_t BMDDisplayModeSupport;
206 enum _BMDDisplayModeSupport {
207     bmdDisplayModeNotSupported                                   = 0,
208     bmdDisplayModeSupported,                                    
209     bmdDisplayModeSupportedWithConversion                       
210 };
211
212 /* Enum BMDTimecodeFormat - Timecode formats for frame metadata */
213
214 typedef uint32_t BMDTimecodeFormat;
215 enum _BMDTimecodeFormat {
216     bmdTimecodeRP188VITC1                                        = /* 'rpv1' */ 0x72707631,     // RP188 timecode where DBB1 equals VITC1 (line 9)
217     bmdTimecodeRP188VITC2                                        = /* 'rp12' */ 0x72703132,     // RP188 timecode where DBB1 equals VITC2 (line 9 for progressive or line 571 for interlaced/PsF)
218     bmdTimecodeRP188LTC                                          = /* 'rplt' */ 0x72706C74,     // RP188 timecode where DBB1 equals LTC (line 10)
219     bmdTimecodeRP188Any                                          = /* 'rp18' */ 0x72703138,     // For capture: return the first valid timecode in {VITC1, LTC ,VITC2} - For playback: set the timecode as VITC1
220     bmdTimecodeVITC                                              = /* 'vitc' */ 0x76697463,
221     bmdTimecodeVITCField2                                        = /* 'vit2' */ 0x76697432,
222     bmdTimecodeSerial                                            = /* 'seri' */ 0x73657269
223 };
224
225 /* Enum BMDAnalogVideoFlags - Analog video display flags */
226
227 typedef uint32_t BMDAnalogVideoFlags;
228 enum _BMDAnalogVideoFlags {
229     bmdAnalogVideoFlagCompositeSetup75                           = 1 << 0,
230     bmdAnalogVideoFlagComponentBetacamLevels                     = 1 << 1
231 };
232
233 /* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */
234
235 typedef uint32_t BMDAudioOutputAnalogAESSwitch;
236 enum _BMDAudioOutputAnalogAESSwitch {
237     bmdAudioOutputSwitchAESEBU                                   = /* 'aes ' */ 0x61657320,
238     bmdAudioOutputSwitchAnalog                                   = /* 'anlg' */ 0x616E6C67
239 };
240
241 /* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */
242
243 typedef uint32_t BMDVideoOutputConversionMode;
244 enum _BMDVideoOutputConversionMode {
245     bmdNoVideoOutputConversion                                   = /* 'none' */ 0x6E6F6E65,
246     bmdVideoOutputLetterboxDownconversion                        = /* 'ltbx' */ 0x6C746278,
247     bmdVideoOutputAnamorphicDownconversion                       = /* 'amph' */ 0x616D7068,
248     bmdVideoOutputHD720toHD1080Conversion                        = /* '720c' */ 0x37323063,
249     bmdVideoOutputHardwareLetterboxDownconversion                = /* 'HWlb' */ 0x48576C62,
250     bmdVideoOutputHardwareAnamorphicDownconversion               = /* 'HWam' */ 0x4857616D,
251     bmdVideoOutputHardwareCenterCutDownconversion                = /* 'HWcc' */ 0x48576363,
252     bmdVideoOutputHardware720p1080pCrossconversion               = /* 'xcap' */ 0x78636170,
253     bmdVideoOutputHardwareAnamorphic720pUpconversion             = /* 'ua7p' */ 0x75613770,
254     bmdVideoOutputHardwareAnamorphic1080iUpconversion            = /* 'ua1i' */ 0x75613169,
255     bmdVideoOutputHardwareAnamorphic149To720pUpconversion        = /* 'u47p' */ 0x75343770,
256     bmdVideoOutputHardwareAnamorphic149To1080iUpconversion       = /* 'u41i' */ 0x75343169,
257     bmdVideoOutputHardwarePillarbox720pUpconversion              = /* 'up7p' */ 0x75703770,
258     bmdVideoOutputHardwarePillarbox1080iUpconversion             = /* 'up1i' */ 0x75703169
259 };
260
261 /* Enum BMDVideoInputConversionMode - Video input conversion mode */
262
263 typedef uint32_t BMDVideoInputConversionMode;
264 enum _BMDVideoInputConversionMode {
265     bmdNoVideoInputConversion                                    = /* 'none' */ 0x6E6F6E65,
266     bmdVideoInputLetterboxDownconversionFromHD1080               = /* '10lb' */ 0x31306C62,
267     bmdVideoInputAnamorphicDownconversionFromHD1080              = /* '10am' */ 0x3130616D,
268     bmdVideoInputLetterboxDownconversionFromHD720                = /* '72lb' */ 0x37326C62,
269     bmdVideoInputAnamorphicDownconversionFromHD720               = /* '72am' */ 0x3732616D,
270     bmdVideoInputLetterboxUpconversion                           = /* 'lbup' */ 0x6C627570,
271     bmdVideoInputAnamorphicUpconversion                          = /* 'amup' */ 0x616D7570
272 };
273
274 /* Enum BMDVideo3DPackingFormat - Video 3D packing format */
275
276 typedef uint32_t BMDVideo3DPackingFormat;
277 enum _BMDVideo3DPackingFormat {
278     bmdVideo3DPackingSidebySideHalf                              = /* 'sbsh' */ 0x73627368,
279     bmdVideo3DPackingLinebyLine                                  = /* 'lbyl' */ 0x6C62796C,
280     bmdVideo3DPackingTopAndBottom                                = /* 'tabo' */ 0x7461626F,
281     bmdVideo3DPackingFramePacking                                = /* 'frpk' */ 0x6672706B,
282     bmdVideo3DPackingLeftOnly                                    = /* 'left' */ 0x6C656674,
283     bmdVideo3DPackingRightOnly                                   = /* 'righ' */ 0x72696768
284 };
285
286 /* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */
287
288 typedef uint32_t BMDIdleVideoOutputOperation;
289 enum _BMDIdleVideoOutputOperation {
290     bmdIdleVideoOutputBlack                                      = /* 'blac' */ 0x626C6163,
291     bmdIdleVideoOutputLastFrame                                  = /* 'lafa' */ 0x6C616661,
292     bmdIdleVideoOutputDesktop                                    = /* 'desk' */ 0x6465736B
293 };
294
295 /* Enum BMDVideoEncoderFrameCodingMode - Video frame coding mode */
296
297 typedef uint32_t BMDVideoEncoderFrameCodingMode;
298 enum _BMDVideoEncoderFrameCodingMode {
299     bmdVideoEncoderFrameCodingModeInter                          = /* 'inte' */ 0x696E7465,
300     bmdVideoEncoderFrameCodingModeIntra                          = /* 'intr' */ 0x696E7472
301 };
302
303 /* Enum BMDDNxHRLevel - DNxHR Levels */
304
305 typedef uint32_t BMDDNxHRLevel;
306 enum _BMDDNxHRLevel {
307     bmdDNxHRLevelSQ                                              = /* 'dnsq' */ 0x646E7371,
308     bmdDNxHRLevelLB                                              = /* 'dnlb' */ 0x646E6C62,
309     bmdDNxHRLevelHQ                                              = /* 'dnhq' */ 0x646E6871,
310     bmdDNxHRLevelHQX                                             = /* 'dhqx' */ 0x64687178,
311     bmdDNxHRLevel444                                             = /* 'd444' */ 0x64343434
312 };
313
314 /* Enum BMDLinkConfiguration - Video link configuration */
315
316 typedef uint32_t BMDLinkConfiguration;
317 enum _BMDLinkConfiguration {
318     bmdLinkConfigurationSingleLink                               = /* 'lcsl' */ 0x6C63736C,
319     bmdLinkConfigurationDualLink                                 = /* 'lcdl' */ 0x6C63646C,
320     bmdLinkConfigurationQuadLink                                 = /* 'lcql' */ 0x6C63716C
321 };
322
323 /* Enum BMDDeviceInterface - Device interface type */
324
325 typedef uint32_t BMDDeviceInterface;
326 enum _BMDDeviceInterface {
327     bmdDeviceInterfacePCI                                        = /* 'pci ' */ 0x70636920,
328     bmdDeviceInterfaceUSB                                        = /* 'usb ' */ 0x75736220,
329     bmdDeviceInterfaceThunderbolt                                = /* 'thun' */ 0x7468756E
330 };
331
332 /* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */
333
334 typedef uint32_t BMDDeckLinkAttributeID;
335 enum _BMDDeckLinkAttributeID {
336
337     /* Flags */
338
339     BMDDeckLinkSupportsInternalKeying                            = /* 'keyi' */ 0x6B657969,
340     BMDDeckLinkSupportsExternalKeying                            = /* 'keye' */ 0x6B657965,
341     BMDDeckLinkSupportsHDKeying                                  = /* 'keyh' */ 0x6B657968,
342     BMDDeckLinkSupportsInputFormatDetection                      = /* 'infd' */ 0x696E6664,
343     BMDDeckLinkHasReferenceInput                                 = /* 'hrin' */ 0x6872696E,
344     BMDDeckLinkHasSerialPort                                     = /* 'hspt' */ 0x68737074,
345     BMDDeckLinkHasAnalogVideoOutputGain                          = /* 'avog' */ 0x61766F67,
346     BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain               = /* 'ovog' */ 0x6F766F67,
347     BMDDeckLinkHasVideoInputAntiAliasingFilter                   = /* 'aafl' */ 0x6161666C,
348     BMDDeckLinkHasBypass                                         = /* 'byps' */ 0x62797073,
349     BMDDeckLinkSupportsDesktopDisplay                            = /* 'extd' */ 0x65787464,
350     BMDDeckLinkSupportsClockTimingAdjustment                     = /* 'ctad' */ 0x63746164,
351     BMDDeckLinkSupportsFullDuplex                                = /* 'fdup' */ 0x66647570,
352     BMDDeckLinkSupportsFullFrameReferenceInputTimingOffset       = /* 'frin' */ 0x6672696E,
353     BMDDeckLinkSupportsSMPTELevelAOutput                         = /* 'lvla' */ 0x6C766C61,
354     BMDDeckLinkSupportsDualLinkSDI                               = /* 'sdls' */ 0x73646C73,
355     BMDDeckLinkSupportsQuadLinkSDI                               = /* 'sqls' */ 0x73716C73,
356     BMDDeckLinkSupportsIdleOutput                                = /* 'idou' */ 0x69646F75,
357     BMDDeckLinkHasLTCTimecodeInput                               = /* 'hltc' */ 0x686C7463,
358
359     /* Integers */
360
361     BMDDeckLinkMaximumAudioChannels                              = /* 'mach' */ 0x6D616368,
362     BMDDeckLinkMaximumAnalogAudioChannels                        = /* 'aach' */ 0x61616368,
363     BMDDeckLinkNumberOfSubDevices                                = /* 'nsbd' */ 0x6E736264,
364     BMDDeckLinkSubDeviceIndex                                    = /* 'subi' */ 0x73756269,
365     BMDDeckLinkPersistentID                                      = /* 'peid' */ 0x70656964,
366     BMDDeckLinkTopologicalID                                     = /* 'toid' */ 0x746F6964,
367     BMDDeckLinkVideoOutputConnections                            = /* 'vocn' */ 0x766F636E,
368     BMDDeckLinkVideoInputConnections                             = /* 'vicn' */ 0x7669636E,
369     BMDDeckLinkAudioOutputConnections                            = /* 'aocn' */ 0x616F636E,
370     BMDDeckLinkAudioInputConnections                             = /* 'aicn' */ 0x6169636E,
371     BMDDeckLinkDeviceBusyState                                   = /* 'dbst' */ 0x64627374,
372     BMDDeckLinkVideoIOSupport                                    = /* 'vios' */ 0x76696F73,     // Returns a BMDVideoIOSupport bit field
373     BMDDeckLinkDeckControlConnections                            = /* 'dccn' */ 0x6463636E,
374     BMDDeckLinkDeviceInterface                                   = /* 'dbus' */ 0x64627573,     // Returns a BMDDeviceInterface
375     BMDDeckLinkAudioInputRCAChannelCount                         = /* 'airc' */ 0x61697263,
376     BMDDeckLinkAudioInputXLRChannelCount                         = /* 'aixc' */ 0x61697863,
377     BMDDeckLinkAudioOutputRCAChannelCount                        = /* 'aorc' */ 0x616F7263,
378     BMDDeckLinkAudioOutputXLRChannelCount                        = /* 'aoxc' */ 0x616F7863,
379
380     /* Floats */
381
382     BMDDeckLinkVideoInputGainMinimum                             = /* 'vigm' */ 0x7669676D,
383     BMDDeckLinkVideoInputGainMaximum                             = /* 'vigx' */ 0x76696778,
384     BMDDeckLinkVideoOutputGainMinimum                            = /* 'vogm' */ 0x766F676D,
385     BMDDeckLinkVideoOutputGainMaximum                            = /* 'vogx' */ 0x766F6778,
386     BMDDeckLinkMicrophoneInputGainMinimum                        = /* 'migm' */ 0x6D69676D,
387     BMDDeckLinkMicrophoneInputGainMaximum                        = /* 'migx' */ 0x6D696778,
388
389     /* Strings */
390
391     BMDDeckLinkSerialPortDeviceName                              = /* 'slpn' */ 0x736C706E,
392     BMDDeckLinkVendorName                                        = /* 'vndr' */ 0x766E6472,
393     BMDDeckLinkDisplayName                                       = /* 'dspn' */ 0x6473706E,
394     BMDDeckLinkModelName                                         = /* 'mdln' */ 0x6D646C6E
395 };
396
397 /* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */
398
399 typedef uint32_t BMDDeckLinkAPIInformationID;
400 enum _BMDDeckLinkAPIInformationID {
401     BMDDeckLinkAPIVersion                                        = /* 'vers' */ 0x76657273
402 };
403
404 /* Enum BMDDeviceBusyState - Current device busy state */
405
406 typedef uint32_t BMDDeviceBusyState;
407 enum _BMDDeviceBusyState {
408     bmdDeviceCaptureBusy                                         = 1 << 0,
409     bmdDevicePlaybackBusy                                        = 1 << 1,
410     bmdDeviceSerialPortBusy                                      = 1 << 2
411 };
412
413 /* Enum BMDVideoIOSupport - Device video input/output support */
414
415 typedef uint32_t BMDVideoIOSupport;
416 enum _BMDVideoIOSupport {
417     bmdDeviceSupportsCapture                                     = 1 << 0,
418     bmdDeviceSupportsPlayback                                    = 1 << 1
419 };
420
421 /* Enum BMD3DPreviewFormat - Linked Frame preview format */
422
423 typedef uint32_t BMD3DPreviewFormat;
424 enum _BMD3DPreviewFormat {
425     bmd3DPreviewFormatDefault                                    = /* 'defa' */ 0x64656661,
426     bmd3DPreviewFormatLeftOnly                                   = /* 'left' */ 0x6C656674,
427     bmd3DPreviewFormatRightOnly                                  = /* 'righ' */ 0x72696768,
428     bmd3DPreviewFormatSideBySide                                 = /* 'side' */ 0x73696465,
429     bmd3DPreviewFormatTopBottom                                  = /* 'topb' */ 0x746F7062
430 };
431
432 /* Enum BMDNotifications - Events that can be subscribed through IDeckLinkNotification */
433
434 typedef uint32_t BMDNotifications;
435 enum _BMDNotifications {
436     bmdPreferencesChanged                                        = /* 'pref' */ 0x70726566
437 };
438
439 #if defined(__cplusplus)
440
441 // Forward Declarations
442
443 class IDeckLinkVideoOutputCallback;
444 class IDeckLinkInputCallback;
445 class IDeckLinkEncoderInputCallback;
446 class IDeckLinkMemoryAllocator;
447 class IDeckLinkAudioOutputCallback;
448 class IDeckLinkIterator;
449 class IDeckLinkAPIInformation;
450 class IDeckLinkOutput;
451 class IDeckLinkInput;
452 class IDeckLinkEncoderInput;
453 class IDeckLinkVideoFrame;
454 class IDeckLinkMutableVideoFrame;
455 class IDeckLinkVideoFrame3DExtensions;
456 class IDeckLinkVideoInputFrame;
457 class IDeckLinkVideoFrameAncillary;
458 class IDeckLinkEncoderPacket;
459 class IDeckLinkEncoderVideoPacket;
460 class IDeckLinkEncoderAudioPacket;
461 class IDeckLinkH265NALPacket;
462 class IDeckLinkAudioInputPacket;
463 class IDeckLinkScreenPreviewCallback;
464 class IDeckLinkGLScreenPreviewHelper;
465 class IDeckLinkNotificationCallback;
466 class IDeckLinkNotification;
467 class IDeckLinkAttributes;
468 class IDeckLinkKeyer;
469 class IDeckLinkVideoConversion;
470 class IDeckLinkDeviceNotificationCallback;
471 class IDeckLinkDiscovery;
472
473 /* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */
474
475 class IDeckLinkVideoOutputCallback : public IUnknown
476 {
477 public:
478     virtual HRESULT ScheduledFrameCompleted (/* in */ IDeckLinkVideoFrame *completedFrame, /* in */ BMDOutputFrameCompletionResult result) = 0;
479     virtual HRESULT ScheduledPlaybackHasStopped (void) = 0;
480
481 protected:
482     virtual ~IDeckLinkVideoOutputCallback () {} // call Release method to drop reference count
483 };
484
485 /* Interface IDeckLinkInputCallback - Frame arrival callback. */
486
487 class IDeckLinkInputCallback : public IUnknown
488 {
489 public:
490     virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
491     virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket) = 0;
492
493 protected:
494     virtual ~IDeckLinkInputCallback () {} // call Release method to drop reference count
495 };
496
497 /* Interface IDeckLinkEncoderInputCallback - Frame arrival callback. */
498
499 class IDeckLinkEncoderInputCallback : public IUnknown
500 {
501 public:
502     virtual HRESULT VideoInputSignalChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0;
503     virtual HRESULT VideoPacketArrived (/* in */ IDeckLinkEncoderVideoPacket* videoPacket) = 0;
504     virtual HRESULT AudioPacketArrived (/* in */ IDeckLinkEncoderAudioPacket* audioPacket) = 0;
505
506 protected:
507     virtual ~IDeckLinkEncoderInputCallback () {} // call Release method to drop reference count
508 };
509
510 /* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */
511
512 class IDeckLinkMemoryAllocator : public IUnknown
513 {
514 public:
515     virtual HRESULT AllocateBuffer (/* in */ uint32_t bufferSize, /* out */ void **allocatedBuffer) = 0;
516     virtual HRESULT ReleaseBuffer (/* in */ void *buffer) = 0;
517
518     virtual HRESULT Commit (void) = 0;
519     virtual HRESULT Decommit (void) = 0;
520 };
521
522 /* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */
523
524 class IDeckLinkAudioOutputCallback : public IUnknown
525 {
526 public:
527     virtual HRESULT RenderAudioSamples (/* in */ bool preroll) = 0;
528 };
529
530 /* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */
531
532 class IDeckLinkIterator : public IUnknown
533 {
534 public:
535     virtual HRESULT Next (/* out */ IDeckLink **deckLinkInstance) = 0;
536 };
537
538 /* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */
539
540 class IDeckLinkAPIInformation : public IUnknown
541 {
542 public:
543     virtual HRESULT GetFlag (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ bool *value) = 0;
544     virtual HRESULT GetInt (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ int64_t *value) = 0;
545     virtual HRESULT GetFloat (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ double *value) = 0;
546     virtual HRESULT GetString (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ const char **value) = 0;
547
548 protected:
549     virtual ~IDeckLinkAPIInformation () {} // call Release method to drop reference count
550 };
551
552 /* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
553
554 class IDeckLinkOutput : public IUnknown
555 {
556 public:
557     virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoOutputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
558     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
559
560     virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
561
562     /* Video Output */
563
564     virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0;
565     virtual HRESULT DisableVideoOutput (void) = 0;
566
567     virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
568     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;
569     virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0;
570
571     virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
572     virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0;
573     virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0;
574     virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0;
575
576     /* Audio Output */
577
578     virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0;
579     virtual HRESULT DisableAudioOutput (void) = 0;
580
581     virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0;
582
583     virtual HRESULT BeginAudioPreroll (void) = 0;
584     virtual HRESULT EndAudioPreroll (void) = 0;
585     virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0;
586
587     virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0;
588     virtual HRESULT FlushBufferedAudioSamples (void) = 0;
589
590     virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0;
591
592     /* Output Control */
593
594     virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0;
595     virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0;
596     virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0;
597     virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0;
598     virtual HRESULT GetReferenceStatus (/* out */ BMDReferenceStatus *referenceStatus) = 0;
599
600     /* Hardware Timing */
601
602     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
603     virtual HRESULT GetFrameCompletionReferenceTimestamp (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *frameCompletionTimestamp) = 0;
604
605 protected:
606     virtual ~IDeckLinkOutput () {} // call Release method to drop reference count
607 };
608
609 /* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
610
611 class IDeckLinkInput : public IUnknown
612 {
613 public:
614     virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
615     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
616
617     virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0;
618
619     /* Video Input */
620
621     virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
622     virtual HRESULT DisableVideoInput (void) = 0;
623     virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0;
624     virtual HRESULT SetVideoInputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
625
626     /* Audio Input */
627
628     virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
629     virtual HRESULT DisableAudioInput (void) = 0;
630     virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
631
632     /* Input Control */
633
634     virtual HRESULT StartStreams (void) = 0;
635     virtual HRESULT StopStreams (void) = 0;
636     virtual HRESULT PauseStreams (void) = 0;
637     virtual HRESULT FlushStreams (void) = 0;
638     virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback *theCallback) = 0;
639
640     /* Hardware Timing */
641
642     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
643
644 protected:
645     virtual ~IDeckLinkInput () {} // call Release method to drop reference count
646 };
647
648 /* Interface IDeckLinkEncoderInput - Created by QueryInterface from IDeckLink. */
649
650 class IDeckLinkEncoderInput : public IUnknown
651 {
652 public:
653     virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0;
654     virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0;
655
656     /* Video Input */
657
658     virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0;
659     virtual HRESULT DisableVideoInput (void) = 0;
660     virtual HRESULT GetAvailablePacketsCount (/* out */ uint32_t *availablePacketsCount) = 0;
661     virtual HRESULT SetMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0;
662
663     /* Audio Input */
664
665     virtual HRESULT EnableAudioInput (/* in */ BMDAudioFormat audioFormat, /* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0;
666     virtual HRESULT DisableAudioInput (void) = 0;
667     virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0;
668
669     /* Input Control */
670
671     virtual HRESULT StartStreams (void) = 0;
672     virtual HRESULT StopStreams (void) = 0;
673     virtual HRESULT PauseStreams (void) = 0;
674     virtual HRESULT FlushStreams (void) = 0;
675     virtual HRESULT SetCallback (/* in */ IDeckLinkEncoderInputCallback *theCallback) = 0;
676
677     /* Hardware Timing */
678
679     virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0;
680
681 protected:
682     virtual ~IDeckLinkEncoderInput () {} // call Release method to drop reference count
683 };
684
685 /* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */
686
687 class IDeckLinkVideoFrame : public IUnknown
688 {
689 public:
690     virtual long GetWidth (void) = 0;
691     virtual long GetHeight (void) = 0;
692     virtual long GetRowBytes (void) = 0;
693     virtual BMDPixelFormat GetPixelFormat (void) = 0;
694     virtual BMDFrameFlags GetFlags (void) = 0;
695     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
696
697     virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0;
698     virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) = 0;
699
700 protected:
701     virtual ~IDeckLinkVideoFrame () {} // call Release method to drop reference count
702 };
703
704 /* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */
705
706 class IDeckLinkMutableVideoFrame : public IDeckLinkVideoFrame
707 {
708 public:
709     virtual HRESULT SetFlags (/* in */ BMDFrameFlags newFlags) = 0;
710
711     virtual HRESULT SetTimecode (/* in */ BMDTimecodeFormat format, /* in */ IDeckLinkTimecode *timecode) = 0;
712     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;
713     virtual HRESULT SetAncillaryData (/* in */ IDeckLinkVideoFrameAncillary *ancillary) = 0;
714     virtual HRESULT SetTimecodeUserBits (/* in */ BMDTimecodeFormat format, /* in */ BMDTimecodeUserBits userBits) = 0;
715
716 protected:
717     virtual ~IDeckLinkMutableVideoFrame () {} // call Release method to drop reference count
718 };
719
720 /* Interface IDeckLinkVideoFrame3DExtensions - Optional interface implemented on IDeckLinkVideoFrame to support 3D frames */
721
722 class IDeckLinkVideoFrame3DExtensions : public IUnknown
723 {
724 public:
725     virtual BMDVideo3DPackingFormat Get3DPackingFormat (void) = 0;
726     virtual HRESULT GetFrameForRightEye (/* out */ IDeckLinkVideoFrame* *rightEyeFrame) = 0;
727
728 protected:
729     virtual ~IDeckLinkVideoFrame3DExtensions () {} // call Release method to drop reference count
730 };
731
732 /* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
733
734 class IDeckLinkVideoInputFrame : public IDeckLinkVideoFrame
735 {
736 public:
737     virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, /* in */ BMDTimeScale timeScale) = 0;
738     virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
739
740 protected:
741     virtual ~IDeckLinkVideoInputFrame () {} // call Release method to drop reference count
742 };
743
744 /* Interface IDeckLinkVideoFrameAncillary - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
745
746 class IDeckLinkVideoFrameAncillary : public IUnknown
747 {
748 public:
749
750     virtual HRESULT GetBufferForVerticalBlankingLine (/* in */ uint32_t lineNumber, /* out */ void **buffer) = 0;
751     virtual BMDPixelFormat GetPixelFormat (void) = 0;
752     virtual BMDDisplayMode GetDisplayMode (void) = 0;
753
754 protected:
755     virtual ~IDeckLinkVideoFrameAncillary () {} // call Release method to drop reference count
756 };
757
758 /* Interface IDeckLinkEncoderPacket - Interface to encapsulate an encoded packet. */
759
760 class IDeckLinkEncoderPacket : public IUnknown
761 {
762 public:
763     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
764     virtual long GetSize (void) = 0;
765     virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* in */ BMDTimeScale timeScale) = 0;
766     virtual BMDPacketType GetPacketType (void) = 0;
767
768 protected:
769     virtual ~IDeckLinkEncoderPacket () {} // call Release method to drop reference count
770 };
771
772 /* Interface IDeckLinkEncoderVideoPacket - Provided by the IDeckLinkEncoderInput video packet arrival callback. */
773
774 class IDeckLinkEncoderVideoPacket : public IDeckLinkEncoderPacket
775 {
776 public:
777     virtual BMDPixelFormat GetPixelFormat (void) = 0;
778     virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0;
779
780     virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0;
781
782 protected:
783     virtual ~IDeckLinkEncoderVideoPacket () {} // call Release method to drop reference count
784 };
785
786 /* Interface IDeckLinkEncoderAudioPacket - Provided by the IDeckLinkEncoderInput audio packet arrival callback. */
787
788 class IDeckLinkEncoderAudioPacket : public IDeckLinkEncoderPacket
789 {
790 public:
791     virtual BMDAudioFormat GetAudioFormat (void) = 0;
792
793 protected:
794     virtual ~IDeckLinkEncoderAudioPacket () {} // call Release method to drop reference count
795 };
796
797 /* Interface IDeckLinkH265NALPacket - Obtained through QueryInterface() on an IDeckLinkEncoderVideoPacket object */
798
799 class IDeckLinkH265NALPacket : public IDeckLinkEncoderVideoPacket
800 {
801 public:
802     virtual HRESULT GetUnitType (/* out */ uint8_t *unitType) = 0;
803     virtual HRESULT GetBytesNoPrefix (/* out */ void **buffer) = 0;
804     virtual long GetSizeNoPrefix (void) = 0;
805
806 protected:
807     virtual ~IDeckLinkH265NALPacket () {} // call Release method to drop reference count
808 };
809
810 /* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */
811
812 class IDeckLinkAudioInputPacket : public IUnknown
813 {
814 public:
815     virtual long GetSampleFrameCount (void) = 0;
816     virtual HRESULT GetBytes (/* out */ void **buffer) = 0;
817     virtual HRESULT GetPacketTime (/* out */ BMDTimeValue *packetTime, /* in */ BMDTimeScale timeScale) = 0;
818
819 protected:
820     virtual ~IDeckLinkAudioInputPacket () {} // call Release method to drop reference count
821 };
822
823 /* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */
824
825 class IDeckLinkScreenPreviewCallback : public IUnknown
826 {
827 public:
828     virtual HRESULT DrawFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
829
830 protected:
831     virtual ~IDeckLinkScreenPreviewCallback () {} // call Release method to drop reference count
832 };
833
834 /* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */
835
836 class IDeckLinkGLScreenPreviewHelper : public IUnknown
837 {
838 public:
839
840     /* Methods must be called with OpenGL context set */
841
842     virtual HRESULT InitializeGL (void) = 0;
843     virtual HRESULT PaintGL (void) = 0;
844     virtual HRESULT SetFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0;
845     virtual HRESULT Set3DPreviewFormat (/* in */ BMD3DPreviewFormat previewFormat) = 0;
846
847 protected:
848     virtual ~IDeckLinkGLScreenPreviewHelper () {} // call Release method to drop reference count
849 };
850
851 /* Interface IDeckLinkNotificationCallback - DeckLink Notification Callback Interface */
852
853 class IDeckLinkNotificationCallback : public IUnknown
854 {
855 public:
856     virtual HRESULT Notify (/* in */ BMDNotifications topic, /* in */ uint64_t param1, /* in */ uint64_t param2) = 0;
857 };
858
859 /* Interface IDeckLinkNotification - DeckLink Notification interface */
860
861 class IDeckLinkNotification : public IUnknown
862 {
863 public:
864     virtual HRESULT Subscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
865     virtual HRESULT Unsubscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0;
866 };
867
868 /* Interface IDeckLinkAttributes - DeckLink Attribute interface */
869
870 class IDeckLinkAttributes : public IUnknown
871 {
872 public:
873     virtual HRESULT GetFlag (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ bool *value) = 0;
874     virtual HRESULT GetInt (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ int64_t *value) = 0;
875     virtual HRESULT GetFloat (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ double *value) = 0;
876     virtual HRESULT GetString (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ const char **value) = 0;
877
878 protected:
879     virtual ~IDeckLinkAttributes () {} // call Release method to drop reference count
880 };
881
882 /* Interface IDeckLinkKeyer - DeckLink Keyer interface */
883
884 class IDeckLinkKeyer : public IUnknown
885 {
886 public:
887     virtual HRESULT Enable (/* in */ bool isExternal) = 0;
888     virtual HRESULT SetLevel (/* in */ uint8_t level) = 0;
889     virtual HRESULT RampUp (/* in */ uint32_t numberOfFrames) = 0;
890     virtual HRESULT RampDown (/* in */ uint32_t numberOfFrames) = 0;
891     virtual HRESULT Disable (void) = 0;
892
893 protected:
894     virtual ~IDeckLinkKeyer () {} // call Release method to drop reference count
895 };
896
897 /* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */
898
899 class IDeckLinkVideoConversion : public IUnknown
900 {
901 public:
902     virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ IDeckLinkVideoFrame* dstFrame) = 0;
903
904 protected:
905     virtual ~IDeckLinkVideoConversion () {} // call Release method to drop reference count
906 };
907
908 /* Interface IDeckLinkDeviceNotificationCallback - DeckLink device arrival/removal notification callbacks */
909
910 class IDeckLinkDeviceNotificationCallback : public IUnknown
911 {
912 public:
913     virtual HRESULT DeckLinkDeviceArrived (/* in */ IDeckLink* deckLinkDevice) = 0;
914     virtual HRESULT DeckLinkDeviceRemoved (/* in */ IDeckLink* deckLinkDevice) = 0;
915
916 protected:
917     virtual ~IDeckLinkDeviceNotificationCallback () {} // call Release method to drop reference count
918 };
919
920 /* Interface IDeckLinkDiscovery - DeckLink device discovery */
921
922 class IDeckLinkDiscovery : public IUnknown
923 {
924 public:
925     virtual HRESULT InstallDeviceNotifications (/* in */ IDeckLinkDeviceNotificationCallback* deviceNotificationCallback) = 0;
926     virtual HRESULT UninstallDeviceNotifications (void) = 0;
927
928 protected:
929     virtual ~IDeckLinkDiscovery () {} // call Release method to drop reference count
930 };
931
932 /* Functions */
933
934 extern "C" {
935
936     IDeckLinkIterator* CreateDeckLinkIteratorInstance (void);
937     IDeckLinkDiscovery* CreateDeckLinkDiscoveryInstance (void);
938     IDeckLinkAPIInformation* CreateDeckLinkAPIInformationInstance (void);
939     IDeckLinkGLScreenPreviewHelper* CreateOpenGLScreenPreviewHelper (void);
940     IDeckLinkVideoConversion* CreateVideoConversionInstance (void);
941
942 }
943
944
945 #endif      // defined(__cplusplus)
946 #endif /* defined(BMD_DECKLINKAPI_H) */