1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>GstStreamVolume: GStreamer Base Plugins 1.0 Library Reference Manual</title> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Library Reference Manual"> 8<link rel="up" href="gstreamer-audio.html" title="Audio Library"> 9<link rel="prev" href="gst-plugins-base-libs-GstAudio-IEC61937.html" title="GstAudio IEC61937"> 10<link rel="next" href="gstreamer-ffft.html" title="FFT Library"> 11<meta name="generator" content="GTK-Doc V1.28 (XML mode)"> 12<link rel="stylesheet" href="style.css" type="text/css"> 13</head> 14<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 15<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> 16<td width="100%" align="left" class="shortcuts"> 17<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> 18 <a href="#GstStreamVolume.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> 19 <a href="#GstStreamVolume.object-hierarchy" class="shortcut">Object Hierarchy</a></span><span id="nav_prerequisites"> <span class="dim">|</span> 20 <a href="#GstStreamVolume.prerequisites" class="shortcut">Prerequisites</a></span><span id="nav_properties"> <span class="dim">|</span> 21 <a href="#GstStreamVolume.properties" class="shortcut">Properties</a></span> 22</td> 23<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 24<td><a accesskey="u" href="gstreamer-audio.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 25<td><a accesskey="p" href="gst-plugins-base-libs-GstAudio-IEC61937.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 26<td><a accesskey="n" href="gstreamer-ffft.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 27</tr></table> 28<div class="refentry"> 29<a name="GstStreamVolume"></a><div class="titlepage"></div> 30<div class="refnamediv"><table width="100%"><tr> 31<td valign="top"> 32<h2><span class="refentrytitle"><a name="GstStreamVolume.top_of_page"></a>GstStreamVolume</span></h2> 33<p>GstStreamVolume — Interface for elements that provide a stream volume</p> 34</td> 35<td class="gallery_image" valign="top" align="right"></td> 36</tr></table></div> 37<div class="refsect1"> 38<a name="GstStreamVolume.functions"></a><h2>Functions</h2> 39<div class="informaltable"><table class="informaltable" width="100%" border="0"> 40<colgroup> 41<col width="150px" class="functions_return"> 42<col class="functions_name"> 43</colgroup> 44<tbody> 45<tr> 46<td class="function_type"> 47<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> 48</td> 49<td class="function_name"> 50<a class="link" href="GstStreamVolume.html#gst-stream-volume-get-volume" title="gst_stream_volume_get_volume ()">gst_stream_volume_get_volume</a> <span class="c_punctuation">()</span> 51</td> 52</tr> 53<tr> 54<td class="function_type"> 55<span class="returnvalue">void</span> 56</td> 57<td class="function_name"> 58<a class="link" href="GstStreamVolume.html#gst-stream-volume-set-volume" title="gst_stream_volume_set_volume ()">gst_stream_volume_set_volume</a> <span class="c_punctuation">()</span> 59</td> 60</tr> 61<tr> 62<td class="function_type"> 63<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> 64</td> 65<td class="function_name"> 66<a class="link" href="GstStreamVolume.html#gst-stream-volume-get-mute" title="gst_stream_volume_get_mute ()">gst_stream_volume_get_mute</a> <span class="c_punctuation">()</span> 67</td> 68</tr> 69<tr> 70<td class="function_type"> 71<span class="returnvalue">void</span> 72</td> 73<td class="function_name"> 74<a class="link" href="GstStreamVolume.html#gst-stream-volume-set-mute" title="gst_stream_volume_set_mute ()">gst_stream_volume_set_mute</a> <span class="c_punctuation">()</span> 75</td> 76</tr> 77<tr> 78<td class="function_type"> 79<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> 80</td> 81<td class="function_name"> 82<a class="link" href="GstStreamVolume.html#gst-stream-volume-convert-volume" title="gst_stream_volume_convert_volume ()">gst_stream_volume_convert_volume</a> <span class="c_punctuation">()</span> 83</td> 84</tr> 85</tbody> 86</table></div> 87</div> 88<div class="refsect1"> 89<a name="GstStreamVolume.properties"></a><h2>Properties</h2> 90<div class="informaltable"><table class="informaltable" border="0"> 91<colgroup> 92<col width="150px" class="properties_type"> 93<col width="300px" class="properties_name"> 94<col width="200px" class="properties_flags"> 95</colgroup> 96<tbody> 97<tr> 98<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> 99<td class="property_name"><a class="link" href="GstStreamVolume.html#GstStreamVolume--mute" title="The “mute” property">mute</a></td> 100<td class="property_flags">Read / Write</td> 101</tr> 102<tr> 103<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a></td> 104<td class="property_name"><a class="link" href="GstStreamVolume.html#GstStreamVolume--volume" title="The “volume” property">volume</a></td> 105<td class="property_flags">Read / Write</td> 106</tr> 107</tbody> 108</table></div> 109</div> 110<div class="refsect1"> 111<a name="GstStreamVolume.other"></a><h2>Types and Values</h2> 112<div class="informaltable"><table class="informaltable" width="100%" border="0"> 113<colgroup> 114<col width="150px" class="name"> 115<col class="description"> 116</colgroup> 117<tbody> 118<tr> 119<td class="datatype_keyword"> </td> 120<td class="function_name"><a class="link" href="GstStreamVolume.html#GstStreamVolume-struct" title="GstStreamVolume">GstStreamVolume</a></td> 121</tr> 122<tr> 123<td class="datatype_keyword">enum</td> 124<td class="function_name"><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat">GstStreamVolumeFormat</a></td> 125</tr> 126</tbody> 127</table></div> 128</div> 129<div class="refsect1"> 130<a name="GstStreamVolume.object-hierarchy"></a><h2>Object Hierarchy</h2> 131<pre class="screen"> <a href="/usr/share/gtk-doc/html/gobject/GTypeModule.html">GInterface</a> 132 <span class="lineart">╰──</span> GstStreamVolume 133</pre> 134</div> 135<div class="refsect1"> 136<a name="GstStreamVolume.prerequisites"></a><h2>Prerequisites</h2> 137<p> 138GstStreamVolume requires 139 <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a>.</p> 140</div> 141<div class="refsect1"> 142<a name="GstStreamVolume.includes"></a><h2>Includes</h2> 143<pre class="synopsis">#include <gst/audio/audio.h> 144</pre> 145</div> 146<div class="refsect1"> 147<a name="GstStreamVolume.description"></a><h2>Description</h2> 148<p>This interface is implemented by elements that provide a stream volume. Examples for 149such elements are <span class="type">volume</span> and <span class="type">playbin</span>.</p> 150<p>Applications can use this interface to get or set the current stream volume. For this 151the "volume" <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> property can be used or the helper functions <a class="link" href="GstStreamVolume.html#gst-stream-volume-set-volume" title="gst_stream_volume_set_volume ()"><code class="function">gst_stream_volume_set_volume()</code></a> 152and <a class="link" href="GstStreamVolume.html#gst-stream-volume-get-volume" title="gst_stream_volume_get_volume ()"><code class="function">gst_stream_volume_get_volume()</code></a>. This volume is always a linear factor, i.e. 0.0 is muted 1531.0 is 100%. For showing the volume in a GUI it might make sense to convert it to 154a different format by using <a class="link" href="GstStreamVolume.html#gst-stream-volume-convert-volume" title="gst_stream_volume_convert_volume ()"><code class="function">gst_stream_volume_convert_volume()</code></a>. Volume sliders should usually 155use a cubic volume.</p> 156<p>Separate from the volume the stream can also be muted by the "mute" <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> property or 157<a class="link" href="GstStreamVolume.html#gst-stream-volume-set-mute" title="gst_stream_volume_set_mute ()"><code class="function">gst_stream_volume_set_mute()</code></a> and <a class="link" href="GstStreamVolume.html#gst-stream-volume-get-mute" title="gst_stream_volume_get_mute ()"><code class="function">gst_stream_volume_get_mute()</code></a>.</p> 158<p>Elements that provide some kind of stream volume should implement the "volume" and 159"mute" <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct"><span class="type">GObject</span></a> properties and handle setting and getting of them properly. 160The volume property is defined to be a linear volume factor.</p> 161</div> 162<div class="refsect1"> 163<a name="GstStreamVolume.functions_details"></a><h2>Functions</h2> 164<div class="refsect2"> 165<a name="gst-stream-volume-get-volume"></a><h3>gst_stream_volume_get_volume ()</h3> 166<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> 167gst_stream_volume_get_volume (<em class="parameter"><code><a class="link" href="GstStreamVolume.html" title="GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>, 168 <em class="parameter"><code><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> format</code></em>);</pre> 169<div class="refsect3"> 170<a name="gst-stream-volume-get-volume.parameters"></a><h4>Parameters</h4> 171<div class="informaltable"><table class="informaltable" width="100%" border="0"> 172<colgroup> 173<col width="150px" class="parameters_name"> 174<col class="parameters_description"> 175<col width="200px" class="parameters_annotations"> 176</colgroup> 177<tbody> 178<tr> 179<td class="parameter_name"><p>volume</p></td> 180<td class="parameter_description"><p><a class="link" href="GstStreamVolume.html" title="GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</p></td> 181<td class="parameter_annotations"> </td> 182</tr> 183<tr> 184<td class="parameter_name"><p>format</p></td> 185<td class="parameter_description"><p><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> which should be returned</p></td> 186<td class="parameter_annotations"> </td> 187</tr> 188</tbody> 189</table></div> 190</div> 191<div class="refsect3"> 192<a name="gst-stream-volume-get-volume.returns"></a><h4>Returns</h4> 193<p> The current stream volume as linear factor</p> 194</div> 195</div> 196<hr> 197<div class="refsect2"> 198<a name="gst-stream-volume-set-volume"></a><h3>gst_stream_volume_set_volume ()</h3> 199<pre class="programlisting"><span class="returnvalue">void</span> 200gst_stream_volume_set_volume (<em class="parameter"><code><a class="link" href="GstStreamVolume.html" title="GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>, 201 <em class="parameter"><code><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> format</code></em>, 202 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> val</code></em>);</pre> 203<div class="refsect3"> 204<a name="gst-stream-volume-set-volume.parameters"></a><h4>Parameters</h4> 205<div class="informaltable"><table class="informaltable" width="100%" border="0"> 206<colgroup> 207<col width="150px" class="parameters_name"> 208<col class="parameters_description"> 209<col width="200px" class="parameters_annotations"> 210</colgroup> 211<tbody> 212<tr> 213<td class="parameter_name"><p>volume</p></td> 214<td class="parameter_description"><p><a class="link" href="GstStreamVolume.html" title="GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</p></td> 215<td class="parameter_annotations"> </td> 216</tr> 217<tr> 218<td class="parameter_name"><p>format</p></td> 219<td class="parameter_description"><p><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> of <em class="parameter"><code>val</code></em> 220</p></td> 221<td class="parameter_annotations"> </td> 222</tr> 223<tr> 224<td class="parameter_name"><p>val</p></td> 225<td class="parameter_description"><p>Linear volume factor that should be set</p></td> 226<td class="parameter_annotations"> </td> 227</tr> 228</tbody> 229</table></div> 230</div> 231</div> 232<hr> 233<div class="refsect2"> 234<a name="gst-stream-volume-get-mute"></a><h3>gst_stream_volume_get_mute ()</h3> 235<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> 236gst_stream_volume_get_mute (<em class="parameter"><code><a class="link" href="GstStreamVolume.html" title="GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>);</pre> 237<div class="refsect3"> 238<a name="gst-stream-volume-get-mute.parameters"></a><h4>Parameters</h4> 239<div class="informaltable"><table class="informaltable" width="100%" border="0"> 240<colgroup> 241<col width="150px" class="parameters_name"> 242<col class="parameters_description"> 243<col width="200px" class="parameters_annotations"> 244</colgroup> 245<tbody><tr> 246<td class="parameter_name"><p>volume</p></td> 247<td class="parameter_description"><p><a class="link" href="GstStreamVolume.html" title="GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</p></td> 248<td class="parameter_annotations"> </td> 249</tr></tbody> 250</table></div> 251</div> 252<div class="refsect3"> 253<a name="gst-stream-volume-get-mute.returns"></a><h4>Returns</h4> 254<p> Returns <a href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the stream is muted</p> 255</div> 256</div> 257<hr> 258<div class="refsect2"> 259<a name="gst-stream-volume-set-mute"></a><h3>gst_stream_volume_set_mute ()</h3> 260<pre class="programlisting"><span class="returnvalue">void</span> 261gst_stream_volume_set_mute (<em class="parameter"><code><a class="link" href="GstStreamVolume.html" title="GstStreamVolume"><span class="type">GstStreamVolume</span></a> *volume</code></em>, 262 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> mute</code></em>);</pre> 263<div class="refsect3"> 264<a name="gst-stream-volume-set-mute.parameters"></a><h4>Parameters</h4> 265<div class="informaltable"><table class="informaltable" width="100%" border="0"> 266<colgroup> 267<col width="150px" class="parameters_name"> 268<col class="parameters_description"> 269<col width="200px" class="parameters_annotations"> 270</colgroup> 271<tbody> 272<tr> 273<td class="parameter_name"><p>volume</p></td> 274<td class="parameter_description"><p><a class="link" href="GstStreamVolume.html" title="GstStreamVolume"><span class="type">GstStreamVolume</span></a> that should be used</p></td> 275<td class="parameter_annotations"> </td> 276</tr> 277<tr> 278<td class="parameter_name"><p>mute</p></td> 279<td class="parameter_description"><p>Mute state that should be set</p></td> 280<td class="parameter_annotations"> </td> 281</tr> 282</tbody> 283</table></div> 284</div> 285</div> 286<hr> 287<div class="refsect2"> 288<a name="gst-stream-volume-convert-volume"></a><h3>gst_stream_volume_convert_volume ()</h3> 289<pre class="programlisting"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="returnvalue">gdouble</span></a> 290gst_stream_volume_convert_volume (<em class="parameter"><code><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> from</code></em>, 291 <em class="parameter"><code><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> to</code></em>, 292 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a> val</code></em>);</pre> 293<div class="refsect3"> 294<a name="gst-stream-volume-convert-volume.parameters"></a><h4>Parameters</h4> 295<div class="informaltable"><table class="informaltable" width="100%" border="0"> 296<colgroup> 297<col width="150px" class="parameters_name"> 298<col class="parameters_description"> 299<col width="200px" class="parameters_annotations"> 300</colgroup> 301<tbody> 302<tr> 303<td class="parameter_name"><p>from</p></td> 304<td class="parameter_description"><p><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> to convert from</p></td> 305<td class="parameter_annotations"> </td> 306</tr> 307<tr> 308<td class="parameter_name"><p>to</p></td> 309<td class="parameter_description"><p><a class="link" href="GstStreamVolume.html#GstStreamVolumeFormat" title="enum GstStreamVolumeFormat"><span class="type">GstStreamVolumeFormat</span></a> to convert to</p></td> 310<td class="parameter_annotations"> </td> 311</tr> 312<tr> 313<td class="parameter_name"><p>val</p></td> 314<td class="parameter_description"><p>Volume in <em class="parameter"><code>from</code></em> 315format that should be converted</p></td> 316<td class="parameter_annotations"> </td> 317</tr> 318</tbody> 319</table></div> 320</div> 321<div class="refsect3"> 322<a name="gst-stream-volume-convert-volume.returns"></a><h4>Returns</h4> 323<p> the converted volume</p> 324</div> 325</div> 326</div> 327<div class="refsect1"> 328<a name="GstStreamVolume.other_details"></a><h2>Types and Values</h2> 329<div class="refsect2"> 330<a name="GstStreamVolume-struct"></a><h3>GstStreamVolume</h3> 331<pre class="programlisting">typedef struct _GstStreamVolume GstStreamVolume;</pre> 332</div> 333<hr> 334<div class="refsect2"> 335<a name="GstStreamVolumeFormat"></a><h3>enum GstStreamVolumeFormat</h3> 336<p>Different representations of a stream volume. <a class="link" href="GstStreamVolume.html#gst-stream-volume-convert-volume" title="gst_stream_volume_convert_volume ()"><code class="function">gst_stream_volume_convert_volume()</code></a> 337allows to convert between the different representations.</p> 338<p>Formulas to convert from a linear to a cubic or dB volume are 339cbrt(val) and 20 * log10 (val).</p> 340<div class="refsect3"> 341<a name="GstStreamVolumeFormat.members"></a><h4>Members</h4> 342<div class="informaltable"><table class="informaltable" width="100%" border="0"> 343<colgroup> 344<col width="300px" class="enum_members_name"> 345<col class="enum_members_description"> 346<col width="200px" class="enum_members_annotations"> 347</colgroup> 348<tbody> 349<tr> 350<td class="enum_member_name"><p><a name="GST-STREAM-VOLUME-FORMAT-LINEAR:CAPS"></a>GST_STREAM_VOLUME_FORMAT_LINEAR</p></td> 351<td class="enum_member_description"> 352<p>Linear scale factor, 1.0 = 100%</p> 353</td> 354<td class="enum_member_annotations"> </td> 355</tr> 356<tr> 357<td class="enum_member_name"><p><a name="GST-STREAM-VOLUME-FORMAT-CUBIC:CAPS"></a>GST_STREAM_VOLUME_FORMAT_CUBIC</p></td> 358<td class="enum_member_description"> 359<p>Cubic volume scale</p> 360</td> 361<td class="enum_member_annotations"> </td> 362</tr> 363<tr> 364<td class="enum_member_name"><p><a name="GST-STREAM-VOLUME-FORMAT-DB:CAPS"></a>GST_STREAM_VOLUME_FORMAT_DB</p></td> 365<td class="enum_member_description"> 366<p>Logarithmic volume scale (dB, amplitude not power)</p> 367</td> 368<td class="enum_member_annotations"> </td> 369</tr> 370</tbody> 371</table></div> 372</div> 373</div> 374</div> 375<div class="refsect1"> 376<a name="GstStreamVolume.property-details"></a><h2>Property Details</h2> 377<div class="refsect2"> 378<a name="GstStreamVolume--mute"></a><h3>The <code class="literal">“mute”</code> property</h3> 379<pre class="programlisting"> “mute” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> 380<p>Mute the audio channel without changing the volume.</p> 381<p>Flags: Read / Write</p> 382<p>Default value: FALSE</p> 383</div> 384<hr> 385<div class="refsect2"> 386<a name="GstStreamVolume--volume"></a><h3>The <code class="literal">“volume”</code> property</h3> 387<pre class="programlisting"> “volume” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gdouble"><span class="type">gdouble</span></a></pre> 388<p>Linear volume factor, 1.0=100%.</p> 389<p>Flags: Read / Write</p> 390<p>Allowed values: >= 0</p> 391<p>Default value: 1</p> 392</div> 393</div> 394</div> 395<div class="footer"> 396<hr>Generated by GTK-Doc V1.28</div> 397</body> 398</html>