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>wasapisrc: GStreamer Bad Plugins 1.0 Plugins Reference Manual</title> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="GStreamer Bad Plugins 1.0 Plugins Reference Manual"> 8<link rel="up" href="ch01.html" title="gst-plugins-bad Elements"> 9<link rel="prev" href="gst-plugins-bad-plugins-wasapisink.html" title="wasapisink"> 10<link rel="next" href="gst-plugins-bad-plugins-watchdog.html" title="watchdog"> 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="#gst-plugins-bad-plugins-wasapisrc.description" class="shortcut">Description</a></span><span id="nav_properties"> <span class="dim">|</span> 19 <a href="#gst-plugins-bad-plugins-wasapisrc.properties" class="shortcut">Properties</a></span> 20</td> 21<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 22<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 23<td><a accesskey="p" href="gst-plugins-bad-plugins-wasapisink.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 24<td><a accesskey="n" href="gst-plugins-bad-plugins-watchdog.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 25</tr></table> 26<div class="refentry"> 27<a name="gst-plugins-bad-plugins-wasapisrc"></a><div class="titlepage"></div> 28<div class="refnamediv"><table width="100%"><tr> 29<td valign="top"> 30<h2><span class="refentrytitle"><a name="gst-plugins-bad-plugins-wasapisrc.top_of_page"></a>wasapisrc</span></h2> 31<p>wasapisrc</p> 32</td> 33<td class="gallery_image" valign="top" align="right"></td> 34</tr></table></div> 35<div class="refsect1"> 36<a name="gst-plugins-bad-plugins-wasapisrc.properties"></a><h2>Properties</h2> 37<div class="informaltable"><table class="informaltable" border="0"> 38<colgroup> 39<col width="150px" class="properties_type"> 40<col width="300px" class="properties_name"> 41<col width="200px" class="properties_flags"> 42</colgroup> 43<tbody> 44<tr> 45<td class="property_type"><span class="type">GstWasapiDeviceRole</span></td> 46<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-wasapisrc.html#GstWasapiSrc--role" title="The “role” property">role</a></td> 47<td class="property_flags">Read / Write</td> 48</tr> 49<tr> 50<td class="property_type"> 51<a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</td> 52<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-wasapisrc.html#GstWasapiSrc--device" title="The “device” property">device</a></td> 53<td class="property_flags">Read / Write</td> 54</tr> 55<tr> 56<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> 57<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-wasapisrc.html#GstWasapiSrc--exclusive" title="The “exclusive” property">exclusive</a></td> 58<td class="property_flags">Read / Write</td> 59</tr> 60<tr> 61<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> 62<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-wasapisrc.html#GstWasapiSrc--low-latency" title="The “low-latency” property">low-latency</a></td> 63<td class="property_flags">Read / Write</td> 64</tr> 65<tr> 66<td class="property_type"><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></td> 67<td class="property_name"><a class="link" href="gst-plugins-bad-plugins-wasapisrc.html#GstWasapiSrc--use-audioclient3" title="The “use-audioclient3” property">use-audioclient3</a></td> 68<td class="property_flags">Read / Write</td> 69</tr> 70</tbody> 71</table></div> 72</div> 73<div class="refsect1"> 74<a name="gst-plugins-bad-plugins-wasapisrc.other"></a><h2>Types and Values</h2> 75<div class="informaltable"><table class="informaltable" width="100%" border="0"> 76<colgroup> 77<col width="150px" class="name"> 78<col class="description"> 79</colgroup> 80<tbody><tr> 81<td class="datatype_keyword">struct</td> 82<td class="function_name"><a class="link" href="gst-plugins-bad-plugins-wasapisrc.html#GstWasapiSrc" title="struct GstWasapiSrc">GstWasapiSrc</a></td> 83</tr></tbody> 84</table></div> 85</div> 86<div class="refsect1"> 87<a name="gst-plugins-bad-plugins-wasapisrc.description"></a><h2>Description</h2> 88<p>Provides audio capture from the Windows Audio Session API available with 89Vista and newer.</p> 90<div class="refsect3"> 91<a name="id-1.2.246.5.3"></a><h4>Example pipelines</h4> 92<div class="informalexample"> 93 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 94 <tbody> 95 <tr> 96 <td class="listing_lines" align="right"><pre>1</pre></td> 97 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v wasapisrc <span class="gtkdoc opt">!</span> fakesink</pre></td> 98 </tr> 99 </tbody> 100 </table> 101</div> 102 103<p> Capture from the default audio device and render to fakesink.</p> 104<div class="informalexample"> 105 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 106 <tbody> 107 <tr> 108 <td class="listing_lines" align="right"><pre>1</pre></td> 109 <td class="listing_code"><pre class="programlisting">gst<span class="gtkdoc opt">-</span>launch<span class="gtkdoc opt">-</span><span class="number">1.0</span> <span class="gtkdoc opt">-</span>v wasapisrc low<span class="gtkdoc opt">-</span>latency<span class="gtkdoc opt">=</span><span class="keyword">true</span> <span class="gtkdoc opt">!</span> fakesink</pre></td> 110 </tr> 111 </tbody> 112 </table> 113</div> 114 115<p> Capture from the default audio device with the minimum possible latency and render to fakesink.</p> 116</div> 117<div class="refsynopsisdiv"> 118<h2>Synopsis</h2> 119<div class="refsect2"> 120<a name="id-1.2.246.5.4.1"></a><h3>Element Information</h3> 121<div class="variablelist"><table border="0" class="variablelist"> 122<colgroup> 123<col align="left" valign="top"> 124<col> 125</colgroup> 126<tbody> 127<tr> 128<td><p><span class="term">plugin</span></p></td> 129<td> 130 <a class="link" href="gst-plugins-bad-plugins-plugin-wasapi.html#plugin-wasapi">wasapi</a> 131 </td> 132</tr> 133<tr> 134<td><p><span class="term">author</span></p></td> 135<td>Nirbheek Chauhan <nirbheek@centricular.com></td> 136</tr> 137<tr> 138<td><p><span class="term">class</span></p></td> 139<td>Source/Audio</td> 140</tr> 141</tbody> 142</table></div> 143</div> 144<hr> 145<div class="refsect2"> 146<a name="id-1.2.246.5.4.2"></a><h3>Element Pads</h3> 147<div class="variablelist"><table border="0" class="variablelist"> 148<colgroup> 149<col align="left" valign="top"> 150<col> 151</colgroup> 152<tbody> 153<tr> 154<td><p><span class="term">name</span></p></td> 155<td>src</td> 156</tr> 157<tr> 158<td><p><span class="term">direction</span></p></td> 159<td>source</td> 160</tr> 161<tr> 162<td><p><span class="term">presence</span></p></td> 163<td>always</td> 164</tr> 165<tr> 166<td><p><span class="term">details</span></p></td> 167<td>audio/x-raw, format=(string)F32LE, layout=(string)interleaved, rate=(int)[ 1, 2147483647 ], channels=(int)[ 1, 2147483647 ]</td> 168</tr> 169</tbody> 170</table></div> 171</div> 172</div> 173</div> 174<div class="refsect1"> 175<a name="gst-plugins-bad-plugins-wasapisrc.functions_details"></a><h2>Functions</h2> 176<p></p> 177</div> 178<div class="refsect1"> 179<a name="gst-plugins-bad-plugins-wasapisrc.other_details"></a><h2>Types and Values</h2> 180<div class="refsect2"> 181<a name="GstWasapiSrc"></a><h3>struct GstWasapiSrc</h3> 182<pre class="programlisting">struct GstWasapiSrc { 183 GstAudioSrc parent; 184 185 IMMDevice *device; 186 IAudioClient *client; 187 IAudioClock *client_clock; 188 guint64 client_clock_freq; 189 IAudioCaptureClient *capture_client; 190 HANDLE event_handle; 191 /* Smooth frames captured from WASAPI, which can be irregular sometimes */ 192 GstAdapter *adapter; 193 /* Client was reset, so it needs to be started again */ 194 gboolean client_needs_restart; 195 196 /* The mix format that wasapi prefers in shared mode */ 197 WAVEFORMATEX *mix_format; 198 /* The probed caps that we can accept */ 199 GstCaps *cached_caps; 200 /* The channel positions in the data read from the device 201 * we will pass this to GstAudioRingbuffer so it can 202 * translate it to the native GStreamer channel layout. */ 203 GstAudioChannelPosition *positions; 204 205 /* properties */ 206 gint role; 207 gint sharemode; 208 gboolean loopback; 209 gboolean low_latency; 210 gboolean try_audioclient3; 211 wchar_t *device_strid; 212}; 213</pre> 214</div> 215</div> 216<div class="refsect1"> 217<a name="gst-plugins-bad-plugins-wasapisrc.property-details"></a><h2>Property Details</h2> 218<div class="refsect2"> 219<a name="GstWasapiSrc--role"></a><h3>The <code class="literal">“role”</code> property</h3> 220<pre class="programlisting"> “role” <span class="type">GstWasapiDeviceRole</span></pre> 221<p>Role of the device: communications, multimedia, etc</p> 222<p>Flags: Read / Write</p> 223<p>Default value: console</p> 224</div> 225<hr> 226<div class="refsect2"> 227<a name="GstWasapiSrc--device"></a><h3>The <code class="literal">“device”</code> property</h3> 228<pre class="programlisting"> “device” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *</pre> 229<p>WASAPI playback device as a GUID string</p> 230<p>Flags: Read / Write</p> 231</div> 232<hr> 233<div class="refsect2"> 234<a name="GstWasapiSrc--exclusive"></a><h3>The <code class="literal">“exclusive”</code> property</h3> 235<pre class="programlisting"> “exclusive” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> 236<p>Open the device in exclusive mode</p> 237<p>Flags: Read / Write</p> 238<p>Default value: FALSE</p> 239</div> 240<hr> 241<div class="refsect2"> 242<a name="GstWasapiSrc--low-latency"></a><h3>The <code class="literal">“low-latency”</code> property</h3> 243<pre class="programlisting"> “low-latency” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> 244<p>Optimize all settings for lowest latency. Always safe to enable.</p> 245<p>Flags: Read / Write</p> 246<p>Default value: FALSE</p> 247</div> 248<hr> 249<div class="refsect2"> 250<a name="GstWasapiSrc--use-audioclient3"></a><h3>The <code class="literal">“use-audioclient3”</code> property</h3> 251<pre class="programlisting"> “use-audioclient3” <a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a></pre> 252<p>Whether to use the Windows 10 AudioClient3 API when available</p> 253<p>Flags: Read / Write</p> 254<p>Default value: FALSE</p> 255</div> 256</div> 257</div> 258<div class="footer"> 259<hr>Generated by GTK-Doc V1.28</div> 260</body> 261</html>