[gst-devel] Media Player development Questions

Tim-Philipp Müller t.i.m at zen.co.uk
Mon Sep 1 10:05:43 CEST 2008


On Thu, 2008-08-28 at 13:08 -0500, Raj Swaminathan wrote:

Hi,

> I am new to Glib programming and gstreamer. I am trying to build a
> basic media player application. So far i have gstreamer pipelines up
> and rendering various media formats.

For a media player you'll probably want to use playbin (or even
playbin2) from gst-plugins-base. There's no need to create your own
pipelines.


> 1) Im trying to reference the gstalsamixer plugin for volume control
> and muting. I understand its an interface and im trying to find out
> whats the best way to access the interface methods like
> gst_alsa_alsa_mixer_get_volume etc ... 
>     Could somebody please provide a code snippet that can show this ?

For stream volume control you should use playbin's "volume" property.
The GStreamer mixer interface (GstMixer) is to control hardware mixer
levels, you usually don't want that in a playback application. It's also
not very nice to use. If you don't use playbin, add a volume element to
your pipeline (alternatively: audiosinks which support stream volumes
will also have a "volume" property).


> 2) When designing the media player, whats the best way to accept user
> input. Do i spool a separate thread for rendering media while the main
> thread waits for user input or is there a better way within gstreamer
> to do this?

GStreamer does all its playback in threads of its own anyway, so the
main thread is yours. All you need to do is check the
pipeline's/playbin's GstBus for messages (errors, tags, state changes)
from time to time.

Cheers
 -Tim







More information about the gstreamer-devel mailing list