QGst::StreamVolume usage and example

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

QGst::StreamVolume usage and example

Mert TAS
Hi everybody,

If any of you are using the QGst library but could not figure out how to use the QGst::StreamVolume functionality (like once I did :) this is the right place.
Using QGst::StreamVolume is fairly simple. You just have to create a pipeline from the playbin2 element that will play the audio/video (as in the Player example
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/qt-gstreamer/html/player_2main_8cpp-example.html)
then create a stream volume and cast the pipeline to stream volume as follows:

// Don't forget to include the headers first
#include <QGst/Pipeline>
#include <QGst/StreamVolume>

QGst::PipelinePtr m_pipeline  = QGst::ElementFactory::make("playbin2").dynamicCast<QGst::Pipeline>();
Q
Gst::StreamVolumePtr m_streamVolume = m_pipeline.dynamicCast<
QGst::StreamVolume>();
Then you can use the stream volume functions setVolume(), volume() and setMuted(), isMuted() to set the volume or mute your audio/video.
You can find the last version of the Player example with added volume control here:
https://bugzilla.gnome.org/show_bug.cgi?id=649040

Thanks to Marco Ballesio & George Kiagiadakis for all their help and advice. Hope this would be useful to all.

Mert Tas

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel