[gst-devel] sink element with multiple sink pads

Edward Hervey bilboed at gmail.com
Fri Dec 19 21:24:08 CET 2008

On Mon, 2008-12-08 at 22:23 -0800, Gregory McGarry wrote:
> I'm working on a plugin which wraps a library.  The library requires
>  roughly synchronised audio and/or video frames.

  Using GstBaseSink is definitely a must-have to have synchronized
rendering (across several sinks).

> Since GstBaseSink only has one sink pad, I need to develop my own sink class.
> What is the best way to handle this problem?  Here are the approaches I have tried:

> 3) element derived from GstBin which contains audio and video sink elements

  I'd say this one is definitely the fastest to implement, and you won't
have to worry about all the 'smartness' (locking, threading,
synchronization, message emission, seek handling, ...) that GstBaseSink
provides if you implement your individual-stream sinks with it.

> - how to create internal elements without registering with factory?

  Just... create them and use them, you're the bin, you control what you
put in it. Provided the objects you're adding to the pipeline are
GstElement subclasses you can use them in the pipeline. You don't need
to register elements in order to use them in a pipeline.
gst_bin_add(g_object_new(MY_TYPE_ELEMENT), ...);

> - difficulty aggregating streams info to initialise library

  Since your individual elements are custom, you can access whatever
methods/functions/properties those elements provide from your bin, and
vice-versa. You can then splitup the single-stream-specific library
calls in the individual sinks, and the global library calls in your bin.
  If you mean that you're not sure when there will be no more extra
streams connected... that problem will be the same whatever technique
you use.

> - overly complicated

  Definitely the simplest if you don't know gstreamer inside out.

> Does a sink element exist which has multiple sink pads?  I couldn't find one.

  Not to my knowledge.

> Thanks for any advice.
>       Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now http://au.docs.yahoo.com/homepageset/?p1=other&p2=au&p3=tagline
> ------------------------------------------------------------------------------
> SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
> The future of the web can't happen without you.  Join us at MIX09 to help
> pave the way to the Next Web now. Learn more and register at
> http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gstreamer-devel

More information about the gstreamer-devel mailing list