DeckLinkAPI.h 52 KB

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