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>directsoundsink: GStreamer Good 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 Good Plugins 1.0 Plugins Reference Manual"> 8<link rel="up" href="ch01.html" title="gst-plugins-good Elements"> 9<link rel="prev" href="gst-plugins-good-plugins-dicetv.html" title="dicetv"> 10<link rel="next" href="gst-plugins-good-plugins-dtmfsrc.html" title="dtmfsrc"> 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-good-plugins-directsoundsink.description" class="shortcut">Description</a></span> 19</td> 20<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 21<td><a accesskey="u" href="ch01.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 22<td><a accesskey="p" href="gst-plugins-good-plugins-dicetv.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 23<td><a accesskey="n" href="gst-plugins-good-plugins-dtmfsrc.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 24</tr></table> 25<div class="refentry"> 26<a name="gst-plugins-good-plugins-directsoundsink"></a><div class="titlepage"></div> 27<div class="refnamediv"><table width="100%"><tr> 28<td valign="top"> 29<h2><span class="refentrytitle"><a name="gst-plugins-good-plugins-directsoundsink.top_of_page"></a>directsoundsink</span></h2> 30<p>directsoundsink</p> 31</td> 32<td class="gallery_image" valign="top" align="right"></td> 33</tr></table></div> 34<div class="refsect1"> 35<a name="gst-plugins-good-plugins-directsoundsink.other"></a><h2>Types and Values</h2> 36<div class="informaltable"><table class="informaltable" width="100%" border="0"> 37<colgroup> 38<col width="150px" class="name"> 39<col class="description"> 40</colgroup> 41<tbody><tr> 42<td class="datatype_keyword">struct</td> 43<td class="function_name"><a class="link" href="gst-plugins-good-plugins-directsoundsink.html#GstDirectSoundSink" title="struct GstDirectSoundSink">GstDirectSoundSink</a></td> 44</tr></tbody> 45</table></div> 46</div> 47<div class="refsect1"> 48<a name="gst-plugins-good-plugins-directsoundsink.description"></a><h2>Description</h2> 49<p>This element lets you output sound using the DirectSound API.</p> 50<p>Note that you should almost always use generic audio conversion elements 51like audioconvert and audioresample in front of an audiosink to make sure 52your pipeline works under all circumstances (those conversion elements will 53act in passthrough-mode if no conversion is necessary).</p> 54<div class="refsect2"> 55<a name="id-1.2.46.4.4"></a><h3>Example pipelines</h3> 56<div class="informalexample"> 57 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 58 <tbody> 59 <tr> 60 <td class="listing_lines" align="right"><pre>1</pre></td> 61 <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 audiotestsrc <span class="gtkdoc opt">!</span> audioconvert <span class="gtkdoc opt">!</span> volume volume<span class="gtkdoc opt">=</span><span class="number">0.1</span> <span class="gtkdoc opt">!</span> directsoundsink</pre></td> 62 </tr> 63 </tbody> 64 </table> 65</div> 66 will output a sine wave (continuous beep sound) to your sound card (with 67a very low volume as precaution). 68<div class="informalexample"> 69 <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> 70 <tbody> 71 <tr> 72 <td class="listing_lines" align="right"><pre>1</pre></td> 73 <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 filesrc location<span class="gtkdoc opt">=</span>music<span class="gtkdoc opt">.</span>ogg <span class="gtkdoc opt">!</span> decodebin <span class="gtkdoc opt">!</span> audioconvert <span class="gtkdoc opt">!</span> audioresample <span class="gtkdoc opt">!</span> directsoundsink</pre></td> 74 </tr> 75 </tbody> 76 </table> 77</div> 78 will play an Ogg/Vorbis audio file and output it. 79</div> 80<div class="refsynopsisdiv"> 81<h2>Synopsis</h2> 82<div class="refsect2"> 83<a name="id-1.2.46.4.5.1"></a><h3>Element Information</h3> 84<div class="variablelist"><table border="0" class="variablelist"> 85<colgroup> 86<col align="left" valign="top"> 87<col> 88</colgroup> 89<tbody> 90<tr> 91<td><p><span class="term">plugin</span></p></td> 92<td> 93 <a class="link" href="gst-plugins-good-plugins-plugin-directsound.html#plugin-directsound">directsound</a> 94 </td> 95</tr> 96<tr> 97<td><p><span class="term">author</span></p></td> 98<td>Sebastien Moutte <sebastien@moutte.net></td> 99</tr> 100<tr> 101<td><p><span class="term">class</span></p></td> 102<td>Sink/Audio</td> 103</tr> 104</tbody> 105</table></div> 106</div> 107<hr> 108<div class="refsect2"> 109<a name="id-1.2.46.4.5.2"></a><h3>Element Pads</h3> 110</div> 111</div> 112</div> 113<div class="refsect1"> 114<a name="gst-plugins-good-plugins-directsoundsink.functions_details"></a><h2>Functions</h2> 115<p></p> 116</div> 117<div class="refsect1"> 118<a name="gst-plugins-good-plugins-directsoundsink.other_details"></a><h2>Types and Values</h2> 119<div class="refsect2"> 120<a name="GstDirectSoundSink"></a><h3>struct GstDirectSoundSink</h3> 121<pre class="programlisting">struct GstDirectSoundSink { 122 GstAudioSink sink; 123 124 125 /* directsound object interface pointer */ 126 LPDIRECTSOUND pDS; 127 128 /* directsound sound object interface pointer */ 129 LPDIRECTSOUNDBUFFER pDSBSecondary; 130 131 /* directSound buffer size */ 132 guint buffer_size; 133 134 /* offset of the circular buffer where we must write next */ 135 guint current_circular_offset; 136 137 guint bytes_per_sample; 138 139 /* current volume setup by mixer interface */ 140 glong volume; 141 gboolean mute; 142 143 /* current directsound device ID */ 144 gchar * device_id; 145 146 GstCaps *cached_caps; 147 /* lock used to protect writes and resets */ 148 GMutex dsound_lock; 149 150 GstClock *system_clock; 151 GstClockID write_wait_clock_id; 152 gboolean reset_while_sleeping; 153 154 gboolean first_buffer_after_reset; 155 156 GstAudioRingBufferFormatType type; 157}; 158</pre> 159</div> 160</div> 161</div> 162<div class="footer"> 163<hr>Generated by GTK-Doc V1.28</div> 164</body> 165</html>