[gst-devel] Getting names and description of the "Source" devices.

Stefan Kost ensonic at hora-obscura.de
Wed Aug 4 14:53:27 CEST 2010


Am 19.07.2010 10:25, schrieb Osmo Maatta:
> Hello,
> 
> I am writing a small sound-recording application/applet in C. It will do
> approx. the same task as this command line.
> $ gst-launch-0.10 pulsesrc device="xxxx" ! queue ! audioconvert !
> vorbisenc ! oggmux ! filesink location=test.oga
> 
> My platform is GNOME on Ubuntu-Linux 10.04.
> 
> In my GTK app, I would like to fill a listbox with names and description
> of the "Source" devices; such as
> "Audio card X"
> "Micro phone 1"
> so the user can select the source of the recording. See the devive=
> parameter in the above command line.
> 
> How can I find the device names + description using c and GStreamer
> libraries?

You can use the GstPropertyProbe interface on the audiosrc element.
> 
> I have poked the "gstreamer-properties" application and it finds the
> device names like

This is available audiosource element and that is retieved from the registry.

Stefan

> 
> PulseAudio Audio Source (pulsesrc):
> Device name: alsa_output.pci-0000_04_02.0.analog-stereo.monitor 
> Description: Unknown
> 
> PulseAudio Audio Source (pulsesrc):
> Device name: device alsa_input.usb-046d_089d-01-U0x46d0x89d.analog-mono
> Description: Unknown
> 
> The device name is ok, but the human readable description is
> empty/"Unknown".
> 
> See this picture:
> http://www.futuredesktop.com/tmp/audio-recorder/picture1.png
> The device description for Source #0 and #1 are set to "Unknown".
> 
> However the "pactl list" command shows the description right.
> http://www.futuredesktop.com/tmp/audio-recorder/picture2.png
> Source #0
>  State: RUNNING
>  Name: alsa_output.pci-0000_04_02.0.analog-stereo.monitor  <-- I WANT THIS
>  Description: Monitor of SB0400 Audigy2 Value Analog Stereo <--- AND THIS
> 
> Source #1
>  State: SUSPENDED
>  Name: alsa_input.usb-046d_089d-01-U0x46d0x89d.analog-mono <- I WANT THIS
>  Description: QuickCam E2500 series Analog Mono <--- AND THIS
> 
> Test code:
> http://www.futuredesktop.com/tmp/audio-recorder/t1.c
> <http://www.futuredesktop.com/tmp/audio-recorder/>
> Kindly
>   Gstreamer newbie.
>   Moma Antero M (osmo)
>   www.futuredesktop.org (com)
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
> 
> 
> 
> _______________________________________________
> 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