1 /* -LICENSE-START- 2 ** Copyright (c) 2011 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 /* DeckLinkAPI.h */ 29 30 #ifndef __DeckLink_API_h__ 31 #define __DeckLink_API_h__ 32 33 #include <CoreFoundation/CoreFoundation.h> 34 #include <CoreFoundation/CFPlugInCOM.h> 35 #include <stdint.h> 36 37 #define BLACKMAGIC_DECKLINK_API_MAGIC 1 38 39 // Type Declarations 40 41 typedef int64_t BMDTimeValue; 42 typedef int64_t BMDTimeScale; 43 typedef uint32_t BMDTimecodeBCD; 44 typedef uint32_t BMDTimecodeUserBits; 45 46 47 // Interface ID Declarations 48 49 #define IID_IDeckLinkVideoOutputCallback /* 20AA5225-1958-47CB-820B-80A8D521A6EE */ (REFIID){0x20,0xAA,0x52,0x25,0x19,0x58,0x47,0xCB,0x82,0x0B,0x80,0xA8,0xD5,0x21,0xA6,0xEE} 50 #define IID_IDeckLinkInputCallback /* DD04E5EC-7415-42AB-AE4A-E80C4DFC044A */ (REFIID){0xDD,0x04,0xE5,0xEC,0x74,0x15,0x42,0xAB,0xAE,0x4A,0xE8,0x0C,0x4D,0xFC,0x04,0x4A} 51 #define IID_IDeckLinkMemoryAllocator /* B36EB6E7-9D29-4AA8-92EF-843B87A289E8 */ (REFIID){0xB3,0x6E,0xB6,0xE7,0x9D,0x29,0x4A,0xA8,0x92,0xEF,0x84,0x3B,0x87,0xA2,0x89,0xE8} 52 #define IID_IDeckLinkAudioOutputCallback /* 403C681B-7F46-4A12-B993-2BB127084EE6 */ (REFIID){0x40,0x3C,0x68,0x1B,0x7F,0x46,0x4A,0x12,0xB9,0x93,0x2B,0xB1,0x27,0x08,0x4E,0xE6} 53 #define IID_IDeckLinkIterator /* 74E936FC-CC28-4A67-81A0-1E94E52D4E69 */ (REFIID){0x74,0xE9,0x36,0xFC,0xCC,0x28,0x4A,0x67,0x81,0xA0,0x1E,0x94,0xE5,0x2D,0x4E,0x69} 54 #define IID_IDeckLinkAPIInformation /* 7BEA3C68-730D-4322-AF34-8A7152B532A4 */ (REFIID){0x7B,0xEA,0x3C,0x68,0x73,0x0D,0x43,0x22,0xAF,0x34,0x8A,0x71,0x52,0xB5,0x32,0xA4} 55 #define IID_IDeckLinkDisplayModeIterator /* 9C88499F-F601-4021-B80B-032E4EB41C35 */ (REFIID){0x9C,0x88,0x49,0x9F,0xF6,0x01,0x40,0x21,0xB8,0x0B,0x03,0x2E,0x4E,0xB4,0x1C,0x35} 56 #define IID_IDeckLinkDisplayMode /* 3EB2C1AB-0A3D-4523-A3AD-F40D7FB14E78 */ (REFIID){0x3E,0xB2,0xC1,0xAB,0x0A,0x3D,0x45,0x23,0xA3,0xAD,0xF4,0x0D,0x7F,0xB1,0x4E,0x78} 57 #define IID_IDeckLink /* 62BFF75D-6569-4E55-8D4D-66AA03829ABC */ (REFIID){0x62,0xBF,0xF7,0x5D,0x65,0x69,0x4E,0x55,0x8D,0x4D,0x66,0xAA,0x03,0x82,0x9A,0xBC} 58 #define IID_IDeckLinkOutput /* A3EF0963-0862-44ED-92A9-EE89ABF431C7 */ (REFIID){0xA3,0xEF,0x09,0x63,0x08,0x62,0x44,0xED,0x92,0xA9,0xEE,0x89,0xAB,0xF4,0x31,0xC7} 59 #define IID_IDeckLinkInput /* 6D40EF78-28B9-4E21-990D-95BB7750A04F */ (REFIID){0x6D,0x40,0xEF,0x78,0x28,0xB9,0x4E,0x21,0x99,0x0D,0x95,0xBB,0x77,0x50,0xA0,0x4F} 60 #define IID_IDeckLinkTimecode /* BC6CFBD3-8317-4325-AC1C-1216391E9340 */ (REFIID){0xBC,0x6C,0xFB,0xD3,0x83,0x17,0x43,0x25,0xAC,0x1C,0x12,0x16,0x39,0x1E,0x93,0x40} 61 #define IID_IDeckLinkVideoFrame /* 3F716FE0-F023-4111-BE5D-EF4414C05B17 */ (REFIID){0x3F,0x71,0x6F,0xE0,0xF0,0x23,0x41,0x11,0xBE,0x5D,0xEF,0x44,0x14,0xC0,0x5B,0x17} 62 #define IID_IDeckLinkMutableVideoFrame /* 69E2639F-40DA-4E19-B6F2-20ACE815C390 */ (REFIID){0x69,0xE2,0x63,0x9F,0x40,0xDA,0x4E,0x19,0xB6,0xF2,0x20,0xAC,0xE8,0x15,0xC3,0x90} 63 #define IID_IDeckLinkVideoFrame3DExtensions /* DA0F7E4A-EDC7-48A8-9CDD-2DB51C729CD7 */ (REFIID){0xDA,0x0F,0x7E,0x4A,0xED,0xC7,0x48,0xA8,0x9C,0xDD,0x2D,0xB5,0x1C,0x72,0x9C,0xD7} 64 #define IID_IDeckLinkVideoInputFrame /* 05CFE374-537C-4094-9A57-680525118F44 */ (REFIID){0x05,0xCF,0xE3,0x74,0x53,0x7C,0x40,0x94,0x9A,0x57,0x68,0x05,0x25,0x11,0x8F,0x44} 65 #define IID_IDeckLinkVideoFrameAncillary /* 732E723C-D1A4-4E29-9E8E-4A88797A0004 */ (REFIID){0x73,0x2E,0x72,0x3C,0xD1,0xA4,0x4E,0x29,0x9E,0x8E,0x4A,0x88,0x79,0x7A,0x00,0x04} 66 #define IID_IDeckLinkAudioInputPacket /* E43D5870-2894-11DE-8C30-0800200C9A66 */ (REFIID){0xE4,0x3D,0x58,0x70,0x28,0x94,0x11,0xDE,0x8C,0x30,0x08,0x00,0x20,0x0C,0x9A,0x66} 67 #define IID_IDeckLinkScreenPreviewCallback /* B1D3F49A-85FE-4C5D-95C8-0B5D5DCCD438 */ (REFIID){0xB1,0xD3,0xF4,0x9A,0x85,0xFE,0x4C,0x5D,0x95,0xC8,0x0B,0x5D,0x5D,0xCC,0xD4,0x38} 68 #define IID_IDeckLinkCocoaScreenPreviewCallback /* D174152F-8F96-4C07-83A5-DD5F5AF0A2AA */ (REFIID){0xD1,0x74,0x15,0x2F,0x8F,0x96,0x4C,0x07,0x83,0xA5,0xDD,0x5F,0x5A,0xF0,0xA2,0xAA} 69 #define IID_IDeckLinkGLScreenPreviewHelper /* 504E2209-CAC7-4C1A-9FB4-C5BB6274D22F */ (REFIID){0x50,0x4E,0x22,0x09,0xCA,0xC7,0x4C,0x1A,0x9F,0xB4,0xC5,0xBB,0x62,0x74,0xD2,0x2F} 70 #define IID_IDeckLinkConfiguration /* C679A35B-610C-4D09-B748-1D0478100FC0 */ (REFIID){0xC6,0x79,0xA3,0x5B,0x61,0x0C,0x4D,0x09,0xB7,0x48,0x1D,0x04,0x78,0x10,0x0F,0xC0} 71 #define IID_IDeckLinkAttributes /* ABC11843-D966-44CB-96E2-A1CB5D3135C4 */ (REFIID){0xAB,0xC1,0x18,0x43,0xD9,0x66,0x44,0xCB,0x96,0xE2,0xA1,0xCB,0x5D,0x31,0x35,0xC4} 72 #define IID_IDeckLinkKeyer /* 89AFCAF5-65F8-421E-98F7-96FE5F5BFBA3 */ (REFIID){0x89,0xAF,0xCA,0xF5,0x65,0xF8,0x42,0x1E,0x98,0xF7,0x96,0xFE,0x5F,0x5B,0xFB,0xA3} 73 #define IID_IDeckLinkVideoConversion /* 3BBCB8A2-DA2C-42D9-B5D8-88083644E99A */ (REFIID){0x3B,0xBC,0xB8,0xA2,0xDA,0x2C,0x42,0xD9,0xB5,0xD8,0x88,0x08,0x36,0x44,0xE9,0x9A} 74 #define IID_IDeckLinkDeckControlStatusCallback /* E5F693C1-4283-4716-B18F-C1431521955B */ (REFIID){0xE5,0xF6,0x93,0xC1,0x42,0x83,0x47,0x16,0xB1,0x8F,0xC1,0x43,0x15,0x21,0x95,0x5B} 75 #define IID_IDeckLinkDeckControl /* 522A9E39-0F3C-4742-94EE-D80DE335DA1D */ (REFIID){0x52,0x2A,0x9E,0x39,0x0F,0x3C,0x47,0x42,0x94,0xEE,0xD8,0x0D,0xE3,0x35,0xDA,0x1D} 76 77 78 /* Enum BMDDisplayMode - Video display modes */ 79 80 typedef uint32_t BMDDisplayMode; 81 enum _BMDDisplayMode { 82 83 /* SD Modes */ 84 85 bmdModeNTSC = 'ntsc', 86 bmdModeNTSC2398 = 'nt23', // 3:2 pulldown 87 bmdModePAL = 'pal ', 88 bmdModeNTSCp = 'ntsp', 89 bmdModePALp = 'palp', 90 91 /* HD 1080 Modes */ 92 93 bmdModeHD1080p2398 = '23ps', 94 bmdModeHD1080p24 = '24ps', 95 bmdModeHD1080p25 = 'Hp25', 96 bmdModeHD1080p2997 = 'Hp29', 97 bmdModeHD1080p30 = 'Hp30', 98 bmdModeHD1080i50 = 'Hi50', 99 bmdModeHD1080i5994 = 'Hi59', 100 bmdModeHD1080i6000 = 'Hi60', // N.B. This _really_ is 60.00 Hz. 101 bmdModeHD1080p50 = 'Hp50', 102 bmdModeHD1080p5994 = 'Hp59', 103 bmdModeHD1080p6000 = 'Hp60', // N.B. This _really_ is 60.00 Hz. 104 105 /* HD 720 Modes */ 106 107 bmdModeHD720p50 = 'hp50', 108 bmdModeHD720p5994 = 'hp59', 109 bmdModeHD720p60 = 'hp60', 110 111 /* 2k Modes */ 112 113 bmdMode2k2398 = '2k23', 114 bmdMode2k24 = '2k24', 115 bmdMode2k25 = '2k25', 116 117 /* DCI Modes (output only) */ 118 119 bmdMode2kDCI2398 = '2d23', 120 bmdMode2kDCI24 = '2d24', 121 bmdMode2kDCI25 = '2d25', 122 123 /* 4k Modes */ 124 125 bmdMode4K2160p2398 = '4k23', 126 bmdMode4K2160p24 = '4k24', 127 bmdMode4K2160p25 = '4k25', 128 bmdMode4K2160p2997 = '4k29', 129 bmdMode4K2160p30 = '4k30', 130 bmdMode4K2160p50 = '4k50', 131 bmdMode4K2160p5994 = '4k59', 132 bmdMode4K2160p60 = '4k60', 133 134 /* DCI Modes (output only) */ 135 136 bmdMode4kDCI2398 = '4d23', 137 bmdMode4kDCI24 = '4d24', 138 bmdMode4kDCI25 = '4d25', 139 140 /* Special Modes */ 141 142 bmdModeUnknown = 'iunk' 143 }; 144 145 146 /* Enum BMDFieldDominance - Video field dominance */ 147 148 typedef uint32_t BMDFieldDominance; 149 enum _BMDFieldDominance { 150 bmdUnknownFieldDominance = 0, 151 bmdLowerFieldFirst = 'lowr', 152 bmdUpperFieldFirst = 'uppr', 153 bmdProgressiveFrame = 'prog', 154 bmdProgressiveSegmentedFrame = 'psf ' 155 }; 156 157 158 /* Enum BMDPixelFormat - Video pixel formats supported for output/input */ 159 160 typedef uint32_t BMDPixelFormat; 161 enum _BMDPixelFormat { 162 bmdFormat8BitYUV = '2vuy', 163 bmdFormat10BitYUV = 'v210', 164 bmdFormat8BitARGB = 32, 165 bmdFormat8BitBGRA = 'BGRA', 166 bmdFormat10BitRGB = 'r210' // Big-endian RGB 10-bit per component with SMPTE video levels (64-960). Packed as 2:10:10:10 167 }; 168 169 170 /* Enum BMDDisplayModeFlags - Flags to describe the characteristics of an IDeckLinkDisplayMode. */ 171 172 typedef uint32_t BMDDisplayModeFlags; 173 enum _BMDDisplayModeFlags { 174 bmdDisplayModeSupports3D = 1 << 0, 175 bmdDisplayModeColorspaceRec601 = 1 << 1, 176 bmdDisplayModeColorspaceRec709 = 1 << 2 177 }; 178 179 180 /* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */ 181 182 typedef uint32_t BMDVideoOutputFlags; 183 enum _BMDVideoOutputFlags { 184 bmdVideoOutputFlagDefault = 0, 185 bmdVideoOutputVANC = 1 << 0, 186 bmdVideoOutputVITC = 1 << 1, 187 bmdVideoOutputRP188 = 1 << 2, 188 bmdVideoOutputDualStream3D = 1 << 4 189 }; 190 191 192 /* Enum BMDFrameFlags - Frame flags */ 193 194 typedef uint32_t BMDFrameFlags; 195 enum _BMDFrameFlags { 196 bmdFrameFlagDefault = 0, 197 bmdFrameFlagFlipVertical = 1 << 0, 198 199 /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */ 200 201 bmdFrameHasNoInputSource = 1 << 31 202 }; 203 204 205 /* Enum BMDVideoInputFlags - Flags applicable to video input */ 206 207 typedef uint32_t BMDVideoInputFlags; 208 enum _BMDVideoInputFlags { 209 bmdVideoInputFlagDefault = 0, 210 bmdVideoInputEnableFormatDetection = 1 << 0, 211 bmdVideoInputDualStream3D = 1 << 1 212 }; 213 214 215 /* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */ 216 217 typedef uint32_t BMDVideoInputFormatChangedEvents; 218 enum _BMDVideoInputFormatChangedEvents { 219 bmdVideoInputDisplayModeChanged = 1 << 0, 220 bmdVideoInputFieldDominanceChanged = 1 << 1, 221 bmdVideoInputColorspaceChanged = 1 << 2 222 }; 223 224 225 /* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */ 226 227 typedef uint32_t BMDDetectedVideoInputFormatFlags; 228 enum _BMDDetectedVideoInputFormatFlags { 229 bmdDetectedVideoInputYCbCr422 = 1 << 0, 230 bmdDetectedVideoInputRGB444 = 1 << 1 231 }; 232 233 234 /* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */ 235 236 typedef uint32_t BMDOutputFrameCompletionResult; 237 enum _BMDOutputFrameCompletionResult { 238 bmdOutputFrameCompleted, 239 bmdOutputFrameDisplayedLate, 240 bmdOutputFrameDropped, 241 bmdOutputFrameFlushed 242 }; 243 244 245 /* Enum BMDReferenceStatus - GenLock input status */ 246 247 typedef uint32_t BMDReferenceStatus; 248 enum _BMDReferenceStatus { 249 bmdReferenceNotSupportedByHardware = 1 << 0, 250 bmdReferenceLocked = 1 << 1 251 }; 252 253 254 /* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */ 255 256 typedef uint32_t BMDAudioSampleRate; 257 enum _BMDAudioSampleRate { 258 bmdAudioSampleRate48kHz = 48000 259 }; 260 261 262 /* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */ 263 264 typedef uint32_t BMDAudioSampleType; 265 enum _BMDAudioSampleType { 266 bmdAudioSampleType16bitInteger = 16, 267 bmdAudioSampleType32bitInteger = 32 268 }; 269 270 271 /* Enum BMDAudioOutputStreamType - Audio output stream type */ 272 273 typedef uint32_t BMDAudioOutputStreamType; 274 enum _BMDAudioOutputStreamType { 275 bmdAudioOutputStreamContinuous, 276 bmdAudioOutputStreamContinuousDontResample, 277 bmdAudioOutputStreamTimestamped 278 }; 279 280 281 /* Enum BMDDisplayModeSupport - Output mode supported flags */ 282 283 typedef uint32_t BMDDisplayModeSupport; 284 enum _BMDDisplayModeSupport { 285 bmdDisplayModeNotSupported = 0, 286 bmdDisplayModeSupported, 287 bmdDisplayModeSupportedWithConversion 288 }; 289 290 291 /* Enum BMDTimecodeFormat - Timecode formats for frame metadata */ 292 293 typedef uint32_t BMDTimecodeFormat; 294 enum _BMDTimecodeFormat { 295 bmdTimecodeRP188 = 'rp18', 296 bmdTimecodeRP188Field2 = 'rp12', 297 bmdTimecodeVITC = 'vitc', 298 bmdTimecodeVITCField2 = 'vit2', 299 bmdTimecodeSerial = 'seri' 300 }; 301 302 303 /* Enum BMDTimecodeFlags - Timecode flags */ 304 305 typedef uint32_t BMDTimecodeFlags; 306 enum _BMDTimecodeFlags { 307 bmdTimecodeFlagDefault = 0, 308 bmdTimecodeIsDropFrame = 1 << 0 309 }; 310 311 312 /* Enum BMDVideoConnection - Video connection types */ 313 314 typedef uint32_t BMDVideoConnection; 315 enum _BMDVideoConnection { 316 bmdVideoConnectionSDI = 1 << 0, 317 bmdVideoConnectionHDMI = 1 << 1, 318 bmdVideoConnectionOpticalSDI = 1 << 2, 319 bmdVideoConnectionComponent = 1 << 3, 320 bmdVideoConnectionComposite = 1 << 4, 321 bmdVideoConnectionSVideo = 1 << 5 322 }; 323 324 325 /* Enum BMDAnalogVideoFlags - Analog video display flags */ 326 327 typedef uint32_t BMDAnalogVideoFlags; 328 enum _BMDAnalogVideoFlags { 329 bmdAnalogVideoFlagCompositeSetup75 = 1 << 0, 330 bmdAnalogVideoFlagComponentBetacamLevels = 1 << 1 331 }; 332 333 334 /* Enum BMDAudioConnection - Audio connection types */ 335 336 typedef uint32_t BMDAudioConnection; 337 enum _BMDAudioConnection { 338 bmdAudioConnectionEmbedded = 'embd', 339 bmdAudioConnectionAESEBU = 'aes ', 340 bmdAudioConnectionAnalog = 'anlg' 341 }; 342 343 344 /* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */ 345 346 typedef uint32_t BMDAudioOutputAnalogAESSwitch; 347 enum _BMDAudioOutputAnalogAESSwitch { 348 bmdAudioOutputSwitchAESEBU = 'aes ', 349 bmdAudioOutputSwitchAnalog = 'anlg' 350 }; 351 352 353 /* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */ 354 355 typedef uint32_t BMDVideoOutputConversionMode; 356 enum _BMDVideoOutputConversionMode { 357 bmdNoVideoOutputConversion = 'none', 358 bmdVideoOutputLetterboxDownconversion = 'ltbx', 359 bmdVideoOutputAnamorphicDownconversion = 'amph', 360 bmdVideoOutputHD720toHD1080Conversion = '720c', 361 bmdVideoOutputHardwareLetterboxDownconversion = 'HWlb', 362 bmdVideoOutputHardwareAnamorphicDownconversion = 'HWam', 363 bmdVideoOutputHardwareCenterCutDownconversion = 'HWcc', 364 bmdVideoOutputHardware720p1080pCrossconversion = 'xcap', 365 bmdVideoOutputHardwareAnamorphic720pUpconversion = 'ua7p', 366 bmdVideoOutputHardwareAnamorphic1080iUpconversion = 'ua1i', 367 bmdVideoOutputHardwareAnamorphic149To720pUpconversion = 'u47p', 368 bmdVideoOutputHardwareAnamorphic149To1080iUpconversion = 'u41i', 369 bmdVideoOutputHardwarePillarbox720pUpconversion = 'up7p', 370 bmdVideoOutputHardwarePillarbox1080iUpconversion = 'up1i' 371 }; 372 373 374 /* Enum BMDVideoInputConversionMode - Video input conversion mode */ 375 376 typedef uint32_t BMDVideoInputConversionMode; 377 enum _BMDVideoInputConversionMode { 378 bmdNoVideoInputConversion = 'none', 379 bmdVideoInputLetterboxDownconversionFromHD1080 = '10lb', 380 bmdVideoInputAnamorphicDownconversionFromHD1080 = '10am', 381 bmdVideoInputLetterboxDownconversionFromHD720 = '72lb', 382 bmdVideoInputAnamorphicDownconversionFromHD720 = '72am', 383 bmdVideoInputLetterboxUpconversion = 'lbup', 384 bmdVideoInputAnamorphicUpconversion = 'amup' 385 }; 386 387 388 /* Enum BMDVideo3DPackingFormat - Video 3D packing format */ 389 390 typedef uint32_t BMDVideo3DPackingFormat; 391 enum _BMDVideo3DPackingFormat { 392 bmdVideo3DPackingSidebySideHalf = 'sbsh', 393 bmdVideo3DPackingLinebyLine = 'lbyl', 394 bmdVideo3DPackingTopAndBottom = 'tabo', 395 bmdVideo3DPackingFramePacking = 'frpk', 396 bmdVideo3DPackingLeftOnly = 'left', 397 bmdVideo3DPackingRightOnly = 'righ' 398 }; 399 400 401 /* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */ 402 403 typedef uint32_t BMDIdleVideoOutputOperation; 404 enum _BMDIdleVideoOutputOperation { 405 bmdIdleVideoOutputBlack = 'blac', 406 bmdIdleVideoOutputLastFrame = 'lafa' 407 }; 408 409 410 /* Enum BMDDeckLinkConfigurationID - DeckLink Configuration ID */ 411 412 typedef uint32_t BMDDeckLinkConfigurationID; 413 enum _BMDDeckLinkConfigurationID { 414 415 /* Serial port Flags */ 416 417 bmdDeckLinkConfigSwapSerialRxTx = 'ssrt', 418 419 /* Video Input/Output Flags */ 420 421 bmdDeckLinkConfigUse1080pNotPsF = 'fpro', 422 423 /* Video Input/Output Integers */ 424 425 bmdDeckLinkConfigHDMI3DPackingFormat = '3dpf', 426 bmdDeckLinkConfigBypass = 'byps', 427 428 /* Audio Input/Output Flags */ 429 430 bmdDeckLinkConfigAnalogAudioConsumerLevels = 'aacl', 431 432 /* Video output flags */ 433 434 bmdDeckLinkConfigFieldFlickerRemoval = 'fdfr', 435 bmdDeckLinkConfigHD1080p24ToHD1080i5994Conversion = 'to59', 436 bmdDeckLinkConfig444SDIVideoOutput = '444o', 437 bmdDeckLinkConfig3GBpsVideoOutput = '3gbs', 438 bmdDeckLinkConfigBlackVideoOutputDuringCapture = 'bvoc', 439 bmdDeckLinkConfigLowLatencyVideoOutput = 'llvo', 440 441 /* Video Output Integers */ 442 443 bmdDeckLinkConfigVideoOutputConnection = 'vocn', 444 bmdDeckLinkConfigVideoOutputConversionMode = 'vocm', 445 bmdDeckLinkConfigAnalogVideoOutputFlags = 'avof', 446 bmdDeckLinkConfigReferenceInputTimingOffset = 'glot', 447 bmdDeckLinkConfigVideoOutputIdleOperation = 'voio', 448 449 /* Video Output Floats */ 450 451 bmdDeckLinkConfigVideoOutputComponentLumaGain = 'oclg', 452 bmdDeckLinkConfigVideoOutputComponentChromaBlueGain = 'occb', 453 bmdDeckLinkConfigVideoOutputComponentChromaRedGain = 'occr', 454 bmdDeckLinkConfigVideoOutputCompositeLumaGain = 'oilg', 455 bmdDeckLinkConfigVideoOutputCompositeChromaGain = 'oicg', 456 bmdDeckLinkConfigVideoOutputSVideoLumaGain = 'oslg', 457 bmdDeckLinkConfigVideoOutputSVideoChromaGain = 'oscg', 458 459 /* Video Input Integers */ 460 461 bmdDeckLinkConfigVideoInputConnection = 'vicn', 462 bmdDeckLinkConfigAnalogVideoInputFlags = 'avif', 463 bmdDeckLinkConfigVideoInputConversionMode = 'vicm', 464 bmdDeckLinkConfig32PulldownSequenceInitialTimecodeFrame = 'pdif', 465 bmdDeckLinkConfigVANCSourceLine1Mapping = 'vsl1', 466 bmdDeckLinkConfigVANCSourceLine2Mapping = 'vsl2', 467 bmdDeckLinkConfigVANCSourceLine3Mapping = 'vsl3', 468 469 /* Video Input Floats */ 470 471 bmdDeckLinkConfigVideoInputComponentLumaGain = 'iclg', 472 bmdDeckLinkConfigVideoInputComponentChromaBlueGain = 'iccb', 473 bmdDeckLinkConfigVideoInputComponentChromaRedGain = 'iccr', 474 bmdDeckLinkConfigVideoInputCompositeLumaGain = 'iilg', 475 bmdDeckLinkConfigVideoInputCompositeChromaGain = 'iicg', 476 bmdDeckLinkConfigVideoInputSVideoLumaGain = 'islg', 477 bmdDeckLinkConfigVideoInputSVideoChromaGain = 'iscg', 478 479 /* Audio Input Integers */ 480 481 bmdDeckLinkConfigAudioInputConnection = 'aicn', 482 483 /* Audio Input Floats */ 484 485 bmdDeckLinkConfigAnalogAudioInputScaleChannel1 = 'ais1', 486 bmdDeckLinkConfigAnalogAudioInputScaleChannel2 = 'ais2', 487 bmdDeckLinkConfigAnalogAudioInputScaleChannel3 = 'ais3', 488 bmdDeckLinkConfigAnalogAudioInputScaleChannel4 = 'ais4', 489 bmdDeckLinkConfigDigitalAudioInputScale = 'dais', 490 491 /* Audio Output Integers */ 492 493 bmdDeckLinkConfigAudioOutputAESAnalogSwitch = 'aoaa', 494 495 /* Audio Output Floats */ 496 497 bmdDeckLinkConfigAnalogAudioOutputScaleChannel1 = 'aos1', 498 bmdDeckLinkConfigAnalogAudioOutputScaleChannel2 = 'aos2', 499 bmdDeckLinkConfigAnalogAudioOutputScaleChannel3 = 'aos3', 500 bmdDeckLinkConfigAnalogAudioOutputScaleChannel4 = 'aos4', 501 bmdDeckLinkConfigDigitalAudioOutputScale = 'daos' 502 }; 503 504 505 /* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */ 506 507 typedef uint32_t BMDDeckLinkAttributeID; 508 enum _BMDDeckLinkAttributeID { 509 510 /* Flags */ 511 512 BMDDeckLinkSupportsInternalKeying = 'keyi', 513 BMDDeckLinkSupportsExternalKeying = 'keye', 514 BMDDeckLinkSupportsHDKeying = 'keyh', 515 BMDDeckLinkSupportsInputFormatDetection = 'infd', 516 BMDDeckLinkHasReferenceInput = 'hrin', 517 BMDDeckLinkHasSerialPort = 'hspt', 518 BMDDeckLinkHasAnalogVideoOutputGain = 'avog', 519 BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain = 'ovog', 520 BMDDeckLinkHasVideoInputAntiAliasingFilter = 'aafl', 521 BMDDeckLinkHasBypass = 'byps', 522 523 /* Integers */ 524 525 BMDDeckLinkMaximumAudioChannels = 'mach', 526 BMDDeckLinkNumberOfSubDevices = 'nsbd', 527 BMDDeckLinkSubDeviceIndex = 'subi', 528 BMDDeckLinkVideoOutputConnections = 'vocn', 529 BMDDeckLinkVideoInputConnections = 'vicn', 530 531 /* Floats */ 532 533 BMDDeckLinkVideoInputGainMinimum = 'vigm', 534 BMDDeckLinkVideoInputGainMaximum = 'vigx', 535 BMDDeckLinkVideoOutputGainMinimum = 'vogm', 536 BMDDeckLinkVideoOutputGainMaximum = 'vogx', 537 538 /* Strings */ 539 540 BMDDeckLinkSerialPortDeviceName = 'slpn' 541 }; 542 543 544 /* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */ 545 546 typedef uint32_t BMDDeckLinkAPIInformationID; 547 enum _BMDDeckLinkAPIInformationID { 548 BMDDeckLinkAPIVersion = 'vers' 549 }; 550 551 552 /* Enum BMDDeckControlMode - DeckControl mode */ 553 554 typedef uint32_t BMDDeckControlMode; 555 enum _BMDDeckControlMode { 556 bmdDeckControlNotOpened = 'ntop', 557 bmdDeckControlVTRControlMode = 'vtrc', 558 bmdDeckControlExportMode = 'expm', 559 bmdDeckControlCaptureMode = 'capm' 560 }; 561 562 563 /* Enum BMDDeckControlEvent - DeckControl event */ 564 565 typedef uint32_t BMDDeckControlEvent; 566 enum _BMDDeckControlEvent { 567 bmdDeckControlAbortedEvent = 'abte', // This event is triggered when a capture or edit-to-tape operation is aborted. 568 569 /* Export-To-Tape events */ 570 571 bmdDeckControlPrepareForExportEvent = 'pfee', // This event is triggered a few frames before reaching the in-point. IDeckLinkInput::StartScheduledPlayback() should be called at this point. 572 bmdDeckControlExportCompleteEvent = 'exce', // This event is triggered a few frames after reaching the out-point. At this point, it is safe to stop playback. 573 574 /* Capture events */ 575 576 bmdDeckControlPrepareForCaptureEvent = 'pfce', // This event is triggered a few frames before reaching the in-point. The serial timecode attached to IDeckLinkVideoInputFrames is now valid. 577 bmdDeckControlCaptureCompleteEvent = 'ccev' // This event is triggered a few frames after reaching the out-point. 578 }; 579 580 581 /* Enum BMDDeckControlVTRControlState - VTR Control state */ 582 583 typedef uint32_t BMDDeckControlVTRControlState; 584 enum _BMDDeckControlVTRControlState { 585 bmdDeckControlNotInVTRControlMode = 'nvcm', 586 bmdDeckControlVTRControlPlaying = 'vtrp', 587 bmdDeckControlVTRControlRecording = 'vtrr', 588 bmdDeckControlVTRControlStill = 'vtra', 589 bmdDeckControlVTRControlSeeking = 'vtrs', 590 bmdDeckControlVTRControlStopped = 'vtro' 591 }; 592 593 594 /* Enum BMDDeckControlStatusFlags - Deck Control status flags */ 595 596 typedef uint32_t BMDDeckControlStatusFlags; 597 enum _BMDDeckControlStatusFlags { 598 bmdDeckControlStatusDeckConnected = 1 << 0, 599 bmdDeckControlStatusRemoteMode = 1 << 1, 600 bmdDeckControlStatusRecordInhibited = 1 << 2, 601 bmdDeckControlStatusCassetteOut = 1 << 3 602 }; 603 604 605 /* Enum BMDDeckControlExportModeOpsFlags - Export mode flags */ 606 607 typedef uint32_t BMDDeckControlExportModeOpsFlags; 608 enum _BMDDeckControlExportModeOpsFlags { 609 bmdDeckControlExportModeInsertVideo = 1 << 0, 610 bmdDeckControlExportModeInsertAudio1 = 1 << 1, 611 bmdDeckControlExportModeInsertAudio2 = 1 << 2, 612 bmdDeckControlExportModeInsertAudio3 = 1 << 3, 613 bmdDeckControlExportModeInsertAudio4 = 1 << 4, 614 bmdDeckControlExportModeInsertAudio5 = 1 << 5, 615 bmdDeckControlExportModeInsertAudio6 = 1 << 6, 616 bmdDeckControlExportModeInsertAudio7 = 1 << 7, 617 bmdDeckControlExportModeInsertAudio8 = 1 << 8, 618 bmdDeckControlExportModeInsertAudio9 = 1 << 9, 619 bmdDeckControlExportModeInsertAudio10 = 1 << 10, 620 bmdDeckControlExportModeInsertAudio11 = 1 << 11, 621 bmdDeckControlExportModeInsertAudio12 = 1 << 12, 622 bmdDeckControlExportModeInsertTimeCode = 1 << 13, 623 bmdDeckControlExportModeInsertAssemble = 1 << 14, 624 bmdDeckControlExportModeInsertPreview = 1 << 15, 625 bmdDeckControlUseManualExport = 1 << 16 626 }; 627 628 629 /* Enum BMDDeckControlError - Deck Control error */ 630 631 typedef uint32_t BMDDeckControlError; 632 enum _BMDDeckControlError { 633 bmdDeckControlNoError = 'noer', 634 bmdDeckControlModeError = 'moer', 635 bmdDeckControlMissedInPointError = 'mier', 636 bmdDeckControlDeckTimeoutError = 'dter', 637 bmdDeckControlCommandFailedError = 'cfer', 638 bmdDeckControlDeviceAlreadyOpenedError = 'dalo', 639 bmdDeckControlFailedToOpenDeviceError = 'fder', 640 bmdDeckControlInLocalModeError = 'lmer', 641 bmdDeckControlEndOfTapeError = 'eter', 642 bmdDeckControlUserAbortError = 'uaer', 643 bmdDeckControlNoTapeInDeckError = 'nter', 644 bmdDeckControlNoVideoFromCardError = 'nvfc', 645 bmdDeckControlNoCommunicationError = 'ncom', 646 bmdDeckControlBufferTooSmallError = 'btsm', 647 bmdDeckControlBadChecksumError = 'chks', 648 bmdDeckControlUnknownError = 'uner' 649 }; 650 651 652 /* Enum BMD3DPreviewFormat - Linked Frame preview format */ 653 654 typedef uint32_t BMD3DPreviewFormat; 655 enum _BMD3DPreviewFormat { 656 bmd3DPreviewFormatDefault = 'defa', 657 bmd3DPreviewFormatLeftOnly = 'left', 658 bmd3DPreviewFormatRightOnly = 'righ', 659 bmd3DPreviewFormatSideBySide = 'side', 660 bmd3DPreviewFormatTopBottom = 'topb' 661 }; 662 663 664 #if defined(__cplusplus) 665 666 // Forward Declarations 667 668 class IDeckLinkVideoOutputCallback; 669 class IDeckLinkInputCallback; 670 class IDeckLinkMemoryAllocator; 671 class IDeckLinkAudioOutputCallback; 672 class IDeckLinkIterator; 673 class IDeckLinkAPIInformation; 674 class IDeckLinkDisplayModeIterator; 675 class IDeckLinkDisplayMode; 676 class IDeckLink; 677 class IDeckLinkOutput; 678 class IDeckLinkInput; 679 class IDeckLinkTimecode; 680 class IDeckLinkVideoFrame; 681 class IDeckLinkMutableVideoFrame; 682 class IDeckLinkVideoFrame3DExtensions; 683 class IDeckLinkVideoInputFrame; 684 class IDeckLinkVideoFrameAncillary; 685 class IDeckLinkAudioInputPacket; 686 class IDeckLinkScreenPreviewCallback; 687 class IDeckLinkCocoaScreenPreviewCallback; 688 class IDeckLinkGLScreenPreviewHelper; 689 class IDeckLinkConfiguration; 690 class IDeckLinkAttributes; 691 class IDeckLinkKeyer; 692 class IDeckLinkVideoConversion; 693 class IDeckLinkDeckControlStatusCallback; 694 class IDeckLinkDeckControl; 695 696 697 /* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */ 698 699 class IDeckLinkVideoOutputCallback : public IUnknown 700 { 701 public: 702 virtual HRESULT ScheduledFrameCompleted (/* in */ IDeckLinkVideoFrame *completedFrame, /* in */ BMDOutputFrameCompletionResult result) = 0; 703 virtual HRESULT ScheduledPlaybackHasStopped (void) = 0; 704 705 protected: ~IDeckLinkVideoOutputCallback()706 virtual ~IDeckLinkVideoOutputCallback () {}; // call Release method to drop reference count 707 }; 708 709 710 /* Interface IDeckLinkInputCallback - Frame arrival callback. */ 711 712 class IDeckLinkInputCallback : public IUnknown 713 { 714 public: 715 virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0; 716 virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket) = 0; 717 718 protected: ~IDeckLinkInputCallback()719 virtual ~IDeckLinkInputCallback () {}; // call Release method to drop reference count 720 }; 721 722 723 /* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */ 724 725 class IDeckLinkMemoryAllocator : public IUnknown 726 { 727 public: 728 virtual HRESULT AllocateBuffer (/* in */ uint32_t bufferSize, /* out */ void **allocatedBuffer) = 0; 729 virtual HRESULT ReleaseBuffer (/* in */ void *buffer) = 0; 730 731 virtual HRESULT Commit (void) = 0; 732 virtual HRESULT Decommit (void) = 0; 733 }; 734 735 736 /* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */ 737 738 class IDeckLinkAudioOutputCallback : public IUnknown 739 { 740 public: 741 virtual HRESULT RenderAudioSamples (/* in */ bool preroll) = 0; 742 }; 743 744 745 /* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */ 746 747 class IDeckLinkIterator : public IUnknown 748 { 749 public: 750 virtual HRESULT Next (/* out */ IDeckLink **deckLinkInstance) = 0; 751 }; 752 753 754 /* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */ 755 756 class IDeckLinkAPIInformation : public IUnknown 757 { 758 public: 759 virtual HRESULT GetFlag (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ bool *value) = 0; 760 virtual HRESULT GetInt (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ int64_t *value) = 0; 761 virtual HRESULT GetFloat (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ double *value) = 0; 762 virtual HRESULT GetString (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ CFStringRef *value) = 0; 763 764 protected: ~IDeckLinkAPIInformation()765 virtual ~IDeckLinkAPIInformation () {}; // call Release method to drop reference count 766 }; 767 768 769 /* Interface IDeckLinkDisplayModeIterator - enumerates over supported input/output display modes. */ 770 771 class IDeckLinkDisplayModeIterator : public IUnknown 772 { 773 public: 774 virtual HRESULT Next (/* out */ IDeckLinkDisplayMode **deckLinkDisplayMode) = 0; 775 776 protected: ~IDeckLinkDisplayModeIterator()777 virtual ~IDeckLinkDisplayModeIterator () {}; // call Release method to drop reference count 778 }; 779 780 781 /* Interface IDeckLinkDisplayMode - represents a display mode */ 782 783 class IDeckLinkDisplayMode : public IUnknown 784 { 785 public: 786 virtual HRESULT GetName (/* out */ CFStringRef *name) = 0; 787 virtual BMDDisplayMode GetDisplayMode (void) = 0; 788 virtual long GetWidth (void) = 0; 789 virtual long GetHeight (void) = 0; 790 virtual HRESULT GetFrameRate (/* out */ BMDTimeValue *frameDuration, /* out */ BMDTimeScale *timeScale) = 0; 791 virtual BMDFieldDominance GetFieldDominance (void) = 0; 792 virtual BMDDisplayModeFlags GetFlags (void) = 0; 793 794 protected: ~IDeckLinkDisplayMode()795 virtual ~IDeckLinkDisplayMode () {}; // call Release method to drop reference count 796 }; 797 798 799 /* Interface IDeckLink - represents a DeckLink device */ 800 801 class IDeckLink : public IUnknown 802 { 803 public: 804 virtual HRESULT GetModelName (/* out */ CFStringRef *modelName) = 0; 805 }; 806 807 808 /* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */ 809 810 class IDeckLinkOutput : public IUnknown 811 { 812 public: 813 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoOutputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0; 814 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0; 815 816 virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0; 817 818 /* Video Output */ 819 820 virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0; 821 virtual HRESULT DisableVideoOutput (void) = 0; 822 823 virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0; 824 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; 825 virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0; 826 827 virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame *theFrame) = 0; 828 virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0; 829 virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0; 830 virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0; 831 832 /* Audio Output */ 833 834 virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0; 835 virtual HRESULT DisableAudioOutput (void) = 0; 836 837 virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0; 838 839 virtual HRESULT BeginAudioPreroll (void) = 0; 840 virtual HRESULT EndAudioPreroll (void) = 0; 841 virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0; 842 843 virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0; 844 virtual HRESULT FlushBufferedAudioSamples (void) = 0; 845 846 virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0; 847 848 /* Output Control */ 849 850 virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0; 851 virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0; 852 virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0; 853 virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0; 854 virtual HRESULT GetReferenceStatus (/* out */ BMDReferenceStatus *referenceStatus) = 0; 855 856 /* Hardware Timing */ 857 858 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0; 859 860 protected: ~IDeckLinkOutput()861 virtual ~IDeckLinkOutput () {}; // call Release method to drop reference count 862 }; 863 864 865 /* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */ 866 867 class IDeckLinkInput : public IUnknown 868 { 869 public: 870 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0; 871 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0; 872 873 virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0; 874 875 /* Video Input */ 876 877 virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0; 878 virtual HRESULT DisableVideoInput (void) = 0; 879 virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0; 880 881 /* Audio Input */ 882 883 virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0; 884 virtual HRESULT DisableAudioInput (void) = 0; 885 virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0; 886 887 /* Input Control */ 888 889 virtual HRESULT StartStreams (void) = 0; 890 virtual HRESULT StopStreams (void) = 0; 891 virtual HRESULT PauseStreams (void) = 0; 892 virtual HRESULT FlushStreams (void) = 0; 893 virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback *theCallback) = 0; 894 895 /* Hardware Timing */ 896 897 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0; 898 899 protected: ~IDeckLinkInput()900 virtual ~IDeckLinkInput () {}; // call Release method to drop reference count 901 }; 902 903 904 /* Interface IDeckLinkTimecode - Used for video frame timecode representation. */ 905 906 class IDeckLinkTimecode : public IUnknown 907 { 908 public: 909 virtual BMDTimecodeBCD GetBCD (void) = 0; 910 virtual HRESULT GetComponents (/* out */ uint8_t *hours, /* out */ uint8_t *minutes, /* out */ uint8_t *seconds, /* out */ uint8_t *frames) = 0; 911 virtual HRESULT GetString (/* out */ CFStringRef *timecode) = 0; 912 virtual BMDTimecodeFlags GetFlags (void) = 0; 913 virtual HRESULT GetTimecodeUserBits (/* out */ BMDTimecodeUserBits *userBits) = 0; 914 915 protected: ~IDeckLinkTimecode()916 virtual ~IDeckLinkTimecode () {}; // call Release method to drop reference count 917 }; 918 919 920 /* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */ 921 922 class IDeckLinkVideoFrame : public IUnknown 923 { 924 public: 925 virtual long GetWidth (void) = 0; 926 virtual long GetHeight (void) = 0; 927 virtual long GetRowBytes (void) = 0; 928 virtual BMDPixelFormat GetPixelFormat (void) = 0; 929 virtual BMDFrameFlags GetFlags (void) = 0; 930 virtual HRESULT GetBytes (/* out */ void **buffer) = 0; 931 932 virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0; 933 virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) = 0; 934 935 protected: ~IDeckLinkVideoFrame()936 virtual ~IDeckLinkVideoFrame () {}; // call Release method to drop reference count 937 }; 938 939 940 /* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */ 941 942 class IDeckLinkMutableVideoFrame : public IDeckLinkVideoFrame 943 { 944 public: 945 virtual HRESULT SetFlags (/* in */ BMDFrameFlags newFlags) = 0; 946 947 virtual HRESULT SetTimecode (/* in */ BMDTimecodeFormat format, /* in */ IDeckLinkTimecode *timecode) = 0; 948 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; 949 virtual HRESULT SetAncillaryData (/* in */ IDeckLinkVideoFrameAncillary *ancillary) = 0; 950 virtual HRESULT SetTimecodeUserBits (/* in */ BMDTimecodeFormat format, /* in */ BMDTimecodeUserBits userBits) = 0; 951 952 protected: ~IDeckLinkMutableVideoFrame()953 virtual ~IDeckLinkMutableVideoFrame () {}; // call Release method to drop reference count 954 }; 955 956 957 /* Interface IDeckLinkVideoFrame3DExtensions - Optional interface implemented on IDeckLinkVideoFrame to support 3D frames */ 958 959 class IDeckLinkVideoFrame3DExtensions : public IUnknown 960 { 961 public: 962 virtual BMDVideo3DPackingFormat Get3DPackingFormat (void) = 0; 963 virtual HRESULT GetFrameForRightEye (/* out */ IDeckLinkVideoFrame* *rightEyeFrame) = 0; 964 965 protected: ~IDeckLinkVideoFrame3DExtensions()966 virtual ~IDeckLinkVideoFrame3DExtensions () {}; // call Release method to drop reference count 967 }; 968 969 970 /* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */ 971 972 class IDeckLinkVideoInputFrame : public IDeckLinkVideoFrame 973 { 974 public: 975 virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, /* in */ BMDTimeScale timeScale) = 0; 976 virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0; 977 978 protected: ~IDeckLinkVideoInputFrame()979 virtual ~IDeckLinkVideoInputFrame () {}; // call Release method to drop reference count 980 }; 981 982 983 /* Interface IDeckLinkVideoFrameAncillary - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */ 984 985 class IDeckLinkVideoFrameAncillary : public IUnknown 986 { 987 public: 988 989 virtual HRESULT GetBufferForVerticalBlankingLine (/* in */ uint32_t lineNumber, /* out */ void **buffer) = 0; 990 virtual BMDPixelFormat GetPixelFormat (void) = 0; 991 virtual BMDDisplayMode GetDisplayMode (void) = 0; 992 993 protected: ~IDeckLinkVideoFrameAncillary()994 virtual ~IDeckLinkVideoFrameAncillary () {}; // call Release method to drop reference count 995 }; 996 997 998 /* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */ 999 1000 class IDeckLinkAudioInputPacket : public IUnknown 1001 { 1002 public: 1003 virtual long GetSampleFrameCount (void) = 0; 1004 virtual HRESULT GetBytes (/* out */ void **buffer) = 0; 1005 virtual HRESULT GetPacketTime (/* out */ BMDTimeValue *packetTime, /* in */ BMDTimeScale timeScale) = 0; 1006 1007 protected: ~IDeckLinkAudioInputPacket()1008 virtual ~IDeckLinkAudioInputPacket () {}; // call Release method to drop reference count 1009 }; 1010 1011 1012 /* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */ 1013 1014 class IDeckLinkScreenPreviewCallback : public IUnknown 1015 { 1016 public: 1017 virtual HRESULT DrawFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0; 1018 1019 protected: ~IDeckLinkScreenPreviewCallback()1020 virtual ~IDeckLinkScreenPreviewCallback () {}; // call Release method to drop reference count 1021 }; 1022 1023 1024 /* Interface IDeckLinkCocoaScreenPreviewCallback - Screen preview callback for Cocoa-based applications */ 1025 1026 class IDeckLinkCocoaScreenPreviewCallback : public IDeckLinkScreenPreviewCallback 1027 { 1028 public: 1029 1030 protected: ~IDeckLinkCocoaScreenPreviewCallback()1031 virtual ~IDeckLinkCocoaScreenPreviewCallback () {}; // call Release method to drop reference count 1032 }; 1033 1034 1035 /* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */ 1036 1037 class IDeckLinkGLScreenPreviewHelper : public IUnknown 1038 { 1039 public: 1040 1041 /* Methods must be called with OpenGL context set */ 1042 1043 virtual HRESULT InitializeGL (void) = 0; 1044 virtual HRESULT PaintGL (void) = 0; 1045 virtual HRESULT SetFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0; 1046 virtual HRESULT Set3DPreviewFormat (/* in */ BMD3DPreviewFormat previewFormat) = 0; 1047 1048 protected: ~IDeckLinkGLScreenPreviewHelper()1049 virtual ~IDeckLinkGLScreenPreviewHelper () {}; // call Release method to drop reference count 1050 }; 1051 1052 1053 /* Interface IDeckLinkConfiguration - DeckLink Configuration interface */ 1054 1055 class IDeckLinkConfiguration : public IUnknown 1056 { 1057 public: 1058 virtual HRESULT SetFlag (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ bool value) = 0; 1059 virtual HRESULT GetFlag (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ bool *value) = 0; 1060 virtual HRESULT SetInt (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ int64_t value) = 0; 1061 virtual HRESULT GetInt (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ int64_t *value) = 0; 1062 virtual HRESULT SetFloat (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ double value) = 0; 1063 virtual HRESULT GetFloat (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ double *value) = 0; 1064 virtual HRESULT SetString (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ CFStringRef value) = 0; 1065 virtual HRESULT GetString (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ CFStringRef *value) = 0; 1066 virtual HRESULT WriteConfigurationToPreferences (void) = 0; 1067 1068 protected: ~IDeckLinkConfiguration()1069 virtual ~IDeckLinkConfiguration () {}; // call Release method to drop reference count 1070 }; 1071 1072 1073 /* Interface IDeckLinkAttributes - DeckLink Attribute interface */ 1074 1075 class IDeckLinkAttributes : public IUnknown 1076 { 1077 public: 1078 virtual HRESULT GetFlag (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ bool *value) = 0; 1079 virtual HRESULT GetInt (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ int64_t *value) = 0; 1080 virtual HRESULT GetFloat (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ double *value) = 0; 1081 virtual HRESULT GetString (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ CFStringRef *value) = 0; 1082 1083 protected: ~IDeckLinkAttributes()1084 virtual ~IDeckLinkAttributes () {}; // call Release method to drop reference count 1085 }; 1086 1087 1088 /* Interface IDeckLinkKeyer - DeckLink Keyer interface */ 1089 1090 class IDeckLinkKeyer : public IUnknown 1091 { 1092 public: 1093 virtual HRESULT Enable (/* in */ bool isExternal) = 0; 1094 virtual HRESULT SetLevel (/* in */ uint8_t level) = 0; 1095 virtual HRESULT RampUp (/* in */ uint32_t numberOfFrames) = 0; 1096 virtual HRESULT RampDown (/* in */ uint32_t numberOfFrames) = 0; 1097 virtual HRESULT Disable (void) = 0; 1098 1099 protected: ~IDeckLinkKeyer()1100 virtual ~IDeckLinkKeyer () {}; // call Release method to drop reference count 1101 }; 1102 1103 1104 /* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */ 1105 1106 class IDeckLinkVideoConversion : public IUnknown 1107 { 1108 public: 1109 virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ IDeckLinkVideoFrame* dstFrame) = 0; 1110 1111 protected: ~IDeckLinkVideoConversion()1112 virtual ~IDeckLinkVideoConversion () {}; // call Release method to drop reference count 1113 }; 1114 1115 1116 /* Interface IDeckLinkDeckControlStatusCallback - Deck control state change callback. */ 1117 1118 class IDeckLinkDeckControlStatusCallback : public IUnknown 1119 { 1120 public: 1121 virtual HRESULT TimecodeUpdate (/* in */ BMDTimecodeBCD currentTimecode) = 0; 1122 virtual HRESULT VTRControlStateChanged (/* in */ BMDDeckControlVTRControlState newState, /* in */ BMDDeckControlError error) = 0; 1123 virtual HRESULT DeckControlEventReceived (/* in */ BMDDeckControlEvent event, /* in */ BMDDeckControlError error) = 0; 1124 virtual HRESULT DeckControlStatusChanged (/* in */ BMDDeckControlStatusFlags flags, /* in */ uint32_t mask) = 0; 1125 1126 protected: ~IDeckLinkDeckControlStatusCallback()1127 virtual ~IDeckLinkDeckControlStatusCallback () {}; // call Release method to drop reference count 1128 }; 1129 1130 1131 /* Interface IDeckLinkDeckControl - Deck Control main interface */ 1132 1133 class IDeckLinkDeckControl : public IUnknown 1134 { 1135 public: 1136 virtual HRESULT Open (/* in */ BMDTimeScale timeScale, /* in */ BMDTimeValue timeValue, /* in */ bool timecodeIsDropFrame, /* out */ BMDDeckControlError *error) = 0; 1137 virtual HRESULT Close (/* in */ bool standbyOn) = 0; 1138 virtual HRESULT GetCurrentState (/* out */ BMDDeckControlMode *mode, /* out */ BMDDeckControlVTRControlState *vtrControlState, /* out */ BMDDeckControlStatusFlags *flags) = 0; 1139 virtual HRESULT SetStandby (/* in */ bool standbyOn) = 0; 1140 virtual HRESULT SendCommand (/* in */ uint8_t *inBuffer, /* in */ uint32_t inBufferSize, /* out */ uint8_t *outBuffer, /* out */ uint32_t *outDataSize, /* in */ uint32_t outBufferSize, /* out */ BMDDeckControlError *error) = 0; 1141 virtual HRESULT Play (/* out */ BMDDeckControlError *error) = 0; 1142 virtual HRESULT Stop (/* out */ BMDDeckControlError *error) = 0; 1143 virtual HRESULT TogglePlayStop (/* out */ BMDDeckControlError *error) = 0; 1144 virtual HRESULT Eject (/* out */ BMDDeckControlError *error) = 0; 1145 virtual HRESULT GoToTimecode (/* in */ BMDTimecodeBCD timecode, /* out */ BMDDeckControlError *error) = 0; 1146 virtual HRESULT FastForward (/* in */ bool viewTape, /* out */ BMDDeckControlError *error) = 0; 1147 virtual HRESULT Rewind (/* in */ bool viewTape, /* out */ BMDDeckControlError *error) = 0; 1148 virtual HRESULT StepForward (/* out */ BMDDeckControlError *error) = 0; 1149 virtual HRESULT StepBack (/* out */ BMDDeckControlError *error) = 0; 1150 virtual HRESULT Jog (/* in */ double rate, /* out */ BMDDeckControlError *error) = 0; 1151 virtual HRESULT Shuttle (/* in */ double rate, /* out */ BMDDeckControlError *error) = 0; 1152 virtual HRESULT GetTimecodeString (/* out */ CFStringRef *currentTimeCode, /* out */ BMDDeckControlError *error) = 0; 1153 virtual HRESULT GetTimecode (/* out */ IDeckLinkTimecode **currentTimecode, /* out */ BMDDeckControlError *error) = 0; 1154 virtual HRESULT GetTimecodeBCD (/* out */ BMDTimecodeBCD *currentTimecode, /* out */ BMDDeckControlError *error) = 0; 1155 virtual HRESULT SetPreroll (/* in */ uint32_t prerollSeconds) = 0; 1156 virtual HRESULT GetPreroll (/* out */ uint32_t *prerollSeconds) = 0; 1157 virtual HRESULT SetExportOffset (/* in */ int32_t exportOffsetFields) = 0; 1158 virtual HRESULT GetExportOffset (/* out */ int32_t *exportOffsetFields) = 0; 1159 virtual HRESULT GetManualExportOffset (/* out */ int32_t *deckManualExportOffsetFields) = 0; 1160 virtual HRESULT SetCaptureOffset (/* in */ int32_t captureOffsetFields) = 0; 1161 virtual HRESULT GetCaptureOffset (/* out */ int32_t *captureOffsetFields) = 0; 1162 virtual HRESULT StartExport (/* in */ BMDTimecodeBCD inTimecode, /* in */ BMDTimecodeBCD outTimecode, /* in */ BMDDeckControlExportModeOpsFlags exportModeOps, /* out */ BMDDeckControlError *error) = 0; 1163 virtual HRESULT StartCapture (/* in */ bool useVITC, /* in */ BMDTimecodeBCD inTimecode, /* in */ BMDTimecodeBCD outTimecode, /* out */ BMDDeckControlError *error) = 0; 1164 virtual HRESULT GetDeviceID (/* out */ uint16_t *deviceId, /* out */ BMDDeckControlError *error) = 0; 1165 virtual HRESULT Abort (void) = 0; 1166 virtual HRESULT CrashRecordStart (/* out */ BMDDeckControlError *error) = 0; 1167 virtual HRESULT CrashRecordStop (/* out */ BMDDeckControlError *error) = 0; 1168 virtual HRESULT SetCallback (/* in */ IDeckLinkDeckControlStatusCallback *callback) = 0; 1169 1170 protected: ~IDeckLinkDeckControl()1171 virtual ~IDeckLinkDeckControl () {}; // call Release method to drop reference count 1172 }; 1173 1174 1175 /* Functions */ 1176 1177 extern "C" { 1178 1179 IDeckLinkIterator* CreateDeckLinkIteratorInstance (void); 1180 IDeckLinkAPIInformation* CreateDeckLinkAPIInformationInstance (void); 1181 IDeckLinkGLScreenPreviewHelper* CreateOpenGLScreenPreviewHelper (void); 1182 IDeckLinkCocoaScreenPreviewCallback* CreateCocoaScreenPreview (void* /* (NSView*) */ parentView); 1183 IDeckLinkVideoConversion* CreateVideoConversionInstance (void); 1184 1185 }; 1186 1187 1188 #endif // defined(__cplusplus) 1189 #endif // __DeckLink_API_h__ 1190