Volume plugin and GstStreamVolume

Sebastian Dröge sebastian at centricular.com
Tue Aug 18 02:07:31 PDT 2015


On Mo, 2015-08-17 at 09:40 -0600, Natanael Mojica wrote:
> Hi
> I'm using the plugin volume in my aplication, With QT and gstreamer
> -1.4.5,
> I attach the slider signal (valueChanged (int)) to my volume 
> function, I use
> 
> :
> gst_stream_volume_set_volume (this-> volume, 
> GST_STREAM_VOLUME_FORMAT_LINEAR, value);
> 
> for dynamically change the volume value of the audio stream in the 
> pipeline, but I get this error:
> 
> "/home/neithan/gstreamer/gstvideo/gstaudio.cpp:42: Error: can not 
> convert '{aka _GstElement GstElement * *}' to '{aka _GstStreamVolume 
> GstStreamVolume * *}' for argument '1' to 'void 
> gst_stream_volume_set_volume (GstStreamVolume *, 
> GstStreamVolumeFormat, gdouble) '
>      gst_stream_volume_set_volume (this-> volume, 
> GST_STREAM_VOLUME_FORMAT_LINEAR, value); "
> 
> I known, the Volume is not a GstStreamVolume element type, but, using 
> gst-inspect-1.0 volume, That return the properties and functions of 
> volume plugin and interfaces, and there, I See That volume plugin 
> implements the GstStreamVolume

Cast the volume element instance to a GstStreamVolume, that is either a
normal C/C++-style cast or a cast with runtime checks:

  gst_stream_volume_set_volume(GST_STREAM_VOLUME(this->volume), GST_STREAM_VOLUME_FORMAT_LINEAR, value);

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com



More information about the gstreamer-devel mailing list