take padding into account

This commit is contained in:
Wim Taymans 2012-03-14 19:52:52 +01:00
parent 9e1b76fb13
commit 11c077bfd1

View file

@ -292,7 +292,7 @@ gst_mpeg2dec_negotiate_pool (GstMpeg2dec * dec, GstCaps * caps,
{ {
GstQuery *query; GstQuery *query;
GstBufferPool *pool = NULL; GstBufferPool *pool = NULL;
guint size, min, max, prefix, alignment; guint size, min, max, prefix, padding, alignment;
GstStructure *config; GstStructure *config;
/* find a pool for the negotiated caps now */ /* find a pool for the negotiated caps now */
@ -302,7 +302,7 @@ gst_mpeg2dec_negotiate_pool (GstMpeg2dec * dec, GstCaps * caps,
GST_DEBUG_OBJECT (dec, "got downstream ALLOCATION hints"); GST_DEBUG_OBJECT (dec, "got downstream ALLOCATION hints");
/* we got configuration from our peer, parse them */ /* we got configuration from our peer, parse them */
gst_query_parse_allocation_params (query, &size, &min, &max, &prefix, gst_query_parse_allocation_params (query, &size, &min, &max, &prefix,
&alignment, &pool); &padding, &alignment, &pool);
size = MAX (size, info->size); size = MAX (size, info->size);
alignment |= 15; alignment |= 15;
} else { } else {
@ -310,12 +310,13 @@ gst_mpeg2dec_negotiate_pool (GstMpeg2dec * dec, GstCaps * caps,
size = info->size; size = info->size;
min = max = 0; min = max = 0;
prefix = 0; prefix = 0;
padding = 0;
alignment = 15; alignment = 15;
} }
GST_DEBUG_OBJECT (dec, GST_DEBUG_OBJECT (dec,
"size:%d, min:%d, max:%d, prefix:%d, alignment:%d, pool:%p", size, min, "size:%d, min:%d, max:%d, prefix:%d, padding:%d, alignment:%d, pool:%p",
max, prefix, alignment, pool); size, min, max, prefix, padding, alignment, pool);
if (pool == NULL) { if (pool == NULL) {
/* we did not get a pool, make one ourselves then */ /* we did not get a pool, make one ourselves then */
@ -327,7 +328,8 @@ gst_mpeg2dec_negotiate_pool (GstMpeg2dec * dec, GstCaps * caps,
dec->pool = pool; dec->pool = pool;
config = gst_buffer_pool_get_config (pool); config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set (config, caps, size, min, max, prefix, alignment); gst_buffer_pool_config_set (config, caps, size, min, max, prefix, padding,
alignment);
/* just set the option, if the pool can support it we will transparently use /* just set the option, if the pool can support it we will transparently use
* it through the video info API. We could also see if the pool support this * it through the video info API. We could also see if the pool support this
* option and only activate it then. */ * option and only activate it then. */