How to find out if the sink chosen by autoaudiosink supports GstStreamVolume.?

Sebastian Dröge sebastian at centricular.com
Tue Feb 23 09:11:19 UTC 2016


On Di, 2016-02-23 at 00:52 -0800, George Yunaev wrote:
> Hi all,
> 
> There are several sinks which autoaudiosink can choose from on Linux.
> Some of them support GstStreamVolume (pulsesink), and some do not 
> (alsasink).
> 
> Using pulsesink's volume, for example, is preferred because it changes the systray
> mixer volume when I change it programmatically. So it is preferred.
> 
> How can I find out:
> 
> 1. Which exact sink autoaudiosink has chosen? I can get it from the sink 
> name, which it changes to something like autoaudiosink-pulse, but it
> doesn't sound reliable.

Check the element factory of the sink element, and the factory name.
That will be "pulsesink" for example.

> 2. How to find out if this  sink has support for GstStreamVolume?

GST_IS_STREAM_VOLUME(sink) would return TRUE.

> 3. And if yes, how to get the access to its GstStreamVolume?

The above sounds like you know how to get access to the internal
element of the autoaudiosink already. But if not, you can get it via
the GstBin API. Specifically the element-added signal will be emitted
when the internal element is added to autoaudiosink, and you can also
iterate over all internal elements with gst_bin_iterate(), and you can
also get internal elements by interface.

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160223/ed61e727/attachment.sig>


More information about the gstreamer-devel mailing list