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>GstAudioSink: 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="GstAudioFilter.html" title="GstAudioFilter"> 10<link rel="next" href="GstAudioSrc.html" title="GstAudioSrc"> 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="#GstAudioSink.description" class="shortcut">Description</a></span><span id="nav_hierarchy"> <span class="dim">|</span> 19 <a href="#GstAudioSink.object-hierarchy" class="shortcut">Object Hierarchy</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="gstreamer-audio.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 23<td><a accesskey="p" href="GstAudioFilter.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 24<td><a accesskey="n" href="GstAudioSrc.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="GstAudioSink"></a><div class="titlepage"></div> 28<div class="refnamediv"><table width="100%"><tr> 29<td valign="top"> 30<h2><span class="refentrytitle"><a name="GstAudioSink.top_of_page"></a>GstAudioSink</span></h2> 31<p>GstAudioSink — Simple base class for audio sinks</p> 32</td> 33<td class="gallery_image" valign="top" align="right"></td> 34</tr></table></div> 35<div class="refsect1"> 36<a name="GstAudioSink.other"></a><h2>Types and Values</h2> 37<div class="informaltable"><table class="informaltable" width="100%" border="0"> 38<colgroup> 39<col width="150px" class="name"> 40<col class="description"> 41</colgroup> 42<tbody> 43<tr> 44<td class="datatype_keyword">struct</td> 45<td class="function_name"><a class="link" href="GstAudioSink.html#GstAudioSink-struct" title="struct GstAudioSink">GstAudioSink</a></td> 46</tr> 47<tr> 48<td class="datatype_keyword">struct</td> 49<td class="function_name"><a class="link" href="GstAudioSink.html#GstAudioSinkClass" title="struct GstAudioSinkClass">GstAudioSinkClass</a></td> 50</tr> 51</tbody> 52</table></div> 53</div> 54<div class="refsect1"> 55<a name="GstAudioSink.object-hierarchy"></a><h2>Object Hierarchy</h2> 56<pre class="screen"> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GObject-struct">GObject</a> 57 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gobject/gobject-The-Base-Object-Type.html#GInitiallyUnowned">GInitiallyUnowned</a> 58 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstObject.html#GstObject-struct">GstObject</a> 59 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-1.0/GstElement.html#GstElement-struct">GstElement</a> 60 <span class="lineart">╰──</span> <a href="/usr/share/gtk-doc/html/gstreamer-libs-1.0/GstBaseSink.html#GstBaseSink-struct">GstBaseSink</a> 61 <span class="lineart">╰──</span> <a class="link" href="GstAudioBaseSink.html" title="GstAudioBaseSink">GstAudioBaseSink</a> 62 <span class="lineart">╰──</span> GstAudioSink 63</pre> 64</div> 65<div class="refsect1"> 66<a name="GstAudioSink.includes"></a><h2>Includes</h2> 67<pre class="synopsis">#include <gst/audio/audio.h> 68</pre> 69</div> 70<div class="refsect1"> 71<a name="GstAudioSink.description"></a><h2>Description</h2> 72<p>This is the most simple base class for audio sinks that only requires 73subclasses to implement a set of simple functions:</p> 74<div class="itemizedlist"><ul class="itemizedlist" style="list-style-type: disc; "> 75<li class="listitem"><p><code class="literal"><code class="function">open()</code></code> :Open the device.</p></li> 76<li class="listitem"><p><code class="literal"><code class="function">prepare()</code></code> :Configure the device with the specified format.</p></li> 77<li class="listitem"><p><code class="literal"><code class="function">write()</code></code> :Write samples to the device.</p></li> 78<li class="listitem"><p><code class="literal"><code class="function">reset()</code></code> :Unblock writes and flush the device.</p></li> 79<li class="listitem"><p><code class="literal"><code class="function">delay()</code></code> :Get the number of samples written but not yet played 80by the device.</p></li> 81<li class="listitem"><p><code class="literal"><code class="function">unprepare()</code></code> :Undo operations done by prepare.</p></li> 82<li class="listitem"><p><code class="literal"><code class="function">close()</code></code> :Close the device.</p></li> 83</ul></div> 84<p>All scheduling of samples and timestamps is done in this base class 85together with <a class="link" href="GstAudioBaseSink.html" title="GstAudioBaseSink"><span class="type">GstAudioBaseSink</span></a> using a default implementation of a 86<a class="link" href="GstAudioRingBuffer.html" title="GstAudioRingBuffer"><span class="type">GstAudioRingBuffer</span></a> that uses threads.</p> 87</div> 88<div class="refsect1"> 89<a name="GstAudioSink.functions_details"></a><h2>Functions</h2> 90<p></p> 91</div> 92<div class="refsect1"> 93<a name="GstAudioSink.other_details"></a><h2>Types and Values</h2> 94<div class="refsect2"> 95<a name="GstAudioSink-struct"></a><h3>struct GstAudioSink</h3> 96<pre class="programlisting">struct GstAudioSink;</pre> 97<p>Opaque <a class="link" href="GstAudioSink.html" title="GstAudioSink"><span class="type">GstAudioSink</span></a>.</p> 98</div> 99<hr> 100<div class="refsect2"> 101<a name="GstAudioSinkClass"></a><h3>struct GstAudioSinkClass</h3> 102<pre class="programlisting">struct GstAudioSinkClass { 103 GstAudioBaseSinkClass parent_class; 104 105 /* vtable */ 106 107 /* open the device with given specs */ 108 gboolean (*open) (GstAudioSink *sink); 109 /* prepare resources and state to operate with the given specs */ 110 gboolean (*prepare) (GstAudioSink *sink, GstAudioRingBufferSpec *spec); 111 /* undo anything that was done in prepare() */ 112 gboolean (*unprepare) (GstAudioSink *sink); 113 /* close the device */ 114 gboolean (*close) (GstAudioSink *sink); 115 /* write samples to the device */ 116 gint (*write) (GstAudioSink *sink, gpointer data, guint length); 117 /* get number of frames queued in the device */ 118 guint (*delay) (GstAudioSink *sink); 119 /* reset the audio device, unblock from a write */ 120 void (*reset) (GstAudioSink *sink); 121}; 122</pre> 123<p><a class="link" href="GstAudioSink.html" title="GstAudioSink"><span class="type">GstAudioSink</span></a> class. Override the vmethods to implement functionality.</p> 124<div class="refsect3"> 125<a name="GstAudioSinkClass.members"></a><h4>Members</h4> 126<div class="informaltable"><table class="informaltable" width="100%" border="0"> 127<colgroup> 128<col width="300px" class="struct_members_name"> 129<col class="struct_members_description"> 130<col width="200px" class="struct_members_annotations"> 131</colgroup> 132<tbody> 133<tr> 134<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAudioSinkClass.open"></a>open</code></em> ()</p></td> 135<td class="struct_member_description"><p>Open the device. No configuration needs to be done at this point. 136This function is also used to check if the device is available.</p></td> 137<td class="struct_member_annotations"> </td> 138</tr> 139<tr> 140<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAudioSinkClass.prepare"></a>prepare</code></em> ()</p></td> 141<td class="struct_member_description"><p>Prepare the device to operate with the specified parameters.</p></td> 142<td class="struct_member_annotations"> </td> 143</tr> 144<tr> 145<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAudioSinkClass.unprepare"></a>unprepare</code></em> ()</p></td> 146<td class="struct_member_description"><p>Undo operations done in prepare.</p></td> 147<td class="struct_member_annotations"> </td> 148</tr> 149<tr> 150<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAudioSinkClass.close"></a>close</code></em> ()</p></td> 151<td class="struct_member_description"><p>Close the device.</p></td> 152<td class="struct_member_annotations"> </td> 153</tr> 154<tr> 155<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAudioSinkClass.write"></a>write</code></em> ()</p></td> 156<td class="struct_member_description"><p>Write data to the device.</p></td> 157<td class="struct_member_annotations"> </td> 158</tr> 159<tr> 160<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAudioSinkClass.delay"></a>delay</code></em> ()</p></td> 161<td class="struct_member_description"><p>Return how many frames are still in the device. This is used to 162drive the synchronisation.</p></td> 163<td class="struct_member_annotations"> </td> 164</tr> 165<tr> 166<td class="struct_member_name"><p><em class="structfield"><code><a name="GstAudioSinkClass.reset"></a>reset</code></em> ()</p></td> 167<td class="struct_member_description"><p>Returns as quickly as possible from a write and flush any pending 168samples from the device.</p></td> 169<td class="struct_member_annotations"> </td> 170</tr> 171</tbody> 172</table></div> 173</div> 174</div> 175</div> 176<div class="refsect1"> 177<a name="GstAudioSink.see-also"></a><h2>See Also</h2> 178<p><a class="link" href="GstAudioBaseSink.html" title="GstAudioBaseSink"><span class="type">GstAudioBaseSink</span></a>, <a class="link" href="GstAudioRingBuffer.html" title="GstAudioRingBuffer"><span class="type">GstAudioRingBuffer</span></a>, <a class="link" href="GstAudioSink.html" title="GstAudioSink"><span class="type">GstAudioSink</span></a>.</p> 179</div> 180</div> 181<div class="footer"> 182<hr>Generated by GTK-Doc V1.28</div> 183</body> 184</html>