2 ** Copyright (c) 2009 Blackmagic Design
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:
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.
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.
27 /* DeckLinkAPI_v7_1.h */
29 #ifndef __DeckLink_API_v7_1_h__
30 #define __DeckLink_API_v7_1_h__
32 #include "DeckLinkAPI.h"
34 // "B28131B6-59AC-4857-B5AC-CD75D5883E2F"
35 #define IID_IDeckLinkDisplayModeIterator_v7_1 (REFIID){0xB2,0x81,0x31,0xB6,0x59,0xAC,0x48,0x57,0xB5,0xAC,0xCD,0x75,0xD5,0x88,0x3E,0x2F}
37 // "AF0CD6D5-8376-435E-8433-54F9DD530AC3"
38 #define IID_IDeckLinkDisplayMode_v7_1 (REFIID){0xAF,0x0C,0xD6,0xD5,0x83,0x76,0x43,0x5E,0x84,0x33,0x54,0xF9,0xDD,0x53,0x0A,0xC3}
40 // "EBD01AFA-E4B0-49C6-A01D-EDB9D1B55FD9"
41 #define IID_IDeckLinkVideoOutputCallback_v7_1 (REFIID){0xEB,0xD0,0x1A,0xFA,0xE4,0xB0,0x49,0xC6,0xA0,0x1D,0xED,0xB9,0xD1,0xB5,0x5F,0xD9}
43 // "7F94F328-5ED4-4E9F-9729-76A86BDC99CC"
44 #define IID_IDeckLinkInputCallback_v7_1 (REFIID){0x7F,0x94,0xF3,0x28,0x5E,0xD4,0x4E,0x9F,0x97,0x29,0x76,0xA8,0x6B,0xDC,0x99,0xCC}
46 // "AE5B3E9B-4E1E-4535-B6E8-480FF52F6CE5"
47 #define IID_IDeckLinkOutput_v7_1 (REFIID){0xAE,0x5B,0x3E,0x9B,0x4E,0x1E,0x45,0x35,0xB6,0xE8,0x48,0x0F,0xF5,0x2F,0x6C,0xE5}
49 // "2B54EDEF-5B32-429F-BA11-BB990596EACD"
50 #define IID_IDeckLinkInput_v7_1 (REFIID){0x2B,0x54,0xED,0xEF,0x5B,0x32,0x42,0x9F,0xBA,0x11,0xBB,0x99,0x05,0x96,0xEA,0xCD}
52 // "333F3A10-8C2D-43CF-B79D-46560FEEA1CE"
53 #define IID_IDeckLinkVideoFrame_v7_1 (REFIID){0x33,0x3F,0x3A,0x10,0x8C,0x2D,0x43,0xCF,0xB7,0x9D,0x46,0x56,0x0F,0xEE,0xA1,0xCE}
55 // "C8B41D95-8848-40EE-9B37-6E3417FB114B"
56 #define IID_IDeckLinkVideoInputFrame_v7_1 (REFIID){0xC8,0xB4,0x1D,0x95,0x88,0x48,0x40,0xEE,0x9B,0x37,0x6E,0x34,0x17,0xFB,0x11,0x4B}
58 // "C86DE4F6-A29F-42E3-AB3A-1363E29F0788"
59 #define IID_IDeckLinkAudioInputPacket_v7_1 (REFIID){0xC8,0x6D,0xE4,0xF6,0xA2,0x9F,0x42,0xE3,0xAB,0x3A,0x13,0x63,0xE2,0x9F,0x07,0x88}
61 #if defined(__cplusplus)
63 class IDeckLinkVideoFrame_v7_1
;
64 class IDeckLinkDisplayModeIterator_v7_1
;
65 class IDeckLinkDisplayMode_v7_1
;
66 class IDeckLinkVideoInputFrame_v7_1
;
67 class IDeckLinkAudioInputPacket_v7_1
;
69 class IDeckLinkDisplayModeIterator_v7_1
: public IUnknown
72 virtual HRESULT STDMETHODCALLTYPE
Next (IDeckLinkDisplayMode_v7_1
* *deckLinkDisplayMode
) = 0;
76 class IDeckLinkDisplayMode_v7_1
: public IUnknown
79 virtual HRESULT STDMETHODCALLTYPE
GetName (CFStringRef
* name
) = 0;
80 virtual BMDDisplayMode STDMETHODCALLTYPE
GetDisplayMode () = 0;
81 virtual long STDMETHODCALLTYPE
GetWidth () = 0;
82 virtual long STDMETHODCALLTYPE
GetHeight () = 0;
83 virtual HRESULT STDMETHODCALLTYPE
GetFrameRate (BMDTimeValue
*frameDuration
, BMDTimeScale
*timeScale
) = 0;
86 class IDeckLinkVideoOutputCallback_v7_1
: public IUnknown
89 virtual HRESULT STDMETHODCALLTYPE
ScheduledFrameCompleted (IDeckLinkVideoFrame_v7_1
* completedFrame
, BMDOutputFrameCompletionResult result
) = 0;
92 class IDeckLinkInputCallback_v7_1
: public IUnknown
95 virtual HRESULT STDMETHODCALLTYPE
VideoInputFrameArrived (IDeckLinkVideoInputFrame_v7_1
* videoFrame
, IDeckLinkAudioInputPacket_v7_1
* audioPacket
) = 0;
98 // IDeckLinkOutput_v7_1. Created by QueryInterface from IDeckLink.
99 class IDeckLinkOutput_v7_1
: public IUnknown
102 // Display mode predicates
103 virtual HRESULT STDMETHODCALLTYPE
DoesSupportVideoMode (BMDDisplayMode displayMode
, BMDPixelFormat pixelFormat
, BMDDisplayModeSupport
*result
) = 0;
104 virtual HRESULT STDMETHODCALLTYPE
GetDisplayModeIterator (IDeckLinkDisplayModeIterator_v7_1
* *iterator
) = 0;
108 virtual HRESULT STDMETHODCALLTYPE
EnableVideoOutput (BMDDisplayMode displayMode
) = 0;
109 virtual HRESULT STDMETHODCALLTYPE
DisableVideoOutput () = 0;
111 virtual HRESULT STDMETHODCALLTYPE
SetVideoOutputFrameMemoryAllocator (IDeckLinkMemoryAllocator
* theAllocator
) = 0;
112 virtual HRESULT STDMETHODCALLTYPE
CreateVideoFrame (int32_t width
, int32_t height
, int32_t rowBytes
, BMDPixelFormat pixelFormat
, BMDFrameFlags flags
, IDeckLinkVideoFrame_v7_1
* *outFrame
) = 0;
113 virtual HRESULT STDMETHODCALLTYPE
CreateVideoFrameFromBuffer (void* buffer
, int32_t width
, int32_t height
, int32_t rowBytes
, BMDPixelFormat pixelFormat
, BMDFrameFlags flags
, IDeckLinkVideoFrame_v7_1
* *outFrame
) = 0;
115 virtual HRESULT STDMETHODCALLTYPE
DisplayVideoFrameSync (IDeckLinkVideoFrame_v7_1
* theFrame
) = 0;
116 virtual HRESULT STDMETHODCALLTYPE
ScheduleVideoFrame (IDeckLinkVideoFrame_v7_1
* theFrame
, BMDTimeValue displayTime
, BMDTimeValue displayDuration
, BMDTimeScale timeScale
) = 0;
117 virtual HRESULT STDMETHODCALLTYPE
SetScheduledFrameCompletionCallback (IDeckLinkVideoOutputCallback_v7_1
* theCallback
) = 0;
121 virtual HRESULT STDMETHODCALLTYPE
EnableAudioOutput (BMDAudioSampleRate sampleRate
, BMDAudioSampleType sampleType
, uint32_t channelCount
) = 0;
122 virtual HRESULT STDMETHODCALLTYPE
DisableAudioOutput () = 0;
124 virtual HRESULT STDMETHODCALLTYPE
WriteAudioSamplesSync (void* buffer
, uint32_t sampleFrameCount
, uint32_t *sampleFramesWritten
) = 0;
126 virtual HRESULT STDMETHODCALLTYPE
BeginAudioPreroll () = 0;
127 virtual HRESULT STDMETHODCALLTYPE
EndAudioPreroll () = 0;
128 virtual HRESULT STDMETHODCALLTYPE
ScheduleAudioSamples (void* buffer
, uint32_t sampleFrameCount
, BMDTimeValue streamTime
, BMDTimeScale timeScale
, uint32_t *sampleFramesWritten
) = 0;
130 virtual HRESULT STDMETHODCALLTYPE
GetBufferedAudioSampleFrameCount (uint32_t *bufferedSampleCount
) = 0;
131 virtual HRESULT STDMETHODCALLTYPE
FlushBufferedAudioSamples () = 0;
133 virtual HRESULT STDMETHODCALLTYPE
SetAudioCallback (IDeckLinkAudioOutputCallback
* theCallback
) = 0;
137 virtual HRESULT STDMETHODCALLTYPE
StartScheduledPlayback (BMDTimeValue playbackStartTime
, BMDTimeScale timeScale
, double playbackSpeed
) = 0;
138 virtual HRESULT STDMETHODCALLTYPE
StopScheduledPlayback (BMDTimeValue stopPlaybackAtTime
, BMDTimeValue
*actualStopTime
, BMDTimeScale timeScale
) = 0;
139 virtual HRESULT STDMETHODCALLTYPE
GetHardwareReferenceClock (BMDTimeScale desiredTimeScale
, BMDTimeValue
*elapsedTimeSinceSchedulerBegan
) = 0;
142 // IDeckLinkInput_v7_1. Created by QueryInterface from IDeckLink.
143 class IDeckLinkInput_v7_1
: public IUnknown
146 virtual HRESULT STDMETHODCALLTYPE
DoesSupportVideoMode (BMDDisplayMode displayMode
, BMDPixelFormat pixelFormat
, BMDDisplayModeSupport
*result
) = 0;
147 virtual HRESULT STDMETHODCALLTYPE
GetDisplayModeIterator (IDeckLinkDisplayModeIterator_v7_1
**iterator
) = 0;
150 virtual HRESULT STDMETHODCALLTYPE
EnableVideoInput (BMDDisplayMode displayMode
, BMDPixelFormat pixelFormat
, BMDVideoInputFlags flags
) = 0;
151 virtual HRESULT STDMETHODCALLTYPE
DisableVideoInput () = 0;
154 virtual HRESULT STDMETHODCALLTYPE
EnableAudioInput (BMDAudioSampleRate sampleRate
, BMDAudioSampleType sampleType
, uint32_t channelCount
) = 0;
155 virtual HRESULT STDMETHODCALLTYPE
DisableAudioInput () = 0;
156 virtual HRESULT STDMETHODCALLTYPE
ReadAudioSamples (void* buffer
, uint32_t sampleFrameCount
, uint32_t *sampleFramesRead
, BMDTimeValue
*audioPacketTime
, BMDTimeScale timeScale
) = 0;
157 virtual HRESULT STDMETHODCALLTYPE
GetBufferedAudioSampleFrameCount (uint32_t *bufferedSampleCount
) = 0;
160 virtual HRESULT STDMETHODCALLTYPE
StartStreams () = 0;
161 virtual HRESULT STDMETHODCALLTYPE
StopStreams () = 0;
162 virtual HRESULT STDMETHODCALLTYPE
PauseStreams () = 0;
163 virtual HRESULT STDMETHODCALLTYPE
SetCallback (IDeckLinkInputCallback_v7_1
* theCallback
) = 0;
166 // IDeckLinkVideoFrame_v7_1. Created by IDeckLinkOutput::CreateVideoFrame.
167 class IDeckLinkVideoFrame_v7_1
: public IUnknown
170 virtual long STDMETHODCALLTYPE
GetWidth () = 0;
171 virtual long STDMETHODCALLTYPE
GetHeight () = 0;
172 virtual long STDMETHODCALLTYPE
GetRowBytes () = 0;
173 virtual BMDPixelFormat STDMETHODCALLTYPE
GetPixelFormat () = 0;
174 virtual BMDFrameFlags STDMETHODCALLTYPE
GetFlags () = 0;
175 virtual HRESULT STDMETHODCALLTYPE
GetBytes (void* *buffer
) = 0;
178 // IDeckLinkVideoInputFrame_v7_1. Provided by the IDeckLinkInput_v7_1 frame arrival callback.
179 class IDeckLinkVideoInputFrame_v7_1
: public IDeckLinkVideoFrame_v7_1
182 virtual HRESULT STDMETHODCALLTYPE
GetFrameTime (BMDTimeValue
*frameTime
, BMDTimeValue
*frameDuration
, BMDTimeScale timeScale
) = 0;
185 // IDeckLinkAudioInputPacket_v7_1. Provided by the IDeckLinkInput_v7_1 callback.
186 class IDeckLinkAudioInputPacket_v7_1
: public IUnknown
189 virtual long STDMETHODCALLTYPE
GetSampleCount () = 0;
190 virtual HRESULT STDMETHODCALLTYPE
GetBytes (void* *buffer
) = 0;
192 virtual HRESULT STDMETHODCALLTYPE
GetAudioPacketTime (BMDTimeValue
*packetTime
, BMDTimeScale timeScale
) = 0;
195 #endif // defined(__cplusplus)
197 #endif // __DeckLink_API_v7_1_h__