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_DECKLINKAPITYPES_H
29 #define BMD_DECKLINKAPITYPES_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 typedef int64_t BMDTimeValue;
43 typedef int64_t BMDTimeScale;
44 typedef uint32_t BMDTimecodeBCD;
45 typedef uint32_t BMDTimecodeUserBits;
46 
47 // Interface ID Declarations
48 
49 BMD_CONST REFIID IID_IDeckLinkTimecode                            = /* BC6CFBD3-8317-4325-AC1C-1216391E9340 */ {0xBC,0x6C,0xFB,0xD3,0x83,0x17,0x43,0x25,0xAC,0x1C,0x12,0x16,0x39,0x1E,0x93,0x40};
50 
51 /* Enum BMDTimecodeFlags - Timecode flags */
52 
53 typedef uint32_t BMDTimecodeFlags;
54 enum _BMDTimecodeFlags {
55     bmdTimecodeFlagDefault                                       = 0,
56     bmdTimecodeIsDropFrame                                       = 1 << 0,
57     bmdTimecodeFieldMark                                         = 1 << 1
58 };
59 
60 /* Enum BMDVideoConnection - Video connection types */
61 
62 typedef uint32_t BMDVideoConnection;
63 enum _BMDVideoConnection {
64     bmdVideoConnectionSDI                                        = 1 << 0,
65     bmdVideoConnectionHDMI                                       = 1 << 1,
66     bmdVideoConnectionOpticalSDI                                 = 1 << 2,
67     bmdVideoConnectionComponent                                  = 1 << 3,
68     bmdVideoConnectionComposite                                  = 1 << 4,
69     bmdVideoConnectionSVideo                                     = 1 << 5
70 };
71 
72 /* Enum BMDAudioConnection - Audio connection types */
73 
74 typedef uint32_t BMDAudioConnection;
75 enum _BMDAudioConnection {
76     bmdAudioConnectionEmbedded                                   = 1 << 0,
77     bmdAudioConnectionAESEBU                                     = 1 << 1,
78     bmdAudioConnectionAnalog                                     = 1 << 2,
79     bmdAudioConnectionAnalogXLR                                  = 1 << 3,
80     bmdAudioConnectionAnalogRCA                                  = 1 << 4,
81     bmdAudioConnectionMicrophone                                 = 1 << 5,
82     bmdAudioConnectionHeadphones                                 = 1 << 6
83 };
84 
85 /* Enum BMDDeckControlConnection - Deck control connections */
86 
87 typedef uint32_t BMDDeckControlConnection;
88 enum _BMDDeckControlConnection {
89     bmdDeckControlConnectionRS422Remote1                         = 1 << 0,
90     bmdDeckControlConnectionRS422Remote2                         = 1 << 1
91 };
92 
93 // Forward Declarations
94 
95 class IDeckLinkTimecode;
96 
97 /* Interface IDeckLinkTimecode - Used for video frame timecode representation. */
98 
99 class IDeckLinkTimecode : public IUnknown
100 {
101 public:
102     virtual BMDTimecodeBCD GetBCD (void) = 0;
103     virtual HRESULT GetComponents (/* out */ uint8_t *hours, /* out */ uint8_t *minutes, /* out */ uint8_t *seconds, /* out */ uint8_t *frames) = 0;
104     virtual HRESULT GetString (/* out */ CFStringRef *timecode) = 0;
105     virtual BMDTimecodeFlags GetFlags (void) = 0;
106     virtual HRESULT GetTimecodeUserBits (/* out */ BMDTimecodeUserBits *userBits) = 0;
107 
108 protected:
~IDeckLinkTimecode()109     virtual ~IDeckLinkTimecode () {} // call Release method to drop reference count
110 };
111 
112 /* Functions */
113 
114 extern "C" {
115 
116 
117 }
118 
119 
120 #endif /* defined(BMD_DECKLINKAPITYPES_H) */
121