1 /* -LICENSE-START- 2 ** Copyright (c) 2016 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_IDeckLinkVideoFrameMetadataExtensions = /* D5973DC9-6432-46D0-8F0B-2496F8A1238F */ {0xD5,0x97,0x3D,0xC9,0x64,0x32,0x46,0xD0,0x8F,0x0B,0x24,0x96,0xF8,0xA1,0x23,0x8F}; 72 BMD_CONST REFIID IID_IDeckLinkVideoInputFrame = /* 05CFE374-537C-4094-9A57-680525118F44 */ {0x05,0xCF,0xE3,0x74,0x53,0x7C,0x40,0x94,0x9A,0x57,0x68,0x05,0x25,0x11,0x8F,0x44}; 73 BMD_CONST REFIID IID_IDeckLinkVideoFrameAncillary = /* 732E723C-D1A4-4E29-9E8E-4A88797A0004 */ {0x73,0x2E,0x72,0x3C,0xD1,0xA4,0x4E,0x29,0x9E,0x8E,0x4A,0x88,0x79,0x7A,0x00,0x04}; 74 BMD_CONST REFIID IID_IDeckLinkEncoderPacket = /* B693F36C-316E-4AF1-B6C2-F389A4BCA620 */ {0xB6,0x93,0xF3,0x6C,0x31,0x6E,0x4A,0xF1,0xB6,0xC2,0xF3,0x89,0xA4,0xBC,0xA6,0x20}; 75 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}; 76 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}; 77 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}; 78 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}; 79 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}; 80 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}; 81 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}; 82 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}; 83 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}; 84 BMD_CONST REFIID IID_IDeckLinkStatus = /* 5F558200-4028-49BC-BEAC-DB3FA4A96E46 */ {0x5F,0x55,0x82,0x00,0x40,0x28,0x49,0xBC,0xBE,0xAC,0xDB,0x3F,0xA4,0xA9,0x6E,0x46}; 85 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}; 86 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}; 87 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}; 88 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}; 89 90 /* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */ 91 92 typedef uint32_t BMDVideoOutputFlags; 93 enum _BMDVideoOutputFlags { 94 bmdVideoOutputFlagDefault = 0, 95 bmdVideoOutputVANC = 1 << 0, 96 bmdVideoOutputVITC = 1 << 1, 97 bmdVideoOutputRP188 = 1 << 2, 98 bmdVideoOutputDualStream3D = 1 << 4 99 }; 100 101 /* Enum BMDPacketType - Type of packet */ 102 103 typedef uint32_t BMDPacketType; 104 enum _BMDPacketType { 105 bmdPacketTypeStreamInterruptedMarker = /* 'sint' */ 0x73696E74, // A packet of this type marks the time when a video stream was interrupted, for example by a disconnected cable 106 bmdPacketTypeStreamData = /* 'sdat' */ 0x73646174 // Regular stream data 107 }; 108 109 /* Enum BMDFrameFlags - Frame flags */ 110 111 typedef uint32_t BMDFrameFlags; 112 enum _BMDFrameFlags { 113 bmdFrameFlagDefault = 0, 114 bmdFrameFlagFlipVertical = 1 << 0, 115 bmdFrameContainsHDRMetadata = 1 << 1, 116 117 /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */ 118 119 bmdFrameHasNoInputSource = 1 << 31 120 }; 121 122 /* Enum BMDVideoInputFlags - Flags applicable to video input */ 123 124 typedef uint32_t BMDVideoInputFlags; 125 enum _BMDVideoInputFlags { 126 bmdVideoInputFlagDefault = 0, 127 bmdVideoInputEnableFormatDetection = 1 << 0, 128 bmdVideoInputDualStream3D = 1 << 1 129 }; 130 131 /* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */ 132 133 typedef uint32_t BMDVideoInputFormatChangedEvents; 134 enum _BMDVideoInputFormatChangedEvents { 135 bmdVideoInputDisplayModeChanged = 1 << 0, 136 bmdVideoInputFieldDominanceChanged = 1 << 1, 137 bmdVideoInputColorspaceChanged = 1 << 2 138 }; 139 140 /* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */ 141 142 typedef uint32_t BMDDetectedVideoInputFormatFlags; 143 enum _BMDDetectedVideoInputFormatFlags { 144 bmdDetectedVideoInputYCbCr422 = 1 << 0, 145 bmdDetectedVideoInputRGB444 = 1 << 1, 146 bmdDetectedVideoInputDualStream3D = 1 << 2 147 }; 148 149 /* Enum BMDDeckLinkCapturePassthroughMode - Enumerates whether the video output is electrically connected to the video input or if the clean switching mode is enabled */ 150 151 typedef uint32_t BMDDeckLinkCapturePassthroughMode; 152 enum _BMDDeckLinkCapturePassthroughMode { 153 bmdDeckLinkCapturePassthroughModeDisabled = /* 'pdis' */ 0x70646973, 154 bmdDeckLinkCapturePassthroughModeDirect = /* 'pdir' */ 0x70646972, 155 bmdDeckLinkCapturePassthroughModeCleanSwitch = /* 'pcln' */ 0x70636C6E 156 }; 157 158 /* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */ 159 160 typedef uint32_t BMDOutputFrameCompletionResult; 161 enum _BMDOutputFrameCompletionResult { 162 bmdOutputFrameCompleted, 163 bmdOutputFrameDisplayedLate, 164 bmdOutputFrameDropped, 165 bmdOutputFrameFlushed 166 }; 167 168 /* Enum BMDReferenceStatus - GenLock input status */ 169 170 typedef uint32_t BMDReferenceStatus; 171 enum _BMDReferenceStatus { 172 bmdReferenceNotSupportedByHardware = 1 << 0, 173 bmdReferenceLocked = 1 << 1 174 }; 175 176 /* Enum BMDAudioFormat - Audio Format */ 177 178 typedef uint32_t BMDAudioFormat; 179 enum _BMDAudioFormat { 180 bmdAudioFormatPCM = /* 'lpcm' */ 0x6C70636D // Linear signed PCM samples 181 }; 182 183 /* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */ 184 185 typedef uint32_t BMDAudioSampleRate; 186 enum _BMDAudioSampleRate { 187 bmdAudioSampleRate48kHz = 48000 188 }; 189 190 /* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */ 191 192 typedef uint32_t BMDAudioSampleType; 193 enum _BMDAudioSampleType { 194 bmdAudioSampleType16bitInteger = 16, 195 bmdAudioSampleType32bitInteger = 32 196 }; 197 198 /* Enum BMDAudioOutputStreamType - Audio output stream type */ 199 200 typedef uint32_t BMDAudioOutputStreamType; 201 enum _BMDAudioOutputStreamType { 202 bmdAudioOutputStreamContinuous, 203 bmdAudioOutputStreamContinuousDontResample, 204 bmdAudioOutputStreamTimestamped 205 }; 206 207 /* Enum BMDDisplayModeSupport - Output mode supported flags */ 208 209 typedef uint32_t BMDDisplayModeSupport; 210 enum _BMDDisplayModeSupport { 211 bmdDisplayModeNotSupported = 0, 212 bmdDisplayModeSupported, 213 bmdDisplayModeSupportedWithConversion 214 }; 215 216 /* Enum BMDTimecodeFormat - Timecode formats for frame metadata */ 217 218 typedef uint32_t BMDTimecodeFormat; 219 enum _BMDTimecodeFormat { 220 bmdTimecodeRP188VITC1 = /* 'rpv1' */ 0x72707631, // RP188 timecode where DBB1 equals VITC1 (line 9) 221 bmdTimecodeRP188VITC2 = /* 'rp12' */ 0x72703132, // RP188 timecode where DBB1 equals VITC2 (line 9 for progressive or line 571 for interlaced/PsF) 222 bmdTimecodeRP188LTC = /* 'rplt' */ 0x72706C74, // RP188 timecode where DBB1 equals LTC (line 10) 223 bmdTimecodeRP188Any = /* 'rp18' */ 0x72703138, // For capture: return the first valid timecode in {VITC1, LTC ,VITC2} - For playback: set the timecode as VITC1 224 bmdTimecodeVITC = /* 'vitc' */ 0x76697463, 225 bmdTimecodeVITCField2 = /* 'vit2' */ 0x76697432, 226 bmdTimecodeSerial = /* 'seri' */ 0x73657269 227 }; 228 229 /* Enum BMDAnalogVideoFlags - Analog video display flags */ 230 231 typedef uint32_t BMDAnalogVideoFlags; 232 enum _BMDAnalogVideoFlags { 233 bmdAnalogVideoFlagCompositeSetup75 = 1 << 0, 234 bmdAnalogVideoFlagComponentBetacamLevels = 1 << 1 235 }; 236 237 /* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */ 238 239 typedef uint32_t BMDAudioOutputAnalogAESSwitch; 240 enum _BMDAudioOutputAnalogAESSwitch { 241 bmdAudioOutputSwitchAESEBU = /* 'aes ' */ 0x61657320, 242 bmdAudioOutputSwitchAnalog = /* 'anlg' */ 0x616E6C67 243 }; 244 245 /* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */ 246 247 typedef uint32_t BMDVideoOutputConversionMode; 248 enum _BMDVideoOutputConversionMode { 249 bmdNoVideoOutputConversion = /* 'none' */ 0x6E6F6E65, 250 bmdVideoOutputLetterboxDownconversion = /* 'ltbx' */ 0x6C746278, 251 bmdVideoOutputAnamorphicDownconversion = /* 'amph' */ 0x616D7068, 252 bmdVideoOutputHD720toHD1080Conversion = /* '720c' */ 0x37323063, 253 bmdVideoOutputHardwareLetterboxDownconversion = /* 'HWlb' */ 0x48576C62, 254 bmdVideoOutputHardwareAnamorphicDownconversion = /* 'HWam' */ 0x4857616D, 255 bmdVideoOutputHardwareCenterCutDownconversion = /* 'HWcc' */ 0x48576363, 256 bmdVideoOutputHardware720p1080pCrossconversion = /* 'xcap' */ 0x78636170, 257 bmdVideoOutputHardwareAnamorphic720pUpconversion = /* 'ua7p' */ 0x75613770, 258 bmdVideoOutputHardwareAnamorphic1080iUpconversion = /* 'ua1i' */ 0x75613169, 259 bmdVideoOutputHardwareAnamorphic149To720pUpconversion = /* 'u47p' */ 0x75343770, 260 bmdVideoOutputHardwareAnamorphic149To1080iUpconversion = /* 'u41i' */ 0x75343169, 261 bmdVideoOutputHardwarePillarbox720pUpconversion = /* 'up7p' */ 0x75703770, 262 bmdVideoOutputHardwarePillarbox1080iUpconversion = /* 'up1i' */ 0x75703169 263 }; 264 265 /* Enum BMDVideoInputConversionMode - Video input conversion mode */ 266 267 typedef uint32_t BMDVideoInputConversionMode; 268 enum _BMDVideoInputConversionMode { 269 bmdNoVideoInputConversion = /* 'none' */ 0x6E6F6E65, 270 bmdVideoInputLetterboxDownconversionFromHD1080 = /* '10lb' */ 0x31306C62, 271 bmdVideoInputAnamorphicDownconversionFromHD1080 = /* '10am' */ 0x3130616D, 272 bmdVideoInputLetterboxDownconversionFromHD720 = /* '72lb' */ 0x37326C62, 273 bmdVideoInputAnamorphicDownconversionFromHD720 = /* '72am' */ 0x3732616D, 274 bmdVideoInputLetterboxUpconversion = /* 'lbup' */ 0x6C627570, 275 bmdVideoInputAnamorphicUpconversion = /* 'amup' */ 0x616D7570 276 }; 277 278 /* Enum BMDVideo3DPackingFormat - Video 3D packing format */ 279 280 typedef uint32_t BMDVideo3DPackingFormat; 281 enum _BMDVideo3DPackingFormat { 282 bmdVideo3DPackingSidebySideHalf = /* 'sbsh' */ 0x73627368, 283 bmdVideo3DPackingLinebyLine = /* 'lbyl' */ 0x6C62796C, 284 bmdVideo3DPackingTopAndBottom = /* 'tabo' */ 0x7461626F, 285 bmdVideo3DPackingFramePacking = /* 'frpk' */ 0x6672706B, 286 bmdVideo3DPackingLeftOnly = /* 'left' */ 0x6C656674, 287 bmdVideo3DPackingRightOnly = /* 'righ' */ 0x72696768 288 }; 289 290 /* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */ 291 292 typedef uint32_t BMDIdleVideoOutputOperation; 293 enum _BMDIdleVideoOutputOperation { 294 bmdIdleVideoOutputBlack = /* 'blac' */ 0x626C6163, 295 bmdIdleVideoOutputLastFrame = /* 'lafa' */ 0x6C616661 296 }; 297 298 /* Enum BMDVideoEncoderFrameCodingMode - Video frame coding mode */ 299 300 typedef uint32_t BMDVideoEncoderFrameCodingMode; 301 enum _BMDVideoEncoderFrameCodingMode { 302 bmdVideoEncoderFrameCodingModeInter = /* 'inte' */ 0x696E7465, 303 bmdVideoEncoderFrameCodingModeIntra = /* 'intr' */ 0x696E7472 304 }; 305 306 /* Enum BMDDNxHRLevel - DNxHR Levels */ 307 308 typedef uint32_t BMDDNxHRLevel; 309 enum _BMDDNxHRLevel { 310 bmdDNxHRLevelSQ = /* 'dnsq' */ 0x646E7371, 311 bmdDNxHRLevelLB = /* 'dnlb' */ 0x646E6C62, 312 bmdDNxHRLevelHQ = /* 'dnhq' */ 0x646E6871, 313 bmdDNxHRLevelHQX = /* 'dhqx' */ 0x64687178, 314 bmdDNxHRLevel444 = /* 'd444' */ 0x64343434 315 }; 316 317 /* Enum BMDLinkConfiguration - Video link configuration */ 318 319 typedef uint32_t BMDLinkConfiguration; 320 enum _BMDLinkConfiguration { 321 bmdLinkConfigurationSingleLink = /* 'lcsl' */ 0x6C63736C, 322 bmdLinkConfigurationDualLink = /* 'lcdl' */ 0x6C63646C, 323 bmdLinkConfigurationQuadLink = /* 'lcql' */ 0x6C63716C 324 }; 325 326 /* Enum BMDDeviceInterface - Device interface type */ 327 328 typedef uint32_t BMDDeviceInterface; 329 enum _BMDDeviceInterface { 330 bmdDeviceInterfacePCI = /* 'pci ' */ 0x70636920, 331 bmdDeviceInterfaceUSB = /* 'usb ' */ 0x75736220, 332 bmdDeviceInterfaceThunderbolt = /* 'thun' */ 0x7468756E 333 }; 334 335 /* Enum BMDDeckLinkFrameMetadataID - DeckLink Frame Metadata ID */ 336 337 typedef uint32_t BMDDeckLinkFrameMetadataID; 338 enum _BMDDeckLinkFrameMetadataID { 339 bmdDeckLinkFrameMetadataHDRElectroOpticalTransferFunc = /* 'eotf' */ 0x656F7466, // EOTF in range 0-7 as per CEA 861.3 340 bmdDeckLinkFrameMetadataHDRDisplayPrimariesRedX = /* 'hdrx' */ 0x68647278, // Red display primaries in range 0.0 - 1.0 341 bmdDeckLinkFrameMetadataHDRDisplayPrimariesRedY = /* 'hdry' */ 0x68647279, // Red display primaries in range 0.0 - 1.0 342 bmdDeckLinkFrameMetadataHDRDisplayPrimariesGreenX = /* 'hdgx' */ 0x68646778, // Green display primaries in range 0.0 - 1.0 343 bmdDeckLinkFrameMetadataHDRDisplayPrimariesGreenY = /* 'hdgy' */ 0x68646779, // Green display primaries in range 0.0 - 1.0 344 bmdDeckLinkFrameMetadataHDRDisplayPrimariesBlueX = /* 'hdbx' */ 0x68646278, // Blue display primaries in range 0.0 - 1.0 345 bmdDeckLinkFrameMetadataHDRDisplayPrimariesBlueY = /* 'hdby' */ 0x68646279, // Blue display primaries in range 0.0 - 1.0 346 bmdDeckLinkFrameMetadataHDRWhitePointX = /* 'hdwx' */ 0x68647778, // White point in range 0.0 - 1.0 347 bmdDeckLinkFrameMetadataHDRWhitePointY = /* 'hdwy' */ 0x68647779, // White point in range 0.0 - 1.0 348 bmdDeckLinkFrameMetadataHDRMaxDisplayMasteringLuminance = /* 'hdml' */ 0x68646D6C, // Max display mastering luminance in range 1 cd/m2 - 65535 cd/m2 349 bmdDeckLinkFrameMetadataHDRMinDisplayMasteringLuminance = /* 'hmil' */ 0x686D696C, // Min display mastering luminance in range 0.0001 cd/m2 - 6.5535 cd/m2 350 bmdDeckLinkFrameMetadataHDRMaximumContentLightLevel = /* 'mcll' */ 0x6D636C6C, // Maximum Content Light Level in range 1 cd/m2 - 65535 cd/m2 351 bmdDeckLinkFrameMetadataHDRMaximumFrameAverageLightLevel = /* 'fall' */ 0x66616C6C // Maximum Frame Average Light Level in range 1 cd/m2 - 65535 cd/m2 352 }; 353 354 /* Enum BMDDuplexMode - Duplex for configurable ports */ 355 356 typedef uint32_t BMDDuplexMode; 357 enum _BMDDuplexMode { 358 bmdDuplexModeFull = /* 'fdup' */ 0x66647570, 359 bmdDuplexModeHalf = /* 'hdup' */ 0x68647570 360 }; 361 362 /* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */ 363 364 typedef uint32_t BMDDeckLinkAttributeID; 365 enum _BMDDeckLinkAttributeID { 366 367 /* Flags */ 368 369 BMDDeckLinkSupportsInternalKeying = /* 'keyi' */ 0x6B657969, 370 BMDDeckLinkSupportsExternalKeying = /* 'keye' */ 0x6B657965, 371 BMDDeckLinkSupportsHDKeying = /* 'keyh' */ 0x6B657968, 372 BMDDeckLinkSupportsInputFormatDetection = /* 'infd' */ 0x696E6664, 373 BMDDeckLinkHasReferenceInput = /* 'hrin' */ 0x6872696E, 374 BMDDeckLinkHasSerialPort = /* 'hspt' */ 0x68737074, 375 BMDDeckLinkHasAnalogVideoOutputGain = /* 'avog' */ 0x61766F67, 376 BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain = /* 'ovog' */ 0x6F766F67, 377 BMDDeckLinkHasVideoInputAntiAliasingFilter = /* 'aafl' */ 0x6161666C, 378 BMDDeckLinkHasBypass = /* 'byps' */ 0x62797073, 379 BMDDeckLinkSupportsClockTimingAdjustment = /* 'ctad' */ 0x63746164, 380 BMDDeckLinkSupportsFullDuplex = /* 'fdup' */ 0x66647570, 381 BMDDeckLinkSupportsFullFrameReferenceInputTimingOffset = /* 'frin' */ 0x6672696E, 382 BMDDeckLinkSupportsSMPTELevelAOutput = /* 'lvla' */ 0x6C766C61, 383 BMDDeckLinkSupportsDualLinkSDI = /* 'sdls' */ 0x73646C73, 384 BMDDeckLinkSupportsQuadLinkSDI = /* 'sqls' */ 0x73716C73, 385 BMDDeckLinkSupportsIdleOutput = /* 'idou' */ 0x69646F75, 386 BMDDeckLinkHasLTCTimecodeInput = /* 'hltc' */ 0x686C7463, 387 BMDDeckLinkSupportsDuplexModeConfiguration = /* 'dupx' */ 0x64757078, 388 BMDDeckLinkSupportsHDRMetadata = /* 'hdrm' */ 0x6864726D, 389 390 /* Integers */ 391 392 BMDDeckLinkMaximumAudioChannels = /* 'mach' */ 0x6D616368, 393 BMDDeckLinkMaximumAnalogAudioChannels = /* 'aach' */ 0x61616368, 394 BMDDeckLinkNumberOfSubDevices = /* 'nsbd' */ 0x6E736264, 395 BMDDeckLinkSubDeviceIndex = /* 'subi' */ 0x73756269, 396 BMDDeckLinkPersistentID = /* 'peid' */ 0x70656964, 397 BMDDeckLinkDeviceGroupID = /* 'dgid' */ 0x64676964, 398 BMDDeckLinkTopologicalID = /* 'toid' */ 0x746F6964, 399 BMDDeckLinkVideoOutputConnections = /* 'vocn' */ 0x766F636E, 400 BMDDeckLinkVideoInputConnections = /* 'vicn' */ 0x7669636E, 401 BMDDeckLinkAudioOutputConnections = /* 'aocn' */ 0x616F636E, 402 BMDDeckLinkAudioInputConnections = /* 'aicn' */ 0x6169636E, 403 BMDDeckLinkVideoIOSupport = /* 'vios' */ 0x76696F73, // Returns a BMDVideoIOSupport bit field 404 BMDDeckLinkDeckControlConnections = /* 'dccn' */ 0x6463636E, 405 BMDDeckLinkDeviceInterface = /* 'dbus' */ 0x64627573, // Returns a BMDDeviceInterface 406 BMDDeckLinkAudioInputRCAChannelCount = /* 'airc' */ 0x61697263, 407 BMDDeckLinkAudioInputXLRChannelCount = /* 'aixc' */ 0x61697863, 408 BMDDeckLinkAudioOutputRCAChannelCount = /* 'aorc' */ 0x616F7263, 409 BMDDeckLinkAudioOutputXLRChannelCount = /* 'aoxc' */ 0x616F7863, 410 BMDDeckLinkPairedDevicePersistentID = /* 'ppid' */ 0x70706964, 411 412 /* Floats */ 413 414 BMDDeckLinkVideoInputGainMinimum = /* 'vigm' */ 0x7669676D, 415 BMDDeckLinkVideoInputGainMaximum = /* 'vigx' */ 0x76696778, 416 BMDDeckLinkVideoOutputGainMinimum = /* 'vogm' */ 0x766F676D, 417 BMDDeckLinkVideoOutputGainMaximum = /* 'vogx' */ 0x766F6778, 418 BMDDeckLinkMicrophoneInputGainMinimum = /* 'migm' */ 0x6D69676D, 419 BMDDeckLinkMicrophoneInputGainMaximum = /* 'migx' */ 0x6D696778, 420 421 /* Strings */ 422 423 BMDDeckLinkSerialPortDeviceName = /* 'slpn' */ 0x736C706E, 424 BMDDeckLinkVendorName = /* 'vndr' */ 0x766E6472, 425 BMDDeckLinkDisplayName = /* 'dspn' */ 0x6473706E, 426 BMDDeckLinkModelName = /* 'mdln' */ 0x6D646C6E, 427 BMDDeckLinkDeviceHandle = /* 'devh' */ 0x64657668 428 }; 429 430 /* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */ 431 432 typedef uint32_t BMDDeckLinkAPIInformationID; 433 enum _BMDDeckLinkAPIInformationID { 434 BMDDeckLinkAPIVersion = /* 'vers' */ 0x76657273 435 }; 436 437 /* Enum BMDDeckLinkStatusID - DeckLink Status ID */ 438 439 typedef uint32_t BMDDeckLinkStatusID; 440 enum _BMDDeckLinkStatusID { 441 442 /* Integers */ 443 444 bmdDeckLinkStatusDetectedVideoInputMode = /* 'dvim' */ 0x6476696D, 445 bmdDeckLinkStatusDetectedVideoInputFlags = /* 'dvif' */ 0x64766966, 446 bmdDeckLinkStatusCurrentVideoInputMode = /* 'cvim' */ 0x6376696D, 447 bmdDeckLinkStatusCurrentVideoInputPixelFormat = /* 'cvip' */ 0x63766970, 448 bmdDeckLinkStatusCurrentVideoInputFlags = /* 'cvif' */ 0x63766966, 449 bmdDeckLinkStatusCurrentVideoOutputMode = /* 'cvom' */ 0x63766F6D, 450 bmdDeckLinkStatusCurrentVideoOutputFlags = /* 'cvof' */ 0x63766F66, 451 bmdDeckLinkStatusPCIExpressLinkWidth = /* 'pwid' */ 0x70776964, 452 bmdDeckLinkStatusPCIExpressLinkSpeed = /* 'plnk' */ 0x706C6E6B, 453 bmdDeckLinkStatusLastVideoOutputPixelFormat = /* 'opix' */ 0x6F706978, 454 bmdDeckLinkStatusReferenceSignalMode = /* 'refm' */ 0x7265666D, 455 bmdDeckLinkStatusReferenceSignalFlags = /* 'reff' */ 0x72656666, 456 bmdDeckLinkStatusDuplexMode = /* 'dupx' */ 0x64757078, 457 bmdDeckLinkStatusBusy = /* 'busy' */ 0x62757379, 458 459 /* Flags */ 460 461 bmdDeckLinkStatusVideoInputSignalLocked = /* 'visl' */ 0x7669736C, 462 bmdDeckLinkStatusReferenceSignalLocked = /* 'refl' */ 0x7265666C 463 }; 464 465 /* Enum BMDDeckLinkVideoStatusFlags - */ 466 467 typedef uint32_t BMDDeckLinkVideoStatusFlags; 468 enum _BMDDeckLinkVideoStatusFlags { 469 bmdDeckLinkVideoStatusPsF = 1 << 0, 470 bmdDeckLinkVideoStatusDualStream3D = 1 << 1 471 }; 472 473 /* Enum BMDDuplexStatus - Duplex status of the device */ 474 475 typedef uint32_t BMDDuplexStatus; 476 enum _BMDDuplexStatus { 477 bmdDuplexStatusFullDuplex = /* 'fdup' */ 0x66647570, 478 bmdDuplexStatusHalfDuplex = /* 'hdup' */ 0x68647570, 479 bmdDuplexStatusSimplex = /* 'splx' */ 0x73706C78, 480 bmdDuplexStatusInactive = /* 'inac' */ 0x696E6163 481 }; 482 483 /* Enum BMDDeviceBusyState - Current device busy state */ 484 485 typedef uint32_t BMDDeviceBusyState; 486 enum _BMDDeviceBusyState { 487 bmdDeviceCaptureBusy = 1 << 0, 488 bmdDevicePlaybackBusy = 1 << 1, 489 bmdDeviceSerialPortBusy = 1 << 2 490 }; 491 492 /* Enum BMDVideoIOSupport - Device video input/output support */ 493 494 typedef uint32_t BMDVideoIOSupport; 495 enum _BMDVideoIOSupport { 496 bmdDeviceSupportsCapture = 1 << 0, 497 bmdDeviceSupportsPlayback = 1 << 1 498 }; 499 500 /* Enum BMD3DPreviewFormat - Linked Frame preview format */ 501 502 typedef uint32_t BMD3DPreviewFormat; 503 enum _BMD3DPreviewFormat { 504 bmd3DPreviewFormatDefault = /* 'defa' */ 0x64656661, 505 bmd3DPreviewFormatLeftOnly = /* 'left' */ 0x6C656674, 506 bmd3DPreviewFormatRightOnly = /* 'righ' */ 0x72696768, 507 bmd3DPreviewFormatSideBySide = /* 'side' */ 0x73696465, 508 bmd3DPreviewFormatTopBottom = /* 'topb' */ 0x746F7062 509 }; 510 511 /* Enum BMDNotifications - Events that can be subscribed through IDeckLinkNotification */ 512 513 typedef uint32_t BMDNotifications; 514 enum _BMDNotifications { 515 bmdPreferencesChanged = /* 'pref' */ 0x70726566, 516 bmdStatusChanged = /* 'stat' */ 0x73746174 517 }; 518 519 #if defined(__cplusplus) 520 521 // Forward Declarations 522 523 class IDeckLinkVideoOutputCallback; 524 class IDeckLinkInputCallback; 525 class IDeckLinkEncoderInputCallback; 526 class IDeckLinkMemoryAllocator; 527 class IDeckLinkAudioOutputCallback; 528 class IDeckLinkIterator; 529 class IDeckLinkAPIInformation; 530 class IDeckLinkOutput; 531 class IDeckLinkInput; 532 class IDeckLinkEncoderInput; 533 class IDeckLinkVideoFrame; 534 class IDeckLinkMutableVideoFrame; 535 class IDeckLinkVideoFrame3DExtensions; 536 class IDeckLinkVideoFrameMetadataExtensions; 537 class IDeckLinkVideoInputFrame; 538 class IDeckLinkVideoFrameAncillary; 539 class IDeckLinkEncoderPacket; 540 class IDeckLinkEncoderVideoPacket; 541 class IDeckLinkEncoderAudioPacket; 542 class IDeckLinkH265NALPacket; 543 class IDeckLinkAudioInputPacket; 544 class IDeckLinkScreenPreviewCallback; 545 class IDeckLinkGLScreenPreviewHelper; 546 class IDeckLinkNotificationCallback; 547 class IDeckLinkNotification; 548 class IDeckLinkAttributes; 549 class IDeckLinkStatus; 550 class IDeckLinkKeyer; 551 class IDeckLinkVideoConversion; 552 class IDeckLinkDeviceNotificationCallback; 553 class IDeckLinkDiscovery; 554 555 /* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */ 556 557 class IDeckLinkVideoOutputCallback : public IUnknown 558 { 559 public: 560 virtual HRESULT ScheduledFrameCompleted (/* in */ IDeckLinkVideoFrame *completedFrame, /* in */ BMDOutputFrameCompletionResult result) = 0; 561 virtual HRESULT ScheduledPlaybackHasStopped (void) = 0; 562 563 protected: ~IDeckLinkVideoOutputCallback()564 virtual ~IDeckLinkVideoOutputCallback () {} // call Release method to drop reference count 565 }; 566 567 /* Interface IDeckLinkInputCallback - Frame arrival callback. */ 568 569 class IDeckLinkInputCallback : public IUnknown 570 { 571 public: 572 virtual HRESULT VideoInputFormatChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0; 573 virtual HRESULT VideoInputFrameArrived (/* in */ IDeckLinkVideoInputFrame* videoFrame, /* in */ IDeckLinkAudioInputPacket* audioPacket) = 0; 574 575 protected: ~IDeckLinkInputCallback()576 virtual ~IDeckLinkInputCallback () {} // call Release method to drop reference count 577 }; 578 579 /* Interface IDeckLinkEncoderInputCallback - Frame arrival callback. */ 580 581 class IDeckLinkEncoderInputCallback : public IUnknown 582 { 583 public: 584 virtual HRESULT VideoInputSignalChanged (/* in */ BMDVideoInputFormatChangedEvents notificationEvents, /* in */ IDeckLinkDisplayMode *newDisplayMode, /* in */ BMDDetectedVideoInputFormatFlags detectedSignalFlags) = 0; 585 virtual HRESULT VideoPacketArrived (/* in */ IDeckLinkEncoderVideoPacket* videoPacket) = 0; 586 virtual HRESULT AudioPacketArrived (/* in */ IDeckLinkEncoderAudioPacket* audioPacket) = 0; 587 588 protected: ~IDeckLinkEncoderInputCallback()589 virtual ~IDeckLinkEncoderInputCallback () {} // call Release method to drop reference count 590 }; 591 592 /* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */ 593 594 class IDeckLinkMemoryAllocator : public IUnknown 595 { 596 public: 597 virtual HRESULT AllocateBuffer (/* in */ uint32_t bufferSize, /* out */ void **allocatedBuffer) = 0; 598 virtual HRESULT ReleaseBuffer (/* in */ void *buffer) = 0; 599 600 virtual HRESULT Commit (void) = 0; 601 virtual HRESULT Decommit (void) = 0; 602 }; 603 604 /* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */ 605 606 class IDeckLinkAudioOutputCallback : public IUnknown 607 { 608 public: 609 virtual HRESULT RenderAudioSamples (/* in */ bool preroll) = 0; 610 }; 611 612 /* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */ 613 614 class IDeckLinkIterator : public IUnknown 615 { 616 public: 617 virtual HRESULT Next (/* out */ IDeckLink **deckLinkInstance) = 0; 618 }; 619 620 /* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */ 621 622 class IDeckLinkAPIInformation : public IUnknown 623 { 624 public: 625 virtual HRESULT GetFlag (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ bool *value) = 0; 626 virtual HRESULT GetInt (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ int64_t *value) = 0; 627 virtual HRESULT GetFloat (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ double *value) = 0; 628 virtual HRESULT GetString (/* in */ BMDDeckLinkAPIInformationID cfgID, /* out */ const char **value) = 0; 629 630 protected: ~IDeckLinkAPIInformation()631 virtual ~IDeckLinkAPIInformation () {} // call Release method to drop reference count 632 }; 633 634 /* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */ 635 636 class IDeckLinkOutput : public IUnknown 637 { 638 public: 639 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoOutputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0; 640 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0; 641 642 virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0; 643 644 /* Video Output */ 645 646 virtual HRESULT EnableVideoOutput (/* in */ BMDDisplayMode displayMode, /* in */ BMDVideoOutputFlags flags) = 0; 647 virtual HRESULT DisableVideoOutput (void) = 0; 648 649 virtual HRESULT SetVideoOutputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0; 650 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; 651 virtual HRESULT CreateAncillaryData (/* in */ BMDPixelFormat pixelFormat, /* out */ IDeckLinkVideoFrameAncillary **outBuffer) = 0; 652 653 virtual HRESULT DisplayVideoFrameSync (/* in */ IDeckLinkVideoFrame *theFrame) = 0; 654 virtual HRESULT ScheduleVideoFrame (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeValue displayTime, /* in */ BMDTimeValue displayDuration, /* in */ BMDTimeScale timeScale) = 0; 655 virtual HRESULT SetScheduledFrameCompletionCallback (/* in */ IDeckLinkVideoOutputCallback *theCallback) = 0; 656 virtual HRESULT GetBufferedVideoFrameCount (/* out */ uint32_t *bufferedFrameCount) = 0; 657 658 /* Audio Output */ 659 660 virtual HRESULT EnableAudioOutput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount, /* in */ BMDAudioOutputStreamType streamType) = 0; 661 virtual HRESULT DisableAudioOutput (void) = 0; 662 663 virtual HRESULT WriteAudioSamplesSync (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* out */ uint32_t *sampleFramesWritten) = 0; 664 665 virtual HRESULT BeginAudioPreroll (void) = 0; 666 virtual HRESULT EndAudioPreroll (void) = 0; 667 virtual HRESULT ScheduleAudioSamples (/* in */ void *buffer, /* in */ uint32_t sampleFrameCount, /* in */ BMDTimeValue streamTime, /* in */ BMDTimeScale timeScale, /* out */ uint32_t *sampleFramesWritten) = 0; 668 669 virtual HRESULT GetBufferedAudioSampleFrameCount (/* out */ uint32_t *bufferedSampleFrameCount) = 0; 670 virtual HRESULT FlushBufferedAudioSamples (void) = 0; 671 672 virtual HRESULT SetAudioCallback (/* in */ IDeckLinkAudioOutputCallback *theCallback) = 0; 673 674 /* Output Control */ 675 676 virtual HRESULT StartScheduledPlayback (/* in */ BMDTimeValue playbackStartTime, /* in */ BMDTimeScale timeScale, /* in */ double playbackSpeed) = 0; 677 virtual HRESULT StopScheduledPlayback (/* in */ BMDTimeValue stopPlaybackAtTime, /* out */ BMDTimeValue *actualStopTime, /* in */ BMDTimeScale timeScale) = 0; 678 virtual HRESULT IsScheduledPlaybackRunning (/* out */ bool *active) = 0; 679 virtual HRESULT GetScheduledStreamTime (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *streamTime, /* out */ double *playbackSpeed) = 0; 680 virtual HRESULT GetReferenceStatus (/* out */ BMDReferenceStatus *referenceStatus) = 0; 681 682 /* Hardware Timing */ 683 684 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0; 685 virtual HRESULT GetFrameCompletionReferenceTimestamp (/* in */ IDeckLinkVideoFrame *theFrame, /* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *frameCompletionTimestamp) = 0; 686 687 protected: ~IDeckLinkOutput()688 virtual ~IDeckLinkOutput () {} // call Release method to drop reference count 689 }; 690 691 /* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */ 692 693 class IDeckLinkInput : public IUnknown 694 { 695 public: 696 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0; 697 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0; 698 699 virtual HRESULT SetScreenPreviewCallback (/* in */ IDeckLinkScreenPreviewCallback *previewCallback) = 0; 700 701 /* Video Input */ 702 703 virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0; 704 virtual HRESULT DisableVideoInput (void) = 0; 705 virtual HRESULT GetAvailableVideoFrameCount (/* out */ uint32_t *availableFrameCount) = 0; 706 virtual HRESULT SetVideoInputFrameMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0; 707 708 /* Audio Input */ 709 710 virtual HRESULT EnableAudioInput (/* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0; 711 virtual HRESULT DisableAudioInput (void) = 0; 712 virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0; 713 714 /* Input Control */ 715 716 virtual HRESULT StartStreams (void) = 0; 717 virtual HRESULT StopStreams (void) = 0; 718 virtual HRESULT PauseStreams (void) = 0; 719 virtual HRESULT FlushStreams (void) = 0; 720 virtual HRESULT SetCallback (/* in */ IDeckLinkInputCallback *theCallback) = 0; 721 722 /* Hardware Timing */ 723 724 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0; 725 726 protected: ~IDeckLinkInput()727 virtual ~IDeckLinkInput () {} // call Release method to drop reference count 728 }; 729 730 /* Interface IDeckLinkEncoderInput - Created by QueryInterface from IDeckLink. */ 731 732 class IDeckLinkEncoderInput : public IUnknown 733 { 734 public: 735 virtual HRESULT DoesSupportVideoMode (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags, /* out */ BMDDisplayModeSupport *result, /* out */ IDeckLinkDisplayMode **resultDisplayMode) = 0; 736 virtual HRESULT GetDisplayModeIterator (/* out */ IDeckLinkDisplayModeIterator **iterator) = 0; 737 738 /* Video Input */ 739 740 virtual HRESULT EnableVideoInput (/* in */ BMDDisplayMode displayMode, /* in */ BMDPixelFormat pixelFormat, /* in */ BMDVideoInputFlags flags) = 0; 741 virtual HRESULT DisableVideoInput (void) = 0; 742 virtual HRESULT GetAvailablePacketsCount (/* out */ uint32_t *availablePacketsCount) = 0; 743 virtual HRESULT SetMemoryAllocator (/* in */ IDeckLinkMemoryAllocator *theAllocator) = 0; 744 745 /* Audio Input */ 746 747 virtual HRESULT EnableAudioInput (/* in */ BMDAudioFormat audioFormat, /* in */ BMDAudioSampleRate sampleRate, /* in */ BMDAudioSampleType sampleType, /* in */ uint32_t channelCount) = 0; 748 virtual HRESULT DisableAudioInput (void) = 0; 749 virtual HRESULT GetAvailableAudioSampleFrameCount (/* out */ uint32_t *availableSampleFrameCount) = 0; 750 751 /* Input Control */ 752 753 virtual HRESULT StartStreams (void) = 0; 754 virtual HRESULT StopStreams (void) = 0; 755 virtual HRESULT PauseStreams (void) = 0; 756 virtual HRESULT FlushStreams (void) = 0; 757 virtual HRESULT SetCallback (/* in */ IDeckLinkEncoderInputCallback *theCallback) = 0; 758 759 /* Hardware Timing */ 760 761 virtual HRESULT GetHardwareReferenceClock (/* in */ BMDTimeScale desiredTimeScale, /* out */ BMDTimeValue *hardwareTime, /* out */ BMDTimeValue *timeInFrame, /* out */ BMDTimeValue *ticksPerFrame) = 0; 762 763 protected: ~IDeckLinkEncoderInput()764 virtual ~IDeckLinkEncoderInput () {} // call Release method to drop reference count 765 }; 766 767 /* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */ 768 769 class IDeckLinkVideoFrame : public IUnknown 770 { 771 public: 772 virtual long GetWidth (void) = 0; 773 virtual long GetHeight (void) = 0; 774 virtual long GetRowBytes (void) = 0; 775 virtual BMDPixelFormat GetPixelFormat (void) = 0; 776 virtual BMDFrameFlags GetFlags (void) = 0; 777 virtual HRESULT GetBytes (/* out */ void **buffer) = 0; 778 779 virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0; 780 virtual HRESULT GetAncillaryData (/* out */ IDeckLinkVideoFrameAncillary **ancillary) = 0; 781 782 protected: ~IDeckLinkVideoFrame()783 virtual ~IDeckLinkVideoFrame () {} // call Release method to drop reference count 784 }; 785 786 /* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */ 787 788 class IDeckLinkMutableVideoFrame : public IDeckLinkVideoFrame 789 { 790 public: 791 virtual HRESULT SetFlags (/* in */ BMDFrameFlags newFlags) = 0; 792 793 virtual HRESULT SetTimecode (/* in */ BMDTimecodeFormat format, /* in */ IDeckLinkTimecode *timecode) = 0; 794 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; 795 virtual HRESULT SetAncillaryData (/* in */ IDeckLinkVideoFrameAncillary *ancillary) = 0; 796 virtual HRESULT SetTimecodeUserBits (/* in */ BMDTimecodeFormat format, /* in */ BMDTimecodeUserBits userBits) = 0; 797 798 protected: ~IDeckLinkMutableVideoFrame()799 virtual ~IDeckLinkMutableVideoFrame () {} // call Release method to drop reference count 800 }; 801 802 /* Interface IDeckLinkVideoFrame3DExtensions - Optional interface implemented on IDeckLinkVideoFrame to support 3D frames */ 803 804 class IDeckLinkVideoFrame3DExtensions : public IUnknown 805 { 806 public: 807 virtual BMDVideo3DPackingFormat Get3DPackingFormat (void) = 0; 808 virtual HRESULT GetFrameForRightEye (/* out */ IDeckLinkVideoFrame* *rightEyeFrame) = 0; 809 810 protected: ~IDeckLinkVideoFrame3DExtensions()811 virtual ~IDeckLinkVideoFrame3DExtensions () {} // call Release method to drop reference count 812 }; 813 814 /* Interface IDeckLinkVideoFrameMetadataExtensions - Optional interface implemented on IDeckLinkVideoFrame to support frame metadata such as HDMI HDR information */ 815 816 class IDeckLinkVideoFrameMetadataExtensions : public IUnknown 817 { 818 public: 819 virtual HRESULT GetInt (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ int64_t *value) = 0; 820 virtual HRESULT GetFloat (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ double *value) = 0; 821 virtual HRESULT GetFlag (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ bool* value) = 0; 822 virtual HRESULT GetString (/* in */ BMDDeckLinkFrameMetadataID metadataID, /* out */ const char **value) = 0; 823 824 protected: ~IDeckLinkVideoFrameMetadataExtensions()825 virtual ~IDeckLinkVideoFrameMetadataExtensions () {} // call Release method to drop reference count 826 }; 827 828 /* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */ 829 830 class IDeckLinkVideoInputFrame : public IDeckLinkVideoFrame 831 { 832 public: 833 virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration, /* in */ BMDTimeScale timeScale) = 0; 834 virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0; 835 836 protected: ~IDeckLinkVideoInputFrame()837 virtual ~IDeckLinkVideoInputFrame () {} // call Release method to drop reference count 838 }; 839 840 /* Interface IDeckLinkVideoFrameAncillary - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */ 841 842 class IDeckLinkVideoFrameAncillary : public IUnknown 843 { 844 public: 845 846 virtual HRESULT GetBufferForVerticalBlankingLine (/* in */ uint32_t lineNumber, /* out */ void **buffer) = 0; 847 virtual BMDPixelFormat GetPixelFormat (void) = 0; 848 virtual BMDDisplayMode GetDisplayMode (void) = 0; 849 850 protected: ~IDeckLinkVideoFrameAncillary()851 virtual ~IDeckLinkVideoFrameAncillary () {} // call Release method to drop reference count 852 }; 853 854 /* Interface IDeckLinkEncoderPacket - Interface to encapsulate an encoded packet. */ 855 856 class IDeckLinkEncoderPacket : public IUnknown 857 { 858 public: 859 virtual HRESULT GetBytes (/* out */ void **buffer) = 0; 860 virtual long GetSize (void) = 0; 861 virtual HRESULT GetStreamTime (/* out */ BMDTimeValue *frameTime, /* in */ BMDTimeScale timeScale) = 0; 862 virtual BMDPacketType GetPacketType (void) = 0; 863 864 protected: ~IDeckLinkEncoderPacket()865 virtual ~IDeckLinkEncoderPacket () {} // call Release method to drop reference count 866 }; 867 868 /* Interface IDeckLinkEncoderVideoPacket - Provided by the IDeckLinkEncoderInput video packet arrival callback. */ 869 870 class IDeckLinkEncoderVideoPacket : public IDeckLinkEncoderPacket 871 { 872 public: 873 virtual BMDPixelFormat GetPixelFormat (void) = 0; 874 virtual HRESULT GetHardwareReferenceTimestamp (/* in */ BMDTimeScale timeScale, /* out */ BMDTimeValue *frameTime, /* out */ BMDTimeValue *frameDuration) = 0; 875 876 virtual HRESULT GetTimecode (/* in */ BMDTimecodeFormat format, /* out */ IDeckLinkTimecode **timecode) = 0; 877 878 protected: ~IDeckLinkEncoderVideoPacket()879 virtual ~IDeckLinkEncoderVideoPacket () {} // call Release method to drop reference count 880 }; 881 882 /* Interface IDeckLinkEncoderAudioPacket - Provided by the IDeckLinkEncoderInput audio packet arrival callback. */ 883 884 class IDeckLinkEncoderAudioPacket : public IDeckLinkEncoderPacket 885 { 886 public: 887 virtual BMDAudioFormat GetAudioFormat (void) = 0; 888 889 protected: ~IDeckLinkEncoderAudioPacket()890 virtual ~IDeckLinkEncoderAudioPacket () {} // call Release method to drop reference count 891 }; 892 893 /* Interface IDeckLinkH265NALPacket - Obtained through QueryInterface() on an IDeckLinkEncoderVideoPacket object */ 894 895 class IDeckLinkH265NALPacket : public IDeckLinkEncoderVideoPacket 896 { 897 public: 898 virtual HRESULT GetUnitType (/* out */ uint8_t *unitType) = 0; 899 virtual HRESULT GetBytesNoPrefix (/* out */ void **buffer) = 0; 900 virtual long GetSizeNoPrefix (void) = 0; 901 902 protected: ~IDeckLinkH265NALPacket()903 virtual ~IDeckLinkH265NALPacket () {} // call Release method to drop reference count 904 }; 905 906 /* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */ 907 908 class IDeckLinkAudioInputPacket : public IUnknown 909 { 910 public: 911 virtual long GetSampleFrameCount (void) = 0; 912 virtual HRESULT GetBytes (/* out */ void **buffer) = 0; 913 virtual HRESULT GetPacketTime (/* out */ BMDTimeValue *packetTime, /* in */ BMDTimeScale timeScale) = 0; 914 915 protected: ~IDeckLinkAudioInputPacket()916 virtual ~IDeckLinkAudioInputPacket () {} // call Release method to drop reference count 917 }; 918 919 /* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */ 920 921 class IDeckLinkScreenPreviewCallback : public IUnknown 922 { 923 public: 924 virtual HRESULT DrawFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0; 925 926 protected: ~IDeckLinkScreenPreviewCallback()927 virtual ~IDeckLinkScreenPreviewCallback () {} // call Release method to drop reference count 928 }; 929 930 /* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */ 931 932 class IDeckLinkGLScreenPreviewHelper : public IUnknown 933 { 934 public: 935 936 /* Methods must be called with OpenGL context set */ 937 938 virtual HRESULT InitializeGL (void) = 0; 939 virtual HRESULT PaintGL (void) = 0; 940 virtual HRESULT SetFrame (/* in */ IDeckLinkVideoFrame *theFrame) = 0; 941 virtual HRESULT Set3DPreviewFormat (/* in */ BMD3DPreviewFormat previewFormat) = 0; 942 943 protected: ~IDeckLinkGLScreenPreviewHelper()944 virtual ~IDeckLinkGLScreenPreviewHelper () {} // call Release method to drop reference count 945 }; 946 947 /* Interface IDeckLinkNotificationCallback - DeckLink Notification Callback Interface */ 948 949 class IDeckLinkNotificationCallback : public IUnknown 950 { 951 public: 952 virtual HRESULT Notify (/* in */ BMDNotifications topic, /* in */ uint64_t param1, /* in */ uint64_t param2) = 0; 953 }; 954 955 /* Interface IDeckLinkNotification - DeckLink Notification interface */ 956 957 class IDeckLinkNotification : public IUnknown 958 { 959 public: 960 virtual HRESULT Subscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0; 961 virtual HRESULT Unsubscribe (/* in */ BMDNotifications topic, /* in */ IDeckLinkNotificationCallback *theCallback) = 0; 962 }; 963 964 /* Interface IDeckLinkAttributes - DeckLink Attribute interface */ 965 966 class IDeckLinkAttributes : public IUnknown 967 { 968 public: 969 virtual HRESULT GetFlag (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ bool *value) = 0; 970 virtual HRESULT GetInt (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ int64_t *value) = 0; 971 virtual HRESULT GetFloat (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ double *value) = 0; 972 virtual HRESULT GetString (/* in */ BMDDeckLinkAttributeID cfgID, /* out */ const char **value) = 0; 973 974 protected: ~IDeckLinkAttributes()975 virtual ~IDeckLinkAttributes () {} // call Release method to drop reference count 976 }; 977 978 /* Interface IDeckLinkStatus - DeckLink Status interface */ 979 980 class IDeckLinkStatus : public IUnknown 981 { 982 public: 983 virtual HRESULT GetFlag (/* in */ BMDDeckLinkStatusID statusID, /* out */ bool *value) = 0; 984 virtual HRESULT GetInt (/* in */ BMDDeckLinkStatusID statusID, /* out */ int64_t *value) = 0; 985 virtual HRESULT GetFloat (/* in */ BMDDeckLinkStatusID statusID, /* out */ double *value) = 0; 986 virtual HRESULT GetString (/* in */ BMDDeckLinkStatusID statusID, /* out */ const char **value) = 0; 987 virtual HRESULT GetBytes (/* in */ BMDDeckLinkStatusID statusID, /* out */ void *buffer, /* in, out */ uint32_t *bufferSize) = 0; 988 989 protected: ~IDeckLinkStatus()990 virtual ~IDeckLinkStatus () {} // call Release method to drop reference count 991 }; 992 993 /* Interface IDeckLinkKeyer - DeckLink Keyer interface */ 994 995 class IDeckLinkKeyer : public IUnknown 996 { 997 public: 998 virtual HRESULT Enable (/* in */ bool isExternal) = 0; 999 virtual HRESULT SetLevel (/* in */ uint8_t level) = 0; 1000 virtual HRESULT RampUp (/* in */ uint32_t numberOfFrames) = 0; 1001 virtual HRESULT RampDown (/* in */ uint32_t numberOfFrames) = 0; 1002 virtual HRESULT Disable (void) = 0; 1003 1004 protected: ~IDeckLinkKeyer()1005 virtual ~IDeckLinkKeyer () {} // call Release method to drop reference count 1006 }; 1007 1008 /* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */ 1009 1010 class IDeckLinkVideoConversion : public IUnknown 1011 { 1012 public: 1013 virtual HRESULT ConvertFrame (/* in */ IDeckLinkVideoFrame* srcFrame, /* in */ IDeckLinkVideoFrame* dstFrame) = 0; 1014 1015 protected: ~IDeckLinkVideoConversion()1016 virtual ~IDeckLinkVideoConversion () {} // call Release method to drop reference count 1017 }; 1018 1019 /* Interface IDeckLinkDeviceNotificationCallback - DeckLink device arrival/removal notification callbacks */ 1020 1021 class IDeckLinkDeviceNotificationCallback : public IUnknown 1022 { 1023 public: 1024 virtual HRESULT DeckLinkDeviceArrived (/* in */ IDeckLink* deckLinkDevice) = 0; 1025 virtual HRESULT DeckLinkDeviceRemoved (/* in */ IDeckLink* deckLinkDevice) = 0; 1026 1027 protected: ~IDeckLinkDeviceNotificationCallback()1028 virtual ~IDeckLinkDeviceNotificationCallback () {} // call Release method to drop reference count 1029 }; 1030 1031 /* Interface IDeckLinkDiscovery - DeckLink device discovery */ 1032 1033 class IDeckLinkDiscovery : public IUnknown 1034 { 1035 public: 1036 virtual HRESULT InstallDeviceNotifications (/* in */ IDeckLinkDeviceNotificationCallback* deviceNotificationCallback) = 0; 1037 virtual HRESULT UninstallDeviceNotifications (void) = 0; 1038 1039 protected: ~IDeckLinkDiscovery()1040 virtual ~IDeckLinkDiscovery () {} // call Release method to drop reference count 1041 }; 1042 1043 /* Functions */ 1044 1045 extern "C" { 1046 1047 IDeckLinkIterator* CreateDeckLinkIteratorInstance (void); 1048 IDeckLinkDiscovery* CreateDeckLinkDiscoveryInstance (void); 1049 IDeckLinkAPIInformation* CreateDeckLinkAPIInformationInstance (void); 1050 IDeckLinkGLScreenPreviewHelper* CreateOpenGLScreenPreviewHelper (void); 1051 IDeckLinkVideoConversion* CreateVideoConversionInstance (void); 1052 1053 } 1054 1055 1056 #endif // defined(__cplusplus) 1057 #endif /* defined(BMD_DECKLINKAPI_H) */ 1058