Best way to use typefind in a custom player
Paul d'AUBIGNY
visechelle at gmail.com
Tue Dec 11 13:14:16 PST 2012
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.
You can add a handler to the typefound signal using g_signal_connect ().
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.
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.
Cheers,
Paul
2012/12/11 gimmeamilk <gimmeamilkbttf at gmail.com>
> Hi,
>
> I'm making a simple player that can detect and play a few container and
> codec types. Decodebin etc is a little heavyweight for my needs for the
> time
> being, so I want to make my own autoplugger using typefind. I have a small
> look-up table of caps strings and suitable elements for both the containers
> and the codecs, eg
>
> containers[] = {
> { "video/quicktime", {"qtdemux",NULL} },
> ...
>
> codecs[] = {
> { "video/h264", {"queue","h264parse","mysinkplugin",NULL },
>
> ..etc
>
> What's the best method to construct the final pipeline? I've been following
> the typefind example, and can detect the container using a
> source!typefind!fakesink pipeline and my look-up table, but how do I then
> "remove" the typefind/sink from the pipeline and insert the demuxer without
> losing any stream data? (I assume if I unlink and remove the typefind
> element, any stream data it had pulled during the typefinding will be
> lost?)
>
>
>
>
>
>
> --
> View this message in context:
> http://gstreamer-devel.966125.n4.nabble.com/Best-way-to-use-typefind-in-a-custom-player-tp4657367.html
> Sent from the GStreamer-devel mailing list archive at Nabble.com.
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/gstreamer-devel/attachments/20121211/fe6a7f12/attachment.html>
More information about the gstreamer-devel
mailing list