After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 608025 - [videorate] fails at upstream negotiation
[videorate] fails at upstream negotiation
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal major
: 0.10.27
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2010-01-25 12:31 UTC by Tim-Philipp Müller
Modified: 2010-02-22 20:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (1.83 KB, patch)
2010-01-27 18:10 UTC, Thiago Sousa Santos
committed Details | Review
videorate: tests: New unit test for upstream caps nego (3.62 KB, patch)
2010-02-19 21:26 UTC, Thiago Sousa Santos
none Details | Review
videorate: tests: Another test for caps nego (2.50 KB, patch)
2010-02-22 16:53 UTC, Thiago Sousa Santos
none Details | Review
videorate: tests: New unit tests for upstream caps nego (5.43 KB, patch)
2010-02-22 20:28 UTC, Thiago Sousa Santos
committed Details | Review

Description Tim-Philipp Müller 2010-01-25 12:31:23 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
Comment 1 Thiago Sousa Santos 2010-01-27 18:10:04 UTC
Created attachment 152435 [details] [review]
Patch

Will push after the freeze.
Comment 2 Tim-Philipp Müller 2010-01-27 18:43:24 UTC
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.
Comment 3 Thiago Sousa Santos 2010-01-27 18:49:27 UTC
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.
Comment 4 Thiago Sousa Santos 2010-02-12 20:37:19 UTC
Anyone else got some opinion?]
Comment 5 Thiago Sousa Santos 2010-02-19 21:26:27 UTC
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
Comment 6 Thiago Sousa Santos 2010-02-22 16:53:28 UTC
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.
Comment 7 Tim-Philipp Müller 2010-02-22 17:46:47 UTC
> 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 :)
Comment 8 Thiago Sousa Santos 2010-02-22 20:28:57 UTC
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
Comment 9 Thiago Sousa Santos 2010-02-22 20:39:29 UTC
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