GNOME Bugzilla – Bug 723271
videotestsrc: fix a warning if downstream does not propose a buffer pool
Last modified: 2014-01-31 14:12:39 UTC
Created attachment 267620 [details] [review] videotestsrc: ensure having caps when setting the buffer pool config * step to reproduce: GST_DEBUG=2 gst-launch-1.0 videotestsrc ! fakesink * actual result: 0:00:00.087664559 7697 0x14f8630 WARN default gstvideopool.c:171:video_buffer_pool_set_config:<videobufferpool0> no caps in config
Review of attachment 267620 [details] [review]: ::: gst/videotestsrc/gstvideotestsrc.c @@ -651,1 +652,5 @@ 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); How about moving this inside the if(pool == NULL) condition? AFAIU if the pool was created downstream it should already contain some configuration parameters, including the caps.
(In reply to comment #1) > Review of attachment 267620 [details] [review]: > > ::: gst/videotestsrc/gstvideotestsrc.c > @@ -651,1 +652,5 @@ > 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); > > How about moving this inside the if(pool == NULL) condition? > > AFAIU if the pool was created downstream it should already contain some > configuration parameters, including the caps. Hi Thiago, thx for your point of view. Actually I thought about it but I think the downstream can also forget to do it. Hi Sebastian, you have accepted the commit but maybe you missed #1 comment ? Let me know and then I can push it.
Please push it, I don't think you can assume that downstream configures the caps or anything else on the buffer. Especially some configuration can't be done by downstream in every case.
Comment on attachment 267620 [details] [review] videotestsrc: ensure having caps when setting the buffer pool config commit c9b493b853e2c28ad0090b063acf88ae97f080a6 Author: Julien Isorce <julien.isorce@collabora.co.uk> Date: Fri Jan 31 13:40:36 2014 +0000 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