summaryrefslogtreecommitdiff
path: root/doc/libogg/ogg_stream_state.html
blob: f6fa437a6113d23e5a61f22e224f4bbf211e1758 (plain)
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
<html>

<head>
<title>libogg - datatype - ogg_stream_state</title>
<link rel=stylesheet href="style.css" type="text/css">
</head>

<body bgcolor=white text=black link="#5555ff" alink="#5555ff" vlink="#5555ff">
<table border=0 width=100%>
<tr>
<td><p class=tiny>libogg documentation</p></td>
<td align=right><p class=tiny>libogg release 1.3.5 - 20210603</p></td>
</tr>
</table>

<h1>ogg_stream_state</h1>

<p><i>declared in "ogg/ogg.h"</i></p>

<p>
The ogg_stream_state struct tracks the current encode/decode state
of the current logical bitstream.
<p>

<table border=0 width=100% color=black cellspacing=0 cellpadding=7>
<tr bgcolor=#cccccc>
	<td>
<pre><b>
typedef struct {
  unsigned char   *body_data;    /* bytes from packet bodies */
  long    body_storage;          /* storage elements allocated */
  long    body_fill;             /* elements stored; fill mark */
  long    body_returned;         /* elements of fill returned */


  int     *lacing_vals;      /* The values that will go to the segment table */
  ogg_int64_t *granule_vals; /* granulepos values for headers. Not compact
                                this way, but it is simple coupled to the
                                lacing fifo */
  long    lacing_storage;
  long    lacing_fill;
  long    lacing_packet;
  long    lacing_returned;

  unsigned char    header[282];      /* working space for header encode */
  int              header_fill;

  int     e_o_s;          /* set when we have buffered the last packet in the
                             logical bitstream */
  int     b_o_s;          /* set after we've written the initial page
                             of a logical bitstream */
  long    serialno;
  long    pageno;
  ogg_int64_t  packetno;  /* sequence number for decode; the framing
                             knows where there's a hole in the data,
                             but we need coupling so that the codec
                             (which is in a separate abstraction
                             layer) also knows about the gap */
  ogg_int64_t   granulepos;

} ogg_stream_state;
</b></pre>
	</td>
</tr>
</table>

<h3>Relevant Struct Members</h3>
<dl>
<dt><i>body_data</i></dt>
<dd>Pointer to data from packet bodies.</dd>
<dt><i>body_storage</i></dt>
<dd>Storage allocated for bodies in bytes (filled or unfilled).</dd>
<dt><i>body_fill</i></dt>
<dd>Amount of storage filled with stored packet bodies.</dd>
<dt><i>body_returned</i></dt>
<dd>Number of elements returned from storage.</dd>
<dt><i>lacing_vals</i></dt>
<dd>String of lacing values for the packet segments within the current page.  Each value is a byte, indicating packet segment length.</dd>
<dt><i>granule_vals</i></dt>
<dd>Pointer to the lacing values for the packet segments within the current page.</dd>
<dt><i>lacing_storage</i></dt>
<dd>Total amount of storage (in bytes) allocated for storing lacing values.</dd>
<dt><i>lacing_fill</i></dt>
<dd>Fill marker for the current vs. total allocated storage of lacing values for the page.</dd>
<dt><i>lacing_packet</i></dt>
<dd>Lacing value for current packet segment.</dd>
<dt><i>lacing_returned</i></dt>
<dd>Number of lacing values returned from lacing_storage.</dd>
<dt><i>header</i></dt>
<dd>Temporary storage for page header during encode process, while the header is being created.</dd>
<dt><i>header_fill</i></dt>
<dd>Fill marker for header storage allocation.  Used during the header creation process.</dd>
<dt><i>e_o_s</i></dt>
<dd>Marker set when the last packet of the logical bitstream has been buffered.</dd>
<dt><i>b_o_s</i></dt>
<dd>Marker set after we have written the first page in the logical bitstream.</dd>
<dt><i>serialno</i></dt>
<dd>Serial number of this logical bitstream.</dd>
<dt><i>pageno</i></dt>
<dd>Number of the current page within the stream.</dd>
<dt><i>packetno</i></dt>
<dd>Number of the current packet.</dd>
<dt><i>granulepos</i></dt>
<dd>Exact position of decoding/encoding process.</dd>
</dl>


<br><br>
<hr noshade>
<table border=0 width=100%>
<tr valign=top>
<td><p class=tiny>copyright &copy; 2000-2021 Xiph.Org Foundation</p></td>
<td align=right><p class=tiny><a href="http://www.xiph.org/ogg/">Ogg Container Format</a></p></td>
</tr><tr>
<td><p class=tiny>libogg documentation</p></td>
<td align=right><p class=tiny>libogg release 1.3.5 - 20210603</p></td>
</tr>
</table>

</body>

</html>