Typefind element generates signals, one is typefound when a type has been found. So let's imagine you connected the upstream elements to typefind sink pad but didn't connect its src pad yet as you don't know which demuxer to use, when receiving the typefound signal, it will call your callback function where you can update your pipeline: add the selected demuxer and linked the remaining elements which were not linked before.<div>
You can add a handler to the typefound signal using g_signal_connect ().</div><div>Furthermore, you don't need to remove typefind element, just connect its source pad to the demuxer sink pad and data will just pass through and you'll not loose anything.</div>
<div>For your information, you were speaking about decodebin being a bit heavyweight  but if you just want to use it to select a demuxer or a parser or whatever, you can use the property caps where you'll specify what kind of caps you want on decodebin src pad.</div>
<div><br></div><div>Cheers,</div><div><br></div><div><br></div><div>Paul</div><div><br><br><div class="gmail_quote">2012/12/11 gimmeamilk <span dir="ltr"><<a href="mailto:gimmeamilkbttf@gmail.com" target="_blank">gimmeamilkbttf@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm making a simple player that can detect and play a few container and<br>
codec types. Decodebin etc is a little heavyweight for my needs for the time<br>
being, so I want to make my own autoplugger using typefind. I have a small<br>
look-up table of caps strings and suitable elements for both the containers<br>
and the codecs, eg<br>
<br>
containers[] = {<br>
{ "video/quicktime", {"qtdemux",NULL} },<br>
...<br>
<br>
codecs[] = {<br>
{ "video/h264", {"queue","h264parse","mysinkplugin",NULL },<br>
<br>
..etc<br>
<br>
What's the best method to construct the final pipeline? I've been following<br>
the typefind example, and can detect the container using a<br>
source!typefind!fakesink pipeline and my look-up table, but how do I then<br>
"remove" the typefind/sink from the pipeline and insert the demuxer without<br>
losing any stream data? (I assume if I unlink and remove the typefind<br>
element, any stream data it had pulled during the typefinding will be lost?)<br>
<br>
<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://gstreamer-devel.966125.n4.nabble.com/Best-way-to-use-typefind-in-a-custom-player-tp4657367.html" target="_blank">http://gstreamer-devel.966125.n4.nabble.com/Best-way-to-use-typefind-in-a-custom-player-tp4657367.html</a><br>

Sent from the GStreamer-devel mailing list archive at Nabble.com.<br>
_______________________________________________<br>
gstreamer-devel mailing list<br>
<a href="mailto:gstreamer-devel@lists.freedesktop.org">gstreamer-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel</a><br>
</blockquote></div><br></div>