From: gb Date: Mon, 3 May 2010 15:29:18 +0000 (+0000) Subject: Use size information from the demuxer, whenever available. i.e. fix WMV3 decoding. X-Git-Tag: accepted/trunk/20120822.173359~467 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4285c2cc02825b5bf401837d418665bcef684343;p=profile%2Fivi%2Fgstreamer-vaapi.git Use size information from the demuxer, whenever available. i.e. fix WMV3 decoding. --- diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c b/gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c index 44e99da..c161d09 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_ffmpeg.c @@ -366,6 +366,10 @@ gst_vaapi_decoder_ffmpeg_open(GstVaapiDecoderFfmpeg *ffdecoder, GstBuffer *buffe } } + /* Use size information from the demuxer, whenever available */ + priv->avctx->coded_width = GST_VAAPI_DECODER_WIDTH(ffdecoder); + priv->avctx->coded_height = GST_VAAPI_DECODER_HEIGHT(ffdecoder); + GST_VAAPI_DISPLAY_LOCK(display); ret = avcodec_open(priv->avctx, ffcodec); GST_VAAPI_DISPLAY_UNLOCK(display); diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_priv.h b/gst-libs/gst/vaapi/gstvaapidecoder_priv.h index 183c499..2b30cf3 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_priv.h +++ b/gst-libs/gst/vaapi/gstvaapidecoder_priv.h @@ -76,6 +76,28 @@ G_BEGIN_DECLS #define GST_VAAPI_DECODER_CODEC_DATA(decoder) \ GST_VAAPI_DECODER_CAST(decoder)->priv->codec_data +/** + * GST_VAAPI_DECODER_WIDTH: + * @decoder: a #GstVaapiDecoder + * + * Macro that evaluates to the coded width of the picture + * This is an internal macro that does not do any run-time type check. + */ +#undef GST_VAAPI_DECODER_WIDTH +#define GST_VAAPI_DECODER_WIDTH(decoder) \ + GST_VAAPI_DECODER_CAST(decoder)->priv->width + +/** + * GST_VAAPI_DECODER_HEIGHT: + * @decoder: a #GstVaapiDecoder + * + * Macro that evaluates to the coded height of the picture + * This is an internal macro that does not do any run-time type check. + */ +#undef GST_VAAPI_DECODER_HEIGHT +#define GST_VAAPI_DECODER_HEIGHT(decoder) \ + GST_VAAPI_DECODER_CAST(decoder)->priv->height + /* End-of-Stream buffer */ #define GST_BUFFER_FLAG_EOS (GST_BUFFER_FLAG_LAST + 0)