1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

CrystalHD: Set aspect ratio.

Signed-off-by: sebist <sebok.istvan@gmail.com>
Reviewed-by: Philip Langdale <philipl@overt.org>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
sebist 2012-04-17 09:36:27 +02:00 committed by Michael Niedermayer
parent e128182afd
commit 7a3d2258a6

View File

@ -741,6 +741,56 @@ static inline CopyRet receive_frame(AVCodecContext *avctx,
av_log(avctx, AV_LOG_VERBOSE, "CrystalHD: Initial format change\n"); av_log(avctx, AV_LOG_VERBOSE, "CrystalHD: Initial format change\n");
avctx->width = output.PicInfo.width; avctx->width = output.PicInfo.width;
avctx->height = output.PicInfo.height; avctx->height = output.PicInfo.height;
switch ( output.PicInfo.aspect_ratio ) {
case vdecAspectRatioSquare:
avctx->sample_aspect_ratio = (AVRational) { 1, 1};
break;
case vdecAspectRatio12_11:
avctx->sample_aspect_ratio = (AVRational) { 12, 11};
break;
case vdecAspectRatio10_11:
avctx->sample_aspect_ratio = (AVRational) { 10, 11};
break;
case vdecAspectRatio16_11:
avctx->sample_aspect_ratio = (AVRational) { 16, 11};
break;
case vdecAspectRatio40_33:
avctx->sample_aspect_ratio = (AVRational) { 40, 33};
break;
case vdecAspectRatio24_11:
avctx->sample_aspect_ratio = (AVRational) { 24, 11};
break;
case vdecAspectRatio20_11:
avctx->sample_aspect_ratio = (AVRational) { 20, 11};
break;
case vdecAspectRatio32_11:
avctx->sample_aspect_ratio = (AVRational) { 32, 11};
break;
case vdecAspectRatio80_33:
avctx->sample_aspect_ratio = (AVRational) { 80, 33};
break;
case vdecAspectRatio18_11:
avctx->sample_aspect_ratio = (AVRational) { 18, 11};
break;
case vdecAspectRatio15_11:
avctx->sample_aspect_ratio = (AVRational) { 15, 11};
break;
case vdecAspectRatio64_33:
avctx->sample_aspect_ratio = (AVRational) { 64, 33};
break;
case vdecAspectRatio160_99:
avctx->sample_aspect_ratio = (AVRational) {160, 99};
break;
case vdecAspectRatio4_3:
avctx->sample_aspect_ratio = (AVRational) { 4, 3};
break;
case vdecAspectRatio16_9:
avctx->sample_aspect_ratio = (AVRational) { 16, 9};
break;
case vdecAspectRatio221_1:
avctx->sample_aspect_ratio = (AVRational) {221, 1};
break;
}
return RET_COPY_AGAIN; return RET_COPY_AGAIN;
} else if (ret == BC_STS_SUCCESS) { } else if (ret == BC_STS_SUCCESS) {
int copy_ret = -1; int copy_ret = -1;