take padding into account

This commit is contained in:
Wim Taymans 2012-03-14 19:52:31 +01:00
parent 0a8a8aac52
commit 9f700cc3c4
2 changed files with 11 additions and 8 deletions

View file

@ -313,8 +313,8 @@ gst_base_video_decoder_setcaps (GstBaseVideoDecoder * base_video_decoder,
} }
if (ret) { if (ret) {
gst_buffer_replace (&GST_BASE_VIDEO_CODEC (base_video_decoder)->state. gst_buffer_replace (&GST_BASE_VIDEO_CODEC (base_video_decoder)->
codec_data, NULL); state.codec_data, NULL);
gst_caps_replace (&GST_BASE_VIDEO_CODEC (base_video_decoder)->state.caps, gst_caps_replace (&GST_BASE_VIDEO_CODEC (base_video_decoder)->state.caps,
NULL); NULL);
GST_BASE_VIDEO_CODEC (base_video_decoder)->state = state; GST_BASE_VIDEO_CODEC (base_video_decoder)->state = state;
@ -1992,7 +1992,7 @@ gst_base_video_decoder_set_src_caps (GstBaseVideoDecoder * base_video_decoder)
GstQuery *query; GstQuery *query;
GstBufferPool *pool = NULL; GstBufferPool *pool = NULL;
GstStructure *config; GstStructure *config;
guint size, min, max, prefix, alignment; guint size, min, max, prefix, padding, alignment;
gboolean ret; gboolean ret;
/* minimum sense */ /* minimum sense */
@ -2045,13 +2045,14 @@ gst_base_video_decoder_set_src_caps (GstBaseVideoDecoder * base_video_decoder)
GST_DEBUG_OBJECT (codec, "got downstream ALLOCATION hints"); GST_DEBUG_OBJECT (codec, "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);
} else { } else {
GST_DEBUG_OBJECT (codec, "didn't get downstream ALLOCATION hints"); GST_DEBUG_OBJECT (codec, "didn't get downstream ALLOCATION hints");
size = info->size; size = info->size;
min = max = 0; min = max = 0;
prefix = 0; prefix = 0;
padding = 0;
alignment = 0; alignment = 0;
} }
@ -2065,7 +2066,8 @@ gst_base_video_decoder_set_src_caps (GstBaseVideoDecoder * base_video_decoder)
base_video_decoder->pool = pool; base_video_decoder->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);
state->bytes_per_picture = size; state->bytes_per_picture = size;
/* 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

View file

@ -669,7 +669,7 @@ gst_base_audio_visualizer_src_negotiate (GstBaseAudioVisualizer * scope)
GstCaps *templ; GstCaps *templ;
GstQuery *query; GstQuery *query;
GstBufferPool *pool = NULL; GstBufferPool *pool = NULL;
guint size, min, max, prefix, alignment; guint size, min, max, prefix, padding, alignment;
templ = gst_pad_get_pad_template_caps (scope->srcpad); templ = gst_pad_get_pad_template_caps (scope->srcpad);
@ -708,11 +708,12 @@ gst_base_audio_visualizer_src_negotiate (GstBaseAudioVisualizer * scope)
if (gst_pad_peer_query (scope->srcpad, query)) { if (gst_pad_peer_query (scope->srcpad, query)) {
/* 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);
} else { } else {
size = scope->bpf; size = scope->bpf;
min = max = 0; min = max = 0;
prefix = 0; prefix = 0;
padding = 0;
alignment = 0; alignment = 0;
} }
@ -724,7 +725,7 @@ gst_base_audio_visualizer_src_negotiate (GstBaseAudioVisualizer * scope)
config = gst_buffer_pool_get_config (pool); config = gst_buffer_pool_get_config (pool);
gst_buffer_pool_config_set (config, target, size, min, max, prefix, gst_buffer_pool_config_set (config, target, size, min, max, prefix,
alignment); padding, alignment);
gst_buffer_pool_set_config (pool, config); gst_buffer_pool_set_config (pool, config);
} }