X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=libavdevice%2Fdecklink_common.h;h=05380ef76d3e26d774708d05c6fe0b3908641e74;hb=09f1d15ae8bd1d7f597aec9ced4f8ebe8762a4bd;hp=96b001c2d88486b5edbae7ce158b9df802511e63;hpb=b4ca32414ea28ad29b4bd387c298f5a676dace2a;p=ffmpeg diff --git a/libavdevice/decklink_common.h b/libavdevice/decklink_common.h index 96b001c2d88..05380ef76d3 100644 --- a/libavdevice/decklink_common.h +++ b/libavdevice/decklink_common.h @@ -24,9 +24,16 @@ #define AVDEVICE_DECKLINK_COMMON_H #include +#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0b000000 +#define IID_IDeckLinkProfileAttributes IID_IDeckLinkAttributes +#define IDeckLinkProfileAttributes IDeckLinkAttributes +#endif #include "libavutil/thread.h" #include "decklink_common_c.h" +#if CONFIG_LIBKLVANC +#include "libklvanc/vanc.h" +#endif #ifdef _WIN32 #define DECKLINK_BOOL BOOL @@ -84,7 +91,7 @@ struct decklink_ctx { IDeckLinkOutput *dlo; IDeckLinkInput *dli; IDeckLinkConfiguration *cfg; - IDeckLinkAttributes *attr; + IDeckLinkProfileAttributes *attr; decklink_output_callback *output_callback; /* DeckLink mode information */ @@ -97,6 +104,7 @@ struct decklink_ctx { int bmd_width; int bmd_height; int bmd_field_dominance; + int supports_vanc; /* Capture buffer queue */ AVPacketQueue queue; @@ -107,23 +115,26 @@ struct decklink_ctx { /* Status */ int playback_started; - int capture_started; int64_t last_pts; unsigned long frameCount; unsigned int dropped; AVStream *audio_st; AVStream *video_st; + AVStream *klv_st; AVStream *teletext_st; + uint16_t cdp_sequence_num; /* Options */ int list_devices; int list_formats; + int enable_klv; int64_t teletext_lines; double preroll; int duplex_mode; DecklinkPtsSource audio_pts_source; DecklinkPtsSource video_pts_source; int draw_bars; + BMDPixelFormat raw_format; int frames_preroll; int frames_buffer; @@ -133,23 +144,33 @@ struct decklink_ctx { int frames_buffer_available_spots; int autodetect; +#if CONFIG_LIBKLVANC + struct klvanc_context_s *vanc_ctx; +#endif + int channels; int audio_depth; + unsigned long tc_seen; // used with option wait_for_tc }; typedef enum { DIRECTION_IN, DIRECTION_OUT} decklink_direction_t; #ifdef _WIN32 -#if BLACKMAGIC_DECKLINK_API_VERSION < 0x0a040000 -typedef unsigned long buffercount_type; -#else typedef unsigned int buffercount_type; -#endif IDeckLinkIterator *CreateDeckLinkIteratorInstance(void); #else typedef uint32_t buffercount_type; #endif +static const BMDPixelFormat decklink_raw_format_map[] = { + (BMDPixelFormat)0, + bmdFormat8BitYUV, + bmdFormat10BitYUV, + bmdFormat8BitARGB, + bmdFormat8BitBGRA, + bmdFormat10BitRGB, +}; + static const BMDAudioConnection decklink_audio_connection_map[] = { (BMDAudioConnection)0, bmdAudioConnectionEmbedded, @@ -179,12 +200,16 @@ static const BMDTimecodeFormat decklink_timecode_format_map[] = { bmdTimecodeVITC, bmdTimecodeVITCField2, bmdTimecodeSerial, +#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000 + bmdTimecodeRP188HighFrameRate, +#else + (BMDTimecodeFormat)0, +#endif }; -HRESULT ff_decklink_get_display_name(IDeckLink *This, const char **displayName); int ff_decklink_set_configs(AVFormatContext *avctx, decklink_direction_t direction); -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, int num = 0); -int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t direction, int num); +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); +int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t direction); int ff_decklink_list_devices(AVFormatContext *avctx, struct AVDeviceInfoList *device_list, int show_inputs, int show_outputs); void ff_decklink_list_devices_legacy(AVFormatContext *avctx, int show_inputs, int show_outputs); int ff_decklink_list_formats(AVFormatContext *avctx, decklink_direction_t direction = DIRECTION_OUT);