[gst-devel] dynamic pipeline

Cameron Gorrie sastraxi at gmail.com
Wed Nov 26 04:52:29 CET 2008


2008/11/25 Hayden Andrews <hayden at heydan.co.uk>:
>  Hi ya :)
>
> Sorry, probably a very 'beginner' question ...
>
> I have a filesrc and a decodebin, and am using a callback on the
> new-decoded-pad signal to create elements for the audio or/and video
> streams, should either appear.
>
>  From the video pad, I want to setup different filters depending on the
> actual caps of the data. I can get the ?template? caps of the pad, but
> when I guessed that I need to get the negotiated caps (am I correct?) it
> returns NULL as there is not yet any data.
>
> What is the best/standard way of finding the caps of the actual data
> that flows through that pad so as to add in the correct filters asap?
>
> I just tried: when the pad is created, I simply placed a callback on it
> for when data flows. And then in the callback create the required
> elements, but, the callback is never called, although the stream plays.
> I guess that the 'have-data' signal only fires if the pad is linked?
> Would I temporarily link it to a fakesink, wait for data to see what the
> actual caps are, and then rewrite the pipeline? I'm guessing wildly :)
> Any pointers would be much appreciated! I'm sure that this scenario is
> quite normal.
>
> Many thanks,
>
>
> Hayden

I had this same problem, too. I can point you to how I eventually did
it but this does
require you to put it into PLAYING mode... I do want to find a way to
do this cleaner,
as I'm thinking this might actually *decode* more data than is
necessary figure out the
"fixed raw caps".

Here is a pastebin thing with the code:
http://pastebin.ca/1267200

OH! I just remembered, I had a discussion on #gstreamer with someone
(I can't remember
whom, sorry!) that said this may be a bug in decodebin2. Right,
Hayden, that's the other
thing, you should use a decodebin2 as it is the one that is supposed
to give fixed caps
even when it's not fully hitched up in the pipeline.

I hope you can find a more ideal way, or if someone more experienced
can tell us a
better way. This code still has a problem with sometimes not issuing
the pipeline PLAYING
state change, so sometimes the code just never finishes. If anyone has
an idea how to
fix this problem, it would be very, very helpful.

So there's my rambling done; I hope it helps.
Cameron




More information about the gstreamer-devel mailing list