From cf825ecea2ced5451feeb4e3576e83743534f4a7 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 17 Apr 2023 12:34:13 +0200 Subject: [PATCH] DeckLink cap/disp: added full-duplex parameter It actually sets `profile=1dfd`. This is a complement to already existing `half-duplex` option (that has on the other hand more more complex semantic - it chooses the profile tailored for the device, since the right one differs for eg. 8K Pro /4dhd/ and Duo/Quad 2 /2dhd/). --- src/blackmagic_common.cpp | 1 - src/video_capture/decklink.cpp | 8 +++++--- src/video_display/decklink.cpp | 8 +++++--- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/blackmagic_common.cpp b/src/blackmagic_common.cpp index 970da3300..d19f3e4f1 100644 --- a/src/blackmagic_common.cpp +++ b/src/blackmagic_common.cpp @@ -372,7 +372,6 @@ class ProfileCallback : public IDeckLinkProfileCallback bool decklink_set_profile(IDeckLink *deckLink, uint32_t profileID, bool stereo) { if (profileID == BMD_OPT_DEFAULT && !stereo) { return true; - profileID = bmdProfileOneSubDeviceFullDuplex; } bool ret = true; diff --git a/src/video_capture/decklink.cpp b/src/video_capture/decklink.cpp index c6fcd5063..fb2ad38c9 100644 --- a/src/video_capture/decklink.cpp +++ b/src/video_capture/decklink.cpp @@ -499,8 +499,8 @@ decklink_help(bool full) col() << "\tPrint description of all available options.\n"; col() << "\n"; - col() << SBOLD("half-duplex") << "\n"; - col() << "\tSet a profile that allows maximal number of simultaneous IOs.\n"; + col() << SBOLD("half-duplex | full-duplex") << "\n"; + col() << "\tSet a profile that allows maximal number of simultaneous IOs / set device to better compatibility (3D, dual-link).\n"; col() << "\n"; if (full) { @@ -700,6 +700,8 @@ static bool parse_option(struct vidcap_decklink_state *s, const char *opt) } else { s->profile = (BMDProfileID) bmd_read_fourcc(mode); } + } else if (strstr(opt, "full-duplex") == opt) { + s->profile = bmdProfileOneSubDeviceFullDuplex; } else if (strstr(opt, "half-duplex") == opt) { s->profile = bmdDuplexHalf; } else if (strcasecmp(opt, "nosig-send") == 0) { @@ -707,7 +709,7 @@ static bool parse_option(struct vidcap_decklink_state *s, const char *opt) } else if (strstr(opt, "keep-settings") == opt) { s->keep_device_defaults = true; } else { - log_msg(LOG_LEVEL_WARNING, "[DeckLink] Warning, unrecognized trailing options in init string: %s\n", opt); + log_msg(LOG_LEVEL_WARNING, "[DeckLink] Warning, unrecognized options in init string: %s\n", opt); return false; } diff --git a/src/video_display/decklink.cpp b/src/video_display/decklink.cpp index 6d5fa39b4..01a8d4ebf 100644 --- a/src/video_display/decklink.cpp +++ b/src/video_display/decklink.cpp @@ -380,8 +380,8 @@ static void show_help(bool full) col() << SBOLD("\tLevelA/LevelB") << "\tspecifies 3G-SDI output level\n"; col() << SBOLD("\t3D") << "\t\t3D stream will be received (see also HDMI3DPacking option)\n"; col() << SBOLD("\taudio_level") << "\tset maximum attenuation for mic\n"; - col() << SBOLD("\thalf-duplex") - << "\tset a profile that allows maximal number of simultaneous IOs\n"; + col() << SBOLD("\thalf-duplex | full-duplex") + << "\tset a profile that allows maximal number of simultaneous IOs / set device to better compatibility (3D, dual-link)\n"; col() << SBOLD("\tHDR[=HDR|PQ|HLG||help]") << " - enable HDR metadata (optionally specifying EOTF, int 0-7 as per CEA 861.), help for extended help\n"; col() << SBOLD("\tdrift_fix") << " activates a time drift fix for the Decklink cards with resampler (experimental)\n"; if (!full) { @@ -1013,6 +1013,8 @@ static bool settings_init(struct state_decklink *s, const char *fmt, } else { s->profile_req = (BMDProfileID) bmd_read_fourcc(ptr); } + } else if (strcasecmp(ptr, "full-duplex") == 0) { + s->profile_req = bmdProfileOneSubDeviceFullDuplex; } else if (strcasecmp(ptr, "half-duplex") == 0) { s->profile_req = bmdDuplexHalf; } else if (strcasecmp(ptr, "LevelA") == 0) { @@ -1080,7 +1082,7 @@ static bool settings_init(struct state_decklink *s, const char *fmt, } else if (strncasecmp(ptr, "targetbuffer=", strlen("targetbuffer=")) == 0) { s->audio_drift_fixer.set_target_buffer(parse_uint32(strchr(ptr, '=') + 1)); } else { - log_msg(LOG_LEVEL_ERROR, MOD_NAME "Warning: unknown options in config string.\n"); + log_msg(LOG_LEVEL_ERROR, MOD_NAME "Warning: unknown option in config string: %s\n", ptr); return false; } ptr = strtok_r(nullptr, ":", &save_ptr);