History

avdevice/decklink: support for more duplex mode for Decklink 8K Pro

Limin Wang committed 5 years ago

Commit 694ec841 parent 13460af7 files · +68 −5Browse files

Unified · Split

7 files
  1. doc/indevs.texi +15 −1
  2. doc/outdevs.texi +15 −1
  3. libavdevice/decklink_common.cpp +6 −2
  4. libavdevice/decklink_common.h +11 −0
  5. libavdevice/decklink_dec_c.c +10 −0
  6. libavdevice/decklink_enc_c.c +10 −0
  7. libavdevice/version.h +1 −1
doc/indevs.texi+15−1
@@ -344,9 +344,23 @@ Defines number of audio channels to capture. Must be @samp{2}, @samp{8} or @samp · 343 unmodified lines
344Defaults to @samp{2}.344Defaults to @samp{2}.
345 345
346@item duplex_mode346@item duplex_mode
347Sets the decklink device duplex mode. Must be @samp{unset}, @samp{half} or @samp{full}.347Sets the decklink device duplex/profile mode. Must be @samp{unset}, @samp{half}, @samp{full},
348@samp{one_sub_device_full}, @samp{one_sub_device_half}, @samp{two_sub_device_full},
349@samp{four_sub_device_half}
348Defaults to @samp{unset}.350Defaults to @samp{unset}.
349 351
352Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
353For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
354sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
355is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
356
357Valid profile modes for DeckLink 8K Pro(with DeckLink SDK >= 11.0):
358@samp{one_sub_device_full}, @samp{one_sub_device_half}, @samp{two_sub_device_full},
359@samp{four_sub_device_half}
360
361Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
362@samp{half}, @samp{full}
363
350@item timecode_format364@item timecode_format
351Timecode type to include in the frame and video stream metadata. Must be365Timecode type to include in the frame and video stream metadata. Must be
352@samp{none}, @samp{rp188vitc}, @samp{rp188vitc2}, @samp{rp188ltc},366@samp{none}, @samp{rp188vitc}, @samp{rp188vitc2}, @samp{rp188ltc},
doc/outdevs.texi+15−1
@@ -198,9 +198,23 @@ Amount of time to preroll video in seconds. · 197 unmodified lines
198Defaults to @option{0.5}.198Defaults to @option{0.5}.
199 199
200@item duplex_mode200@item duplex_mode
201Sets the decklink device duplex mode. Must be @samp{unset}, @samp{half} or @samp{full}.201Sets the decklink device duplex/profile mode. Must be @samp{unset}, @samp{half}, @samp{full},
202@samp{one_sub_device_full}, @samp{one_sub_device_half}, @samp{two_sub_device_full},
203@samp{four_sub_device_half}
202Defaults to @samp{unset}.204Defaults to @samp{unset}.
203 205
206Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
207For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
208sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
209is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
210
211Valid profile modes for DeckLink 8K Pro(with DeckLink SDK >= 11.0):
212@samp{one_sub_device_full}, @samp{one_sub_device_half}, @samp{two_sub_device_full},
213@samp{four_sub_device_half}
214
215Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
216@samp{half}, @samp{full}
217
204@item timing_offset218@item timing_offset
205Sets the genlock timing pixel offset on the used output.219Sets the genlock timing pixel offset on the used output.
206Defaults to @samp{unset}.220Defaults to @samp{unset}.
libavdevice/decklink_common.cpp+6−2
@@ -182,7 +182,11 @@ int ff_decklink_set_configs(AVFormatContext *avctx, · 181 unmodified lines
182 if (duplex_supported) {182 if (duplex_supported) {
183#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000183#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
184 IDeckLinkProfile *profile = NULL;184 IDeckLinkProfile *profile = NULL;
185 BMDProfileID bmd_profile_id = ctx->duplex_mode == 2 ? bmdProfileOneSubDeviceFullDuplex : bmdProfileTwoSubDevicesHalfDuplex;185 BMDProfileID bmd_profile_id;
186
187 if (ctx->duplex_mode < 0 || ctx->duplex_mode >= FF_ARRAY_ELEMS(decklink_profile_id_map))
188 return EINVAL;
189 bmd_profile_id = decklink_profile_id_map[ctx->duplex_mode];
186 res = manager->GetProfile(bmd_profile_id, &profile);190 res = manager->GetProfile(bmd_profile_id, &profile);
187 if (res == S_OK) {191 if (res == S_OK) {
188 res = profile->SetActive();192 res = profile->SetActive();
@@ -195,7 +199,7 @@ int ff_decklink_set_configs(AVFormatContext *avctx, · 6 unmodified lines
195 if (res != S_OK)199 if (res != S_OK)
196 av_log(avctx, AV_LOG_WARNING, "Setting duplex mode failed.\n");200 av_log(avctx, AV_LOG_WARNING, "Setting duplex mode failed.\n");
197 else201 else
198 av_log(avctx, AV_LOG_VERBOSE, "Successfully set duplex mode to %s duplex.\n", ctx->duplex_mode == 2 ? "full" : "half");202 av_log(avctx, AV_LOG_VERBOSE, "Successfully set duplex mode to %s duplex.\n", ctx->duplex_mode == 2 || ctx->duplex_mode == 4 ? "full" : "half");
199 } else {203 } else {
200 av_log(avctx, AV_LOG_WARNING, "Unable to set duplex mode, because it is not supported.\n");204 av_log(avctx, AV_LOG_WARNING, "Unable to set duplex mode, because it is not supported.\n");
201 }205 }
libavdevice/decklink_common.h+11−0
@@ -208,6 +208,17 @@ static const BMDLinkConfiguration decklink_link_conf_map[] = { · 207 unmodified lines
208 bmdLinkConfigurationQuadLink208 bmdLinkConfigurationQuadLink
209};209};
210 210
211#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
212static const BMDProfileID decklink_profile_id_map[] = {
213 (BMDProfileID)0,
214 bmdProfileTwoSubDevicesHalfDuplex,
215 bmdProfileOneSubDeviceFullDuplex,
216 bmdProfileOneSubDeviceHalfDuplex,
217 bmdProfileTwoSubDevicesFullDuplex,
218 bmdProfileFourSubDevicesHalfDuplex,
219};
220#endif
221
211int ff_decklink_set_configs(AVFormatContext *avctx, decklink_direction_t direction);222int ff_decklink_set_configs(AVFormatContext *avctx, decklink_direction_t direction);
212int 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);223int 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);
213int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t direction);224int ff_decklink_set_format(AVFormatContext *avctx, decklink_direction_t direction);
libavdevice/decklink_dec_c.c+10−0
@@ -45,10 +45,20 @@ static const AVOption options[] = { · 44 unmodified 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"},
46 { "all", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0x7ffffffffLL}, 0, 0, DEC, "teletext_lines"},46 { "all", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0x7ffffffffLL}, 0, 0, DEC, "teletext_lines"},
47 { "channels", "number of audio channels", OFFSET(audio_channels), AV_OPT_TYPE_INT , { .i64 = 2 }, 2, 16, DEC },47 { "channels", "number of audio channels", OFFSET(audio_channels), AV_OPT_TYPE_INT , { .i64 = 2 }, 2, 16, DEC },
48#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
49 { "duplex_mode", "duplex mode", OFFSET(duplex_mode), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 5, DEC, "duplex_mode"},
50#else
48 { "duplex_mode", "duplex mode", OFFSET(duplex_mode), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 2, DEC, "duplex_mode"},51 { "duplex_mode", "duplex mode", OFFSET(duplex_mode), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 2, DEC, "duplex_mode"},
52#endif
49 { "unset", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0}, 0, 0, DEC, "duplex_mode"},53 { "unset", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0}, 0, 0, DEC, "duplex_mode"},
50 { "half", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1}, 0, 0, DEC, "duplex_mode"},54 { "half", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1}, 0, 0, DEC, "duplex_mode"},
51 { "full", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2}, 0, 0, DEC, "duplex_mode"},55 { "full", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2}, 0, 0, DEC, "duplex_mode"},
56#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
57 { "one_sub_device_full", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 2}, 0, 0, DEC, "duplex_mode"},
58 { "one_sub_device_half", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 3}, 0, 0, DEC, "duplex_mode"},
59 { "two_sub_device_full", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 4}, 0, 0, DEC, "duplex_mode"},
60 { "four_sub_device_half", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 5}, 0, 0, DEC, "duplex_mode"},
61#endif
52 { "timecode_format", "timecode format", OFFSET(tc_format), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 8, DEC, "tc_format"},62 { "timecode_format", "timecode format", OFFSET(tc_format), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 8, DEC, "tc_format"},
53 { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0}, 0, 0, DEC, "tc_format"},63 { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0}, 0, 0, DEC, "tc_format"},
54 { "rp188vitc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1}, 0, 0, DEC, "tc_format"},64 { "rp188vitc", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1}, 0, 0, DEC, "tc_format"},
libavdevice/decklink_enc_c.c+10−0
@@ -31,10 +31,20 @@ static const AVOption options[] = { · 30 unmodified lines
31 { "list_devices", "use ffmpeg -sinks decklink instead", OFFSET(list_devices), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC | AV_OPT_FLAG_DEPRECATED},31 { "list_devices", "use ffmpeg -sinks decklink instead", OFFSET(list_devices), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC | AV_OPT_FLAG_DEPRECATED},
32 { "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, ENC },32 { "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, ENC },
33 { "preroll" , "video preroll in seconds", OFFSET(preroll ), AV_OPT_TYPE_DOUBLE, { .dbl = 0.5 }, 0, 5, ENC },33 { "preroll" , "video preroll in seconds", OFFSET(preroll ), AV_OPT_TYPE_DOUBLE, { .dbl = 0.5 }, 0, 5, ENC },
34#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
35 { "duplex_mode" , "duplex mode" , OFFSET(duplex_mode ), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 5, ENC, "duplex_mode"},
36#else
34 { "duplex_mode" , "duplex mode" , OFFSET(duplex_mode ), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 2, ENC, "duplex_mode"},37 { "duplex_mode" , "duplex mode" , OFFSET(duplex_mode ), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 2, ENC, "duplex_mode"},
38#endif
35 { "unset" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 0 }, 0, 0, ENC, "duplex_mode"},39 { "unset" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 0 }, 0, 0, ENC, "duplex_mode"},
36 { "half" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 1 }, 0, 0, ENC, "duplex_mode"},40 { "half" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 1 }, 0, 0, ENC, "duplex_mode"},
37 { "full" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 2 }, 0, 0, ENC, "duplex_mode"},41 { "full" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 2 }, 0, 0, ENC, "duplex_mode"},
42#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
43 { "one_sub_device_full", NULL ,0 , AV_OPT_TYPE_CONST , { .i64 = 2 }, 0, 0, ENC, "duplex_mode"},
44 { "one_sub_device_half", NULL ,0 , AV_OPT_TYPE_CONST , { .i64 = 3 }, 0, 0, ENC, "duplex_mode"},
45 { "two_sub_device_full", NULL ,0 , AV_OPT_TYPE_CONST , { .i64 = 4 }, 0, 0, ENC, "duplex_mode"},
46 { "four_sub_device_half", NULL ,0 , AV_OPT_TYPE_CONST , { .i64 = 5 }, 0, 0, ENC, "duplex_mode"},
47#endif
38 { "link" , "single/dual/quad SDI link configuration", OFFSET(link), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, ENC, "link"},48 { "link" , "single/dual/quad SDI link configuration", OFFSET(link), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, ENC, "link"},
39 { "unset" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 0 }, 0, 0, ENC, "link"},49 { "unset" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 0 }, 0, 0, ENC, "link"},
40 { "single" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 1 }, 0, 0, ENC, "link"},50 { "single" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 1 }, 0, 0, ENC, "link"},
libavdevice/version.h+1−1
@@ -29,7 +29,7 @@ · 28 unmodified lines
29 29
30#define LIBAVDEVICE_VERSION_MAJOR 5930#define LIBAVDEVICE_VERSION_MAJOR 59
31#define LIBAVDEVICE_VERSION_MINOR 031#define LIBAVDEVICE_VERSION_MINOR 0
32#define LIBAVDEVICE_VERSION_MICRO 10032#define LIBAVDEVICE_VERSION_MICRO 101
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