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 703800 - playbin: We always request stream combiner pad sink_%u, even if another pad would be better
playbin: We always request stream combiner pad sink_%u, even if another pad w...
Status: RESOLVED NOTABUG
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-07-08 16:14 UTC by Brendan Long
Modified: 2013-07-16 06:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to use `gst_element_get_compatible_pad` instead of `gst_element_get_request_pad` (1.03 KB, patch)
2013-07-08 16:14 UTC, Brendan Long
none Details | Review
Use gst_element_request_pads (1.83 KB, patch)
2013-07-09 16:26 UTC, Brendan Long
rejected Details | Review

Description Brendan Long 2013-07-08 16:14:18 UTC
Created attachment 248622 [details] [review]
Patch to use `gst_element_get_compatible_pad` instead of `gst_element_get_request_pad`

I have a situation where my stream combiner element has multiple kinds of request pads, but playbin only uses the ones named "sink_%u", even if the caps aren't compatible. This patch makes playbin request a compatible pad using the caps.

I'm not sure if my reason for doing this is actually a good idea, but I think this makes playbin better anyway.

Backwards compatibility: Since input-selector only has one kind of request pad, with ANY caps, this doesn't change behaviour in the default case.
Comment 1 Sebastian Dröge (slomo) 2013-07-09 07:21:30 UTC
This will also use unlinked existing pads. I think it's better to iterate over all request sink pad templates of the combiner and then explicitly request a pad for the first template that is matching. Otherwise you might get a non-request pad and try to release that later (which will fail).


Out of curiosity, what exactly is your custom stream combiner doing? Why does it have different request pad templates?
Comment 2 Brendan Long 2013-07-09 15:12:02 UTC
(In reply to comment #1)
> Out of curiosity, what exactly is your custom stream combiner doing? Why does
> it have different request pad templates?

My stream combiner is a bin with a funnel. If you request a text/vtt pad, it just connects to the funnel. If you request a text/x-raw pad, it creates a webvttenc, then connects that to the funnel. I could probably do it with caps events, but I think it would be more complicated.
Comment 3 Olivier Crête 2013-07-09 15:29:57 UTC
If you want to do it with the caps event, you can just put a autoconvert with identity & webvttenc.
Comment 4 Sebastian Dröge (slomo) 2013-07-09 15:32:16 UTC
That sounds like something that should indeed be done with the CAPS event like everywhere else :)
Comment 5 Brendan Long 2013-07-09 16:05:06 UTC
(In reply to comment #3)
> If you want to do it with the caps event, you can just put a autoconvert with
> identity & webvttenc.

Ah, sounds like another case of me not knowing about standard elements.. I feel like I need to order a GStreamer dictionary.
Comment 6 Brendan Long 2013-07-09 16:26:20 UTC
Created attachment 248747 [details] [review]
Use gst_element_request_pads

Here's this if you want it. I still think it's a good idea for playbin to not care what the pads are named, even though I won't actually be using this.
Comment 7 Brendan Long 2013-07-09 17:38:10 UTC
(In reply to comment #3)
> If you want to do it with the caps event, you can just put a autoconvert with
> identity & webvttenc.

I'm trying to use this, and autoconvert hooks up the webvttenc at first (because it matches caps ANY), and then the link fails with no attempt to try the identity element.
Comment 8 Sebastian Dröge (slomo) 2013-07-10 07:16:36 UTC
(In reply to comment #7)
> (In reply to comment #3)
> > If you want to do it with the caps event, you can just put a autoconvert with
> > identity & webvttenc.
> 
> I'm trying to use this, and autoconvert hooks up the webvttenc at first
> (because it matches caps ANY), and then the link fails with no attempt to try
> the identity element.

Can you create a separate bug for that? Also it might be an option to just not use autoconvert for this simple scenario and just do the linking yourself based on the CAPS event.
Comment 9 Sebastian Dröge (slomo) 2013-07-10 07:19:25 UTC
(In reply to comment #6)
> Created an attachment (id=248747) [details] [review]
> Use gst_element_request_pads
> 
> Here's this if you want it. I still think it's a good idea for playbin to not
> care what the pads are named, even though I won't actually be using this.

I'm not so sure about it, it might be better to enforce a stricter interface to the stream combiners to make sure people try to understand the expected behaviour instead of just putting random elements there.

We have the same for sinks for example, where a pad with the name "sink" is required.
Comment 10 Brendan Long 2013-07-15 22:08:40 UTC
(In reply to comment #9)
> I'm not so sure about it, it might be better to enforce a stricter interface to
> the stream combiners to make sure people try to understand the expected
> behaviour instead of just putting random elements there.
> 
> We have the same for sinks for example, where a pad with the name "sink" is
> required.

It seems useful to be able to drop-in elements that weren't specifically designed for this. It's not difficult to throw an element in a bin and setup some ghostpads, but it seems worthwhile to simplify it in playbin.

If you're not interested, feel free to close this as invalid though. I don't really have a strong opinion about it anymore.
Comment 11 Sebastian Dröge (slomo) 2013-07-16 06:54:04 UTC
Ok, let's close it then.