Only set the pix_fmt for rawvideo. Fixes ticket #9005.
Showing the changes to libavdevice/decklink_dec.cpp (1 of 1 file). Show all
Unified · Split
| @@ -1320,34 +1320,26 @@ av_cold int ff_decklink_read_header(AVFormatContext *avctx) · 1319 unmodified lines | |||
| 1320 | switch(ctx->raw_format) { | 1320 | switch(ctx->raw_format) { |
| 1321 | case bmdFormat8BitYUV: | 1321 | case bmdFormat8BitYUV: |
| 1322 | st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; | 1322 | st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; |
| 1323 | st->codecpar->codec_tag = MKTAG('U', 'Y', 'V', 'Y'); | ||
| 1324 | st->codecpar->format = AV_PIX_FMT_UYVY422; | 1323 | st->codecpar->format = AV_PIX_FMT_UYVY422; |
| 1325 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 16, st->time_base.den, st->time_base.num); | 1324 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 16, st->time_base.den, st->time_base.num); |
| 1326 | break; | 1325 | break; |
| 1327 | case bmdFormat10BitYUV: | 1326 | case bmdFormat10BitYUV: |
| 1328 | st->codecpar->codec_id = AV_CODEC_ID_V210; | 1327 | st->codecpar->codec_id = AV_CODEC_ID_V210; |
| 1329 | st->codecpar->codec_tag = MKTAG('V','2','1','0'); | ||
| 1330 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 64, st->time_base.den, st->time_base.num * 3); | 1328 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 64, st->time_base.den, st->time_base.num * 3); |
| 1331 | st->codecpar->bits_per_coded_sample = 10; | ||
| 1332 | break; | 1329 | break; |
| 1333 | case bmdFormat8BitARGB: | 1330 | case bmdFormat8BitARGB: |
| 1334 | st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; | 1331 | st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; |
| 1335 | st->codecpar->format = AV_PIX_FMT_0RGB; | 1332 | st->codecpar->format = AV_PIX_FMT_0RGB; |
| 1336 | st->codecpar->codec_tag = avcodec_pix_fmt_to_codec_tag((enum AVPixelFormat)st->codecpar->format); | ||
| 1337 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 32, st->time_base.den, st->time_base.num); | 1333 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 32, st->time_base.den, st->time_base.num); |
| 1338 | break; | 1334 | break; |
| 1339 | case bmdFormat8BitBGRA: | 1335 | case bmdFormat8BitBGRA: |
| 1340 | st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; | 1336 | st->codecpar->codec_id = AV_CODEC_ID_RAWVIDEO; |
| 1341 | st->codecpar->format = AV_PIX_FMT_BGR0; | 1337 | st->codecpar->format = AV_PIX_FMT_BGR0; |
| 1342 | st->codecpar->codec_tag = avcodec_pix_fmt_to_codec_tag((enum AVPixelFormat)st->codecpar->format); | ||
| 1343 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 32, st->time_base.den, st->time_base.num); | 1338 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 32, st->time_base.den, st->time_base.num); |
| 1344 | break; | 1339 | break; |
| 1345 | case bmdFormat10BitRGB: | 1340 | case bmdFormat10BitRGB: |
| 1346 | st->codecpar->codec_id = AV_CODEC_ID_R210; | 1341 | st->codecpar->codec_id = AV_CODEC_ID_R210; |
| 1347 | st->codecpar->codec_tag = MKTAG('R','2','1','0'); | ||
| 1348 | st->codecpar->format = AV_PIX_FMT_RGB48LE; | ||
| 1349 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 30, st->time_base.den, st->time_base.num); | 1342 | st->codecpar->bit_rate = av_rescale(ctx->bmd_width * ctx->bmd_height * 30, st->time_base.den, st->time_base.num); |
| 1350 | st->codecpar->bits_per_coded_sample = 10; | ||
| 1351 | break; | 1343 | break; |
| 1352 | default: | 1344 | default: |
| 1353 | char fourcc_str[AV_FOURCC_MAX_STRING_SIZE] = {0}; | 1345 | char fourcc_str[AV_FOURCC_MAX_STRING_SIZE] = {0}; |