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
344344 Defaults to @samp{2}.
345345
346346 @item duplex_mode
347−Sets the decklink device duplex mode. Must be @samp{unset}, @samp{half} or @samp{full}.
347+Sets 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}
348350 Defaults to @samp{unset}.
349351
352+Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
353+For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
354+sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
355+is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
356+
357+Valid 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+
361+Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
362+@samp{half}, @samp{full}
363+
350364 @item timecode_format
351365 Timecode type to include in the frame and video stream metadata. Must be
352366 @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
198198 Defaults to @option{0.5}.
199199
200200 @item duplex_mode
201−Sets the decklink device duplex mode. Must be @samp{unset}, @samp{half} or @samp{full}.
201+Sets 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}
202204 Defaults to @samp{unset}.
203205
206+Note: DeckLink SDK 11.0 have replaced the duplex property by a profile property.
207+For the DeckLink Duo 2 and DeckLink Quad 2, a profile is shared between any 2
208+sub-devices that utilize the same connectors. For the DeckLink 8K Pro, a profile
209+is shared between all 4 sub-devices. So DeckLink 8K Pro support four profiles.
210+
211+Valid 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+
215+Valid profile modes for DeckLink Quad 2 and DeckLink Duo 2:
216+@samp{half}, @samp{full}
217+
204218 @item timing_offset
205219 Sets the genlock timing pixel offset on the used output.
206220 Defaults to @samp{unset}.
libavdevice/decklink_common.cpp+6−2
@@ -182,7 +182,11 @@ int ff_decklink_set_configs(AVFormatContext *avctx, · 181 unmodified lines
182182 if (duplex_supported) {
183183 #if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
184184 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];
186190 res = manager->GetProfile(bmd_profile_id, &profile);
187191 if (res == S_OK) {
188192 res = profile->SetActive();
@@ -195,7 +199,7 @@ int ff_decklink_set_configs(AVFormatContext *avctx, · 6 unmodified lines
195199 if (res != S_OK)
196200 av_log(avctx, AV_LOG_WARNING, "Setting duplex mode failed.\n");
197201 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");
199203 } else {
200204 av_log(avctx, AV_LOG_WARNING, "Unable to set duplex mode, because it is not supported.\n");
201205 }
libavdevice/decklink_common.h+11−0
@@ -208,6 +208,17 @@ static const BMDLinkConfiguration decklink_link_conf_map[] = { · 207 unmodified lines
208208 bmdLinkConfigurationQuadLink
209209 };
210210
211+#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
212+static const BMDProfileID decklink_profile_id_map[] = {
213+ (BMDProfileID)0,
214+ bmdProfileTwoSubDevicesHalfDuplex,
215+ bmdProfileOneSubDeviceFullDuplex,
216+ bmdProfileOneSubDeviceHalfDuplex,
217+ bmdProfileTwoSubDevicesFullDuplex,
218+ bmdProfileFourSubDevicesHalfDuplex,
219+};
220+#endif
221+
211222 int ff_decklink_set_configs(AVFormatContext *avctx, decklink_direction_t direction);
212223 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);
213224 int 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
4545 { "standard", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0x7fff9fffeLL}, 0, 0, DEC, "teletext_lines"},
4646 { "all", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0x7ffffffffLL}, 0, 0, DEC, "teletext_lines"},
4747 { "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
4851 { "duplex_mode", "duplex mode", OFFSET(duplex_mode), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 2, DEC, "duplex_mode"},
52+#endif
4953 { "unset", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0}, 0, 0, DEC, "duplex_mode"},
5054 { "half", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 1}, 0, 0, DEC, "duplex_mode"},
5155 { "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
5262 { "timecode_format", "timecode format", OFFSET(tc_format), AV_OPT_TYPE_INT, { .i64 = 0}, 0, 8, DEC, "tc_format"},
5363 { "none", NULL, 0, AV_OPT_TYPE_CONST, { .i64 = 0}, 0, 0, DEC, "tc_format"},
5464 { "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
3131 { "list_devices", "use ffmpeg -sinks decklink instead", OFFSET(list_devices), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, ENC | AV_OPT_FLAG_DEPRECATED},
3232 { "list_formats", "list supported formats" , OFFSET(list_formats), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 1, ENC },
3333 { "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
3437 { "duplex_mode" , "duplex mode" , OFFSET(duplex_mode ), AV_OPT_TYPE_INT , { .i64 = 0 }, 0, 2, ENC, "duplex_mode"},
38+#endif
3539 { "unset" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 0 }, 0, 0, ENC, "duplex_mode"},
3640 { "half" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 1 }, 0, 0, ENC, "duplex_mode"},
3741 { "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
3848 { "link" , "single/dual/quad SDI link configuration", OFFSET(link), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 3, ENC, "link"},
3949 { "unset" , NULL , 0 , AV_OPT_TYPE_CONST , { .i64 = 0 }, 0, 0, ENC, "link"},
4050 { "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
2929
3030 #define LIBAVDEVICE_VERSION_MAJOR 59
3131 #define LIBAVDEVICE_VERSION_MINOR 0
32−#define LIBAVDEVICE_VERSION_MICRO 100
32+#define LIBAVDEVICE_VERSION_MICRO 101
3333
3434 #define LIBAVDEVICE_VERSION_INT AV_VERSION_INT(LIBAVDEVICE_VERSION_MAJOR, \
3535 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