Setting Playbin's default sink

Tim-Philipp Müller t.i.m at zen.co.uk
Thu Aug 2 09:26:32 PDT 2012


On Thu, 2012-08-02 at 17:42 +0200, Hamza Chouh wrote:

Hi,

> I'm trying to stream media on a specific platform which does not (for
> the moment) have an alsa, jack or oss sink. I want playbin to stream
> on a specific sink that I partially wrote and which works correctly
> when I use gst-launch.
> How can I specify it to playbin ?

I would recommend you use playbin2 instead of playbin.

Use the "audio-sink" property and set your element as that:

  GstElement *mysink;
  mysink = gst_element_factory_make ("mysink", NULL);
  g_object_set (playbin, "audio-sink", mysink, NULL);


With gst-launch you can do this *if* your version of GStreamer core is
sufficiently recent:

  gst-launch-0.10 playbin2 uri=file:///path/to/foo.mp3 audio-sink=mysink

Cheers
 -Tim



More information about the gstreamer-devel mailing list