~pybind/pyswfdec/trunk

« back to all changes in this revision

Viewing changes to docs/reference/pyswfdec-bufferqueue.xml

  • Committer: Gian Mario Tagliaretti
  • Date: 2008-10-26 10:15:25 UTC
  • Revision ID: gianmt@urano-20081026101525-pklmlyo79ntquc24
docs updated

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" standalone="no"?>
 
2
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
 
3
        "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">
 
4
 
 
5
<refentry id="pyswfdec-bufferqueue">
 
6
 
 
7
    <refnamediv>
 
8
        <refname>swfdec.BufferQueue</refname>
 
9
            <refpurpose>Memory region handling.</refpurpose>
 
10
    </refnamediv>
 
11
 
 
12
    <refsect1>
 
13
        <title>Synopsis</title>
 
14
 
 
15
        <classsynopsis language="python">
 
16
            <ooclass><classname>swfdec.BufferQueue</classname></ooclass>
 
17
            <ooclass><classname>gobject.GBoxed</classname></ooclass>
 
18
            
 
19
            <constructorsynopsis language="python">
 
20
                <methodname><link linkend="constructor-bufferqueue">swfdec.BufferQueue</link></methodname>
 
21
                <methodparam></methodparam>
 
22
            </constructorsynopsis>
 
23
            
 
24
            <methodsynopsis language="python">
 
25
                <methodname><link linkend="method-swfbufferqueue--clear">clear</link></methodname>
 
26
                <methodparam></methodparam>
 
27
            </methodsynopsis>
 
28
            
 
29
            <methodsynopsis language="python">
 
30
                <methodname><link linkend="method-swfbufferqueue--flush">flush</link></methodname>
 
31
                <methodparam><parameter role="keyword">n_bytes</parameter></methodparam>
 
32
            </methodsynopsis>
 
33
            
 
34
            <methodsynopsis language="python">
 
35
                <methodname><link linkend="method-swfbufferqueue--get-depth">get_depth</link></methodname>
 
36
                <methodparam></methodparam>
 
37
            </methodsynopsis>
 
38
            
 
39
            <methodsynopsis language="python">
 
40
                <methodname><link linkend="method-swfbufferqueue--get-offset">get_offset</link></methodname>
 
41
                <methodparam></methodparam>
 
42
            </methodsynopsis>
 
43
            
 
44
            <methodsynopsis language="python">
 
45
                <methodname><link linkend="method-swfbufferqueue--peek">peek</link></methodname>
 
46
                <methodparam><parameter role="keyword">length</parameter></methodparam>
 
47
            </methodsynopsis>
 
48
            
 
49
            <methodsynopsis language="python">
 
50
                <methodname><link linkend="method-swfbufferqueue--peek-buffer">peek_buffer</link></methodname>
 
51
                <methodparam></methodparam>
 
52
            </methodsynopsis>
 
53
            
 
54
            <methodsynopsis language="python">
 
55
                <methodname><link linkend="method-swfbufferqueue--pull">pull</link></methodname>
 
56
                <methodparam><parameter role="keyword">length</parameter></methodparam>
 
57
            </methodsynopsis>
 
58
            
 
59
            <methodsynopsis language="python">
 
60
                <methodname><link linkend="method-swfbufferqueue--pull-buffer">pull_buffer</link></methodname>
 
61
                <methodparam></methodparam>
 
62
            </methodsynopsis>
 
63
            
 
64
            <methodsynopsis language="python">
 
65
                <methodname><link linkend="method-swfbufferqueue--push">push</link></methodname>
 
66
                <methodparam><parameter role="keyword">buffer</parameter></methodparam>
 
67
            </methodsynopsis>
 
68
        </classsynopsis>
 
69
 
 
70
    </refsect1>
 
71
 
 
72
    <refsect1>
 
73
        <title>Ancestry</title>
 
74
 
 
75
<synopsis>+-- <link linkend="class-gobjectgboxed">gobject.GBoxed</link>
 
76
    +-- <link linkend="pyswfdec-bufferqueue">swfdec.BufferQueue</link>
 
77
</synopsis>
 
78
 
 
79
    </refsect1>
 
80
    
 
81
    <refsect1>
 
82
        <title>Description</title>
 
83
            <para>
 
84
                A <link linkend="pyswfdec-bufferqueue"><classname>swfdec.BufferQueue</classname></link>
 
85
                is a queue of continuous buffers that allows reading its data in chunks of pre-defined sizes.
 
86
                It is used to transform a data stream that was provided by buffers of random sizes to buffers of the right size.
 
87
            </para>
 
88
    </refsect1>
 
89
    
 
90
    <refsect1 id="constructor-bufferqueue">
 
91
            <title>Constructor</title>
 
92
            
 
93
            <programlisting><constructorsynopsis language="python">
 
94
                            <methodname>swfdec.BufferQueue</methodname>
 
95
                    </constructorsynopsis></programlisting>
 
96
            
 
97
            <variablelist>
 
98
                    <varlistentry>
 
99
                            <term><emphasis>Returns</emphasis>&nbsp;:</term>
 
100
                            <listitem><simpara>A new 
 
101
                                            <link linkend="pyswfdec-bufferqueue"><classname>swfdec.BufferQueue</classname></link>
 
102
                                    </simpara></listitem>
 
103
                    </varlistentry>
 
104
            </variablelist>
 
105
            <para>
 
106
                    Creates a new <link linkend="pyswfdec-bufferqueue"><classname>swfdec.BufferQueue</classname></link>.
 
107
            </para>
 
108
        </refsect1>
 
109
        
 
110
    <refsect1>
 
111
        <title>Methods</title>
 
112
 
 
113
        <refsect2 id="method-swfbufferqueue--clear">
 
114
            <title>swfdec.BufferQueue.clear</title>
 
115
 
 
116
            <programlisting><methodsynopsis language="python">
 
117
                <methodname>clear</methodname>
 
118
                    <methodparam></methodparam>
 
119
                </methodsynopsis></programlisting>
 
120
 
 
121
            <variablelist>
 
122
            </variablelist>
 
123
 
 
124
            <para>
 
125
                Resets queue into to initial state. All buffers it contains will
 
126
                be released and the offset will be reset to 0.
 
127
            </para>
 
128
        </refsect2>
 
129
 
 
130
        <refsect2 id="method-swfbufferqueue--flush">
 
131
            <title>swfdec.BufferQueue.flush</title>
 
132
 
 
133
            <programlisting><methodsynopsis language="python">
 
134
                <methodname>flush</methodname>
 
135
                    <methodparam><parameter role="keyword">n_bytes</parameter></methodparam>
 
136
                </methodsynopsis></programlisting>
 
137
 
 
138
            <variablelist>
 
139
                <varlistentry>
 
140
                    <term><parameter role="keyword">n_bytes</parameter>&nbsp;:</term>
 
141
                    <listitem><simpara>amount of bytes to flush from the queue </simpara></listitem>
 
142
                </varlistentry>
 
143
            </variablelist>
 
144
 
 
145
            <para>
 
146
                Removes the first n_bytes bytes from the queue.
 
147
            </para>
 
148
        </refsect2>
 
149
        
 
150
        <refsect2 id="method-swfbufferqueue--get-depth">
 
151
            <title>swfdec.BufferQueue.get_depth</title>
 
152
 
 
153
            <programlisting><methodsynopsis language="python">
 
154
                <methodname>get_depth</methodname>
 
155
                    <methodparam></methodparam>
 
156
                </methodsynopsis></programlisting>
 
157
 
 
158
            <variablelist>
 
159
                <varlistentry>
 
160
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
 
161
                    <listitem><simpara>The amount of bytes in queue.</simpara></listitem>
 
162
                </varlistentry>
 
163
            </variablelist>
 
164
 
 
165
            <para>
 
166
                Returns the number of bytes currently in queue.
 
167
            </para>
 
168
        </refsect2>
 
169
        
 
170
        <refsect2 id="method-swfbufferqueue--get-offset">
 
171
            <title>swfdec.BufferQueue.get_offset</title>
 
172
 
 
173
            <programlisting><methodsynopsis language="python">
 
174
                <methodname>get_offset</methodname>
 
175
                    <methodparam></methodparam>
 
176
                </methodsynopsis></programlisting>
 
177
 
 
178
            <variablelist>
 
179
                <varlistentry>
 
180
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
 
181
                    <listitem><simpara>Number of bytes that were already pulled from this queue.</simpara></listitem>
 
182
                </varlistentry>
 
183
            </variablelist>
 
184
 
 
185
            <para>
 
186
                Queries the amount of bytes that has already been pulled out of
 
187
                queue using functions like
 
188
                <methodname><link linkend="method-swfbufferqueue--pull">swfdec.BufferQueue.pull()</link></methodname>
 
189
            </para>
 
190
        </refsect2>
 
191
        
 
192
        <refsect2 id="method-swfbufferqueue--peek">
 
193
            <title>swfdec.BufferQueue.peek</title>
 
194
 
 
195
            <programlisting><methodsynopsis language="python">
 
196
                <methodname>peek</methodname>
 
197
                    <methodparam><parameter role="keyword">length</parameter></methodparam>
 
198
                </methodsynopsis></programlisting>
 
199
 
 
200
            <variablelist>
 
201
                <varlistentry>
 
202
                    <term><parameter role="keyword">length</parameter>&nbsp;:</term>
 
203
                    <listitem><simpara>Amount of bytes to peek.</simpara></listitem>
 
204
                </varlistentry>
 
205
                <varlistentry>
 
206
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
 
207
                    <listitem><simpara>None if the requested amount of data wasn't
 
208
                    available or a new readonly SwfdecBuffer.</simpara></listitem>
 
209
                </varlistentry>
 
210
            </variablelist>
 
211
 
 
212
            <para>
 
213
                Creates a new buffer with the first length bytes from queue, but unlike
 
214
                <methodname><link linkend="method-swfbufferqueue--pull">swfdec.BufferQueue.pull()</link></methodname>
 
215
                does not remove them from queue.
 
216
            </para>
 
217
        </refsect2>
 
218
        
 
219
        <refsect2 id="method-swfbufferqueue--peek-buffer">
 
220
            <title>swfdec.BufferQueue.peek_buffer</title>
 
221
 
 
222
            <programlisting><methodsynopsis language="python">
 
223
                <methodname>peek_buffer</methodname>
 
224
                    <methodparam></methodparam>
 
225
                </methodsynopsis></programlisting>
 
226
 
 
227
            <variablelist>
 
228
                <varlistentry>
 
229
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
 
230
                    <listitem><simpara>The first buffer in queue or <literal>None</literal>
 
231
                    if queue is empty.</simpara></listitem>
 
232
                </varlistentry>
 
233
            </variablelist>
 
234
 
 
235
            <para>
 
236
                Gets the first buffer out of queue and returns it. This function is
 
237
                equivalent to calling
 
238
                <methodname><link linkend="method-swfbufferqueue--peek">swfdec.BufferQueue.peek</link></methodname>()
 
239
                with the size of the first buffer in it.
 
240
            </para>
 
241
        </refsect2>
 
242
        
 
243
        <refsect2 id="method-swfbufferqueue--pull">
 
244
            <title>swfdec.BufferQueue.pull</title>
 
245
 
 
246
            <programlisting><methodsynopsis language="python">
 
247
                <methodname>pull</methodname>
 
248
                    <methodparam><parameter role="keyword">length</parameter></methodparam>
 
249
                </methodsynopsis></programlisting>
 
250
 
 
251
            <variablelist>
 
252
                <varlistentry>
 
253
                    <term><parameter role="keyword">length</parameter>&nbsp;:</term>
 
254
                    <listitem><simpara>Amount of bytes to pull.</simpara></listitem>
 
255
                </varlistentry>
 
256
                <varlistentry>
 
257
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
 
258
                    <listitem><simpara>A new SwfdecBuffer or None</simpara></listitem>
 
259
                </varlistentry>
 
260
            </variablelist>
 
261
 
 
262
            <para>
 
263
                If enough data is still available in queue, the first length bytes
 
264
                are put into a new buffer and that buffer is returned. The length
 
265
                bytes are removed from the head of the queue. If not enough data is available,
 
266
                None is returned.
 
267
            </para>
 
268
        </refsect2>
 
269
        
 
270
        <refsect2 id="method-swfbufferqueue--pull-buffer">
 
271
            <title>swfdec.BufferQueue.pull_buffer</title>
 
272
 
 
273
            <programlisting><methodsynopsis language="python">
 
274
                <methodname>pull_buffer</methodname>
 
275
                    <methodparam></methodparam>
 
276
                </methodsynopsis></programlisting>
 
277
 
 
278
            <variablelist>
 
279
                <varlistentry>
 
280
                    <term><emphasis>Returns</emphasis>&nbsp;:</term>
 
281
                    <listitem><simpara>The first buffer in queue or None if queue is empty.</simpara></listitem>
 
282
                </varlistentry>
 
283
            </variablelist>
 
284
 
 
285
            <para>
 
286
                Pulls the first buffer out of queue and returns it. This function
 
287
                is equivalent to calling
 
288
                <methodname><link linkend="method-swfbufferqueue--pull">swfdec.BufferQueue.pull()</link></methodname>
 
289
                with the size of the first buffer in it.
 
290
            </para>
 
291
        </refsect2>
 
292
        
 
293
        <refsect2 id="method-swfbufferqueue--push">
 
294
            <title>swfdec.BufferQueue.push</title>
 
295
 
 
296
            <programlisting><methodsynopsis language="python">
 
297
                <methodname>push</methodname>
 
298
                    <methodparam><parameter role="keyword">buffer</parameter></methodparam>
 
299
                </methodsynopsis></programlisting>
 
300
 
 
301
            <variablelist>
 
302
                <varlistentry>
 
303
                    <term><parameter role="keyword">buffer</parameter>&nbsp;:</term>
 
304
                    <listitem><simpara>SwfdecBuffer to append to queue.</simpara></listitem>
 
305
                </varlistentry>
 
306
            </variablelist>
 
307
 
 
308
            <para>
 
309
                Appends the given buffer to the buffers already in queue. This function
 
310
                will take ownership of the given buffer.
 
311
            </para>
 
312
        </refsect2>
 
313
 
 
314
    </refsect1>
 
315
    
 
316
</refentry>