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

Showing the changes to libavdevice/decklink_common.cpp (1 of 7 files). Show all

Unified · Split

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 }

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