1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <title>gstringbuffer</title>
6 <meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
7 <link rel="home" href="index.html" title="GStreamer Base Plugins 0.10 Library Reference Manual">
8 <link rel="up" href="gstreamer-audio.html" title="Audio Library">
9 <link rel="prev" href="gst-plugins-base-libs-gstmultichannel.html" title="gstmultichannel">
10 <link rel="next" href="gstreamer-cdda.html" title="CDDA Library">
11 <meta name="generator" content="GTK-Doc V1.17 (XML mode)">
12 <link rel="stylesheet" href="style.css" type="text/css">
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="2">
17 <td><a accesskey="p" href="gst-plugins-base-libs-gstmultichannel.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18 <td><a accesskey="u" href="gstreamer-audio.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19 <td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20 <th width="100%" align="center">GStreamer Base Plugins 0.10 Library Reference Manual</th>
21 <td><a accesskey="n" href="gstreamer-cdda.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23 <tr><td colspan="5" class="shortcuts">
24 <a href="#gst-plugins-base-libs-gstringbuffer.synopsis" class="shortcut">Top</a>
26 <a href="#gst-plugins-base-libs-gstringbuffer.description" class="shortcut">Description</a>
28 <a href="#gst-plugins-base-libs-gstringbuffer.object-hierarchy" class="shortcut">Object Hierarchy</a>
31 <div class="refentry">
32 <a name="gst-plugins-base-libs-gstringbuffer"></a><div class="titlepage"></div>
33 <div class="refnamediv"><table width="100%"><tr>
35 <h2><span class="refentrytitle"><a name="gst-plugins-base-libs-gstringbuffer.top_of_page"></a>gstringbuffer</span></h2>
36 <p>gstringbuffer — Base class for audio ringbuffer implementations</p>
38 <td valign="top" align="right"></td>
40 <div class="refsynopsisdiv">
41 <a name="gst-plugins-base-libs-gstringbuffer.synopsis"></a><h2>Synopsis</h2>
42 <a name="GstRingBuffer"></a><pre class="synopsis">
43 #include <gst/audio/gstringbuffer.h>
45 struct <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer-struct" title="struct GstRingBuffer">GstRingBuffer</a>;
46 struct <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferClass" title="struct GstRingBufferClass">GstRingBufferClass</a>;
47 struct <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferSpec" title="struct GstRingBufferSpec">GstRingBufferSpec</a>;
48 <span class="returnvalue">void</span> (<a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferCallback" title="GstRingBufferCallback ()">*GstRingBufferCallback</a>) (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *rbuf</code></em>,
49 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *data</code></em>,
50 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> len</code></em>,
51 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
52 enum <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferSegState" title="enum GstRingBufferSegState">GstRingBufferSegState</a>;
53 enum <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferState" title="enum GstRingBufferState">GstRingBufferState</a>;
54 enum <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstBufferFormat" title="enum GstBufferFormat">GstBufferFormat</a>;
55 enum <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstBufferFormatType" title="enum GstBufferFormatType">GstBufferFormatType</a>;
56 #define <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GST-RING-BUFFER-BROADCAST:CAPS" title="GST_RING_BUFFER_BROADCAST()">GST_RING_BUFFER_BROADCAST</a> (buf)
57 #define <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GST-RING-BUFFER-GET-COND:CAPS" title="GST_RING_BUFFER_GET_COND()">GST_RING_BUFFER_GET_COND</a> (buf)
58 #define <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GST-RING-BUFFER-SIGNAL:CAPS" title="GST_RING_BUFFER_SIGNAL()">GST_RING_BUFFER_SIGNAL</a> (buf)
59 #define <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GST-RING-BUFFER-WAIT:CAPS" title="GST_RING_BUFFER_WAIT()">GST_RING_BUFFER_WAIT</a> (buf)
60 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-set-callback" title="gst_ring_buffer_set_callback ()">gst_ring_buffer_set_callback</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
61 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferCallback" title="GstRingBufferCallback ()"><span class="type">GstRingBufferCallback</span></a> cb</code></em>,
62 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);
63 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-acquire" title="gst_ring_buffer_acquire ()">gst_ring_buffer_acquire</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
64 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferSpec" title="struct GstRingBufferSpec"><span class="type">GstRingBufferSpec</span></a> *spec</code></em>);
65 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-release" title="gst_ring_buffer_release ()">gst_ring_buffer_release</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
66 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-is-acquired" title="gst_ring_buffer_is_acquired ()">gst_ring_buffer_is_acquired</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
67 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-activate" title="gst_ring_buffer_activate ()">gst_ring_buffer_activate</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
68 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> active</code></em>);
69 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-is-active" title="gst_ring_buffer_is_active ()">gst_ring_buffer_is_active</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
70 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-start" title="gst_ring_buffer_start ()">gst_ring_buffer_start</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
71 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-pause" title="gst_ring_buffer_pause ()">gst_ring_buffer_pause</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
72 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-stop" title="gst_ring_buffer_stop ()">gst_ring_buffer_stop</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
73 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-delay" title="gst_ring_buffer_delay ()">gst_ring_buffer_delay</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
74 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-samples-done" title="gst_ring_buffer_samples_done ()">gst_ring_buffer_samples_done</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
75 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-set-sample" title="gst_ring_buffer_set_sample ()">gst_ring_buffer_set_sample</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
76 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> sample</code></em>);
77 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-commit" title="gst_ring_buffer_commit ()">gst_ring_buffer_commit</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
78 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> sample</code></em>,
79 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
80 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> len</code></em>);
81 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-commit-full" title="gst_ring_buffer_commit_full ()">gst_ring_buffer_commit_full</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
82 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *sample</code></em>,
83 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
84 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> in_samples</code></em>,
85 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> out_samples</code></em>,
86 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *accum</code></em>);
87 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-convert" title="gst_ring_buffer_convert ()">gst_ring_buffer_convert</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
88 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a> src_fmt</code></em>,
89 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> src_val</code></em>,
90 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a> dest_fmt</code></em>,
91 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> *dest_val</code></em>);
92 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-prepare-read" title="gst_ring_buffer_prepare_read ()">gst_ring_buffer_prepare_read</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
93 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *segment</code></em>,
94 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **readptr</code></em>,
95 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *len</code></em>);
96 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-read" title="gst_ring_buffer_read ()">gst_ring_buffer_read</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
97 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> sample</code></em>,
98 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
99 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> len</code></em>);
100 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-clear" title="gst_ring_buffer_clear ()">gst_ring_buffer_clear</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
101 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> segment</code></em>);
102 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-clear-all" title="gst_ring_buffer_clear_all ()">gst_ring_buffer_clear_all</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
103 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-advance" title="gst_ring_buffer_advance ()">gst_ring_buffer_advance</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
104 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> advance</code></em>);
105 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-close-device" title="gst_ring_buffer_close_device ()">gst_ring_buffer_close_device</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
106 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-open-device" title="gst_ring_buffer_open_device ()">gst_ring_buffer_open_device</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
107 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-device-is-open" title="gst_ring_buffer_device_is_open ()">gst_ring_buffer_device_is_open</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);
108 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-may-start" title="gst_ring_buffer_may_start ()">gst_ring_buffer_may_start</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
109 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allowed</code></em>);
110 <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-parse-caps" title="gst_ring_buffer_parse_caps ()">gst_ring_buffer_parse_caps</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferSpec" title="struct GstRingBufferSpec"><span class="type">GstRingBufferSpec</span></a> *spec</code></em>,
111 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>);
112 <span class="returnvalue">void</span> <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-set-flushing" title="gst_ring_buffer_set_flushing ()">gst_ring_buffer_set_flushing</a> (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
113 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> flushing</code></em>);
116 <div class="refsect1">
117 <a name="gst-plugins-base-libs-gstringbuffer.object-hierarchy"></a><h2>Object Hierarchy</h2>
118 <pre class="synopsis">
119 <a href="http://library.gnome.org/devel/gobject/unstable/gobject-The-Base-Object-Type.html#GObject">GObject</a>
120 +----<a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstObject.html">GstObject</a>
124 <div class="refsect1">
125 <a name="gst-plugins-base-libs-gstringbuffer.description"></a><h2>Description</h2>
128 <div class="refsect2">
129 <a name="idp11277488"></a><p>
130 This object is the base class for audio ringbuffers used by the base
131 audio source and sink classes.
134 The ringbuffer abstracts a circular buffer of data. One reader and
135 one writer can operate on the data from different threads in a lockfree
136 manner. The base class is sufficiently flexible to be used as an
137 abstraction for DMA based ringbuffers as well as a pure software
144 Last reviewed on 2006-02-02 (0.10.4)
147 <div class="refsect1">
148 <a name="gst-plugins-base-libs-gstringbuffer.details"></a><h2>Details</h2>
149 <div class="refsect2">
150 <a name="GstRingBuffer-struct"></a><h3>struct GstRingBuffer</h3>
151 <pre class="programlisting">struct GstRingBuffer {
156 GstRingBufferSpec spec;
157 GstRingBufferSegState *segstate;
158 gint samples_per_seg;
168 The ringbuffer base class structure.
170 <div class="variablelist"><table border="0">
171 <col align="left" valign="top">
174 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Threads.html#GCond"><span class="type">GCond</span></a> *<em class="structfield"><code><a name="GstRingBuffer-struct.cond"></a>cond</code></em>;</span></p></td>
175 <td>used to signal start/stop/pause/resume actions</td>
178 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="GstRingBuffer-struct.open"></a>open</code></em>;</span></p></td>
179 <td>boolean indicating that the ringbuffer is open</td>
182 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="GstRingBuffer-struct.acquired"></a>acquired</code></em>;</span></p></td>
183 <td>boolean indicating that the ringbuffer is acquired</td>
186 <td><p><span class="term"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a> *<em class="structfield"><code><a name="GstRingBuffer-struct.data"></a>data</code></em>;</span></p></td>
187 <td>data in the ringbuffer</td>
190 <td><p><span class="term"><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferSpec" title="struct GstRingBufferSpec"><span class="type">GstRingBufferSpec</span></a> <em class="structfield"><code><a name="GstRingBuffer-struct.spec"></a>spec</code></em>;</span></p></td>
191 <td>format and layout of the ringbuffer data</td>
194 <td><p><span class="term"><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferSegState" title="enum GstRingBufferSegState"><span class="type">GstRingBufferSegState</span></a> *<em class="structfield"><code><a name="GstRingBuffer-struct.segstate"></a>segstate</code></em>;</span></p></td>
195 <td>status of each segment in the ringbuffer (unused)</td>
198 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBuffer-struct.samples-per-seg"></a>samples_per_seg</code></em>;</span></p></td>
199 <td>number of samples in one segment</td>
202 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *<em class="structfield"><code><a name="GstRingBuffer-struct.empty-seg"></a>empty_seg</code></em>;</span></p></td>
203 <td>pointer to memory holding one segment of silence samples</td>
206 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBuffer-struct.state"></a>state</code></em>;</span></p></td>
207 <td>state of the buffer</td>
210 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBuffer-struct.segdone"></a>segdone</code></em>;</span></p></td>
211 <td>readpointer in the ringbuffer</td>
214 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBuffer-struct.segbase"></a>segbase</code></em>;</span></p></td>
215 <td>segment corresponding to segment 0 (unused)</td>
218 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBuffer-struct.waiting"></a>waiting</code></em>;</span></p></td>
219 <td>is a reader or writer waiting for a free segment</td>
225 <div class="refsect2">
226 <a name="GstRingBufferClass"></a><h3>struct GstRingBufferClass</h3>
227 <pre class="programlisting">struct GstRingBufferClass {
228 GstObjectClass parent_class;
230 gboolean (*open_device) (GstRingBuffer *buf);
231 gboolean (*acquire) (GstRingBuffer *buf, GstRingBufferSpec *spec);
232 gboolean (*release) (GstRingBuffer *buf);
233 gboolean (*close_device) (GstRingBuffer *buf);
235 gboolean (*start) (GstRingBuffer *buf);
236 gboolean (*pause) (GstRingBuffer *buf);
237 gboolean (*resume) (GstRingBuffer *buf);
238 gboolean (*stop) (GstRingBuffer *buf);
240 guint (*delay) (GstRingBuffer *buf);
243 gboolean (*activate) (GstRingBuffer *buf, gboolean active);
245 guint (*commit) (GstRingBuffer * buf, guint64 *sample,
246 guchar * data, gint in_samples,
247 gint out_samples, gint * accum);
249 void (*clear_all) (GstRingBuffer * buf);
253 The vmethods that subclasses can override to implement the ringbuffer.
255 <div class="variablelist"><table border="0">
256 <col align="left" valign="top">
259 <td><p><span class="term"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstObject.html#GstObjectClass"><span class="type">GstObjectClass</span></a> <em class="structfield"><code><a name="GstRingBufferClass.parent-class"></a>parent_class</code></em>;</span></p></td>
260 <td>parent class</td>
263 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.open-device"></a>open_device</code></em> ()</span></p></td>
264 <td>open the device, don't set any params or allocate anything</td>
267 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.acquire"></a>acquire</code></em> ()</span></p></td>
268 <td>allocate the resources for the ringbuffer using the given spec</td>
271 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.release"></a>release</code></em> ()</span></p></td>
272 <td>free resources of the ringbuffer</td>
275 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.close-device"></a>close_device</code></em> ()</span></p></td>
276 <td>close the device</td>
279 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.start"></a>start</code></em> ()</span></p></td>
280 <td>start processing of samples</td>
283 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.pause"></a>pause</code></em> ()</span></p></td>
284 <td>pause processing of samples</td>
287 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.resume"></a>resume</code></em> ()</span></p></td>
288 <td>resume processing of samples after pause</td>
291 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.stop"></a>stop</code></em> ()</span></p></td>
292 <td>stop processing of samples</td>
295 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.delay"></a>delay</code></em> ()</span></p></td>
296 <td>get number of samples queued in device</td>
299 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.activate"></a>activate</code></em> ()</span></p></td>
300 <td>activate the thread that starts pulling and monitoring the
301 consumed segments in the device. Since 0.10.22</td>
304 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.commit"></a>commit</code></em> ()</span></p></td>
305 <td>write samples into the ringbuffer</td>
308 <td><p><span class="term"><em class="structfield"><code><a name="GstRingBufferClass.clear-all"></a>clear_all</code></em> ()</span></p></td>
309 <td>clear the entire ringbuffer Since 0.10.24</td>
315 <div class="refsect2">
316 <a name="GstRingBufferSpec"></a><h3>struct GstRingBufferSpec</h3>
317 <pre class="programlisting">struct GstRingBufferSpec {
319 GstCaps *caps; /* the caps of the buffer */
322 GstBufferFormatType type;
323 GstBufferFormat format;
331 guint64 latency_time; /* the required/actual latency time, this is the
332 * actual the size of one segment and the
333 * minimum possible latency we can achieve. */
334 guint64 buffer_time; /* the required/actual time of the buffer, this is
335 * the total size of the buffer and maximum
336 * latency we can compensate for. */
337 gint segsize; /* size of one buffer segment in bytes, this value
338 * should be chosen to match latency_time as
339 * well as possible. */
340 gint segtotal; /* total number of segments, this value is the
341 * number of segments of @segsize and should be
342 * chosen so that it matches buffer_time as
343 * close as possible. */
345 gint bytes_per_sample; /* number of bytes of one sample */
346 guint8 silence_sample[32]; /* bytes representing silence */
348 /* ABI added 0.10.20 */
349 gint seglatency; /* number of segments queued in the lower
350 * level device, defaults to segtotal. */
354 The structure containing the format specification of the ringbuffer.
356 <div class="variablelist"><table border="0">
357 <col align="left" valign="top">
360 <td><p><span class="term"><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *<em class="structfield"><code><a name="GstRingBufferSpec.caps"></a>caps</code></em>;</span></p></td>
361 <td>The caps that generated the Spec.</td>
364 <td><p><span class="term"><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstBufferFormatType" title="enum GstBufferFormatType"><span class="type">GstBufferFormatType</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.type"></a>type</code></em>;</span></p></td>
365 <td>the sample type</td>
368 <td><p><span class="term"><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstBufferFormat" title="enum GstBufferFormat"><span class="type">GstBufferFormat</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.format"></a>format</code></em>;</span></p></td>
369 <td>the sample format</td>
372 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.sign"></a>sign</code></em>;</span></p></td>
373 <td>the sample sign</td>
376 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.bigend"></a>bigend</code></em>;</span></p></td>
377 <td>the endianness of the samples</td>
380 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.width"></a>width</code></em>;</span></p></td>
381 <td>the width of the samples</td>
384 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.depth"></a>depth</code></em>;</span></p></td>
385 <td>th depth of the samples</td>
388 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.rate"></a>rate</code></em>;</span></p></td>
389 <td>the samplerate</td>
392 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.channels"></a>channels</code></em>;</span></p></td>
393 <td>the number of channels</td>
396 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.latency-time"></a>latency_time</code></em>;</span></p></td>
397 <td>the latency in microseconds</td>
400 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.buffer-time"></a>buffer_time</code></em>;</span></p></td>
401 <td>the total buffer size in microseconds</td>
404 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.segsize"></a>segsize</code></em>;</span></p></td>
405 <td>the size of one segment in bytes</td>
408 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.segtotal"></a>segtotal</code></em>;</span></p></td>
409 <td>the total number of segments</td>
412 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.bytes-per-sample"></a>bytes_per_sample</code></em>;</span></p></td>
413 <td>number of bytes in one sample</td>
416 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.silence-sample"></a>silence_sample</code></em>[32];</span></p></td>
417 <td>bytes representing one sample of silence</td>
420 <td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GstRingBufferSpec.seglatency"></a>seglatency</code></em>;</span></p></td>
421 <td>number of segments queued in the lower level device,
422 defaults to segtotal</td>
428 <div class="refsect2">
429 <a name="GstRingBufferCallback"></a><h3>GstRingBufferCallback ()</h3>
430 <pre class="programlisting"><span class="returnvalue">void</span> (*GstRingBufferCallback) (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *rbuf</code></em>,
431 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> *data</code></em>,
432 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> len</code></em>,
433 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
435 This function is set with <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-set-callback" title="gst_ring_buffer_set_callback ()"><code class="function">gst_ring_buffer_set_callback()</code></a> and is
436 called to fill the memory at <em class="parameter"><code>data</code></em> with <em class="parameter"><code>len</code></em> bytes of samples.
438 <div class="variablelist"><table border="0">
439 <col align="left" valign="top">
442 <td><p><span class="term"><em class="parameter"><code>rbuf</code></em> :</span></p></td>
443 <td>a <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a>
447 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
448 <td>target to fill</td>
451 <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
452 <td>amount to fill</td>
455 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
462 <div class="refsect2">
463 <a name="GstRingBufferSegState"></a><h3>enum GstRingBufferSegState</h3>
464 <pre class="programlisting">typedef enum {
465 GST_SEGSTATE_INVALID,
469 } GstRingBufferSegState;
472 The state of a segment in the ringbuffer.
474 <div class="variablelist"><table border="0">
475 <col align="left" valign="top">
478 <td><p><a name="GST-SEGSTATE-INVALID:CAPS"></a><span class="term"><code class="literal">GST_SEGSTATE_INVALID</code></span></p></td>
479 <td>The content of the segment is invalid
483 <td><p><a name="GST-SEGSTATE-EMPTY:CAPS"></a><span class="term"><code class="literal">GST_SEGSTATE_EMPTY</code></span></p></td>
484 <td>The segment is empty
488 <td><p><a name="GST-SEGSTATE-FILLED:CAPS"></a><span class="term"><code class="literal">GST_SEGSTATE_FILLED</code></span></p></td>
489 <td>The segment contains valid data
493 <td><p><a name="GST-SEGSTATE-PARTIAL:CAPS"></a><span class="term"><code class="literal">GST_SEGSTATE_PARTIAL</code></span></p></td>
494 <td>The segment partially contains valid data
501 <div class="refsect2">
502 <a name="GstRingBufferState"></a><h3>enum GstRingBufferState</h3>
503 <pre class="programlisting">typedef enum {
504 GST_RING_BUFFER_STATE_STOPPED,
505 GST_RING_BUFFER_STATE_PAUSED,
506 GST_RING_BUFFER_STATE_STARTED
507 } GstRingBufferState;
510 The state of the ringbuffer.
512 <div class="variablelist"><table border="0">
513 <col align="left" valign="top">
516 <td><p><a name="GST-RING-BUFFER-STATE-STOPPED:CAPS"></a><span class="term"><code class="literal">GST_RING_BUFFER_STATE_STOPPED</code></span></p></td>
517 <td>The ringbuffer is stopped
521 <td><p><a name="GST-RING-BUFFER-STATE-PAUSED:CAPS"></a><span class="term"><code class="literal">GST_RING_BUFFER_STATE_PAUSED</code></span></p></td>
522 <td>The ringbuffer is paused
526 <td><p><a name="GST-RING-BUFFER-STATE-STARTED:CAPS"></a><span class="term"><code class="literal">GST_RING_BUFFER_STATE_STARTED</code></span></p></td>
527 <td>The ringbuffer is started
534 <div class="refsect2">
535 <a name="GstBufferFormat"></a><h3>enum GstBufferFormat</h3>
536 <pre class="programlisting">typedef enum
590 <div class="refsect2">
591 <a name="GstBufferFormatType"></a><h3>enum GstBufferFormatType</h3>
592 <pre class="programlisting">typedef enum
598 GST_BUFTYPE_IMA_ADPCM,
605 } GstBufferFormatType;
608 The format of the samples in the ringbuffer.
610 <div class="variablelist"><table border="0">
611 <col align="left" valign="top">
614 <td><p><a name="GST-BUFTYPE-LINEAR:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_LINEAR</code></span></p></td>
615 <td>samples in linear PCM
619 <td><p><a name="GST-BUFTYPE-FLOAT:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_FLOAT</code></span></p></td>
624 <td><p><a name="GST-BUFTYPE-MU-LAW:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_MU_LAW</code></span></p></td>
629 <td><p><a name="GST-BUFTYPE-A-LAW:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_A_LAW</code></span></p></td>
634 <td><p><a name="GST-BUFTYPE-IMA-ADPCM:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_IMA_ADPCM</code></span></p></td>
635 <td>samples in ima adpcm
639 <td><p><a name="GST-BUFTYPE-MPEG:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_MPEG</code></span></p></td>
640 <td>samples in mpeg audio format
644 <td><p><a name="GST-BUFTYPE-GSM:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_GSM</code></span></p></td>
645 <td>samples in gsm format
649 <td><p><a name="GST-BUFTYPE-IEC958:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_IEC958</code></span></p></td>
650 <td>samples in IEC958 frames (e.g. AC3)
654 <td><p><a name="GST-BUFTYPE-AC3:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_AC3</code></span></p></td>
655 <td>samples in AC3 format
659 <td><p><a name="GST-BUFTYPE-EAC3:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_EAC3</code></span></p></td>
660 <td>samples in EAC3 format
664 <td><p><a name="GST-BUFTYPE-DTS:CAPS"></a><span class="term"><code class="literal">GST_BUFTYPE_DTS</code></span></p></td>
665 <td>samples in DTS format
672 <div class="refsect2">
673 <a name="GST-RING-BUFFER-BROADCAST:CAPS"></a><h3>GST_RING_BUFFER_BROADCAST()</h3>
674 <pre class="programlisting">#define GST_RING_BUFFER_BROADCAST(buf)(g_cond_broadcast (GST_RING_BUFFER_GET_COND (buf)))
678 <div class="refsect2">
679 <a name="GST-RING-BUFFER-GET-COND:CAPS"></a><h3>GST_RING_BUFFER_GET_COND()</h3>
680 <pre class="programlisting">#define GST_RING_BUFFER_GET_COND(buf) (((GstRingBuffer *)buf)->cond)
684 <div class="refsect2">
685 <a name="GST-RING-BUFFER-SIGNAL:CAPS"></a><h3>GST_RING_BUFFER_SIGNAL()</h3>
686 <pre class="programlisting">#define GST_RING_BUFFER_SIGNAL(buf) (g_cond_signal (GST_RING_BUFFER_GET_COND (buf)))
690 <div class="refsect2">
691 <a name="GST-RING-BUFFER-WAIT:CAPS"></a><h3>GST_RING_BUFFER_WAIT()</h3>
692 <pre class="programlisting">#define GST_RING_BUFFER_WAIT(buf) (g_cond_wait (GST_RING_BUFFER_GET_COND (buf), GST_OBJECT_GET_LOCK (buf)))
696 <div class="refsect2">
697 <a name="gst-ring-buffer-set-callback"></a><h3>gst_ring_buffer_set_callback ()</h3>
698 <pre class="programlisting"><span class="returnvalue">void</span> gst_ring_buffer_set_callback (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
699 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferCallback" title="GstRingBufferCallback ()"><span class="type">GstRingBufferCallback</span></a> cb</code></em>,
700 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> user_data</code></em>);</pre>
702 Sets the given callback function on the buffer. This function
703 will be called every time a segment has been written to a device.
708 <div class="variablelist"><table border="0">
709 <col align="left" valign="top">
712 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
713 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to set the callback on</td>
716 <td><p><span class="term"><em class="parameter"><code>cb</code></em> :</span></p></td>
717 <td>the callback to set</td>
720 <td><p><span class="term"><em class="parameter"><code>user_data</code></em> :</span></p></td>
721 <td>user data passed to the callback</td>
727 <div class="refsect2">
728 <a name="gst-ring-buffer-acquire"></a><h3>gst_ring_buffer_acquire ()</h3>
729 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_acquire (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
730 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferSpec" title="struct GstRingBufferSpec"><span class="type">GstRingBufferSpec</span></a> *spec</code></em>);</pre>
732 Allocate the resources for the ringbuffer. This function fills
733 in the data pointer of the ring buffer with a valid <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstBuffer.html#GstBuffer"><span class="type">GstBuffer</span></a>
734 to which samples can be written.
736 <div class="variablelist"><table border="0">
737 <col align="left" valign="top">
740 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
741 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to acquire</td>
744 <td><p><span class="term"><em class="parameter"><code>spec</code></em> :</span></p></td>
745 <td>the specs of the buffer</td>
748 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
749 <td>TRUE if the device could be acquired, FALSE on error.
756 <div class="refsect2">
757 <a name="gst-ring-buffer-release"></a><h3>gst_ring_buffer_release ()</h3>
758 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_release (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
760 Free the resources of the ringbuffer.
762 <div class="variablelist"><table border="0">
763 <col align="left" valign="top">
766 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
767 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to release</td>
770 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
771 <td>TRUE if the device could be released, FALSE on error.
778 <div class="refsect2">
779 <a name="gst-ring-buffer-is-acquired"></a><h3>gst_ring_buffer_is_acquired ()</h3>
780 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_is_acquired (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
782 Check if the ringbuffer is acquired and ready to use.
784 <div class="variablelist"><table border="0">
785 <col align="left" valign="top">
788 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
789 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to check</td>
792 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
793 <td>TRUE if the ringbuffer is acquired, FALSE on error.
800 <div class="refsect2">
801 <a name="gst-ring-buffer-activate"></a><h3>gst_ring_buffer_activate ()</h3>
802 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_activate (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
803 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> active</code></em>);</pre>
805 Activate <em class="parameter"><code>buf</code></em> to start or stop pulling data.
810 <div class="variablelist"><table border="0">
811 <col align="left" valign="top">
814 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
815 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to activate</td>
818 <td><p><span class="term"><em class="parameter"><code>active</code></em> :</span></p></td>
819 <td>the new mode</td>
822 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
823 <td>TRUE if the device could be activated in the requested mode,
828 <p class="since">Since 0.10.22.</p>
831 <div class="refsect2">
832 <a name="gst-ring-buffer-is-active"></a><h3>gst_ring_buffer_is_active ()</h3>
833 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_is_active (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
835 Check if <em class="parameter"><code>buf</code></em> is activated.
840 <div class="variablelist"><table border="0">
841 <col align="left" valign="top">
844 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
845 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a>
849 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
850 <td>TRUE if the device is active.</td>
854 <p class="since">Since 0.10.22.</p>
857 <div class="refsect2">
858 <a name="gst-ring-buffer-start"></a><h3>gst_ring_buffer_start ()</h3>
859 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_start (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
861 Start processing samples from the ringbuffer.
863 <div class="variablelist"><table border="0">
864 <col align="left" valign="top">
867 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
868 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to start</td>
871 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
872 <td>TRUE if the device could be started, FALSE on error.
879 <div class="refsect2">
880 <a name="gst-ring-buffer-pause"></a><h3>gst_ring_buffer_pause ()</h3>
881 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_pause (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
883 Pause processing samples from the ringbuffer.
885 <div class="variablelist"><table border="0">
886 <col align="left" valign="top">
889 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
890 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to pause</td>
893 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
894 <td>TRUE if the device could be paused, FALSE on error.
901 <div class="refsect2">
902 <a name="gst-ring-buffer-stop"></a><h3>gst_ring_buffer_stop ()</h3>
903 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_stop (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
905 Stop processing samples from the ringbuffer.
907 <div class="variablelist"><table border="0">
908 <col align="left" valign="top">
911 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
912 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to stop</td>
915 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
916 <td>TRUE if the device could be stopped, FALSE on error.
923 <div class="refsect2">
924 <a name="gst-ring-buffer-delay"></a><h3>gst_ring_buffer_delay ()</h3>
925 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gst_ring_buffer_delay (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
927 Get the number of samples queued in the audio device. This is
928 usually less than the segment size but can be bigger when the
929 implementation uses another internal buffer between the audio
933 For playback ringbuffers this is the amount of samples transfered from the
934 ringbuffer to the device but still not played.
937 For capture ringbuffers this is the amount of samples in the device that are
938 not yet transfered to the ringbuffer.
940 <div class="variablelist"><table border="0">
941 <col align="left" valign="top">
944 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
945 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to query</td>
948 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
949 <td>The number of samples queued in the audio device.
956 <div class="refsect2">
957 <a name="gst-ring-buffer-samples-done"></a><h3>gst_ring_buffer_samples_done ()</h3>
958 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="returnvalue">guint64</span></a> gst_ring_buffer_samples_done (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
960 Get the number of samples that were processed by the ringbuffer
961 since it was last started. This does not include the number of samples not
962 yet processed (see <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-delay" title="gst_ring_buffer_delay ()"><code class="function">gst_ring_buffer_delay()</code></a>).
964 <div class="variablelist"><table border="0">
965 <col align="left" valign="top">
968 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
969 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to query</td>
972 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
973 <td>The number of samples processed by the ringbuffer.
980 <div class="refsect2">
981 <a name="gst-ring-buffer-set-sample"></a><h3>gst_ring_buffer_set_sample ()</h3>
982 <pre class="programlisting"><span class="returnvalue">void</span> gst_ring_buffer_set_sample (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
983 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> sample</code></em>);</pre>
985 Make sure that the next sample written to the device is
986 accounted for as being the <em class="parameter"><code>sample</code></em> sample written to the
987 device. This value will be used in reporting the current
988 sample position of the ringbuffer.
991 This function will also clear the buffer with silence.
996 <div class="variablelist"><table border="0">
997 <col align="left" valign="top">
1000 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1001 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to use</td>
1004 <td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
1005 <td>the sample number to set</td>
1011 <div class="refsect2">
1012 <a name="gst-ring-buffer-commit"></a><h3>gst_ring_buffer_commit ()</h3>
1013 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gst_ring_buffer_commit (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1014 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> sample</code></em>,
1015 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
1016 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> len</code></em>);</pre>
1018 Same as <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-commit-full" title="gst_ring_buffer_commit_full ()"><code class="function">gst_ring_buffer_commit_full()</code></a> but with a in_samples and out_samples
1019 equal to <em class="parameter"><code>len</code></em>, ignoring accum.
1021 <div class="variablelist"><table border="0">
1022 <col align="left" valign="top">
1025 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1026 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to commit</td>
1029 <td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
1030 <td>the sample position of the data</td>
1033 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1034 <td>the data to commit</td>
1037 <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
1038 <td>the number of samples in the data to commit</td>
1041 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1042 <td>The number of samples written to the ringbuffer or -1 on
1050 <div class="refsect2">
1051 <a name="gst-ring-buffer-commit-full"></a><h3>gst_ring_buffer_commit_full ()</h3>
1052 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gst_ring_buffer_commit_full (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1053 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> *sample</code></em>,
1054 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
1055 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> in_samples</code></em>,
1056 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> out_samples</code></em>,
1057 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *accum</code></em>);</pre>
1059 Commit <em class="parameter"><code>in_samples</code></em> samples pointed to by <em class="parameter"><code>data</code></em> to the ringbuffer <em class="parameter"><code>buf</code></em>.
1062 <em class="parameter"><code>in_samples</code></em> and <em class="parameter"><code>out_samples</code></em> define the rate conversion to perform on the the
1063 samples in <em class="parameter"><code>data</code></em>. For negative rates, <em class="parameter"><code>out_samples</code></em> must be negative and
1064 <em class="parameter"><code>in_samples</code></em> positive.
1067 When <em class="parameter"><code>out_samples</code></em> is positive, the first sample will be written at position <em class="parameter"><code>sample</code></em>
1068 in the ringbuffer. When <em class="parameter"><code>out_samples</code></em> is negative, the last sample will be written to
1069 <em class="parameter"><code>sample</code></em> in reverse order.
1072 <em class="parameter"><code>out_samples</code></em> does not need to be a multiple of the segment size of the ringbuffer
1073 although it is recommended for optimal performance.
1076 <em class="parameter"><code>accum</code></em> will hold a temporary accumulator used in rate conversion and should be
1077 set to 0 when this function is first called. In case the commit operation is
1078 interrupted, one can resume the processing by passing the previously returned
1079 <em class="parameter"><code>accum</code></em> value back to this function.
1084 <div class="variablelist"><table border="0">
1085 <col align="left" valign="top">
1088 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1089 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to commit</td>
1092 <td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
1093 <td>the sample position of the data</td>
1096 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1097 <td>the data to commit</td>
1100 <td><p><span class="term"><em class="parameter"><code>in_samples</code></em> :</span></p></td>
1101 <td>the number of samples in the data to commit</td>
1104 <td><p><span class="term"><em class="parameter"><code>out_samples</code></em> :</span></p></td>
1105 <td>the number of samples to write to the ringbuffer</td>
1108 <td><p><span class="term"><em class="parameter"><code>accum</code></em> :</span></p></td>
1109 <td>accumulator for rate conversion.</td>
1112 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1113 <td>The number of samples written to the ringbuffer or -1 on error. The
1114 number of samples written can be less than <em class="parameter"><code>out_samples</code></em> when <em class="parameter"><code>buf</code></em> was interrupted
1115 with a flush or stop.</td>
1119 <p class="since">Since 0.10.11.</p>
1122 <div class="refsect2">
1123 <a name="gst-ring-buffer-convert"></a><h3>gst_ring_buffer_convert ()</h3>
1124 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_convert (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1125 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a> src_fmt</code></em>,
1126 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> src_val</code></em>,
1127 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstFormat.html#GstFormat"><span class="type">GstFormat</span></a> dest_fmt</code></em>,
1128 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint64"><span class="type">gint64</span></a> *dest_val</code></em>);</pre>
1130 Convert <em class="parameter"><code>src_val</code></em> in <em class="parameter"><code>src_fmt</code></em> to the equivalent value in <em class="parameter"><code>dest_fmt</code></em>. The result
1131 will be put in <em class="parameter"><code>dest_val</code></em>.
1133 <div class="variablelist"><table border="0">
1134 <col align="left" valign="top">
1137 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1138 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a>
1142 <td><p><span class="term"><em class="parameter"><code>src_fmt</code></em> :</span></p></td>
1143 <td>the source format</td>
1146 <td><p><span class="term"><em class="parameter"><code>src_val</code></em> :</span></p></td>
1147 <td>the source value</td>
1150 <td><p><span class="term"><em class="parameter"><code>dest_fmt</code></em> :</span></p></td>
1151 <td>the destination format</td>
1154 <td><p><span class="term"><em class="parameter"><code>dest_val</code></em> :</span></p></td>
1155 <td>a location to store the converted value</td>
1158 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1159 <td>TRUE if the conversion succeeded.</td>
1163 <p class="since">Since 0.10.22.</p>
1166 <div class="refsect2">
1167 <a name="gst-ring-buffer-prepare-read"></a><h3>gst_ring_buffer_prepare_read ()</h3>
1168 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_prepare_read (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1169 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *segment</code></em>,
1170 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint8"><span class="type">guint8</span></a> **readptr</code></em>,
1171 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *len</code></em>);</pre>
1173 Returns a pointer to memory where the data from segment <em class="parameter"><code>segment</code></em>
1174 can be found. This function is mostly used by subclasses.
1176 <div class="variablelist"><table border="0">
1177 <col align="left" valign="top">
1180 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1181 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to read from</td>
1184 <td><p><span class="term"><em class="parameter"><code>segment</code></em> :</span></p></td>
1185 <td>the segment to read</td>
1188 <td><p><span class="term"><em class="parameter"><code>readptr</code></em> :</span></p></td>
1189 <td>the pointer to the memory where samples can be read</td>
1192 <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
1193 <td>the number of bytes to read</td>
1196 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1197 <td>FALSE if the buffer is not started.
1204 <div class="refsect2">
1205 <a name="gst-ring-buffer-read"></a><h3>gst_ring_buffer_read ()</h3>
1206 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gst_ring_buffer_read (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1207 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint64"><span class="type">guint64</span></a> sample</code></em>,
1208 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guchar"><span class="type">guchar</span></a> *data</code></em>,
1209 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> len</code></em>);</pre>
1211 Read <em class="parameter"><code>len</code></em> samples from the ringbuffer into the memory pointed
1212 to by <em class="parameter"><code>data</code></em>.
1213 The first sample should be read from position <em class="parameter"><code>sample</code></em> in
1217 <em class="parameter"><code>len</code></em> should not be a multiple of the segment size of the ringbuffer
1218 although it is recommended.
1220 <div class="variablelist"><table border="0">
1221 <col align="left" valign="top">
1224 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1225 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to read from</td>
1228 <td><p><span class="term"><em class="parameter"><code>sample</code></em> :</span></p></td>
1229 <td>the sample position of the data</td>
1232 <td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1233 <td>where the data should be read</td>
1236 <td><p><span class="term"><em class="parameter"><code>len</code></em> :</span></p></td>
1237 <td>the number of samples in data to read</td>
1240 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1241 <td>The number of samples read from the ringbuffer or -1 on
1249 <div class="refsect2">
1250 <a name="gst-ring-buffer-clear"></a><h3>gst_ring_buffer_clear ()</h3>
1251 <pre class="programlisting"><span class="returnvalue">void</span> gst_ring_buffer_clear (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1252 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> segment</code></em>);</pre>
1254 Clear the given segment of the buffer with silence samples.
1255 This function is used by subclasses.
1260 <div class="variablelist"><table border="0">
1261 <col align="left" valign="top">
1264 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1265 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to clear</td>
1268 <td><p><span class="term"><em class="parameter"><code>segment</code></em> :</span></p></td>
1269 <td>the segment to clear</td>
1275 <div class="refsect2">
1276 <a name="gst-ring-buffer-clear-all"></a><h3>gst_ring_buffer_clear_all ()</h3>
1277 <pre class="programlisting"><span class="returnvalue">void</span> gst_ring_buffer_clear_all (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
1279 Fill the ringbuffer with silence.
1284 <div class="variablelist"><table border="0">
1285 <col align="left" valign="top">
1287 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1288 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to clear</td>
1293 <div class="refsect2">
1294 <a name="gst-ring-buffer-advance"></a><h3>gst_ring_buffer_advance ()</h3>
1295 <pre class="programlisting"><span class="returnvalue">void</span> gst_ring_buffer_advance (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1296 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> advance</code></em>);</pre>
1298 Subclasses should call this function to notify the fact that
1299 <em class="parameter"><code>advance</code></em> segments are now processed by the device.
1304 <div class="variablelist"><table border="0">
1305 <col align="left" valign="top">
1308 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1309 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to advance</td>
1312 <td><p><span class="term"><em class="parameter"><code>advance</code></em> :</span></p></td>
1313 <td>the number of segments written</td>
1319 <div class="refsect2">
1320 <a name="gst-ring-buffer-close-device"></a><h3>gst_ring_buffer_close_device ()</h3>
1321 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_close_device (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
1323 Close the audio device associated with the ring buffer. The ring buffer
1324 should already have been released via <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#gst-ring-buffer-release" title="gst_ring_buffer_release ()"><code class="function">gst_ring_buffer_release()</code></a>.
1326 <div class="variablelist"><table border="0">
1327 <col align="left" valign="top">
1330 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1331 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a>
1335 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1336 <td>TRUE if the device could be closed, FALSE on error.
1343 <div class="refsect2">
1344 <a name="gst-ring-buffer-open-device"></a><h3>gst_ring_buffer_open_device ()</h3>
1345 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_open_device (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
1347 Open the audio device associated with the ring buffer. Does not perform any
1348 setup on the device. You must open the device before acquiring the ring
1351 <div class="variablelist"><table border="0">
1352 <col align="left" valign="top">
1355 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1356 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a>
1360 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1361 <td>TRUE if the device could be opened, FALSE on error.
1368 <div class="refsect2">
1369 <a name="gst-ring-buffer-device-is-open"></a><h3>gst_ring_buffer_device_is_open ()</h3>
1370 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_device_is_open (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>);</pre>
1372 Checks the status of the device associated with the ring buffer.
1374 <div class="variablelist"><table border="0">
1375 <col align="left" valign="top">
1378 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1379 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a>
1383 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1384 <td>TRUE if the device was open, FALSE if it was closed.
1391 <div class="refsect2">
1392 <a name="gst-ring-buffer-may-start"></a><h3>gst_ring_buffer_may_start ()</h3>
1393 <pre class="programlisting"><span class="returnvalue">void</span> gst_ring_buffer_may_start (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1394 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> allowed</code></em>);</pre>
1396 Tell the ringbuffer that it is allowed to start playback when
1397 the ringbuffer is filled with samples.
1402 <div class="variablelist"><table border="0">
1403 <col align="left" valign="top">
1406 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1407 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a>
1411 <td><p><span class="term"><em class="parameter"><code>allowed</code></em> :</span></p></td>
1412 <td>the new value</td>
1416 <p class="since">Since 0.10.6</p>
1419 <div class="refsect2">
1420 <a name="gst-ring-buffer-parse-caps"></a><h3>gst_ring_buffer_parse_caps ()</h3>
1421 <pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gst_ring_buffer_parse_caps (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBufferSpec" title="struct GstRingBufferSpec"><span class="type">GstRingBufferSpec</span></a> *spec</code></em>,
1422 <em class="parameter"><code><a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a> *caps</code></em>);</pre>
1424 Parse <em class="parameter"><code>caps</code></em> into <em class="parameter"><code>spec</code></em>.
1426 <div class="variablelist"><table border="0">
1427 <col align="left" valign="top">
1430 <td><p><span class="term"><em class="parameter"><code>spec</code></em> :</span></p></td>
1434 <td><p><span class="term"><em class="parameter"><code>caps</code></em> :</span></p></td>
1435 <td>a <a href="http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstCaps.html#GstCaps"><span class="type">GstCaps</span></a>
1439 <td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1440 <td>TRUE if the caps could be parsed.</td>
1446 <div class="refsect2">
1447 <a name="gst-ring-buffer-set-flushing"></a><h3>gst_ring_buffer_set_flushing ()</h3>
1448 <pre class="programlisting"><span class="returnvalue">void</span> gst_ring_buffer_set_flushing (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> *buf</code></em>,
1449 <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> flushing</code></em>);</pre>
1451 Set the ringbuffer to flushing mode or normal mode.
1456 <div class="variablelist"><table border="0">
1457 <col align="left" valign="top">
1460 <td><p><span class="term"><em class="parameter"><code>buf</code></em> :</span></p></td>
1461 <td>the <a class="link" href="gst-plugins-base-libs-gstringbuffer.html#GstRingBuffer"><span class="type">GstRingBuffer</span></a> to flush</td>
1464 <td><p><span class="term"><em class="parameter"><code>flushing</code></em> :</span></p></td>
1465 <td>the new mode</td>
1471 <div class="refsect1">
1472 <a name="gst-plugins-base-libs-gstringbuffer.see-also"></a><h2>See Also</h2>
1473 <a class="link" href="gst-plugins-base-libs-gstbaseaudiosink.html#GstBaseAudioSink"><span class="type">GstBaseAudioSink</span></a>, <a class="link" href="gst-plugins-base-libs-gstaudiosink.html#GstAudioSink"><span class="type">GstAudioSink</span></a>
1476 <div class="footer">
1478 Generated by GTK-Doc V1.17</div>