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>
This commit is contained in:
Limin Wang
2021-08-13 10:47:28 +08:00
parent 13460af456
commit 694ec84ae9
7 changed files with 68 additions and 5 deletions

View File

@@ -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");
}