File: group__decfuncs.html

package info (click to toggle)
libtheora 1.1.1%2Bdfsg.1-15
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 7,460 kB
  • sloc: ansic: 32,561; sh: 9,675; makefile: 744
file content (367 lines) | stat: -rw-r--r-- 26,048 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>libtheora: Functions for Decoding</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
</div>
<div class="contents">
<h1>Functions for Decoding</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Functions for decoding</h2></td></tr>
<tr><td colspan="2"><p><a class="anchor" id="amgrp9d29c94aa62f20426aa5ff062c7daedd"></a>You must link to <code>libtheoradec</code> if you use any of the functions in this section.</p>
<p>The functions are listed in the order they are used in a typical decode. The basic steps are:</p>
<ul>
<li>Parse the header packets by repeatedly calling <a class="el" href="group__decfuncs.html#ga006d01d36fbe64768c571e6a12b7fc50" title="Decodes the header packets of a Theora stream.">th_decode_headerin()</a>.</li>
<li>Allocate a <a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729" title="The decoder context.">th_dec_ctx</a> handle with <a class="el" href="group__decfuncs.html#ga0ef07a9a97849054aa606c595a2d807e" title="Allocates a decoder instance.">th_decode_alloc()</a>.</li>
<li>Call <a class="el" href="group__decfuncs.html#gadef55431b68aaa59d0d7b32b2f118f27" title="Releases all storage used for the decoder setup information.">th_setup_free()</a> to free any memory used for codec setup information.</li>
<li>Perform any additional decoder configuration with <a class="el" href="group__decfuncs.html#ga1a8051958d75b1012573b6e3c8f670e1" title="Decoder control function.">th_decode_ctl()</a>.</li>
<li>For each video data packet:<ul>
<li>Submit the packet to the decoder via <a class="el" href="group__decfuncs.html#ga31c814bf09b2232aff69c57ae20f04eb" title="Submits a packet containing encoded video data to the decoder.">th_decode_packetin()</a>.</li>
<li>Retrieve the uncompressed video data via <a class="el" href="group__decfuncs.html#gaa9cc8af63fa8540e0fc95572f259cdcb" title="Outputs the next available frame of decoded Y&#39;CbCr data.">th_decode_ycbcr_out()</a>.</li>
</ul>
</li>
<li>Call <a class="el" href="group__decfuncs.html#gafb6684ad8ba507b71112bc9de148e7d0" title="Frees an allocated decoder instance.">th_decode_free()</a> to release all decoder memory. </li>
</ul>
<br/><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__decfuncs.html#ga006d01d36fbe64768c571e6a12b7fc50">th_decode_headerin</a> (<a class="el" href="structth__info.html">th_info</a> *_info, <a class="el" href="structth__comment.html">th_comment</a> *_tc, <a class="el" href="theoradec_8h.html#ab71cd2657455cc27d6c0127c66a89f28">th_setup_info</a> **_setup, ogg_packet *_op)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decodes the header packets of a Theora stream.  <a href="#ga006d01d36fbe64768c571e6a12b7fc50"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__decfuncs.html#ga0ef07a9a97849054aa606c595a2d807e">th_decode_alloc</a> (const <a class="el" href="structth__info.html">th_info</a> *_info, const <a class="el" href="theoradec_8h.html#ab71cd2657455cc27d6c0127c66a89f28">th_setup_info</a> *_setup)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Allocates a decoder instance.  <a href="#ga0ef07a9a97849054aa606c595a2d807e"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__decfuncs.html#gadef55431b68aaa59d0d7b32b2f118f27">th_setup_free</a> (<a class="el" href="theoradec_8h.html#ab71cd2657455cc27d6c0127c66a89f28">th_setup_info</a> *_setup)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Releases all storage used for the decoder setup information.  <a href="#gadef55431b68aaa59d0d7b32b2f118f27"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__decfuncs.html#ga1a8051958d75b1012573b6e3c8f670e1">th_decode_ctl</a> (<a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *_dec, int _req, void *_buf, size_t _buf_sz)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Decoder control function.  <a href="#ga1a8051958d75b1012573b6e3c8f670e1"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__decfuncs.html#ga31c814bf09b2232aff69c57ae20f04eb">th_decode_packetin</a> (<a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *_dec, const ogg_packet *_op, ogg_int64_t *_granpos)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Submits a packet containing encoded video data to the decoder.  <a href="#ga31c814bf09b2232aff69c57ae20f04eb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__decfuncs.html#gaa9cc8af63fa8540e0fc95572f259cdcb">th_decode_ycbcr_out</a> (<a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *_dec, <a class="el" href="codec_8h.html#a343f7cfabad179cc4fe527cf06873f45">th_ycbcr_buffer</a> _ycbcr)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Outputs the next available frame of decoded Y'CbCr data.  <a href="#gaa9cc8af63fa8540e0fc95572f259cdcb"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__decfuncs.html#gafb6684ad8ba507b71112bc9de148e7d0">th_decode_free</a> (<a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *_dec)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Frees an allocated decoder instance.  <a href="#gafb6684ad8ba507b71112bc9de148e7d0"></a><br/></td></tr>
</table>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="ga0ef07a9a97849054aa606c595a2d807e"></a><!-- doxytag: member="theoradec.h::th_decode_alloc" ref="ga0ef07a9a97849054aa606c595a2d807e" args="(const th_info *_info, const th_setup_info *_setup)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a>* th_decode_alloc </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="structth__info.html">th_info</a> *&nbsp;</td>
          <td class="paramname"> <em>_info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="theoradec_8h.html#ab71cd2657455cc27d6c0127c66a89f28">th_setup_info</a> *&nbsp;</td>
          <td class="paramname"> <em>_setup</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Allocates a decoder instance. </p>
<p><b>Security Warning:</b> The Theora format supports very large frame sizes, potentially even larger than the address space of a 32-bit machine, and creating a decoder context allocates the space for several frames of data. If the allocation fails here, your program will crash, possibly at some future point because the OS kernel returned a valid memory range and will only fail when it tries to map the pages in it the first time they are used. Even if it succeeds, you may experience a denial of service if the frame size is large enough to cause excessive paging. If you are integrating libtheora in a larger application where such things are undesirable, it is highly recommended that you check the frame size in <em>_info</em> before calling this function and refuse to decode streams where it is larger than some reasonable maximum. libtheora will not check this for you, because there may be machines that can handle such streams and applications that wish to. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_info</em>&nbsp;</td><td>A <a class="el" href="structth__info.html" title="Theora bitstream information.">th_info</a> struct filled via <a class="el" href="group__decfuncs.html#ga006d01d36fbe64768c571e6a12b7fc50" title="Decodes the header packets of a Theora stream.">th_decode_headerin()</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_setup</em>&nbsp;</td><td>A <a class="el" href="theoradec_8h.html#ab71cd2657455cc27d6c0127c66a89f28" title="Setup information.">th_setup_info</a> handle returned via <a class="el" href="group__decfuncs.html#ga006d01d36fbe64768c571e6a12b7fc50" title="Decodes the header packets of a Theora stream.">th_decode_headerin()</a>. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The initialized <a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729" title="The decoder context.">th_dec_ctx</a> handle. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>NULL</em>&nbsp;</td><td>If the decoding parameters were invalid. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga1a8051958d75b1012573b6e3c8f670e1"></a><!-- doxytag: member="theoradec.h::th_decode_ctl" ref="ga1a8051958d75b1012573b6e3c8f670e1" args="(th_dec_ctx *_dec, int _req, void *_buf, size_t _buf_sz)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int th_decode_ctl </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *&nbsp;</td>
          <td class="paramname"> <em>_dec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>_req</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>_buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&nbsp;</td>
          <td class="paramname"> <em>_buf_sz</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Decoder control function. </p>
<p>This is used to provide advanced control of the decoding process. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_dec</em>&nbsp;</td><td>A <a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729" title="The decoder context.">th_dec_ctx</a> handle. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_req</em>&nbsp;</td><td>The control code to process. See <a class="el" href="theoradec_8h.html#decctlcodes">the list of available control codes</a> for details. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_buf</em>&nbsp;</td><td>The parameters for this control code. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_buf_sz</em>&nbsp;</td><td>The size of the parameter buffer. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gafb6684ad8ba507b71112bc9de148e7d0"></a><!-- doxytag: member="theoradec.h::th_decode_free" ref="gafb6684ad8ba507b71112bc9de148e7d0" args="(th_dec_ctx *_dec)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void th_decode_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *&nbsp;</td>
          <td class="paramname"> <em>_dec</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Frees an allocated decoder instance. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_dec</em>&nbsp;</td><td>A <a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729" title="The decoder context.">th_dec_ctx</a> handle. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga006d01d36fbe64768c571e6a12b7fc50"></a><!-- doxytag: member="theoradec.h::th_decode_headerin" ref="ga006d01d36fbe64768c571e6a12b7fc50" args="(th_info *_info, th_comment *_tc, th_setup_info **_setup, ogg_packet *_op)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int th_decode_headerin </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structth__info.html">th_info</a> *&nbsp;</td>
          <td class="paramname"> <em>_info</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structth__comment.html">th_comment</a> *&nbsp;</td>
          <td class="paramname"> <em>_tc</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="theoradec_8h.html#ab71cd2657455cc27d6c0127c66a89f28">th_setup_info</a> **&nbsp;</td>
          <td class="paramname"> <em>_setup</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ogg_packet *&nbsp;</td>
          <td class="paramname"> <em>_op</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Decodes the header packets of a Theora stream. </p>
<p>This should be called on the initial packets of the stream, in succession, until it returns <code>0</code>, indicating that all headers have been processed, or an error is encountered. At least three header packets are required, and additional optional header packets may follow. This can be used on the first packet of any logical stream to determine if that stream is a Theora stream. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_info</em>&nbsp;</td><td>A <a class="el" href="structth__info.html" title="Theora bitstream information.">th_info</a> structure to fill in. This must have been previously initialized with <a class="el" href="group__basefuncs.html#ga430d9c605816a6ca0bdce3a0b965b926" title="Initializes a th_info structure.">th_info_init()</a>. The application may immediately begin using the contents of this structure after the first header is decoded, though it must continue to be passed in on all subsequent calls. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_tc</em>&nbsp;</td><td>A <a class="el" href="structth__comment.html" title="The comment information.">th_comment</a> structure to fill in. The application may immediately begin using the contents of this structure after the second header is decoded, though it must continue to be passed in on all subsequent calls. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_setup</em>&nbsp;</td><td>Returns a pointer to additional, private setup information needed by the decoder. The contents of this pointer must be initialized to <code>NULL</code> on the first call, and the returned value must continue to be passed in on all subsequent calls. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_op</em>&nbsp;</td><td>An <code>ogg_packet</code> structure which contains one of the initial packets of an Ogg logical stream. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>A positive value indicates that a Theora header was successfully processed. </dd></dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>0</em>&nbsp;</td><td>The first video data packet was encountered after all required header packets were parsed. The packet just passed in on this call should be saved and fed to <a class="el" href="group__decfuncs.html#ga31c814bf09b2232aff69c57ae20f04eb" title="Submits a packet containing encoded video data to the decoder.">th_decode_packetin()</a> to begin decoding video data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_EFAULT</em>&nbsp;</td><td>One of <em>_info</em>, <em>_tc</em>, or <em>_setup</em> was <code>NULL</code>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_EBADHEADER</em>&nbsp;</td><td><em>_op</em> was <code>NULL</code>, the packet was not the next header packet in the expected sequence, or the format of the header data was invalid. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_EVERSION</em>&nbsp;</td><td>The packet data was a Theora info header, but for a bitstream version not decodable with this version of <code>libtheoradec</code>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_ENOTFORMAT</em>&nbsp;</td><td>The packet was not a Theora header. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga31c814bf09b2232aff69c57ae20f04eb"></a><!-- doxytag: member="theoradec.h::th_decode_packetin" ref="ga31c814bf09b2232aff69c57ae20f04eb" args="(th_dec_ctx *_dec, const ogg_packet *_op, ogg_int64_t *_granpos)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int th_decode_packetin </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *&nbsp;</td>
          <td class="paramname"> <em>_dec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const ogg_packet *&nbsp;</td>
          <td class="paramname"> <em>_op</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">ogg_int64_t *&nbsp;</td>
          <td class="paramname"> <em>_granpos</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Submits a packet containing encoded video data to the decoder. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_dec</em>&nbsp;</td><td>A <a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729" title="The decoder context.">th_dec_ctx</a> handle. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_op</em>&nbsp;</td><td>An <code>ogg_packet</code> containing encoded video data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_granpos</em>&nbsp;</td><td>Returns the granule position of the decoded packet. If non-<code>NULL</code>, the granule position for this specific packet is stored in this location. This is computed incrementally from previously decoded packets. After a seek, the correct granule position must be set via <a class="el" href="theoradec_8h.html#a1e870c654d35394f0d490045df04e0f5" title="Sets the granule position.">TH_DECCTL_SET_GRANPOS</a> for this to work properly. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>0</em>&nbsp;</td><td>Success. A new decoded frame can be retrieved by calling <a class="el" href="group__decfuncs.html#gaa9cc8af63fa8540e0fc95572f259cdcb" title="Outputs the next available frame of decoded Y&#39;CbCr data.">th_decode_ycbcr_out()</a>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_DUPFRAME</em>&nbsp;</td><td>The packet represented a dropped (0-byte) frame. The player can skip the call to <a class="el" href="group__decfuncs.html#gaa9cc8af63fa8540e0fc95572f259cdcb" title="Outputs the next available frame of decoded Y&#39;CbCr data.">th_decode_ycbcr_out()</a>, as the contents of the decoded frame buffer have not changed. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_EFAULT</em>&nbsp;</td><td><em>_dec</em> or <em>_op</em> was <code>NULL</code>. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_EBADPACKET</em>&nbsp;</td><td><em>_op</em> does not contain encoded video data. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_EIMPL</em>&nbsp;</td><td>The video data uses bitstream features which this library does not support. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gaa9cc8af63fa8540e0fc95572f259cdcb"></a><!-- doxytag: member="theoradec.h::th_decode_ycbcr_out" ref="gaa9cc8af63fa8540e0fc95572f259cdcb" args="(th_dec_ctx *_dec, th_ycbcr_buffer _ycbcr)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int th_decode_ycbcr_out </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729">th_dec_ctx</a> *&nbsp;</td>
          <td class="paramname"> <em>_dec</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="codec_8h.html#a343f7cfabad179cc4fe527cf06873f45">th_ycbcr_buffer</a>&nbsp;</td>
          <td class="paramname"> <em>_ycbcr</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Outputs the next available frame of decoded Y'CbCr data. </p>
<p>If a striped decode callback has been set with <a class="el" href="theoradec_8h.html#ac95cc9e109474b0fa4bb920ab2cfdf1e" title="Sets the striped decode callback function.">TH_DECCTL_SET_STRIPE_CB</a>, then the application does not need to call this function. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_dec</em>&nbsp;</td><td>A <a class="el" href="theoradec_8h.html#a843d70bb02563885a8d54b9c1a781729" title="The decoder context.">th_dec_ctx</a> handle. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>_ycbcr</em>&nbsp;</td><td>A video buffer structure to fill in. <code>libtheoradec</code> will fill in all the members of this structure, including the pointers to the uncompressed video data. The memory for this video data is owned by <code>libtheoradec</code>. It may be freed or overwritten without notification when subsequent frames are decoded. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Return values:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>0</em>&nbsp;</td><td>Success </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>TH_EFAULT</em>&nbsp;</td><td><em>_dec</em> or <em>_ycbcr</em> was <code>NULL</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="gadef55431b68aaa59d0d7b32b2f118f27"></a><!-- doxytag: member="theoradec.h::th_setup_free" ref="gadef55431b68aaa59d0d7b32b2f118f27" args="(th_setup_info *_setup)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void th_setup_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="theoradec_8h.html#ab71cd2657455cc27d6c0127c66a89f28">th_setup_info</a> *&nbsp;</td>
          <td class="paramname"> <em>_setup</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Releases all storage used for the decoder setup information. </p>
<p>This should be called after you no longer want to create any decoders for a stream whose headers you have parsed with <a class="el" href="group__decfuncs.html#ga006d01d36fbe64768c571e6a12b7fc50" title="Decodes the header packets of a Theora stream.">th_decode_headerin()</a>. </p>
<dl><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>_setup</em>&nbsp;</td><td>The setup information to free. This can safely be <code>NULL</code>. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on 28 Sep 2009 for libtheora by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>