DeckLinkAPI.idl 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813
  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. #ifndef BMD_CONST
  28. #if defined(_MSC_VER)
  29. #define BMD_CONST __declspec(selectany) static const
  30. #else
  31. #define BMD_CONST static const
  32. #endif
  33. #endif
  34. /* DeckLink API */
  35. import "unknwn.idl";
  36. [uuid(D864517A-EDD5-466D-867D-C819F1C052BB),
  37. version(1.0), helpstring("DeckLink API Library")]
  38. library DeckLinkAPI
  39. {
  40. #include "DeckLinkAPITypes.idl"
  41. #include "DeckLinkAPIModes.idl"
  42. #include "DeckLinkAPIDiscovery.idl"
  43. #include "DeckLinkAPIConfiguration.idl"
  44. #include "DeckLinkAPIDeckControl.idl"
  45. #include "DeckLinkAPIStreaming.idl"
  46. // Type Declarations
  47. // Enumeration Mapping
  48. cpp_quote("typedef unsigned long BMDFrameFlags;")
  49. cpp_quote("typedef unsigned long BMDVideoInputFlags;")
  50. cpp_quote("typedef unsigned long BMDVideoInputFormatChangedEvents;")
  51. cpp_quote("typedef unsigned long BMDDetectedVideoInputFormatFlags;")
  52. cpp_quote("typedef unsigned long BMDDeckLinkCapturePassthroughMode;")
  53. cpp_quote("typedef unsigned long BMDAnalogVideoFlags;")
  54. cpp_quote("typedef unsigned long BMDDeviceBusyState;")
  55. cpp_quote("#if 0")
  56. typedef enum _BMDFrameFlags BMDFrameFlags;
  57. typedef enum _BMDVideoInputFlags BMDVideoInputFlags;
  58. typedef enum _BMDVideoInputFormatChangedEvents BMDVideoInputFormatChangedEvents;
  59. typedef enum _BMDDetectedVideoInputFormatFlags BMDDetectedVideoInputFormatFlags;
  60. typedef enum _BMDDeckLinkCapturePassthroughMode BMDDeckLinkCapturePassthroughMode;
  61. typedef enum _BMDAnalogVideoFlags BMDAnalogVideoFlags;
  62. typedef enum _BMDDeviceBusyState BMDDeviceBusyState;
  63. cpp_quote("#endif")
  64. /* Enum BMDVideoOutputFlags - Flags to control the output of ancillary data along with video. */
  65. typedef [v1_enum] enum _BMDVideoOutputFlags {
  66. bmdVideoOutputFlagDefault = 0,
  67. bmdVideoOutputVANC = 1 << 0,
  68. bmdVideoOutputVITC = 1 << 1,
  69. bmdVideoOutputRP188 = 1 << 2,
  70. bmdVideoOutputDualStream3D = 1 << 4
  71. } BMDVideoOutputFlags;
  72. /* Enum BMDFrameFlags - Frame flags */
  73. [v1_enum] enum _BMDFrameFlags {
  74. bmdFrameFlagDefault = 0,
  75. bmdFrameFlagFlipVertical = 1 << 0,
  76. /* Flags that are applicable only to instances of IDeckLinkVideoInputFrame */
  77. bmdFrameHasNoInputSource = 1 << 31
  78. };
  79. /* Enum BMDVideoInputFlags - Flags applicable to video input */
  80. [v1_enum] enum _BMDVideoInputFlags {
  81. bmdVideoInputFlagDefault = 0,
  82. bmdVideoInputEnableFormatDetection = 1 << 0,
  83. bmdVideoInputDualStream3D = 1 << 1
  84. };
  85. /* Enum BMDVideoInputFormatChangedEvents - Bitmask passed to the VideoInputFormatChanged notification to identify the properties of the input signal that have changed */
  86. [v1_enum] enum _BMDVideoInputFormatChangedEvents {
  87. bmdVideoInputDisplayModeChanged = 1 << 0,
  88. bmdVideoInputFieldDominanceChanged = 1 << 1,
  89. bmdVideoInputColorspaceChanged = 1 << 2
  90. };
  91. /* Enum BMDDetectedVideoInputFormatFlags - Flags passed to the VideoInputFormatChanged notification to describe the detected video input signal */
  92. [v1_enum] enum _BMDDetectedVideoInputFormatFlags {
  93. bmdDetectedVideoInputYCbCr422 = 1 << 0,
  94. bmdDetectedVideoInputRGB444 = 1 << 1,
  95. bmdDetectedVideoInputDualStream3D = 1 << 2
  96. };
  97. /* Enum BMDDeckLinkCapturePassthroughMode - Enumerates whether the video output is electrically connected to the video input or if the clean switching mode is enabled */
  98. [v1_enum] enum _BMDDeckLinkCapturePassthroughMode {
  99. bmdDeckLinkCapturePassthroughModeDirect = /* 'pdir' */ 0x70646972,
  100. bmdDeckLinkCapturePassthroughModeCleanSwitch = /* 'pcln' */ 0x70636C6E
  101. };
  102. /* Enum BMDOutputFrameCompletionResult - Frame Completion Callback */
  103. typedef [v1_enum] enum _BMDOutputFrameCompletionResult {
  104. bmdOutputFrameCompleted,
  105. bmdOutputFrameDisplayedLate,
  106. bmdOutputFrameDropped,
  107. bmdOutputFrameFlushed
  108. } BMDOutputFrameCompletionResult;
  109. /* Enum BMDReferenceStatus - GenLock input status */
  110. typedef [v1_enum] enum _BMDReferenceStatus {
  111. bmdReferenceNotSupportedByHardware = 1 << 0,
  112. bmdReferenceLocked = 1 << 1
  113. } BMDReferenceStatus;
  114. /* Enum BMDAudioSampleRate - Audio sample rates supported for output/input */
  115. typedef [v1_enum] enum _BMDAudioSampleRate {
  116. bmdAudioSampleRate48kHz = 48000
  117. } BMDAudioSampleRate;
  118. /* Enum BMDAudioSampleType - Audio sample sizes supported for output/input */
  119. typedef [v1_enum] enum _BMDAudioSampleType {
  120. bmdAudioSampleType16bitInteger = 16,
  121. bmdAudioSampleType32bitInteger = 32
  122. } BMDAudioSampleType;
  123. /* Enum BMDAudioOutputStreamType - Audio output stream type */
  124. typedef [v1_enum] enum _BMDAudioOutputStreamType {
  125. bmdAudioOutputStreamContinuous,
  126. bmdAudioOutputStreamContinuousDontResample,
  127. bmdAudioOutputStreamTimestamped
  128. } BMDAudioOutputStreamType;
  129. /* Enum BMDDisplayModeSupport - Output mode supported flags */
  130. typedef [v1_enum] enum _BMDDisplayModeSupport {
  131. bmdDisplayModeNotSupported = 0,
  132. bmdDisplayModeSupported,
  133. bmdDisplayModeSupportedWithConversion
  134. } BMDDisplayModeSupport;
  135. /* Enum BMDTimecodeFormat - Timecode formats for frame metadata */
  136. typedef [v1_enum] enum _BMDTimecodeFormat {
  137. bmdTimecodeRP188VITC1 = /* 'rpv1' */ 0x72707631, // RP188 timecode where DBB1 equals VITC1 (line 9)
  138. bmdTimecodeRP188VITC2 = /* 'rp12' */ 0x72703132, // RP188 timecode where DBB1 equals VITC2 (line 9 for progressive or line 571 for interlaced/PsF)
  139. bmdTimecodeRP188LTC = /* 'rplt' */ 0x72706C74, // RP188 timecode where DBB1 equals LTC (line 10)
  140. bmdTimecodeRP188Any = /* 'rp18' */ 0x72703138, // For capture: return the first valid timecode in {VITC1, LTC ,VITC2} - For playback: set the timecode as VITC1
  141. bmdTimecodeVITC = /* 'vitc' */ 0x76697463,
  142. bmdTimecodeVITCField2 = /* 'vit2' */ 0x76697432,
  143. bmdTimecodeSerial = /* 'seri' */ 0x73657269
  144. } BMDTimecodeFormat;
  145. /* Enum BMDAnalogVideoFlags - Analog video display flags */
  146. [v1_enum] enum _BMDAnalogVideoFlags {
  147. bmdAnalogVideoFlagCompositeSetup75 = 1 << 0,
  148. bmdAnalogVideoFlagComponentBetacamLevels = 1 << 1
  149. };
  150. /* Enum BMDAudioOutputAnalogAESSwitch - Audio output Analog/AESEBU switch */
  151. typedef [v1_enum] enum _BMDAudioOutputAnalogAESSwitch {
  152. bmdAudioOutputSwitchAESEBU = /* 'aes ' */ 0x61657320,
  153. bmdAudioOutputSwitchAnalog = /* 'anlg' */ 0x616E6C67
  154. } BMDAudioOutputAnalogAESSwitch;
  155. /* Enum BMDVideoOutputConversionMode - Video/audio conversion mode */
  156. typedef [v1_enum] enum _BMDVideoOutputConversionMode {
  157. bmdNoVideoOutputConversion = /* 'none' */ 0x6E6F6E65,
  158. bmdVideoOutputLetterboxDownconversion = /* 'ltbx' */ 0x6C746278,
  159. bmdVideoOutputAnamorphicDownconversion = /* 'amph' */ 0x616D7068,
  160. bmdVideoOutputHD720toHD1080Conversion = /* '720c' */ 0x37323063,
  161. bmdVideoOutputHardwareLetterboxDownconversion = /* 'HWlb' */ 0x48576C62,
  162. bmdVideoOutputHardwareAnamorphicDownconversion = /* 'HWam' */ 0x4857616D,
  163. bmdVideoOutputHardwareCenterCutDownconversion = /* 'HWcc' */ 0x48576363,
  164. bmdVideoOutputHardware720p1080pCrossconversion = /* 'xcap' */ 0x78636170,
  165. bmdVideoOutputHardwareAnamorphic720pUpconversion = /* 'ua7p' */ 0x75613770,
  166. bmdVideoOutputHardwareAnamorphic1080iUpconversion = /* 'ua1i' */ 0x75613169,
  167. bmdVideoOutputHardwareAnamorphic149To720pUpconversion = /* 'u47p' */ 0x75343770,
  168. bmdVideoOutputHardwareAnamorphic149To1080iUpconversion = /* 'u41i' */ 0x75343169,
  169. bmdVideoOutputHardwarePillarbox720pUpconversion = /* 'up7p' */ 0x75703770,
  170. bmdVideoOutputHardwarePillarbox1080iUpconversion = /* 'up1i' */ 0x75703169
  171. } BMDVideoOutputConversionMode;
  172. /* Enum BMDVideoInputConversionMode - Video input conversion mode */
  173. typedef [v1_enum] enum _BMDVideoInputConversionMode {
  174. bmdNoVideoInputConversion = /* 'none' */ 0x6E6F6E65,
  175. bmdVideoInputLetterboxDownconversionFromHD1080 = /* '10lb' */ 0x31306C62,
  176. bmdVideoInputAnamorphicDownconversionFromHD1080 = /* '10am' */ 0x3130616D,
  177. bmdVideoInputLetterboxDownconversionFromHD720 = /* '72lb' */ 0x37326C62,
  178. bmdVideoInputAnamorphicDownconversionFromHD720 = /* '72am' */ 0x3732616D,
  179. bmdVideoInputLetterboxUpconversion = /* 'lbup' */ 0x6C627570,
  180. bmdVideoInputAnamorphicUpconversion = /* 'amup' */ 0x616D7570
  181. } BMDVideoInputConversionMode;
  182. /* Enum BMDVideo3DPackingFormat - Video 3D packing format */
  183. typedef [v1_enum] enum _BMDVideo3DPackingFormat {
  184. bmdVideo3DPackingSidebySideHalf = /* 'sbsh' */ 0x73627368,
  185. bmdVideo3DPackingLinebyLine = /* 'lbyl' */ 0x6C62796C,
  186. bmdVideo3DPackingTopAndBottom = /* 'tabo' */ 0x7461626F,
  187. bmdVideo3DPackingFramePacking = /* 'frpk' */ 0x6672706B,
  188. bmdVideo3DPackingLeftOnly = /* 'left' */ 0x6C656674,
  189. bmdVideo3DPackingRightOnly = /* 'righ' */ 0x72696768
  190. } BMDVideo3DPackingFormat;
  191. /* Enum BMDIdleVideoOutputOperation - Video output operation when not playing video */
  192. typedef [v1_enum] enum _BMDIdleVideoOutputOperation {
  193. bmdIdleVideoOutputBlack = /* 'blac' */ 0x626C6163,
  194. bmdIdleVideoOutputLastFrame = /* 'lafa' */ 0x6C616661,
  195. bmdIdleVideoOutputDesktop = /* 'desk' */ 0x6465736B
  196. } BMDIdleVideoOutputOperation;
  197. /* Enum BMDDeckLinkAttributeID - DeckLink Attribute ID */
  198. typedef [v1_enum] enum _BMDDeckLinkAttributeID {
  199. /* Flags */
  200. BMDDeckLinkSupportsInternalKeying = /* 'keyi' */ 0x6B657969,
  201. BMDDeckLinkSupportsExternalKeying = /* 'keye' */ 0x6B657965,
  202. BMDDeckLinkSupportsHDKeying = /* 'keyh' */ 0x6B657968,
  203. BMDDeckLinkSupportsInputFormatDetection = /* 'infd' */ 0x696E6664,
  204. BMDDeckLinkHasReferenceInput = /* 'hrin' */ 0x6872696E,
  205. BMDDeckLinkHasSerialPort = /* 'hspt' */ 0x68737074,
  206. BMDDeckLinkHasAnalogVideoOutputGain = /* 'avog' */ 0x61766F67,
  207. BMDDeckLinkCanOnlyAdjustOverallVideoOutputGain = /* 'ovog' */ 0x6F766F67,
  208. BMDDeckLinkHasVideoInputAntiAliasingFilter = /* 'aafl' */ 0x6161666C,
  209. BMDDeckLinkHasBypass = /* 'byps' */ 0x62797073,
  210. BMDDeckLinkSupportsDesktopDisplay = /* 'extd' */ 0x65787464,
  211. BMDDeckLinkSupportsClockTimingAdjustment = /* 'ctad' */ 0x63746164,
  212. BMDDeckLinkSupportsFullDuplex = /* 'fdup' */ 0x66647570,
  213. BMDDeckLinkSupportsFullFrameReferenceInputTimingOffset = /* 'frin' */ 0x6672696E,
  214. /* Integers */
  215. BMDDeckLinkMaximumAudioChannels = /* 'mach' */ 0x6D616368,
  216. BMDDeckLinkMaximumAnalogAudioChannels = /* 'aach' */ 0x61616368,
  217. BMDDeckLinkNumberOfSubDevices = /* 'nsbd' */ 0x6E736264,
  218. BMDDeckLinkSubDeviceIndex = /* 'subi' */ 0x73756269,
  219. BMDDeckLinkPersistentID = /* 'peid' */ 0x70656964,
  220. BMDDeckLinkTopologicalID = /* 'toid' */ 0x746F6964,
  221. BMDDeckLinkVideoOutputConnections = /* 'vocn' */ 0x766F636E,
  222. BMDDeckLinkVideoInputConnections = /* 'vicn' */ 0x7669636E,
  223. BMDDeckLinkAudioOutputConnections = /* 'aocn' */ 0x616F636E,
  224. BMDDeckLinkAudioInputConnections = /* 'aicn' */ 0x6169636E,
  225. BMDDeckLinkDeviceBusyState = /* 'dbst' */ 0x64627374,
  226. BMDDeckLinkVideoIOSupport = /* 'vios' */ 0x76696F73, // Returns a BMDVideoIOSupport bit field
  227. /* Floats */
  228. BMDDeckLinkVideoInputGainMinimum = /* 'vigm' */ 0x7669676D,
  229. BMDDeckLinkVideoInputGainMaximum = /* 'vigx' */ 0x76696778,
  230. BMDDeckLinkVideoOutputGainMinimum = /* 'vogm' */ 0x766F676D,
  231. BMDDeckLinkVideoOutputGainMaximum = /* 'vogx' */ 0x766F6778,
  232. /* Strings */
  233. BMDDeckLinkSerialPortDeviceName = /* 'slpn' */ 0x736C706E
  234. } BMDDeckLinkAttributeID;
  235. /* Enum BMDDeckLinkAPIInformationID - DeckLinkAPI information ID */
  236. typedef [v1_enum] enum _BMDDeckLinkAPIInformationID {
  237. BMDDeckLinkAPIVersion = /* 'vers' */ 0x76657273
  238. } BMDDeckLinkAPIInformationID;
  239. /* Enum BMDDeviceBusyState - Current device busy state */
  240. [v1_enum] enum _BMDDeviceBusyState {
  241. bmdDeviceCaptureBusy = 1 << 0,
  242. bmdDevicePlaybackBusy = 1 << 1,
  243. bmdDeviceSerialPortBusy = 1 << 2
  244. };
  245. /* Enum BMDVideoIOSupport - Device video input/output support */
  246. typedef [v1_enum] enum _BMDVideoIOSupport {
  247. bmdDeviceSupportsCapture = 1 << 0,
  248. bmdDeviceSupportsPlayback = 1 << 1
  249. } BMDVideoIOSupport;
  250. /* Enum BMD3DPreviewFormat - Linked Frame preview format */
  251. typedef [v1_enum] enum _BMD3DPreviewFormat {
  252. bmd3DPreviewFormatDefault = /* 'defa' */ 0x64656661,
  253. bmd3DPreviewFormatLeftOnly = /* 'left' */ 0x6C656674,
  254. bmd3DPreviewFormatRightOnly = /* 'righ' */ 0x72696768,
  255. bmd3DPreviewFormatSideBySide = /* 'side' */ 0x73696465,
  256. bmd3DPreviewFormatTopBottom = /* 'topb' */ 0x746F7062
  257. } BMD3DPreviewFormat;
  258. /* Enum BMDNotifications - Events that can be subscribed through IDeckLinkNotification */
  259. typedef [v1_enum] enum _BMDNotifications {
  260. bmdPreferencesChanged = /* 'pref' */ 0x70726566
  261. } BMDNotifications;
  262. // Forward Declarations
  263. interface IDeckLinkVideoOutputCallback;
  264. interface IDeckLinkInputCallback;
  265. interface IDeckLinkMemoryAllocator;
  266. interface IDeckLinkAudioOutputCallback;
  267. interface IDeckLinkIterator;
  268. interface IDeckLinkAPIInformation;
  269. interface IDeckLinkOutput;
  270. interface IDeckLinkInput;
  271. interface IDeckLinkVideoFrame;
  272. interface IDeckLinkMutableVideoFrame;
  273. interface IDeckLinkVideoFrame3DExtensions;
  274. interface IDeckLinkVideoInputFrame;
  275. interface IDeckLinkVideoFrameAncillary;
  276. interface IDeckLinkAudioInputPacket;
  277. interface IDeckLinkScreenPreviewCallback;
  278. interface IDeckLinkGLScreenPreviewHelper;
  279. interface IDeckLinkDX9ScreenPreviewHelper;
  280. interface IDeckLinkNotificationCallback;
  281. interface IDeckLinkNotification;
  282. interface IDeckLinkAttributes;
  283. interface IDeckLinkKeyer;
  284. interface IDeckLinkVideoConversion;
  285. interface IDeckLinkDeviceNotificationCallback;
  286. interface IDeckLinkDiscovery;
  287. /* Interface IDeckLinkVideoOutputCallback - Frame completion callback. */
  288. [
  289. object,
  290. uuid(20AA5225-1958-47CB-820B-80A8D521A6EE),
  291. helpstring("Frame completion callback.")
  292. ] interface IDeckLinkVideoOutputCallback : IUnknown
  293. {
  294. HRESULT ScheduledFrameCompleted([in] IDeckLinkVideoFrame *completedFrame, [in] BMDOutputFrameCompletionResult result);
  295. HRESULT ScheduledPlaybackHasStopped(void);
  296. };
  297. /* Interface IDeckLinkInputCallback - Frame arrival callback. */
  298. [
  299. object,
  300. uuid(DD04E5EC-7415-42AB-AE4A-E80C4DFC044A),
  301. helpstring("Frame arrival callback.")
  302. ] interface IDeckLinkInputCallback : IUnknown
  303. {
  304. HRESULT VideoInputFormatChanged([in] BMDVideoInputFormatChangedEvents notificationEvents, [in] IDeckLinkDisplayMode *newDisplayMode, [in] BMDDetectedVideoInputFormatFlags detectedSignalFlags);
  305. HRESULT VideoInputFrameArrived([in] IDeckLinkVideoInputFrame* videoFrame, [in] IDeckLinkAudioInputPacket* audioPacket);
  306. };
  307. /* Interface IDeckLinkMemoryAllocator - Memory allocator for video frames. */
  308. [
  309. object,
  310. uuid(B36EB6E7-9D29-4AA8-92EF-843B87A289E8),
  311. local,
  312. helpstring("Memory allocator for video frames.")
  313. ] interface IDeckLinkMemoryAllocator : IUnknown
  314. {
  315. HRESULT AllocateBuffer([in] unsigned long bufferSize, [out] void **allocatedBuffer);
  316. HRESULT ReleaseBuffer([in] void *buffer);
  317. HRESULT Commit(void);
  318. HRESULT Decommit(void);
  319. };
  320. /* Interface IDeckLinkAudioOutputCallback - Optional callback to allow audio samples to be pulled as required. */
  321. [
  322. object,
  323. uuid(403C681B-7F46-4A12-B993-2BB127084EE6),
  324. local,
  325. helpstring("Optional callback to allow audio samples to be pulled as required.")
  326. ] interface IDeckLinkAudioOutputCallback : IUnknown
  327. {
  328. HRESULT RenderAudioSamples([in] BOOL preroll);
  329. };
  330. /* Interface IDeckLinkIterator - enumerates installed DeckLink hardware */
  331. [
  332. object,
  333. uuid(50FB36CD-3063-4B73-BDBB-958087F2D8BA),
  334. helpstring("enumerates installed DeckLink hardware")
  335. ] interface IDeckLinkIterator : IUnknown
  336. {
  337. HRESULT Next([out] IDeckLink **deckLinkInstance);
  338. };
  339. /* Interface IDeckLinkAPIInformation - DeckLinkAPI attribute interface */
  340. [
  341. object,
  342. uuid(7BEA3C68-730D-4322-AF34-8A7152B532A4),
  343. helpstring("DeckLinkAPI attribute interface")
  344. ] interface IDeckLinkAPIInformation : IUnknown
  345. {
  346. HRESULT GetFlag([in] BMDDeckLinkAPIInformationID cfgID, [out] BOOL *value);
  347. HRESULT GetInt([in] BMDDeckLinkAPIInformationID cfgID, [out] LONGLONG *value);
  348. HRESULT GetFloat([in] BMDDeckLinkAPIInformationID cfgID, [out] double *value);
  349. HRESULT GetString([in] BMDDeckLinkAPIInformationID cfgID, [out] BSTR *value);
  350. };
  351. /* Interface IDeckLinkOutput - Created by QueryInterface from IDeckLink. */
  352. [
  353. object,
  354. uuid(CC5C8A6E-3F2F-4B3A-87EA-FD78AF300564),
  355. local,
  356. helpstring("Created by QueryInterface from IDeckLink.")
  357. ] interface IDeckLinkOutput : IUnknown
  358. {
  359. HRESULT DoesSupportVideoMode([in] BMDDisplayMode displayMode, [in] BMDPixelFormat pixelFormat, [in] BMDVideoOutputFlags flags, [out] BMDDisplayModeSupport *result, [out] IDeckLinkDisplayMode **resultDisplayMode);
  360. HRESULT GetDisplayModeIterator([out] IDeckLinkDisplayModeIterator **iterator);
  361. HRESULT SetScreenPreviewCallback([in] IDeckLinkScreenPreviewCallback *previewCallback);
  362. /* Video Output */
  363. HRESULT EnableVideoOutput([in] BMDDisplayMode displayMode, [in] BMDVideoOutputFlags flags);
  364. HRESULT DisableVideoOutput(void);
  365. HRESULT SetVideoOutputFrameMemoryAllocator([in] IDeckLinkMemoryAllocator *theAllocator);
  366. HRESULT CreateVideoFrame([in] long width, [in] long height, [in] long rowBytes, [in] BMDPixelFormat pixelFormat, [in] BMDFrameFlags flags, [out] IDeckLinkMutableVideoFrame **outFrame);
  367. HRESULT CreateAncillaryData([in] BMDPixelFormat pixelFormat, [out] IDeckLinkVideoFrameAncillary **outBuffer);
  368. HRESULT DisplayVideoFrameSync([in] IDeckLinkVideoFrame *theFrame);
  369. HRESULT ScheduleVideoFrame([in] IDeckLinkVideoFrame *theFrame, [in] BMDTimeValue displayTime, [in] BMDTimeValue displayDuration, [in] BMDTimeScale timeScale);
  370. HRESULT SetScheduledFrameCompletionCallback([in] IDeckLinkVideoOutputCallback *theCallback);
  371. HRESULT GetBufferedVideoFrameCount([out] unsigned long *bufferedFrameCount);
  372. /* Audio Output */
  373. HRESULT EnableAudioOutput([in] BMDAudioSampleRate sampleRate, [in] BMDAudioSampleType sampleType, [in] unsigned long channelCount, [in] BMDAudioOutputStreamType streamType);
  374. HRESULT DisableAudioOutput(void);
  375. HRESULT WriteAudioSamplesSync([in] void *buffer, [in] unsigned long sampleFrameCount, [out] unsigned long *sampleFramesWritten);
  376. HRESULT BeginAudioPreroll(void);
  377. HRESULT EndAudioPreroll(void);
  378. HRESULT ScheduleAudioSamples([in] void *buffer, [in] unsigned long sampleFrameCount, [in] BMDTimeValue streamTime, [in] BMDTimeScale timeScale, [out] unsigned long *sampleFramesWritten);
  379. HRESULT GetBufferedAudioSampleFrameCount([out] unsigned long *bufferedSampleFrameCount);
  380. HRESULT FlushBufferedAudioSamples(void);
  381. HRESULT SetAudioCallback([in] IDeckLinkAudioOutputCallback *theCallback);
  382. /* Output Control */
  383. HRESULT StartScheduledPlayback([in] BMDTimeValue playbackStartTime, [in] BMDTimeScale timeScale, [in] double playbackSpeed);
  384. HRESULT StopScheduledPlayback([in] BMDTimeValue stopPlaybackAtTime, [out] BMDTimeValue *actualStopTime, [in] BMDTimeScale timeScale);
  385. HRESULT IsScheduledPlaybackRunning([out] BOOL *active);
  386. HRESULT GetScheduledStreamTime([in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue *streamTime, [out] double *playbackSpeed);
  387. HRESULT GetReferenceStatus([out] BMDReferenceStatus *referenceStatus);
  388. /* Hardware Timing */
  389. HRESULT GetHardwareReferenceClock([in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue *hardwareTime, [out] BMDTimeValue *timeInFrame, [out] BMDTimeValue *ticksPerFrame);
  390. HRESULT GetFrameCompletionReferenceTimestamp([in] IDeckLinkVideoFrame *theFrame, [in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue *frameCompletionTimestamp);
  391. };
  392. /* Interface IDeckLinkInput - Created by QueryInterface from IDeckLink. */
  393. [
  394. object,
  395. uuid(AF22762B-DFAC-4846-AA79-FA8883560995),
  396. helpstring("Created by QueryInterface from IDeckLink.")
  397. ] interface IDeckLinkInput : IUnknown
  398. {
  399. HRESULT DoesSupportVideoMode([in] BMDDisplayMode displayMode, [in] BMDPixelFormat pixelFormat, [in] BMDVideoInputFlags flags, [out] BMDDisplayModeSupport *result, [out] IDeckLinkDisplayMode **resultDisplayMode);
  400. HRESULT GetDisplayModeIterator([out] IDeckLinkDisplayModeIterator **iterator);
  401. HRESULT SetScreenPreviewCallback([in] IDeckLinkScreenPreviewCallback *previewCallback);
  402. /* Video Input */
  403. HRESULT EnableVideoInput([in] BMDDisplayMode displayMode, [in] BMDPixelFormat pixelFormat, [in] BMDVideoInputFlags flags);
  404. HRESULT DisableVideoInput(void);
  405. HRESULT GetAvailableVideoFrameCount([out] unsigned long *availableFrameCount);
  406. HRESULT SetVideoInputFrameMemoryAllocator([in] IDeckLinkMemoryAllocator *theAllocator);
  407. /* Audio Input */
  408. HRESULT EnableAudioInput([in] BMDAudioSampleRate sampleRate, [in] BMDAudioSampleType sampleType, [in] unsigned long channelCount);
  409. HRESULT DisableAudioInput(void);
  410. HRESULT GetAvailableAudioSampleFrameCount([out] unsigned long *availableSampleFrameCount);
  411. /* Input Control */
  412. HRESULT StartStreams(void);
  413. HRESULT StopStreams(void);
  414. HRESULT PauseStreams(void);
  415. HRESULT FlushStreams(void);
  416. HRESULT SetCallback([in] IDeckLinkInputCallback *theCallback);
  417. /* Hardware Timing */
  418. HRESULT GetHardwareReferenceClock([in] BMDTimeScale desiredTimeScale, [out] BMDTimeValue *hardwareTime, [out] BMDTimeValue *timeInFrame, [out] BMDTimeValue *ticksPerFrame);
  419. };
  420. /* Interface IDeckLinkVideoFrame - Interface to encapsulate a video frame; can be caller-implemented. */
  421. [
  422. object,
  423. uuid(3F716FE0-F023-4111-BE5D-EF4414C05B17),
  424. local,
  425. helpstring("Interface to encapsulate a video frame; can be caller-implemented.")
  426. ] interface IDeckLinkVideoFrame : IUnknown
  427. {
  428. long GetWidth(void);
  429. long GetHeight(void);
  430. long GetRowBytes(void);
  431. BMDPixelFormat GetPixelFormat(void);
  432. BMDFrameFlags GetFlags(void);
  433. HRESULT GetBytes([out] void **buffer);
  434. HRESULT GetTimecode([in] BMDTimecodeFormat format, [out] IDeckLinkTimecode **timecode);
  435. HRESULT GetAncillaryData([out] IDeckLinkVideoFrameAncillary **ancillary);
  436. };
  437. /* Interface IDeckLinkMutableVideoFrame - Created by IDeckLinkOutput::CreateVideoFrame. */
  438. [
  439. object,
  440. uuid(69E2639F-40DA-4E19-B6F2-20ACE815C390),
  441. local,
  442. helpstring("Created by IDeckLinkOutput::CreateVideoFrame.")
  443. ] interface IDeckLinkMutableVideoFrame : IDeckLinkVideoFrame
  444. {
  445. HRESULT SetFlags([in] BMDFrameFlags newFlags);
  446. HRESULT SetTimecode([in] BMDTimecodeFormat format, [in] IDeckLinkTimecode *timecode);
  447. HRESULT SetTimecodeFromComponents([in] BMDTimecodeFormat format, [in] unsigned char hours, [in] unsigned char minutes, [in] unsigned char seconds, [in] unsigned char frames, [in] BMDTimecodeFlags flags);
  448. HRESULT SetAncillaryData([in] IDeckLinkVideoFrameAncillary *ancillary);
  449. HRESULT SetTimecodeUserBits([in] BMDTimecodeFormat format, [in] BMDTimecodeUserBits userBits);
  450. };
  451. /* Interface IDeckLinkVideoFrame3DExtensions - Optional interface implemented on IDeckLinkVideoFrame to support 3D frames */
  452. [
  453. object,
  454. uuid(DA0F7E4A-EDC7-48A8-9CDD-2DB51C729CD7),
  455. local,
  456. helpstring("Optional interface implemented on IDeckLinkVideoFrame to support 3D frames")
  457. ] interface IDeckLinkVideoFrame3DExtensions : IUnknown
  458. {
  459. BMDVideo3DPackingFormat Get3DPackingFormat(void);
  460. HRESULT GetFrameForRightEye([out] IDeckLinkVideoFrame* *rightEyeFrame);
  461. };
  462. /* Interface IDeckLinkVideoInputFrame - Provided by the IDeckLinkVideoInput frame arrival callback. */
  463. [
  464. object,
  465. uuid(05CFE374-537C-4094-9A57-680525118F44),
  466. local,
  467. helpstring("Provided by the IDeckLinkVideoInput frame arrival callback.")
  468. ] interface IDeckLinkVideoInputFrame : IDeckLinkVideoFrame
  469. {
  470. HRESULT GetStreamTime([out] BMDTimeValue *frameTime, [out] BMDTimeValue *frameDuration, [in] BMDTimeScale timeScale);
  471. HRESULT GetHardwareReferenceTimestamp([in] BMDTimeScale timeScale, [out] BMDTimeValue *frameTime, [out] BMDTimeValue *frameDuration);
  472. };
  473. /* Interface IDeckLinkVideoFrameAncillary - Obtained through QueryInterface() on an IDeckLinkVideoFrame object. */
  474. [
  475. object,
  476. uuid(732E723C-D1A4-4E29-9E8E-4A88797A0004),
  477. local,
  478. helpstring("Obtained through QueryInterface() on an IDeckLinkVideoFrame object.")
  479. ] interface IDeckLinkVideoFrameAncillary : IUnknown
  480. {
  481. HRESULT GetBufferForVerticalBlankingLine([in] unsigned long lineNumber, [out] void **buffer);
  482. BMDPixelFormat GetPixelFormat(void);
  483. BMDDisplayMode GetDisplayMode(void);
  484. };
  485. /* Interface IDeckLinkAudioInputPacket - Provided by the IDeckLinkInput callback. */
  486. [
  487. object,
  488. uuid(E43D5870-2894-11DE-8C30-0800200C9A66),
  489. local,
  490. helpstring("Provided by the IDeckLinkInput callback.")
  491. ] interface IDeckLinkAudioInputPacket : IUnknown
  492. {
  493. long GetSampleFrameCount(void);
  494. HRESULT GetBytes([out] void **buffer);
  495. HRESULT GetPacketTime([out] BMDTimeValue *packetTime, [in] BMDTimeScale timeScale);
  496. };
  497. /* Interface IDeckLinkScreenPreviewCallback - Screen preview callback */
  498. [
  499. object,
  500. uuid(B1D3F49A-85FE-4C5D-95C8-0B5D5DCCD438),
  501. local,
  502. helpstring("Screen preview callback")
  503. ] interface IDeckLinkScreenPreviewCallback : IUnknown
  504. {
  505. HRESULT DrawFrame([in] IDeckLinkVideoFrame *theFrame);
  506. };
  507. /* Interface IDeckLinkGLScreenPreviewHelper - Created with CoCreateInstance(). */
  508. [
  509. object,
  510. uuid(504E2209-CAC7-4C1A-9FB4-C5BB6274D22F),
  511. local,
  512. helpstring("Created with CoCreateInstance().")
  513. ] interface IDeckLinkGLScreenPreviewHelper : IUnknown
  514. {
  515. /* Methods must be called with OpenGL context set */
  516. HRESULT InitializeGL(void);
  517. HRESULT PaintGL(void);
  518. HRESULT SetFrame([in] IDeckLinkVideoFrame *theFrame);
  519. HRESULT Set3DPreviewFormat([in] BMD3DPreviewFormat previewFormat);
  520. };
  521. /* Interface IDeckLinkDX9ScreenPreviewHelper - Created with CoCreateInstance(). */
  522. [
  523. object,
  524. uuid(2094B522-D1A1-40C0-9AC7-1C012218EF02),
  525. local,
  526. helpstring("Created with CoCreateInstance().")
  527. ] interface IDeckLinkDX9ScreenPreviewHelper : IUnknown
  528. {
  529. HRESULT Initialize([in] void *device);
  530. HRESULT Render([in] RECT *rc);
  531. HRESULT SetFrame([in] IDeckLinkVideoFrame *theFrame);
  532. HRESULT Set3DPreviewFormat([in] BMD3DPreviewFormat previewFormat);
  533. };
  534. /* Interface IDeckLinkNotificationCallback - DeckLink Notification Callback Interface */
  535. [
  536. object,
  537. uuid(b002a1ec-070d-4288-8289-bd5d36e5ff0d),
  538. local,
  539. helpstring("DeckLink Notification Callback Interface")
  540. ] interface IDeckLinkNotificationCallback : IUnknown
  541. {
  542. HRESULT Notify([in] BMDNotifications topic, [in] ULONGLONG param1, [in] ULONGLONG param2);
  543. };
  544. /* Interface IDeckLinkNotification - DeckLink Notification interface */
  545. [
  546. object,
  547. uuid(0a1fb207-e215-441b-9b19-6fa1575946c5),
  548. local,
  549. helpstring("DeckLink Notification interface")
  550. ] interface IDeckLinkNotification : IUnknown
  551. {
  552. HRESULT Subscribe([in] BMDNotifications topic, [in] IDeckLinkNotificationCallback *theCallback);
  553. HRESULT Unsubscribe([in] BMDNotifications topic, [in] IDeckLinkNotificationCallback *theCallback);
  554. };
  555. /* Interface IDeckLinkAttributes - DeckLink Attribute interface */
  556. [
  557. object,
  558. uuid(ABC11843-D966-44CB-96E2-A1CB5D3135C4),
  559. local,
  560. helpstring("DeckLink Attribute interface")
  561. ] interface IDeckLinkAttributes : IUnknown
  562. {
  563. HRESULT GetFlag([in] BMDDeckLinkAttributeID cfgID, [out] BOOL *value);
  564. HRESULT GetInt([in] BMDDeckLinkAttributeID cfgID, [out] LONGLONG *value);
  565. HRESULT GetFloat([in] BMDDeckLinkAttributeID cfgID, [out] double *value);
  566. HRESULT GetString([in] BMDDeckLinkAttributeID cfgID, [out] BSTR *value);
  567. };
  568. /* Interface IDeckLinkKeyer - DeckLink Keyer interface */
  569. [
  570. object,
  571. uuid(89AFCAF5-65F8-421E-98F7-96FE5F5BFBA3),
  572. local,
  573. helpstring("DeckLink Keyer interface")
  574. ] interface IDeckLinkKeyer : IUnknown
  575. {
  576. HRESULT Enable([in] BOOL isExternal);
  577. HRESULT SetLevel([in] unsigned char level);
  578. HRESULT RampUp([in] unsigned long numberOfFrames);
  579. HRESULT RampDown([in] unsigned long numberOfFrames);
  580. HRESULT Disable(void);
  581. };
  582. /* Interface IDeckLinkVideoConversion - Created with CoCreateInstance(). */
  583. [
  584. object,
  585. uuid(3BBCB8A2-DA2C-42D9-B5D8-88083644E99A),
  586. local,
  587. helpstring("Created with CoCreateInstance().")
  588. ] interface IDeckLinkVideoConversion : IUnknown
  589. {
  590. HRESULT ConvertFrame([in] IDeckLinkVideoFrame* srcFrame, [in] IDeckLinkVideoFrame* dstFrame);
  591. };
  592. /* Interface IDeckLinkDeviceNotificationCallback - DeckLink device arrival/removal notification callbacks */
  593. [
  594. object,
  595. uuid(4997053B-0ADF-4CC8-AC70-7A50C4BE728F),
  596. helpstring("DeckLink device arrival/removal notification callbacks")
  597. ] interface IDeckLinkDeviceNotificationCallback : IUnknown
  598. {
  599. HRESULT DeckLinkDeviceArrived([in] IDeckLink* deckLinkDevice);
  600. HRESULT DeckLinkDeviceRemoved([in] IDeckLink* deckLinkDevice);
  601. };
  602. /* Interface IDeckLinkDiscovery - DeckLink device discovery */
  603. [
  604. object,
  605. uuid(CDBF631C-BC76-45FA-B44D-C55059BC6101),
  606. helpstring("DeckLink device discovery")
  607. ] interface IDeckLinkDiscovery : IUnknown
  608. {
  609. HRESULT InstallDeviceNotifications([in] IDeckLinkDeviceNotificationCallback* deviceNotificationCallback);
  610. HRESULT UninstallDeviceNotifications(void);
  611. };
  612. /* Coclasses */
  613. [
  614. uuid(1F2E109A-8F4F-49E4-9203-135595CB6FA5),
  615. helpstring("CDeckLinkIterator Class")
  616. ] coclass CDeckLinkIterator
  617. {
  618. [default] interface IDeckLinkIterator;
  619. };
  620. [
  621. uuid(263CA19F-ED09-482E-9F9D-84005783A237),
  622. helpstring("CDeckLinkAPIInformation Class")
  623. ] coclass CDeckLinkAPIInformation
  624. {
  625. [default] interface IDeckLinkAPIInformation;
  626. };
  627. [
  628. uuid(F63E77C7-B655-4A4A-9AD0-3CA85D394343),
  629. helpstring("CDeckLinkGLScreenPreviewHelper Class")
  630. ] coclass CDeckLinkGLScreenPreviewHelper
  631. {
  632. [default] interface IDeckLinkGLScreenPreviewHelper;
  633. };
  634. [
  635. uuid(CC010023-E01D-4525-9D59-80C8AB3DC7A0),
  636. helpstring("CDeckLinkDX9ScreenPreviewHelper Class")
  637. ] coclass CDeckLinkDX9ScreenPreviewHelper
  638. {
  639. [default] interface IDeckLinkDX9ScreenPreviewHelper;
  640. };
  641. [
  642. uuid(7DBBBB11-5B7B-467D-AEA4-CEA468FD368C),
  643. helpstring("CDeckLinkVideoConversion Class")
  644. ] coclass CDeckLinkVideoConversion
  645. {
  646. [default] interface IDeckLinkVideoConversion;
  647. };
  648. [
  649. uuid(1073A05C-D885-47E9-B3C6-129B3F9F648B),
  650. helpstring("CDeckLinkDiscovery Class")
  651. ] coclass CDeckLinkDiscovery
  652. {
  653. [default] interface IDeckLinkDiscovery;
  654. };
  655. };