OLD | NEW |
(Empty) | |
| 1 /* -LICENSE-START- |
| 2 ** Copyright (c) 2014 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 |
| 29 #ifndef BMD_CONST |
| 30 #if defined(_MSC_VER) |
| 31 #define BMD_CONST __declspec(selectany) static const |
| 32 #else |
| 33 #define BMD_CONST static const |
| 34 #endif |
| 35 #endif |
| 36 |
| 37 // Type Declarations |
| 38 |
| 39 |
| 40 // Enumeration Mapping |
| 41 |
| 42 cpp_quote("#if 0") |
| 43 cpp_quote("#endif") |
| 44 |
| 45 /* Enum BMDStreamingDeviceMode - Device modes */ |
| 46 |
| 47 typedef [v1_enum] enum _BMDStreamingDeviceMode { |
| 48 bmdStreamingDeviceIdle = /* 'idle' */
0x69646C65, |
| 49 bmdStreamingDeviceEncoding = /* 'enco' */
0x656E636F, |
| 50 bmdStreamingDeviceStopping = /* 'stop' */
0x73746F70, |
| 51 bmdStreamingDeviceUnknown = /* 'munk' */
0x6D756E6B |
| 52 } BMDStreamingDeviceMode; |
| 53 |
| 54 /* Enum BMDStreamingEncodingFrameRate - Encoded frame rates */ |
| 55 |
| 56 typedef [v1_enum] enum _BMDStreamingEncodingFrameRate { |
| 57 |
| 58 /* Interlaced rates */ |
| 59 |
| 60 bmdStreamingEncodedFrameRate50i = /* 'e50i' */
0x65353069, |
| 61 bmdStreamingEncodedFrameRate5994i = /* 'e59i' */
0x65353969, |
| 62 bmdStreamingEncodedFrameRate60i = /* 'e60i' */
0x65363069, |
| 63 |
| 64 /* Progressive rates */ |
| 65 |
| 66 bmdStreamingEncodedFrameRate2398p = /* 'e23p' */
0x65323370, |
| 67 bmdStreamingEncodedFrameRate24p = /* 'e24p' */
0x65323470, |
| 68 bmdStreamingEncodedFrameRate25p = /* 'e25p' */
0x65323570, |
| 69 bmdStreamingEncodedFrameRate2997p = /* 'e29p' */
0x65323970, |
| 70 bmdStreamingEncodedFrameRate30p = /* 'e30p' */
0x65333070, |
| 71 bmdStreamingEncodedFrameRate50p = /* 'e50p' */
0x65353070, |
| 72 bmdStreamingEncodedFrameRate5994p = /* 'e59p' */
0x65353970, |
| 73 bmdStreamingEncodedFrameRate60p = /* 'e60p' */
0x65363070 |
| 74 } BMDStreamingEncodingFrameRate; |
| 75 |
| 76 /* Enum BMDStreamingEncodingSupport - Output encoding mode supported flag */ |
| 77 |
| 78 typedef [v1_enum] enum _BMDStreamingEncodingSupport { |
| 79 bmdStreamingEncodingModeNotSupported = 0, |
| 80 bmdStreamingEncodingModeSupported, |
| 81 bmdStreamingEncodingModeSupportedWithChanges |
| 82 } BMDStreamingEncodingSupport; |
| 83 |
| 84 /* Enum BMDStreamingVideoCodec - Video codecs */ |
| 85 |
| 86 typedef [v1_enum] enum _BMDStreamingVideoCodec { |
| 87 bmdStreamingVideoCodecH264 = /* 'H264' */
0x48323634 |
| 88 } BMDStreamingVideoCodec; |
| 89 |
| 90 /* Enum BMDStreamingH264Profile - H264 encoding profile */ |
| 91 |
| 92 typedef [v1_enum] enum _BMDStreamingH264Profile { |
| 93 bmdStreamingH264ProfileHigh = /* 'high' */
0x68696768, |
| 94 bmdStreamingH264ProfileMain = /* 'main' */
0x6D61696E, |
| 95 bmdStreamingH264ProfileBaseline = /* 'base' */
0x62617365 |
| 96 } BMDStreamingH264Profile; |
| 97 |
| 98 /* Enum BMDStreamingH264Level - H264 encoding level */ |
| 99 |
| 100 typedef [v1_enum] enum _BMDStreamingH264Level { |
| 101 bmdStreamingH264Level12 = /* 'lv12' */
0x6C763132, |
| 102 bmdStreamingH264Level13 = /* 'lv13' */
0x6C763133, |
| 103 bmdStreamingH264Level2 = /* 'lv2 ' */
0x6C763220, |
| 104 bmdStreamingH264Level21 = /* 'lv21' */
0x6C763231, |
| 105 bmdStreamingH264Level22 = /* 'lv22' */
0x6C763232, |
| 106 bmdStreamingH264Level3 = /* 'lv3 ' */
0x6C763320, |
| 107 bmdStreamingH264Level31 = /* 'lv31' */
0x6C763331, |
| 108 bmdStreamingH264Level32 = /* 'lv32' */
0x6C763332, |
| 109 bmdStreamingH264Level4 = /* 'lv4 ' */
0x6C763420, |
| 110 bmdStreamingH264Level41 = /* 'lv41' */
0x6C763431, |
| 111 bmdStreamingH264Level42 = /* 'lv42' */
0x6C763432 |
| 112 } BMDStreamingH264Level; |
| 113 |
| 114 /* Enum BMDStreamingH264EntropyCoding - H264 entropy coding */ |
| 115 |
| 116 typedef [v1_enum] enum _BMDStreamingH264EntropyCoding { |
| 117 bmdStreamingH264EntropyCodingCAVLC = /* 'EVLC' */
0x45564C43, |
| 118 bmdStreamingH264EntropyCodingCABAC = /* 'EBAC' */
0x45424143 |
| 119 } BMDStreamingH264EntropyCoding; |
| 120 |
| 121 /* Enum BMDStreamingAudioCodec - Audio codecs */ |
| 122 |
| 123 typedef [v1_enum] enum _BMDStreamingAudioCodec { |
| 124 bmdStreamingAudioCodecAAC = /* 'AAC ' */
0x41414320 |
| 125 } BMDStreamingAudioCodec; |
| 126 |
| 127 /* Enum BMDStreamingEncodingModePropertyID - Encoding mode properties */ |
| 128 |
| 129 typedef [v1_enum] enum _BMDStreamingEncodingModePropertyID { |
| 130 |
| 131 /* Integers, Video Properties */ |
| 132 |
| 133 bmdStreamingEncodingPropertyVideoFrameRate = /* 'vfrt' */
0x76667274, // Uses values of type BMDStreamingEncodingFrameRate |
| 134 bmdStreamingEncodingPropertyVideoBitRateKbps = /* 'vbrt' */
0x76627274, |
| 135 |
| 136 /* Integers, H264 Properties */ |
| 137 |
| 138 bmdStreamingEncodingPropertyH264Profile = /* 'hprf' */
0x68707266, |
| 139 bmdStreamingEncodingPropertyH264Level = /* 'hlvl' */
0x686C766C, |
| 140 bmdStreamingEncodingPropertyH264EntropyCoding = /* 'hent' */
0x68656E74, |
| 141 |
| 142 /* Flags, H264 Properties */ |
| 143 |
| 144 bmdStreamingEncodingPropertyH264HasBFrames = /* 'hBfr' */
0x68426672, |
| 145 |
| 146 /* Integers, Audio Properties */ |
| 147 |
| 148 bmdStreamingEncodingPropertyAudioCodec = /* 'acdc' */
0x61636463, |
| 149 bmdStreamingEncodingPropertyAudioSampleRate = /* 'asrt' */
0x61737274, |
| 150 bmdStreamingEncodingPropertyAudioChannelCount = /* 'achc' */
0x61636863, |
| 151 bmdStreamingEncodingPropertyAudioBitRateKbps = /* 'abrt' */
0x61627274 |
| 152 } BMDStreamingEncodingModePropertyID; |
| 153 |
| 154 // Forward Declarations |
| 155 |
| 156 interface IBMDStreamingDeviceNotificationCallback; |
| 157 interface IBMDStreamingH264InputCallback; |
| 158 interface IBMDStreamingDiscovery; |
| 159 interface IBMDStreamingVideoEncodingMode; |
| 160 interface IBMDStreamingMutableVideoEncodingMode; |
| 161 interface IBMDStreamingVideoEncodingModePresetIterator; |
| 162 interface IBMDStreamingDeviceInput; |
| 163 interface IBMDStreamingH264NALPacket; |
| 164 interface IBMDStreamingAudioPacket; |
| 165 interface IBMDStreamingMPEG2TSPacket; |
| 166 interface IBMDStreamingH264NALParser; |
| 167 |
| 168 /* Interface IBMDStreamingDeviceNotificationCallback - Device notification callb
acks. */ |
| 169 |
| 170 [ |
| 171 object, |
| 172 uuid(F9531D64-3305-4B29-A387-7F74BB0D0E84), |
| 173 helpstring("Device notification callbacks.") |
| 174 ] interface IBMDStreamingDeviceNotificationCallback : IUnknown |
| 175 { |
| 176 HRESULT StreamingDeviceArrived([in] IDeckLink* device); |
| 177 HRESULT StreamingDeviceRemoved([in] IDeckLink* device); |
| 178 HRESULT StreamingDeviceModeChanged([in] IDeckLink* device, [in] BMDStreaming
DeviceMode mode); |
| 179 }; |
| 180 |
| 181 /* Interface IBMDStreamingH264InputCallback - H264 input callbacks. */ |
| 182 |
| 183 [ |
| 184 object, |
| 185 uuid(823C475F-55AE-46F9-890C-537CC5CEDCCA), |
| 186 helpstring("H264 input callbacks.") |
| 187 ] interface IBMDStreamingH264InputCallback : IUnknown |
| 188 { |
| 189 HRESULT H264NALPacketArrived([in] IBMDStreamingH264NALPacket* nalPacket); |
| 190 HRESULT H264AudioPacketArrived([in] IBMDStreamingAudioPacket* audioPacket); |
| 191 HRESULT MPEG2TSPacketArrived([in] IBMDStreamingMPEG2TSPacket* tsPacket); |
| 192 HRESULT H264VideoInputConnectorScanningChanged(void); |
| 193 HRESULT H264VideoInputConnectorChanged(void); |
| 194 HRESULT H264VideoInputModeChanged(void); |
| 195 }; |
| 196 |
| 197 /* Interface IBMDStreamingDiscovery - Installs device notifications */ |
| 198 |
| 199 [ |
| 200 object, |
| 201 uuid(2C837444-F989-4D87-901A-47C8A36D096D), |
| 202 helpstring("Installs device notifications") |
| 203 ] interface IBMDStreamingDiscovery : IUnknown |
| 204 { |
| 205 HRESULT InstallDeviceNotifications([in] IBMDStreamingDeviceNotificationCallb
ack* theCallback); |
| 206 HRESULT UninstallDeviceNotifications(void); |
| 207 }; |
| 208 |
| 209 /* Interface IBMDStreamingVideoEncodingMode - Represents an encoded video mode.
*/ |
| 210 |
| 211 [ |
| 212 object, |
| 213 uuid(1AB8035B-CD13-458D-B6DF-5E8F7C2141D9), |
| 214 helpstring("Represents an encoded video mode.") |
| 215 ] interface IBMDStreamingVideoEncodingMode : IUnknown |
| 216 { |
| 217 HRESULT GetName([out] BSTR *name); |
| 218 unsigned int GetPresetID(void); |
| 219 unsigned int GetSourcePositionX(void); |
| 220 unsigned int GetSourcePositionY(void); |
| 221 unsigned int GetSourceWidth(void); |
| 222 unsigned int GetSourceHeight(void); |
| 223 unsigned int GetDestWidth(void); |
| 224 unsigned int GetDestHeight(void); |
| 225 HRESULT GetFlag([in] BMDStreamingEncodingModePropertyID cfgID, [out] BOOL* v
alue); |
| 226 HRESULT GetInt([in] BMDStreamingEncodingModePropertyID cfgID, [out] LONGLONG
* value); |
| 227 HRESULT GetFloat([in] BMDStreamingEncodingModePropertyID cfgID, [out] double
* value); |
| 228 HRESULT GetString([in] BMDStreamingEncodingModePropertyID cfgID, [out] BSTR
*value); |
| 229 HRESULT CreateMutableVideoEncodingMode([out] IBMDStreamingMutableVideoEncodi
ngMode** newEncodingMode); // Creates a mutable copy of the encoding mode |
| 230 }; |
| 231 |
| 232 /* Interface IBMDStreamingMutableVideoEncodingMode - Represents a mutable encode
d video mode. */ |
| 233 |
| 234 [ |
| 235 object, |
| 236 uuid(19BF7D90-1E0A-400D-B2C6-FFC4E78AD49D), |
| 237 helpstring("Represents a mutable encoded video mode.") |
| 238 ] interface IBMDStreamingMutableVideoEncodingMode : IBMDStreamingVideoEncodingMo
de |
| 239 { |
| 240 HRESULT SetSourceRect([in] unsigned long posX, [in] unsigned long posY, [in]
unsigned long width, [in] unsigned long height); |
| 241 HRESULT SetDestSize([in] unsigned long width, [in] unsigned long height); |
| 242 HRESULT SetFlag([in] BMDStreamingEncodingModePropertyID cfgID, [in] BOOL val
ue); |
| 243 HRESULT SetInt([in] BMDStreamingEncodingModePropertyID cfgID, [in] LONGLONG
value); |
| 244 HRESULT SetFloat([in] BMDStreamingEncodingModePropertyID cfgID, [in] double
value); |
| 245 HRESULT SetString([in] BMDStreamingEncodingModePropertyID cfgID, [in] BSTR v
alue); |
| 246 }; |
| 247 |
| 248 /* Interface IBMDStreamingVideoEncodingModePresetIterator - Enumerates encoding
mode presets */ |
| 249 |
| 250 [ |
| 251 object, |
| 252 uuid(7AC731A3-C950-4AD0-804A-8377AA51C6C4), |
| 253 helpstring("Enumerates encoding mode presets") |
| 254 ] interface IBMDStreamingVideoEncodingModePresetIterator : IUnknown |
| 255 { |
| 256 HRESULT Next([out] IBMDStreamingVideoEncodingMode** videoEncodingMode); |
| 257 }; |
| 258 |
| 259 /* Interface IBMDStreamingDeviceInput - Created by QueryInterface from IDeckLink
*/ |
| 260 |
| 261 [ |
| 262 object, |
| 263 uuid(24B6B6EC-1727-44BB-9818-34FF086ACF98), |
| 264 helpstring("Created by QueryInterface from IDeckLink") |
| 265 ] interface IBMDStreamingDeviceInput : IUnknown |
| 266 { |
| 267 |
| 268 /* Input modes */ |
| 269 |
| 270 HRESULT DoesSupportVideoInputMode([in] BMDDisplayMode inputMode, [out] BOOL*
result); |
| 271 HRESULT GetVideoInputModeIterator([out] IDeckLinkDisplayModeIterator** itera
tor); |
| 272 HRESULT SetVideoInputMode([in] BMDDisplayMode inputMode); |
| 273 HRESULT GetCurrentDetectedVideoInputMode([out] BMDDisplayMode* detectedMode)
; |
| 274 |
| 275 /* Capture modes */ |
| 276 |
| 277 HRESULT GetVideoEncodingMode([out] IBMDStreamingVideoEncodingMode** encoding
Mode); |
| 278 HRESULT GetVideoEncodingModePresetIterator([in] BMDDisplayMode inputMode, [o
ut] IBMDStreamingVideoEncodingModePresetIterator** iterator); |
| 279 HRESULT DoesSupportVideoEncodingMode([in] BMDDisplayMode inputMode, [in] IBM
DStreamingVideoEncodingMode* encodingMode, [out] BMDStreamingEncodingSupport* re
sult, [out] IBMDStreamingVideoEncodingMode** changedEncodingMode); |
| 280 HRESULT SetVideoEncodingMode([in] IBMDStreamingVideoEncodingMode* encodingMo
de); |
| 281 |
| 282 /* Input control */ |
| 283 |
| 284 HRESULT StartCapture(void); |
| 285 HRESULT StopCapture(void); |
| 286 HRESULT SetCallback([in] IUnknown* theCallback); |
| 287 }; |
| 288 |
| 289 /* Interface IBMDStreamingH264NALPacket - Represent an H.264 NAL packet */ |
| 290 |
| 291 [ |
| 292 object, |
| 293 uuid(E260E955-14BE-4395-9775-9F02CC0A9D89), |
| 294 helpstring("Represent an H.264 NAL packet") |
| 295 ] interface IBMDStreamingH264NALPacket : IUnknown |
| 296 { |
| 297 long GetPayloadSize(void); |
| 298 HRESULT GetBytes([out] void** buffer); |
| 299 HRESULT GetBytesWithSizePrefix([out] void** buffer); // Contains a 32-bit un
signed big endian size prefix |
| 300 HRESULT GetDisplayTime([in] ULONGLONG requestedTimeScale, [out] ULONGLONG* d
isplayTime); |
| 301 HRESULT GetPacketIndex([out] unsigned long* packetIndex); // Deprecated |
| 302 }; |
| 303 |
| 304 /* Interface IBMDStreamingAudioPacket - Represents a chunk of audio data */ |
| 305 |
| 306 [ |
| 307 object, |
| 308 uuid(D9EB5902-1AD2-43F4-9E2C-3CFA50B5EE19), |
| 309 helpstring("Represents a chunk of audio data") |
| 310 ] interface IBMDStreamingAudioPacket : IUnknown |
| 311 { |
| 312 BMDStreamingAudioCodec GetCodec(void); |
| 313 long GetPayloadSize(void); |
| 314 HRESULT GetBytes([out] void** buffer); |
| 315 HRESULT GetPlayTime([in] ULONGLONG requestedTimeScale, [out] ULONGLONG* play
Time); |
| 316 HRESULT GetPacketIndex([out] unsigned long* packetIndex); // Deprecated |
| 317 }; |
| 318 |
| 319 /* Interface IBMDStreamingMPEG2TSPacket - Represent an MPEG2 Transport Stream pa
cket */ |
| 320 |
| 321 [ |
| 322 object, |
| 323 uuid(91810D1C-4FB3-4AAA-AE56-FA301D3DFA4C), |
| 324 helpstring("Represent an MPEG2 Transport Stream packet") |
| 325 ] interface IBMDStreamingMPEG2TSPacket : IUnknown |
| 326 { |
| 327 long GetPayloadSize(void); |
| 328 HRESULT GetBytes([out] void** buffer); |
| 329 }; |
| 330 |
| 331 /* Interface IBMDStreamingH264NALParser - For basic NAL parsing */ |
| 332 |
| 333 [ |
| 334 object, |
| 335 uuid(5867F18C-5BFA-4CCC-B2A7-9DFD140417D2), |
| 336 helpstring("For basic NAL parsing") |
| 337 ] interface IBMDStreamingH264NALParser : IUnknown |
| 338 { |
| 339 HRESULT IsNALSequenceParameterSet([in] IBMDStreamingH264NALPacket* nal); |
| 340 HRESULT IsNALPictureParameterSet([in] IBMDStreamingH264NALPacket* nal); |
| 341 HRESULT GetProfileAndLevelFromSPS([in] IBMDStreamingH264NALPacket* nal, [out
] unsigned long* profileIdc, [out] unsigned long* profileCompatability, [out] un
signed long* levelIdc); |
| 342 }; |
| 343 |
| 344 /* Coclasses */ |
| 345 |
| 346 importlib("stdole2.tlb"); |
| 347 |
| 348 [ |
| 349 uuid(0CAA31F6-8A26-40B0-86A4-BF58DCCA710C), |
| 350 helpstring("CBMDStreamingDiscovery Class") |
| 351 ] coclass CBMDStreamingDiscovery |
| 352 { |
| 353 [default] interface IBMDStreamingDiscovery; |
| 354 }; |
| 355 |
| 356 [ |
| 357 uuid(7753EFBD-951C-407C-97A5-23C737B73B52), |
| 358 helpstring("CBMDStreamingH264NALParser Class") |
| 359 ] coclass CBMDStreamingH264NALParser |
| 360 { |
| 361 [default] interface IBMDStreamingH264NALParser; |
| 362 }; |
| 363 |
| 364 |
OLD | NEW |