Go to the documentation of this file.
23 #ifndef AVDEVICE_DECKLINK_COMMON_H
24 #define AVDEVICE_DECKLINK_COMMON_H
26 #include <DeckLinkAPIVersion.h>
27 #if BLACKMAGIC_DECKLINK_API_VERSION < 0x0b000000
28 #define IID_IDeckLinkProfileAttributes IID_IDeckLinkAttributes
29 #define IDeckLinkProfileAttributes IDeckLinkAttributes
32 #if BLACKMAGIC_DECKLINK_API_VERSION < 0x0e030000
33 #define IDeckLinkInput_v14_2_1 IDeckLinkInput
34 #define IDeckLinkInputCallback_v14_2_1 IDeckLinkInputCallback
35 #define IDeckLinkMemoryAllocator_v14_2_1 IDeckLinkMemoryAllocator
36 #define IDeckLinkOutput_v14_2_1 IDeckLinkOutput
37 #define IDeckLinkVideoFrame_v14_2_1 IDeckLinkVideoFrame
38 #define IDeckLinkVideoInputFrame_v14_2_1 IDeckLinkVideoInputFrame
39 #define IDeckLinkVideoOutputCallback_v14_2_1 IDeckLinkVideoOutputCallback
40 #define IID_IDeckLinkInput_v14_2_1 IID_IDeckLinkInput
41 #define IID_IDeckLinkInputCallback_v14_2_1 IID_IDeckLinkInputCallback
42 #define IID_IDeckLinkMemoryAllocator_v14_2_1 IID_IDeckLinkMemoryAllocator
43 #define IID_IDeckLinkOutput_v14_2_1 IID_IDeckLinkOutput
44 #define IID_IDeckLinkVideoFrame_v14_2_1 IID_IDeckLinkVideoFrame
45 #define IID_IDeckLinkVideoInputFrame_v14_2_1 IID_IDeckLinkVideoInputFrame
46 #define IID_IDeckLinkVideoOutputCallback_v14_2_1 IID_IDeckLinkVideoOutputCallback
57 #include "libklvanc/vanc.h"
61 #define DECKLINK_BOOL BOOL
63 #define DECKLINK_BOOL bool
70 int l = WideCharToMultiByte(CP_UTF8, 0,
w, -1, 0, 0, 0, 0);
73 WideCharToMultiByte(CP_UTF8, 0,
w, -1,
s, l, 0, 0);
76 #define DECKLINK_STR OLECHAR *
77 #define DECKLINK_STRDUP dup_wchar_to_utf8
78 #define DECKLINK_FREE(s) SysFreeString(s)
79 #elif defined(__APPLE__)
80 static char *dup_cfstring_to_utf8(CFStringRef
w)
83 CFStringGetCString(
w,
s, 255, kCFStringEncodingUTF8);
86 #define DECKLINK_STR const __CFString *
87 #define DECKLINK_STRDUP dup_cfstring_to_utf8
88 #define DECKLINK_FREE(s) CFRelease(s)
90 #define DECKLINK_STR const char *
91 #define DECKLINK_STRDUP av_strdup
93 #define DECKLINK_FREE(s) free((void *) s)
98 #define DECKLINK_IsEqualIID IsEqualIID
102 return memcmp(&riid1, &riid2,
sizeof(REFIID)) == 0;
125 IDeckLinkConfiguration *
cfg;
188 struct klvanc_context_s *vanc_ctx;
208 (BMDAudioConnection)0,
209 bmdAudioConnectionEmbedded,
210 bmdAudioConnectionAESEBU,
211 bmdAudioConnectionAnalog,
212 bmdAudioConnectionAnalogXLR,
213 bmdAudioConnectionAnalogRCA,
214 bmdAudioConnectionMicrophone,
218 (BMDVideoConnection)0,
219 bmdVideoConnectionSDI,
220 bmdVideoConnectionHDMI,
221 bmdVideoConnectionOpticalSDI,
222 bmdVideoConnectionComponent,
223 bmdVideoConnectionComposite,
224 bmdVideoConnectionSVideo,
228 (BMDTimecodeFormat)0,
229 bmdTimecodeRP188VITC1,
230 bmdTimecodeRP188VITC2,
234 bmdTimecodeVITCField2,
236 #
if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
237 bmdTimecodeRP188HighFrameRate,
239 (BMDTimecodeFormat)0,
244 (BMDLinkConfiguration)0,
245 bmdLinkConfigurationSingleLink,
246 bmdLinkConfigurationDualLink,
247 bmdLinkConfigurationQuadLink
250 #if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
251 static const BMDProfileID decklink_profile_id_map[] = {
253 bmdProfileTwoSubDevicesHalfDuplex,
254 bmdProfileOneSubDeviceFullDuplex,
255 bmdProfileOneSubDeviceHalfDuplex,
256 bmdProfileTwoSubDevicesFullDuplex,
257 bmdProfileFourSubDevicesHalfDuplex,
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf default minimum maximum flags name is the option name
int frames_buffer_available_spots
static const BMDPixelFormat decklink_raw_format_map[]
DecklinkPtsSource audio_pts_source
IDeckLinkProfileAttributes * attr
int ff_decklink_packet_queue_get(DecklinkPacketQueue *q, AVPacket *pkt, int block)
int ff_decklink_set_configs(AVFormatContext *avctx, decklink_direction_t direction)
#define IDeckLinkInput_v14_2_1
DecklinkPacketQueue queue
decklink_output_callback * output_callback
static const BMDVideoConnection decklink_video_connection_map[]
static const BMDAudioConnection decklink_audio_connection_map[]
void ff_decklink_packet_queue_init(AVFormatContext *avctx, DecklinkPacketQueue *q, int64_t queue_size)
IDeckLinkInput_v14_2_1 * dli
void ff_decklink_list_devices_legacy(AVFormatContext *avctx, int show_inputs, int show_outputs)
int ff_decklink_list_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list, int show_inputs, int show_outputs)
static const BMDTimecodeFormat decklink_timecode_format_map[]
int ff_decklink_packet_queue_put(DecklinkPacketQueue *q, AVPacket *pkt)
DecklinkPacketQueue vanc_queue
IDeckLinkConfiguration * cfg
unsigned long long ff_decklink_packet_queue_size(DecklinkPacketQueue *q)
static bool DECKLINK_IsEqualIID(const REFIID &riid1, const REFIID &riid2)
int64_t ff_decklink_packet_queue_peekpts(DecklinkPacketQueue *q)
static const BMDLinkConfiguration decklink_link_conf_map[]
BMDLinkConfiguration link
DecklinkPtsSource video_pts_source
static char * dup_wchar_to_utf8(wchar_t *w)
int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direction=DIRECTION_OUT)
int ff_decklink_init_device(AVFormatContext *avctx, const char *name)
int ff_decklink_set_format(AVFormatContext *avctx, int width, int height, int tb_num, int tb_den, enum AVFieldOrder field_order, decklink_direction_t direction=DIRECTION_OUT)
void ff_decklink_packet_queue_flush(DecklinkPacketQueue *q)
#define IDeckLinkProfileAttributes
void ff_decklink_packet_queue_end(DecklinkPacketQueue *q)
BMDAudioConnection audio_input
uint16_t cdp_sequence_num
char * av_strdup(const char *s)
Duplicate a string.
void ff_decklink_cleanup(AVFormatContext *avctx)
BMDVideoConnection video_input
This structure stores compressed data.
IDeckLinkOutput_v14_2_1 * dlo
The exact code depends on how similar the blocks are and how related they are to the block
#define IDeckLinkOutput_v14_2_1
DecklinkSignalLossAction signal_loss_action
BMDTimecodeFormat tc_format
BMDPixelFormat raw_format
CCFifo cc_fifo
closed captions