avdevice/decklink: new option 'format_code' to set video format by fourCC

Signed-off-by: Matthias Hunstock <atze@fem.tu-ilmenau.de>
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:
Matthias Hunstock
2017-03-20 00:16:37 +01:00
committed by Marton Balint
parent 607bffbed2
commit b3a2adaac6
6 changed files with 28 additions and 11 deletions

View File

@@ -539,9 +539,10 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx)
goto error;
}
if (mode_num > 0) {
if (mode_num > 0 || cctx->format_code) {
if (ff_decklink_set_format(avctx, DIRECTION_IN, mode_num) < 0) {
av_log(avctx, AV_LOG_ERROR, "Could not set mode %d for %s\n", mode_num, fname);
av_log(avctx, AV_LOG_ERROR, "Could not set mode number %d or format code %s for %s\n",
mode_num, (cctx->format_code) ? cctx->format_code : "(unset)", fname);
ret = AVERROR(EIO);
goto error;
}