@@ -164,6 +164,32 @@ FF_ENABLE_DEPRECATION_WARNINGS
param.sSpatialLayers[0].iSpatialBitrate = param.iTargetBitrate;
param.sSpatialLayers[0].iMaxSpatialBitrate = param.iMaxBitrate;
+ #if OPENH264_VER_AT_LEAST(1, 7)
+ if(avctx->sample_aspect_ratio.num == 0 ||
avctx->sample_aspect_ratio.den == 0)
+ param.sSpatialLayers[0].bAspectRatioPresent = false;
+ else {
+ param.sSpatialLayers[0].bAspectRatioPresent = true;
+ if (!av_cmp_q(av_make_q( 1, 1),
avctx->sample_aspect_ratio)) param.sSpatialLayers[0].eAspectRatio =
ASP_1x1;
+ else if (!av_cmp_q(av_make_q(12, 11),
avctx->sample_aspect_ratio)) param.sSpatialLayers[0].eAspectRatio =
ASP_12x11;
+ else if (!av_cmp_q(av_make_q(10, 11),
avctx->sample_aspect_ratio)) param.sSpatialLayers[0].eAspectRatio =
ASP_10x11;
+ else if (!av_cmp_q(av_make_q(16, 11),
avctx->sample_aspect_ratio)) param.sSpatialLayers[0].eAspectRatio =
ASP_16x11;
+ else if (!av_cmp_q(av_make_q(40, 33),
avctx->sample_aspect_ratio)) param.sSpatialLayers[0].eAspectRatio =
ASP_40x33;
+ else if (!av_cmp_q(av_make_q(24, 11),
avctx->sample_aspect_ratio)) param.sSpatialLayers[0].eAspectRatio =
ASP_24x11;
+ else if (!av_cmp_q(av_make_q(20, 11),
avctx->sample_aspect_ratio)) param.sSpatialLayers[0].eAspectRatio =
ASP_20x11;
+ else if (!av_cmp_q(av_make_q(32, 11),
avctx->sample_aspect_ratio)) param.sSpatialLayers[0].eAspectRatio =