1 /* -LICENSE-START-
2 ** Copyright (c) 2016 Blackmagic Design
3 **
4 ** Permission is hereby granted, free of charge, to any person or organization
5 ** obtaining a copy of the software and accompanying documentation covered by
6 ** this license (the "Software") to use, reproduce, display, distribute,
7 ** execute, and transmit the Software, and to prepare derivative works of the
8 ** Software, and to permit third-parties to whom the Software is furnished to
9 ** do so, all subject to the following:
10 **
11 ** The copyright notices in the Software and this entire statement, including
12 ** the above license grant, this restriction and the following disclaimer,
13 ** must be included in all copies of the Software, in whole or in part, and
14 ** all derivative works of the Software, unless such copies or derivative
15 ** works are solely in the form of machine-executable object code generated by
16 ** a source language processor.
17 **
18 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 ** FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
21 ** SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
22 ** FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
23 ** ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
24 ** DEALINGS IN THE SOFTWARE.
25 ** -LICENSE-END-
26 */
27 
28 #ifndef BMD_DECKLINKAPICONFIGURATION_H
29 #define BMD_DECKLINKAPICONFIGURATION_H
30 
31 
32 #ifndef BMD_CONST
33     #if defined(_MSC_VER)
34         #define BMD_CONST __declspec(selectany) static const
35     #else
36         #define BMD_CONST static const
37     #endif
38 #endif
39 
40 // Type Declarations
41 
42 
43 // Interface ID Declarations
44 
45 BMD_CONST REFIID IID_IDeckLinkConfiguration                       = /* CB71734A-FE37-4E8D-8E13-802133A1C3F2 */ {0xCB,0x71,0x73,0x4A,0xFE,0x37,0x4E,0x8D,0x8E,0x13,0x80,0x21,0x33,0xA1,0xC3,0xF2};
46 BMD_CONST REFIID IID_IDeckLinkEncoderConfiguration                = /* 138050E5-C60A-4552-BF3F-0F358049327E */ {0x13,0x80,0x50,0xE5,0xC6,0x0A,0x45,0x52,0xBF,0x3F,0x0F,0x35,0x80,0x49,0x32,0x7E};
47 
48 /* Enum BMDDeckLinkConfigurationID - DeckLink Configuration ID */
49 
50 typedef uint32_t BMDDeckLinkConfigurationID;
51 enum _BMDDeckLinkConfigurationID {
52 
53     /* Serial port Flags */
54 
55     bmdDeckLinkConfigSwapSerialRxTx                              = 'ssrt',
56 
57     /* Video Input/Output Flags */
58 
59     bmdDeckLinkConfigUse1080pNotPsF                              = 'fpro',
60 
61     /* Video Input/Output Integers */
62 
63     bmdDeckLinkConfigHDMI3DPackingFormat                         = '3dpf',
64     bmdDeckLinkConfigBypass                                      = 'byps',
65     bmdDeckLinkConfigClockTimingAdjustment                       = 'ctad',
66     bmdDeckLinkConfigDuplexMode                                  = 'dupx',
67 
68     /* Audio Input/Output Flags */
69 
70     bmdDeckLinkConfigAnalogAudioConsumerLevels                   = 'aacl',
71 
72     /* Video output flags */
73 
74     bmdDeckLinkConfigFieldFlickerRemoval                         = 'fdfr',
75     bmdDeckLinkConfigHD1080p24ToHD1080i5994Conversion            = 'to59',
76     bmdDeckLinkConfig444SDIVideoOutput                           = '444o',
77     bmdDeckLinkConfigBlackVideoOutputDuringCapture               = 'bvoc',
78     bmdDeckLinkConfigLowLatencyVideoOutput                       = 'llvo',
79     bmdDeckLinkConfigDownConversionOnAllAnalogOutput             = 'caao',
80     bmdDeckLinkConfigSMPTELevelAOutput                           = 'smta',
81 
82     /* Video Output Integers */
83 
84     bmdDeckLinkConfigVideoOutputConnection                       = 'vocn',
85     bmdDeckLinkConfigVideoOutputConversionMode                   = 'vocm',
86     bmdDeckLinkConfigAnalogVideoOutputFlags                      = 'avof',
87     bmdDeckLinkConfigReferenceInputTimingOffset                  = 'glot',
88     bmdDeckLinkConfigVideoOutputIdleOperation                    = 'voio',
89     bmdDeckLinkConfigDefaultVideoOutputMode                      = 'dvom',
90     bmdDeckLinkConfigDefaultVideoOutputModeFlags                 = 'dvof',
91     bmdDeckLinkConfigSDIOutputLinkConfiguration                  = 'solc',
92 
93     /* Video Output Floats */
94 
95     bmdDeckLinkConfigVideoOutputComponentLumaGain                = 'oclg',
96     bmdDeckLinkConfigVideoOutputComponentChromaBlueGain          = 'occb',
97     bmdDeckLinkConfigVideoOutputComponentChromaRedGain           = 'occr',
98     bmdDeckLinkConfigVideoOutputCompositeLumaGain                = 'oilg',
99     bmdDeckLinkConfigVideoOutputCompositeChromaGain              = 'oicg',
100     bmdDeckLinkConfigVideoOutputSVideoLumaGain                   = 'oslg',
101     bmdDeckLinkConfigVideoOutputSVideoChromaGain                 = 'oscg',
102 
103     /* Video Input Flags */
104 
105     bmdDeckLinkConfigVideoInputScanning                          = 'visc',	// Applicable to H264 Pro Recorder only
106     bmdDeckLinkConfigUseDedicatedLTCInput                        = 'dltc',	// Use timecode from LTC input instead of SDI stream
107     bmdDeckLinkConfigSDIInput3DPayloadOverride                   = '3dds',
108 
109     /* Video Input Integers */
110 
111     bmdDeckLinkConfigVideoInputConnection                        = 'vicn',
112     bmdDeckLinkConfigAnalogVideoInputFlags                       = 'avif',
113     bmdDeckLinkConfigVideoInputConversionMode                    = 'vicm',
114     bmdDeckLinkConfig32PulldownSequenceInitialTimecodeFrame      = 'pdif',
115     bmdDeckLinkConfigVANCSourceLine1Mapping                      = 'vsl1',
116     bmdDeckLinkConfigVANCSourceLine2Mapping                      = 'vsl2',
117     bmdDeckLinkConfigVANCSourceLine3Mapping                      = 'vsl3',
118     bmdDeckLinkConfigCapturePassThroughMode                      = 'cptm',
119 
120     /* Video Input Floats */
121 
122     bmdDeckLinkConfigVideoInputComponentLumaGain                 = 'iclg',
123     bmdDeckLinkConfigVideoInputComponentChromaBlueGain           = 'iccb',
124     bmdDeckLinkConfigVideoInputComponentChromaRedGain            = 'iccr',
125     bmdDeckLinkConfigVideoInputCompositeLumaGain                 = 'iilg',
126     bmdDeckLinkConfigVideoInputCompositeChromaGain               = 'iicg',
127     bmdDeckLinkConfigVideoInputSVideoLumaGain                    = 'islg',
128     bmdDeckLinkConfigVideoInputSVideoChromaGain                  = 'iscg',
129 
130     /* Audio Input Flags */
131 
132     bmdDeckLinkConfigMicrophonePhantomPower                      = 'mphp',
133 
134     /* Audio Input Integers */
135 
136     bmdDeckLinkConfigAudioInputConnection                        = 'aicn',
137 
138     /* Audio Input Floats */
139 
140     bmdDeckLinkConfigAnalogAudioInputScaleChannel1               = 'ais1',
141     bmdDeckLinkConfigAnalogAudioInputScaleChannel2               = 'ais2',
142     bmdDeckLinkConfigAnalogAudioInputScaleChannel3               = 'ais3',
143     bmdDeckLinkConfigAnalogAudioInputScaleChannel4               = 'ais4',
144     bmdDeckLinkConfigDigitalAudioInputScale                      = 'dais',
145     bmdDeckLinkConfigMicrophoneInputGain                         = 'micg',
146 
147     /* Audio Output Integers */
148 
149     bmdDeckLinkConfigAudioOutputAESAnalogSwitch                  = 'aoaa',
150 
151     /* Audio Output Floats */
152 
153     bmdDeckLinkConfigAnalogAudioOutputScaleChannel1              = 'aos1',
154     bmdDeckLinkConfigAnalogAudioOutputScaleChannel2              = 'aos2',
155     bmdDeckLinkConfigAnalogAudioOutputScaleChannel3              = 'aos3',
156     bmdDeckLinkConfigAnalogAudioOutputScaleChannel4              = 'aos4',
157     bmdDeckLinkConfigDigitalAudioOutputScale                     = 'daos',
158     bmdDeckLinkConfigHeadphoneVolume                             = 'hvol',
159 
160     /* Device Information Strings */
161 
162     bmdDeckLinkConfigDeviceInformationLabel                      = 'dila',
163     bmdDeckLinkConfigDeviceInformationSerialNumber               = 'disn',
164     bmdDeckLinkConfigDeviceInformationCompany                    = 'dico',
165     bmdDeckLinkConfigDeviceInformationPhone                      = 'diph',
166     bmdDeckLinkConfigDeviceInformationEmail                      = 'diem',
167     bmdDeckLinkConfigDeviceInformationDate                       = 'dida',
168 
169     /* Deck Control Integers */
170 
171     bmdDeckLinkConfigDeckControlConnection                       = 'dcco'
172 };
173 
174 /* Enum BMDDeckLinkEncoderConfigurationID - DeckLink Encoder Configuration ID */
175 
176 typedef uint32_t BMDDeckLinkEncoderConfigurationID;
177 enum _BMDDeckLinkEncoderConfigurationID {
178 
179     /* Video Encoder Integers */
180 
181     bmdDeckLinkEncoderConfigPreferredBitDepth                    = 'epbr',
182     bmdDeckLinkEncoderConfigFrameCodingMode                      = 'efcm',
183 
184     /* HEVC/H.265 Encoder Integers */
185 
186     bmdDeckLinkEncoderConfigH265TargetBitrate                    = 'htbr',
187 
188     /* DNxHR/DNxHD Compression ID */
189 
190     bmdDeckLinkEncoderConfigDNxHRCompressionID                   = 'dcid',
191 
192     /* DNxHR/DNxHD Level */
193 
194     bmdDeckLinkEncoderConfigDNxHRLevel                           = 'dlev',
195 
196     /* Encoded Sample Decriptions */
197 
198     bmdDeckLinkEncoderConfigMPEG4SampleDescription               = 'stsE',	// Full MPEG4 sample description (aka SampleEntry of an 'stsd' atom-box). Useful for MediaFoundation, QuickTime, MKV and more
199     bmdDeckLinkEncoderConfigMPEG4CodecSpecificDesc               = 'esds'	// Sample description extensions only (atom stream, each with size and fourCC header). Useful for AVFoundation, VideoToolbox, MKV and more
200 };
201 
202 // Forward Declarations
203 
204 class IDeckLinkConfiguration;
205 class IDeckLinkEncoderConfiguration;
206 
207 /* Interface IDeckLinkConfiguration - DeckLink Configuration interface */
208 
209 class IDeckLinkConfiguration : public IUnknown
210 {
211 public:
212     virtual HRESULT SetFlag (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ bool value) = 0;
213     virtual HRESULT GetFlag (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ bool *value) = 0;
214     virtual HRESULT SetInt (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ int64_t value) = 0;
215     virtual HRESULT GetInt (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ int64_t *value) = 0;
216     virtual HRESULT SetFloat (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ double value) = 0;
217     virtual HRESULT GetFloat (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ double *value) = 0;
218     virtual HRESULT SetString (/* in */ BMDDeckLinkConfigurationID cfgID, /* in */ CFStringRef value) = 0;
219     virtual HRESULT GetString (/* in */ BMDDeckLinkConfigurationID cfgID, /* out */ CFStringRef *value) = 0;
220     virtual HRESULT WriteConfigurationToPreferences (void) = 0;
221 
222 protected:
~IDeckLinkConfiguration()223     virtual ~IDeckLinkConfiguration () {} // call Release method to drop reference count
224 };
225 
226 /* Interface IDeckLinkEncoderConfiguration - DeckLink Encoder Configuration interface. Obtained from IDeckLinkEncoderInput */
227 
228 class IDeckLinkEncoderConfiguration : public IUnknown
229 {
230 public:
231     virtual HRESULT SetFlag (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* in */ bool value) = 0;
232     virtual HRESULT GetFlag (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* out */ bool *value) = 0;
233     virtual HRESULT SetInt (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* in */ int64_t value) = 0;
234     virtual HRESULT GetInt (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* out */ int64_t *value) = 0;
235     virtual HRESULT SetFloat (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* in */ double value) = 0;
236     virtual HRESULT GetFloat (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* out */ double *value) = 0;
237     virtual HRESULT SetString (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* in */ CFStringRef value) = 0;
238     virtual HRESULT GetString (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* out */ CFStringRef *value) = 0;
239     virtual HRESULT GetBytes (/* in */ BMDDeckLinkEncoderConfigurationID cfgID, /* out */ void *buffer /* optional */, /* in, out */ uint32_t *bufferSize) = 0;
240 
241 protected:
~IDeckLinkEncoderConfiguration()242     virtual ~IDeckLinkEncoderConfiguration () {} // call Release method to drop reference count
243 };
244 
245 /* Functions */
246 
247 extern "C" {
248 
249 
250 }
251 
252 
253 #endif /* defined(BMD_DECKLINKAPICONFIGURATION_H) */
254