This patch also makes BlackMagic drivers v10.6.1 a hard requirement.
Showing the changes to libavdevice/decklink_common.cpp (1 of 7 files). Show all
Unified · Split
| @@ -111,6 +111,23 @@ int ff_decklink_set_format(AVFormatContext *avctx, · 110 unmodified lines | ||
| 111 | 111 | int i = 1; |
| 112 | 112 | HRESULT res; |
| 113 | 113 | |
| 114 | + if (ctx->duplex_mode) { | |
| 115 | + bool duplex_supported = false; | |
| 116 | + | |
| 117 | + if (ctx->attr->GetFlag(BMDDeckLinkSupportsDuplexModeConfiguration, &duplex_supported) != S_OK) | |
| 118 | + duplex_supported = false; | |
| 119 | + | |
| 120 | + if (duplex_supported) { | |
| 121 | + res = ctx->cfg->SetInt(bmdDeckLinkConfigDuplexMode, ctx->duplex_mode == 2 ? bmdDuplexModeFull : bmdDuplexModeHalf); | |
| 122 | + if (res != S_OK) | |
| 123 | + av_log(avctx, AV_LOG_WARNING, "Setting duplex mode failed.\n"); | |
| 124 | + else | |
| 125 | + av_log(avctx, AV_LOG_VERBOSE, "Succesfully set duplex mode to %s duplex.\n", ctx->duplex_mode == 2 ? "full" : "half"); | |
| 126 | + } else { | |
| 127 | + av_log(avctx, AV_LOG_WARNING, "Unable to set duplex mode, because it is not supported.\n"); | |
| 128 | + } | |
| 129 | + } | |
| 130 | + | |
| 114 | 131 | if (direction == DIRECTION_IN) { |
| 115 | 132 | res = ctx->dli->GetDisplayModeIterator (&itermode); |
| 116 | 133 | } else { |
| @@ -249,6 +266,10 @@ void ff_decklink_cleanup(AVFormatContext *avctx) · 132 unmodified lines | ||
| 249 | 266 | ctx->dli->Release(); |
| 250 | 267 | if (ctx->dlo) |
| 251 | 268 | ctx->dlo->Release(); |
| 269 | + if (ctx->attr) | |
| 270 | + ctx->attr->Release(); | |
| 271 | + if (ctx->cfg) | |
| 272 | + ctx->cfg->Release(); | |
| 252 | 273 | if (ctx->dl) |
| 253 | 274 | ctx->dl->Release(); |
| 254 | 275 | } |
| @@ -279,5 +300,17 @@ int ff_decklink_init_device(AVFormatContext *avctx, const char* name) · 24 unmodified lines | ||
| 279 | 300 | if (!ctx->dl) |
| 280 | 301 | return AVERROR(ENXIO); |
| 281 | 302 | |
| 303 | + if (ctx->dl->QueryInterface(IID_IDeckLinkConfiguration, (void **)&ctx->cfg) != S_OK) { | |
| 304 | + av_log(avctx, AV_LOG_ERROR, "Could not get configuration interface for '%s'\n", name); | |
| 305 | + ff_decklink_cleanup(avctx); | |
| 306 | + return AVERROR_EXTERNAL; | |
| 307 | + } | |
| 308 | + | |
| 309 | + if (ctx->dl->QueryInterface(IID_IDeckLinkAttributes, (void **)&ctx->attr) != S_OK) { | |
| 310 | + av_log(avctx, AV_LOG_ERROR, "Could not get attributes interface for '%s'\n", name); | |
| 311 | + ff_decklink_cleanup(avctx); | |
| 312 | + return AVERROR_EXTERNAL; | |
| 313 | + } | |
| 314 | + | |
| 282 | 315 | return 0; |
| 283 | 316 | } |