summaryrefslogtreecommitdiff
path: root/libavdevice/decklink_common.cpp
diff options
context:
space:
mode:
authorLimin Wang <lance.lmwang@gmail.com>2021-08-13 10:47:28 +0800
committerLimin Wang <lance.lmwang@gmail.com>2021-08-16 10:00:39 +0800
commit694ec84ae92f64694c6d6dcd57dcd0bfaf0596f9 (patch)
treec63c243cea16142bf0537ef7d62174f1eac36063 /libavdevice/decklink_common.cpp
parent13460af45621f2f01d3717cb93d6d09a60e63510 (diff)
avdevice/decklink: support for more duplex mode for Decklink 8K Pro
Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Limin Wang <lance.lmwang@gmail.com>
Diffstat (limited to 'libavdevice/decklink_common.cpp')
-rw-r--r--libavdevice/decklink_common.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/libavdevice/decklink_common.cpp b/libavdevice/decklink_common.cpp
index 056946212f..acd1f77e6c 100644
--- a/libavdevice/decklink_common.cpp
+++ b/libavdevice/decklink_common.cpp
@@ -182,7 +182,11 @@ int ff_decklink_set_configs(AVFormatContext *avctx,
if (duplex_supported) {
#if BLACKMAGIC_DECKLINK_API_VERSION >= 0x0b000000
IDeckLinkProfile *profile = NULL;
- BMDProfileID bmd_profile_id = ctx->duplex_mode == 2 ? bmdProfileOneSubDeviceFullDuplex : bmdProfileTwoSubDevicesHalfDuplex;
+ BMDProfileID bmd_profile_id;
+
+ if (ctx->duplex_mode < 0 || ctx->duplex_mode >= FF_ARRAY_ELEMS(decklink_profile_id_map))
+ return EINVAL;
+ bmd_profile_id = decklink_profile_id_map[ctx->duplex_mode];
res = manager->GetProfile(bmd_profile_id, &profile);
if (res == S_OK) {
res = profile->SetActive();
@@ -195,7 +199,7 @@ int ff_decklink_set_configs(AVFormatContext *avctx,
if (res != S_OK)
av_log(avctx, AV_LOG_WARNING, "Setting duplex mode failed.\n");
else
- av_log(avctx, AV_LOG_VERBOSE, "Successfully set duplex mode to %s duplex.\n", ctx->duplex_mode == 2 ? "full" : "half");
+ av_log(avctx, AV_LOG_VERBOSE, "Successfully set duplex mode to %s duplex.\n", ctx->duplex_mode == 2 || ctx->duplex_mode == 4 ? "full" : "half");
} else {
av_log(avctx, AV_LOG_WARNING, "Unable to set duplex mode, because it is not supported.\n");
}