GNOME Bugzilla – Bug 608025
[videorate] fails at upstream negotiation
Last modified: 2010-02-22 20:39:56 UTC
It looks like videorate doesn't pass on downstream framerate preferences correctly for upstream negotiation - I suspect it just takes downstream caps and replaces the framerate field with [0/1; MAX/1] instead of appending the ANY-FRAMERATE caps to the downstream caps when passing them upstream. $ gst-launch-0.10 -v videotestsrc num-buffers=1 ! identity ! videorate ! video/x-raw-yuv,framerate=10/1 ! fakesink videotestsrc0.src: caps = video/x-raw-yuv,framerate=(fraction)30/1, ... identity0: last-message = "chain ******* (identity0:sink)i (153600 bytes, timestamp: 0:00:00.000000000, duration: 0:00:00.033333333" videorate0.sink: caps = video/x-raw-yuv, framerate=(fraction)10/1, ... videorate0.src: caps = video/x-raw-yuv, framerate=(fraction)10/1, ... videorate0.sink: caps = video/x-raw-yuv, framerate=(fraction)30/1, ... fakesink0.sink: caps = video/x-raw-yuv, framerate=(fraction)10/1, ... fakesink0: last-message = "chain ******* < (153600 bytes, timestamp: 0:00:00.000000000, duration: 0:00:00.100000000
Created attachment 152435 [details] [review] Patch Will push after the freeze.
Right, so you're appending the new any-framerate caps now instead of interleaving them, right? So if the input is video/x-raw-yuv,framerate=10; video/x-raw-rgb,framerate=10 your output is video/x-raw-yuv,framerate=10; video/x-raw-rgb,framerate=10; \ video/x-raw-yuv,framerate=[0-MAX]; video/x-raw-rgb,framerate=[0-MAX] and not video/x-raw-yuv,framerate=10; video/x-raw-yuv,framerate=[0-MAX]; \ video/x-raw-rgb,framerate=10; video/x-raw-rgb,framerate=[0-MAX] Not entirely sure what's best - but originally I thought the second was preferable.
Yes, I notice that and did that intentionally, and I'm also not sure what's best here. I assume that passthrough is the best option, so I list the preferred formats first, and then the other ones that might require some work from videorate. But one might argue that if downstream listed 'yuv' first instead of 'rgb', it might prefer receiving 'yuv' than 'rgb' and videorate should do its best to accomplish this.
Anyone else got some opinion?]
Created attachment 154249 [details] [review] videorate: tests: New unit test for upstream caps nego Adds a unit test that checks videorate's sink pad caps when src pad is linked downstream. The caps must match downstream caps and have a proper structure order (downstream preferred comes first) Fixes #608025
Created attachment 154411 [details] [review] videorate: tests: Another test for caps nego Another test (applies on top of the other one) that checks if the passthrough caps is selected for videorate's sinkpad.
> Created an attachment (id=154411) [details] [review] > videorate: tests: Another test for caps nego > > Another test (applies on top of the other one) that > checks if the passthrough caps is selected for > videorate's sinkpad. This is not really a good test, since the capsfilter downstream of videorate has a framerate of 25, which may well be what videotestrate would fixate to anyway by default. You should have a framerate downstream that videotestsrc is unlikely to use unless specifically requested, e.g. 42/1 or 999/7 or whatever :)
Created attachment 154439 [details] [review] videorate: tests: New unit tests for upstream caps nego squashed the 2 tests patches into one and used an unusual framerate as Tim has suggested
Pushed, as agreed on IRC. Module: gst-plugins-base Branch: master Commit: 616f130d0513619710e0933647ceb2e1a5f82a13 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=616f130d0513619710e0933647ceb2e1a5f82a13 Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Wed Jan 27 15:07:47 2010 -0300 videorate: Improve upstream negotiation Put peer pad caps preferred framerates first, indicating they are videorate's first choices, removing an unnecessary conversion. Fixes #608025 Module: gst-plugins-base Branch: master Commit: e5f96a7a191ec903d421da42fcb24f86d84ae040 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=e5f96a7a191ec903d421da42fcb24f86d84ae040 Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Fri Feb 19 18:24:40 2010 -0300 videorate: tests: New unit tests for upstream caps nego Adds unit tests that check videorate's upstream caps negotiation works properly (put passthrough caps first) Fixes #608025