GNOME Bugzilla – Bug 540645
caps are renegotiated a lot
Last modified: 2010-07-16 08:25:06 UTC
As a sequel to Bug 316248. Linking works, but getting to playing takes ages.
Example:
+ Trace 201619
Created attachment 113582 [details] test application I tried adding gst_tee_src_getcaps() to tee. Similar to what Wim did in Bug #316248 for adder. It does not show obvious improvement though :/ I also tried to keep a copy of the peercaps and taking shortcuts it they have not changed. Unfortunaly I still need to request them that for and thsi triggers the machinery ... I belive the main issue is that _getcaps() is called so many times: 5 x for tee:src0 8 x for tee:src1 I also wonder why gst_pad_proxy_getcaps runs 3 times for tee:sink.
Created attachment 113597 [details] test application I made the example a bit smaller. it now builds: src ! tee ! queue1 ! adder t. ! queue2 ! a.
I have added some loggin to adder/tee/queue and gst-utils::gst_pad_proxy_getcaps(). Based on that I can capture a log of the negotiation process. I wrote a perl script that parses the log and translates it to a format understood by a java-sequence chart generator. I also can easily grep for the number of _getcaps() calls. And this puzzles me - for the attached testapp, the number of getcaps() calls is 48, but sometimes its 144! I am attaching two images.
Comment on attachment 113582 [details] test application obsolete
Created attachment 113599 [details] seq chart for 48 getcaps calls
Created attachment 113603 [details] seq chart for 144 getcaps calls both sequences start the same and they only differ when the short one ends.
Created attachment 113612 [details] [review] cache _getcaps results for tee
Created attachment 113613 [details] [review] cache _getcaps results for adder
Created attachment 113615 [details] [review] cache _getcaps results for tee
Created attachment 113616 [details] [review] cache _getcaps results for tee
The idea is that getcaps always goes in one direction, I don't think proxy_getcaps does that correctly.
Created attachment 115680 [details] [review] cache _getcaps results for adder Update patch after formatting change. Only cache fixed caps.
Uploaded the wrong patch for tee. Will update the patch too and reupload.
Created attachment 115785 [details] [review] cache _getcaps results for tee Also here, only cache fixed caps.
Created attachment 116032 [details] [review] cache _getcaps results for adder fix double unlock
Created attachment 116084 [details] [review] cache _getcaps results for tee
In answer to comment #12. Thats not the problem here. FX1 - T < > A - FX2 Problem is that when T -> FX1 is negotiated, it negotiates FX1 -> A, then A -> FX2 and FX2 -> T and then it locks. We could explot some facts: * tee and adder need to have the same format for all request pads * if we have queried t.src to negotiate t.sink1 we can use the same to t.sink2 if t.src has not changed What does the patch change: * it caches caps to avoid calling _getcaps() * it does not merge caps for all request pads as they must be the same anyway
I works for my usecase, but as people have commented on irc, it breaks reverse negotiation. This is a testcase. Making the window of ximagesink smaller should make reverse negotiate with videtestsrc, so that the video files ximagesink and the video in xvimagesink should become coarse. gst-launch videotestsrc ! tee name=t ! queue ! xvimagesink t. ! queue ! ffmpegcolorspace ! ximagesink
Actually wims latest commit to core fixed it. So could we review this again? Date: Fri Oct 10 2008 15:27:52 UTC Log message: * gst/gstpad.c: (gst_pad_get_range), (gst_pad_pull_range): Revert a patch from 21 months ago that broke caps negotiation in pull mode. Basically, having a buffer pass over a pad will trigger the setcaps function when caps change, just like in push mode.
False alarm. I had the patch deactivated :(.
is this fixed with recent optimisations to caps negotiation?
Is this fixed with the recent fix to proxy_getcaps() ?
Stefan, could you comment on Wims question? TIA!
Reopening as I can't see any open non developer question.
I mark this as fixed: $ GST_DEBUG_NO_COLOR=1 GST_DEBUG="GST_PAD*:4" ./negotiate 2>debug.log $ grep "proxying getcaps" debug.log | wc -l 13 and the 13 is constant.