History

avdevice/decklink_dec: map the raw_format instead of hardcode

The patch will change the numerical values for the string constants so bump micro version.

Limin Wang committed 5 years ago

Commit 09f1d151 parent c055a474 files · +19 −9Browse files

Unified · Split

4 files
  1. libavdevice/decklink_common.h +9 −0
  2. libavdevice/decklink_dec.cpp +2 −1
  3. libavdevice/decklink_dec_c.c +7 −7
  4. libavdevice/version.h +1 −1
libavdevice/decklink_common.h+9−0
@@ -162,6 +162,15 @@ IDeckLinkIterator *CreateDeckLinkIteratorInstance(void); · 161 unmodified lines
162typedef uint32_t buffercount_type;162typedef uint32_t buffercount_type;
163#endif163#endif
164 164
165static const BMDPixelFormat decklink_raw_format_map[] = {
166 (BMDPixelFormat)0,
167 bmdFormat8BitYUV,
168 bmdFormat10BitYUV,
169 bmdFormat8BitARGB,
170 bmdFormat8BitBGRA,
171 bmdFormat10BitRGB,
172};
173
165static const BMDAudioConnection decklink_audio_connection_map[] = {174static const BMDAudioConnection decklink_audio_connection_map[] = {
166 (BMDAudioConnection)0,175 (BMDAudioConnection)0,
167 bmdAudioConnectionEmbedded,176 bmdAudioConnectionEmbedded,
libavdevice/decklink_dec.cpp+2−1
@@ -1152,7 +1152,8 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) · 1151 unmodified lines
1152 ctx->video_pts_source = cctx->video_pts_source;1152 ctx->video_pts_source = cctx->video_pts_source;
1153 ctx->draw_bars = cctx->draw_bars;1153 ctx->draw_bars = cctx->draw_bars;
1154 ctx->audio_depth = cctx->audio_depth;1154 ctx->audio_depth = cctx->audio_depth;
1155 ctx->raw_format = (BMDPixelFormat)cctx->raw_format;1155 if (cctx->raw_format > 0 && (unsigned int)cctx->raw_format < FF_ARRAY_ELEMS(decklink_raw_format_map))
1156 ctx->raw_format = decklink_raw_format_map[cctx->raw_format];
1156 cctx->ctx = ctx;1157 cctx->ctx = ctx;
1157 1158
1158 /* Check audio channel option for valid values: 2, 8 or 16 */1159 /* Check audio channel option for valid values: 2, 8 or 16 */
libavdevice/decklink_dec_c.c+7−7
@@ -33,13 +33,13 @@ static const AVOption options[] = { · 32 unmodified lines
33 { "list_devices", "list available devices" , OFFSET(list_devices), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, DEC },33 { "list_devices", "list available devices" , OFFSET(list_devices), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, DEC },
34 { "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, DEC },34 { "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, DEC },
35 { "format_code", "set format by fourcc" , OFFSET(format_code), AV_OPT_TYPE_STRING, { .str = NULL}, 0, 0, DEC },35 { "format_code", "set format by fourcc" , OFFSET(format_code), AV_OPT_TYPE_STRING, { .str = NULL}, 0, 0, DEC },
36 { "raw_format", "pixel format to be returned by the card when capturing" , OFFSET(raw_format), AV_OPT_TYPE_INT, { .i64 = 0}, 0, UINT_MAX, DEC, "raw_format" },36 { "raw_format", "pixel format to be returned by the card when capturing" , OFFSET(raw_format), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 5, DEC, "raw_format" },
37 { "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, DEC, "raw_format"},37 { "auto", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, DEC, "raw_format"},
38 { "uyvy422", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MKBETAG('2','v','u','y') }, 0, 0, DEC, "raw_format"},38 { "uyvy422", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, DEC, "raw_format"},
39 { "yuv422p10", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MKBETAG('v','2','1','0') }, 0, 0, DEC, "raw_format"},39 { "yuv422p10", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2 }, 0, 0, DEC, "raw_format"},
40 { "argb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 32 }, 0, 0, DEC, "raw_format"},40 { "argb", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3 }, 0, 0, DEC, "raw_format"},
41 { "bgra", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MKBETAG('B','G','R','A') }, 0, 0, DEC, "raw_format"},41 { "bgra", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 4 }, 0, 0, DEC, "raw_format"},
42 { "rgb10", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = MKBETAG('r','2','1','0') }, 0, 0, DEC, "raw_format"},42 { "rgb10", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 5 }, 0, 0, DEC, "raw_format"},
43 { "enable_klv", "output klv if present in vanc", OFFSET(enable_klv), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC },43 { "enable_klv", "output klv if present in vanc", OFFSET(enable_klv), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, DEC },
44 { "teletext_lines", "teletext lines bitmask", OFFSET(teletext_lines), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, 0x7ffffffffLL, DEC, "teletext_lines"},44 { "teletext_lines", "teletext lines bitmask", OFFSET(teletext_lines), AV_OPT_TYPE_INT64, { .i64 = 0 }, 0, 0x7ffffffffLL, DEC, "teletext_lines"},
45 { "standard", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0x7fff9fffeLL}, 0, 0, DEC, "teletext_lines"},45 { "standard", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0x7fff9fffeLL}, 0, 0, DEC, "teletext_lines"},
libavdevice/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29 29
30#define LIBAVDEVICE_VERSION_MAJOR 5830#define LIBAVDEVICE_VERSION_MAJOR 58
31#define LIBAVDEVICE_VERSION_MINOR 1131#define LIBAVDEVICE_VERSION_MINOR 11
32#define LIBAVDEVICE_VERSION_MICRO 10232#define LIBAVDEVICE_VERSION_MICRO 103
33 33
34#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \34#define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
35 LIBAVDEVICE_VERSION_MINOR, \35 LIBAVDEVICE_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t