GNOME Bugzilla – Bug 728268
Need a way to detect that pool haven't changed, is active, and does not need to be renegotiated
Last modified: 2014-07-25 17:48:45 UTC
Currently base classes blindly call decide_allocation() whenever a reconfigure event is triggered. It assumed that pools found in the query and selected by the element are not active. In most cases, the second query endup with the same pool (which is active, hence configuration cannot be changed) and settings are still compatible. This issue can be triggered with pipelines like this one (VideoDecoder): GST_DEBUG=3 gst-launch-1.0 videotestsrc ! jpegenc ! decodebin ! xvimagesink Trace: bufferpool gstbufferpool.c:632:gst_buffer_pool_set_config:<xvimagebufferpool0> can't change config, we are active And this one (BaseSrc): bufferpool gstbufferpool.c:632:gst_buffer_pool_set_config:<xvimagebufferpool0> can't change config, we are active I'm not fully certain what is right and what is wrong in current implementation. It seems that most active pool detection is required, that some helper to detect "compatible" config would be nice. I also have the impression that setting the config should be done once, most likely by the base class, but that I'm not so clear, since there is no way to tell the base class we want to enabled certain options. Finally, for decoders, it's not always possible to switch pool right away. Buffers from the pool could be used as the decoder observation, so releasing them at any moment could break the image. Instead, the renegotiation should be handled asynchronously. Waiting for a sync point, draining, stopping the pool, and then operating the allocation query. We need a way to tell the base class about that, and implement an asynchronous mechanism for it. This not exactly a plan, so input would be appreciated.
*** Bug 727765 has been marked as a duplicate of this bug. ***
Created attachment 276031 [details] [review] [PATCH] value: Add support for GObject comparising in structures This is useful to allow comparing pool configuration where a GstAllocator is set. https://bugzilla.gnome.org/show_bug.cgi?id=728268 --- gst/gstvalue.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+)
Created attachment 276032 [details] [review] [PATCH] test: Comparision of GObject (by pointer) https://bugzilla.gnome.org/show_bug.cgi?id=728268 --- tests/check/gst/gstvalue.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
Created attachment 276033 [details] [review] [PATCH] value: Add support for GstAllocationParams comparision This is useful to compare buffer pool configuaration. https://bugzilla.gnome.org/show_bug.cgi?id=728268 --- gst/gstvalue.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+)
Created attachment 276034 [details] [review] [PATCH] test: Comparision of GAllocationParams https://bugzilla.gnome.org/show_bug.cgi?id=728268 --- tests/check/gst/gstvalue.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Created attachment 276035 [details] [review] [PATCH] bufferpool: Add support for reconfiguring a pool If a pool config is being configured again, check if the configuration have changed. If not, skip that step. Finally, if the pool is active, try deactivating it. https://bugzilla.gnome.org/show_bug.cgi?id=728268 --- gst/gstbufferpool.c | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-)
Created attachment 276036 [details] [review] [PATCH] test: Test buffer pool activation and configuration https://bugzilla.gnome.org/show_bug.cgi?id=728268 --- tests/check/gst/gstbufferpool.c | 51 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-)
I've sqashed the code and their unit tests. commit 6079666a71ab098151207a0564946e433fa7838b Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> Date: Tue May 6 15:35:14 2014 -0400 bufferpool: Add support for reconfiguring a pool If a pool config is being configured again, check if the configuration have changed. If not, skip that step. Finally, if the pool is active, try deactivating it. https://bugzilla.gnome.org/show_bug.cgi?id=728268 commit 64aa64cb80a404c49bb5d123c06610b9509d6ead Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> Date: Tue May 6 16:59:34 2014 -0400 value: Add support for GstAllocationParams comparision This is useful to compare buffer pool configuaration. https://bugzilla.gnome.org/show_bug.cgi?id=728268 commit 00614e2c2b3882604d7715908a3b43230a2607aa Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> Date: Tue May 6 16:46:55 2014 -0400 value: Add support for GObject comparising in structures This is useful to allow comparing pool configuration where a GstAllocator is set. https://bugzilla.gnome.org/show_bug.cgi?id=728268
Just had one more cleanup left in my branch, related but not major. commit e196906b993285f3405690f6240f5dcd491ae9ea Author: Nicolas Dufresne <nicolas.dufresne@collabora.co.uk> Date: Sat May 24 19:02:59 2014 -0400 v4l2object: Remove is_active checks These checks are no longer required with recent change to the bufferpool. This should allow changing the configuartion, hence the way forward renegotiation support. https://bugzilla.gnome.org/show_bug.cgi?id=728268