ffdec: fix for ALLOCATION query API changes

This commit is contained in:
Wim Taymans 2011-05-02 11:12:10 +02:00
parent c71a2ec502
commit 8860e5c6c9

View file

@ -1176,7 +1176,7 @@ gst_ffmpegdec_bufferpool (GstFFMpegDec * ffmpegdec, GstCaps * caps)
{ {
GstQuery *query; GstQuery *query;
GstBufferPool *pool = NULL; GstBufferPool *pool = NULL;
guint alignment, prefix, size; guint size, min, max, prefix, alignment;
GstStructure *config; GstStructure *config;
/* find a pool for the negotiated caps now */ /* find a pool for the negotiated caps now */
@ -1184,13 +1184,14 @@ gst_ffmpegdec_bufferpool (GstFFMpegDec * ffmpegdec, GstCaps * caps)
if (gst_pad_peer_query (ffmpegdec->srcpad, query)) { if (gst_pad_peer_query (ffmpegdec->srcpad, query)) {
/* we got configuration from our peer, parse them */ /* we got configuration from our peer, parse them */
gst_query_parse_allocation_params (query, &alignment, &prefix, &size, gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
&pool); &alignment, &pool);
} else { } else {
alignment = 16;
prefix = 0;
size = gst_ffmpeg_avpicture_get_size (ffmpegdec->context->pix_fmt, size = gst_ffmpeg_avpicture_get_size (ffmpegdec->context->pix_fmt,
ffmpegdec->context->width, ffmpegdec->context->height); ffmpegdec->context->width, ffmpegdec->context->height);
min = max = 0;
prefix = 0;
alignment = 16;
} }
if (pool == NULL) { if (pool == NULL) {
@ -1199,7 +1200,7 @@ gst_ffmpegdec_bufferpool (GstFFMpegDec * ffmpegdec, GstCaps * caps)
} }
config = gst_buffer_pool_get_config (pool); config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set (config, caps, size, 0, 0, prefix, 0, gst_buffer_pool_config_set (config, caps, size, min, max, prefix, 0,
MAX (alignment, 16)); MAX (alignment, 16));
gst_buffer_pool_set_config (pool, config); gst_buffer_pool_set_config (pool, config);