h264: use pixel-aspect-ratio from SPS header.

Propagate pixel-aspect-ratio determined by the GStreamer codecparser
from the sequence headers.

Signed-off-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
Simon Farnsworth 2012-09-27 18:05:46 +01:00 committed by Gwenole Beauchesne
parent 3f430b32a4
commit fa87396905

View file

@ -689,6 +689,7 @@ end:
static GstVaapiDecoderStatus static GstVaapiDecoderStatus
decode_sps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu) decode_sps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu)
{ {
GstVaapiDecoder * const base_decoder = GST_VAAPI_DECODER(decoder);
GstVaapiDecoderH264Private * const priv = decoder->priv; GstVaapiDecoderH264Private * const priv = decoder->priv;
GstH264SPS * const sps = &priv->last_sps; GstH264SPS * const sps = &priv->last_sps;
GstH264ParserResult result; GstH264ParserResult result;
@ -703,6 +704,11 @@ decode_sps(GstVaapiDecoderH264 *decoder, GstH264NalUnit *nalu)
if (result != GST_H264_PARSER_OK) if (result != GST_H264_PARSER_OK)
return get_status(result); return get_status(result);
gst_vaapi_decoder_set_pixel_aspect_ratio(
base_decoder,
sps->vui_parameters.par_n,
sps->vui_parameters.par_d
);
return ensure_context(decoder, sps); return ensure_context(decoder, sps);
} }