From: Julien Isorce Date: Fri, 31 Jan 2014 13:40:36 +0000 (+0000) Subject: videotestsrc: ensure having caps when setting the buffer pool config X-Git-Tag: 1.19.3~511^2~4731 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c9b493b853e2c28ad0090b063acf88ae97f080a6;p=platform%2Fupstream%2Fgstreamer.git videotestsrc: ensure having caps when setting the buffer pool config It happens if downstream does not propose a buffer pool. GST_DEBUG=2 gst-launch-1.0 videotestsrc ! fakesink https://bugzilla.gnome.org/show_bug.cgi?id=723271 --- diff --git a/gst/videotestsrc/gstvideotestsrc.c b/gst/videotestsrc/gstvideotestsrc.c index d82ce2d..b3dacbe 100644 --- a/gst/videotestsrc/gstvideotestsrc.c +++ b/gst/videotestsrc/gstvideotestsrc.c @@ -624,6 +624,7 @@ gst_video_test_src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query) gboolean update; guint size, min, max; GstStructure *config; + GstCaps *caps = NULL; videotestsrc = GST_VIDEO_TEST_SRC (bsrc); @@ -649,6 +650,11 @@ gst_video_test_src_decide_allocation (GstBaseSrc * bsrc, GstQuery * query) } config = gst_buffer_pool_get_config (pool); + + gst_query_parse_allocation (query, &caps, NULL); + if (caps) + gst_buffer_pool_config_set_params (config, caps, size, min, max); + if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL)) { gst_buffer_pool_config_add_option (config, GST_BUFFER_POOL_OPTION_VIDEO_META);