]> git.sesse.net Git - ffmpeg/blobdiff - libavdevice/decklink_common.h
avdevice/decklink_dec: map the raw_format instead of hardcode
[ffmpeg] / libavdevice / decklink_common.h
index 8b3dbce2fb435020c386b102d3358afa0b872a91..05380ef76d3e26d774708d05c6fe0b3908641e74 100644 (file)
@@ -115,18 +115,19 @@ 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;
@@ -155,16 +156,21 @@ struct decklink_ctx {
 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,
@@ -194,6 +200,11 @@ static const BMDTimecodeFormat decklink_timecode_format_map[] = {
     bmdTimecodeVITC,
     bmdTimecodeVITCField2,
     bmdTimecodeSerial,
+#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
+    bmdTimecodeRP188HighFrameRate,
+#else
+    (BMDTimecodeFormat)0,
+#endif
 };
 
 int ff_decklink_set_configs(AVFormatContext *avctx, decklink_direction_t direction);