how to read/write property of alsasink from application

Tim-Philipp Müller t.i.m at zen.co.uk
Sat Jan 19 11:08:56 PST 2013


On Sun, 2013-01-20 at 00:13 +0800, Soho Soho123 wrote:

Hi,
> 
> If my application uses the pipe like "gst-launch-0.10 playbin url=.....", then

You should use playbin2 uri=... really, not the old playbin.


> is there any method that I can read/write property of alsasink from
> main of application?
>  Does someone have idea?
> Because I have to tell alsa to do someting while audio playback!

The easiest way would be to create the alsasink yourself using

 GstElement *alsasink = gst_element_factory_make ("alsasink", NULL);

and then set it on playbin (=the pipeline) with

g_object_set (playbin, "audio-sink", alsasink, NULL);

Then you can keep the alsasink pointer around and use

  g_object_set (alsasink, "property-name", value, NULL);
or
  g_object_get (alsasink, "property-name", &value, NULL);

(though many of the values can probably only be manipulated while
alsasink is in NULL state, not while it's being used for output).

Cheers
 -Tim




More information about the gstreamer-devel mailing list