DeckLinkAPI.h 54 KB

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