Correct PPTP server firewall rules chain.
[tomato/davidwu.git] / release / src / router / flac / doc / html / api / encoder_8h-source.html
blob25fc8813314e29f5109893677767a4006cfec82d
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2 <html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3 <title>FLAC: include/FLAC++/encoder.h Source File</title>
4 <link href="doxygen.css" rel="stylesheet" type="text/css">
5 </head><body>
6 <!-- Generated by Doxygen 1.4.2 -->
7 <div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="globals.html">File&nbsp;Members</a></div>
8 <div class="nav">
9 <a class="el" href="dir_000000.html">include</a>&nbsp;/&nbsp;<a class="el" href="dir_000001.html">FLAC++</a></div>
10 <h1>encoder.h</h1><a href="encoder_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment">00001 <span class="comment">/* libFLAC++ - Free Lossless Audio Codec library</span>
11 00002 <span class="comment"> * Copyright (C) 2002,2003,2004,2005,2006,2007 Josh Coalson</span>
12 00003 <span class="comment"> *</span>
13 00004 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
14 00005 <span class="comment"> * modification, are permitted provided that the following conditions</span>
15 00006 <span class="comment"> * are met:</span>
16 00007 <span class="comment"> *</span>
17 00008 <span class="comment"> * - Redistributions of source code must retain the above copyright</span>
18 00009 <span class="comment"> * notice, this list of conditions and the following disclaimer.</span>
19 00010 <span class="comment"> *</span>
20 00011 <span class="comment"> * - Redistributions in binary form must reproduce the above copyright</span>
21 00012 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
22 00013 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
23 00014 <span class="comment"> *</span>
24 00015 <span class="comment"> * - Neither the name of the Xiph.org Foundation nor the names of its</span>
25 00016 <span class="comment"> * contributors may be used to endorse or promote products derived from</span>
26 00017 <span class="comment"> * this software without specific prior written permission.</span>
27 00018 <span class="comment"> *</span>
28 00019 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS</span>
29 00020 <span class="comment"> * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT</span>
30 00021 <span class="comment"> * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR</span>
31 00022 <span class="comment"> * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR</span>
32 00023 <span class="comment"> * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,</span>
33 00024 <span class="comment"> * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,</span>
34 00025 <span class="comment"> * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</span>
35 00026 <span class="comment"> * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF</span>
36 00027 <span class="comment"> * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span>
37 00028 <span class="comment"> * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
38 00029 <span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
39 00030 <span class="comment"> */</span>
40 00031
41 00032 <span class="preprocessor">#ifndef FLACPP__ENCODER_H</span>
42 00033 <span class="preprocessor"></span><span class="preprocessor">#define FLACPP__ENCODER_H</span>
43 00034 <span class="preprocessor"></span>
44 00035 <span class="preprocessor">#include "<a class="code" href="+_2export_8h.html">export.h</a>"</span>
45 00036
46 00037 <span class="preprocessor">#include "<a class="code" href="stream__encoder_8h.html">FLAC/stream_encoder.h</a>"</span>
47 00038 <span class="preprocessor">#include "<a class="code" href="decoder_8h.html">decoder.h</a>"</span>
48 00039 <span class="preprocessor">#include "<a class="code" href="+_2metadata_8h.html">metadata.h</a>"</span>
49 00040
50 00041
51 00078 <span class="keyword">namespace </span>FLAC {
52 00079 <span class="keyword">namespace </span>Encoder {
53 00080
54 <a name="l00101"></a><a class="code" href="classFLAC_1_1Encoder_1_1Stream.html">00101</a> <span class="keyword">class </span>FLACPP_API Stream {
55 00102 <span class="keyword">public</span>:
56 <a name="l00105"></a><a class="code" href="classFLAC_1_1Encoder_1_1Stream_1_1State.html">00105</a> <span class="keyword">class </span>FLACPP_API State {
57 00106 <span class="keyword">public</span>:
58 00107 <span class="keyword">inline</span> State(::<a class="code" href="group__flac__stream__encoder.html#ga65">FLAC__StreamEncoderState</a> state): state_(state) { }
59 00108 <span class="keyword">inline</span> <a class="code" href="group__flac__stream__encoder.html#ga65">operator ::FLAC__StreamEncoderState</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> state_; }
60 00109 <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *as_cstring()<span class="keyword"> const </span>{ <a class="code" href="group__flac__stream__encoder.html#ga0">return ::FLAC__StreamEncoderStateString</a>[state_]; }
61 00110 <span class="keyword">inline</span> <span class="keyword">const</span> <span class="keywordtype">char</span> *resolved_as_cstring(<span class="keyword">const</span> Stream &amp;encoder)<span class="keyword"> const </span>{ <a class="code" href="group__flac__stream__encoder.html#ga37">return ::FLAC__stream_encoder_get_resolved_state_string</a>(encoder.<a class="code" href="classFLAC_1_1Encoder_1_1Stream.html#FLAC_1_1Encoder_1_1Streamp0">encoder_</a>); }
62 00111 <span class="keyword">protected</span>:<a class="code" href="group__flac__stream__encoder.html#ga65"></a>
63 00112 <a class="code" href="group__flac__stream__encoder.html#ga65"> ::FLAC__StreamEncoderState</a> state_;
64 00113 };
65 00114
66 00115 Stream();
67 00116 <span class="keyword">virtual</span> ~Stream();
68 00117
69 00119
70 00123 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> is_valid() <span class="keyword">const</span>;
71 <a name="l00124"></a><a class="code" href="classFLAC_1_1Encoder_1_1Stream.html#FLAC_1_1Encoder_1_1Streama3">00124</a> <span class="keyword">inline</span> operator bool()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> is_valid(); }
72 00125
73 00126
74 00127 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_ogg_serial_number(<span class="keywordtype">long</span> value);
75 00128 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_verify(<span class="keywordtype">bool</span> value);
76 00129 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_streamable_subset(<span class="keywordtype">bool</span> value);
77 00130 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_channels(<span class="keywordtype">unsigned</span> value);
78 00131 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_bits_per_sample(<span class="keywordtype">unsigned</span> value);
79 00132 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_sample_rate(<span class="keywordtype">unsigned</span> value);
80 00133 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_compression_level(<span class="keywordtype">unsigned</span> value);
81 00134 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_blocksize(<span class="keywordtype">unsigned</span> value);
82 00135 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_do_mid_side_stereo(<span class="keywordtype">bool</span> value);
83 00136 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_loose_mid_side_stereo(<span class="keywordtype">bool</span> value);
84 00137 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_apodization(<span class="keyword">const</span> <span class="keywordtype">char</span> *specification);
85 00138 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_max_lpc_order(<span class="keywordtype">unsigned</span> value);
86 00139 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_qlp_coeff_precision(<span class="keywordtype">unsigned</span> value);
87 00140 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_do_qlp_coeff_prec_search(<span class="keywordtype">bool</span> value);
88 00141 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_do_escape_coding(<span class="keywordtype">bool</span> value);
89 00142 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_do_exhaustive_model_search(<span class="keywordtype">bool</span> value);
90 00143 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_min_residual_partition_order(<span class="keywordtype">unsigned</span> value);
91 00144 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_max_residual_partition_order(<span class="keywordtype">unsigned</span> value);
92 00145 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_rice_parameter_search_dist(<span class="keywordtype">unsigned</span> value);
93 00146 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_total_samples_estimate(FLAC__uint64 value);
94 00147 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_metadata(::<a class="code" href="structFLAC____StreamMetadata.html">FLAC__StreamMetadata</a> **metadata, <span class="keywordtype">unsigned</span> num_blocks);
95 00148 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> set_metadata(<a class="code" href="classFLAC_1_1Metadata_1_1Prototype.html">FLAC::Metadata::Prototype</a> **metadata, <span class="keywordtype">unsigned</span> num_blocks);
96 00149
97 00150 <span class="comment">/* get_state() is not virtual since we want subclasses to be able to return their own state */</span>
98 00151 State get_state() <span class="keyword">const</span>;
99 00152 <span class="keyword">virtual</span> <a class="code" href="classFLAC_1_1Decoder_1_1Stream_1_1State.html">Decoder::Stream::State</a> get_verify_decoder_state() <span class="keyword">const</span>;
100 00153 <span class="keyword">virtual</span> <span class="keywordtype">void</span> get_verify_decoder_error_stats(FLAC__uint64 *absolute_sample, <span class="keywordtype">unsigned</span> *frame_number, <span class="keywordtype">unsigned</span> *channel, <span class="keywordtype">unsigned</span> *sample, FLAC__int32 *expected, FLAC__int32 *got);
101 00154 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> get_verify() <span class="keyword">const</span>;
102 00155 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> get_streamable_subset() <span class="keyword">const</span>;
103 00156 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> get_do_mid_side_stereo() <span class="keyword">const</span>;
104 00157 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> get_loose_mid_side_stereo() <span class="keyword">const</span>;
105 00158 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_channels() <span class="keyword">const</span>;
106 00159 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_bits_per_sample() <span class="keyword">const</span>;
107 00160 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_sample_rate() <span class="keyword">const</span>;
108 00161 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_blocksize() <span class="keyword">const</span>;
109 00162 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_max_lpc_order() <span class="keyword">const</span>;
110 00163 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_qlp_coeff_precision() <span class="keyword">const</span>;
111 00164 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> get_do_qlp_coeff_prec_search() <span class="keyword">const</span>;
112 00165 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> get_do_escape_coding() <span class="keyword">const</span>;
113 00166 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> get_do_exhaustive_model_search() <span class="keyword">const</span>;
114 00167 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_min_residual_partition_order() <span class="keyword">const</span>;
115 00168 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_max_residual_partition_order() <span class="keyword">const</span>;
116 00169 <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> get_rice_parameter_search_dist() <span class="keyword">const</span>;
117 00170 <span class="keyword">virtual</span> FLAC__uint64 get_total_samples_estimate() <span class="keyword">const</span>;
118 00171
119 00172 <a class="code" href="group__flac__stream__encoder.html#ga66">virtual ::FLAC__StreamEncoderInitStatus</a> init();
120 00173 <a class="code" href="group__flac__stream__encoder.html#ga66">virtual ::FLAC__StreamEncoderInitStatus</a> init_ogg();
121 00174
122 00175 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> finish();
123 00176
124 00177 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> process(<span class="keyword">const</span> FLAC__int32 * <span class="keyword">const</span> buffer[], <span class="keywordtype">unsigned</span> samples);
125 00178 <span class="keyword">virtual</span> <span class="keywordtype">bool</span> process_interleaved(<span class="keyword">const</span> FLAC__int32 buffer[], <span class="keywordtype">unsigned</span> samples);
126 00179 <span class="keyword">protected</span>:
127 00181 <a class="code" href="group__flac__stream__encoder.html#ga67">virtual ::FLAC__StreamEncoderReadStatus</a> read_callback(FLAC__byte buffer[], size_t *bytes);
128 00182
129 00184 <a class="code" href="group__flac__stream__encoder.html#ga68">virtual ::FLAC__StreamEncoderWriteStatus</a> write_callback(<span class="keyword">const</span> FLAC__byte buffer[], size_t bytes, <span class="keywordtype">unsigned</span> samples, <span class="keywordtype">unsigned</span> current_frame) = 0;
130 00185
131 00187 <a class="code" href="group__flac__stream__encoder.html#ga69">virtual ::FLAC__StreamEncoderSeekStatus</a> seek_callback(FLAC__uint64 absolute_byte_offset);
132 00188
133 00190 <a class="code" href="group__flac__stream__encoder.html#ga70">virtual ::FLAC__StreamEncoderTellStatus</a> tell_callback(FLAC__uint64 *absolute_byte_offset);
134 00191
135 00193 <span class="keyword">virtual</span> <span class="keywordtype">void</span> metadata_callback(<span class="keyword">const</span> ::<a class="code" href="structFLAC____StreamMetadata.html">FLAC__StreamMetadata</a> *metadata);
136 00194
137 00195 <span class="preprocessor">#if (defined _MSC_VER) || (defined __BORLANDC__) || (defined __GNUG__ &amp;&amp; (__GNUG__ &lt; 2 || (__GNUG__ == 2 &amp;&amp; __GNUC_MINOR__ &lt; 96))) || (defined __SUNPRO_CC)</span>
138 00196 <span class="preprocessor"></span> <span class="comment">// lame hack: some MSVC/GCC versions can't see a protected encoder_ from nested State::resolved_as_cstring()</span>
139 00197 <span class="keyword">friend</span> State;
140 00198 <span class="preprocessor">#endif</span>
141 00199 <span class="preprocessor"></span> ::FLAC__StreamEncoder *encoder_;
142 00200
143 00201 <a class="code" href="group__flac__stream__encoder.html#ga67">static ::FLAC__StreamEncoderReadStatus</a> read_callback_(<span class="keyword">const</span> ::<a class="code" href="structFLAC____StreamEncoder.html">FLAC__StreamEncoder</a> *encoder, FLAC__byte buffer[], size_t *bytes, <span class="keywordtype">void</span> *client_data);
144 00202 <a class="code" href="group__flac__stream__encoder.html#ga68">static ::FLAC__StreamEncoderWriteStatus</a> write_callback_(<span class="keyword">const</span> ::<a class="code" href="structFLAC____StreamEncoder.html">FLAC__StreamEncoder</a> *encoder, <span class="keyword">const</span> FLAC__byte buffer[], size_t bytes, <span class="keywordtype">unsigned</span> samples, <span class="keywordtype">unsigned</span> current_frame, <span class="keywordtype">void</span> *client_data);
145 00203 <a class="code" href="group__flac__stream__encoder.html#ga69">static ::FLAC__StreamEncoderSeekStatus</a> seek_callback_(<span class="keyword">const</span> <a class="code" href="structFLAC____StreamEncoder.html">FLAC__StreamEncoder</a> *encoder, FLAC__uint64 absolute_byte_offset, <span class="keywordtype">void</span> *client_data);
146 00204 <a class="code" href="group__flac__stream__encoder.html#ga70">static ::FLAC__StreamEncoderTellStatus</a> tell_callback_(<span class="keyword">const</span> <a class="code" href="structFLAC____StreamEncoder.html">FLAC__StreamEncoder</a> *encoder, FLAC__uint64 *absolute_byte_offset, <span class="keywordtype">void</span> *client_data);
147 00205 <span class="keyword">static</span> <span class="keywordtype">void</span> metadata_callback_(<span class="keyword">const</span> ::<a class="code" href="structFLAC____StreamEncoder.html">FLAC__StreamEncoder</a> *encoder, <span class="keyword">const</span> ::<a class="code" href="structFLAC____StreamMetadata.html">FLAC__StreamMetadata</a> *metadata, <span class="keywordtype">void</span> *client_data);
148 00206 <span class="keyword">private</span>:
149 00207 <span class="comment">// Private and undefined so you can't use them:</span>
150 00208 Stream(<span class="keyword">const</span> Stream &amp;);
151 00209 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> Stream &amp;);
152 00210 };
153 00211
154 <a name="l00232"></a><a class="code" href="classFLAC_1_1Encoder_1_1File.html">00232</a> <span class="keyword">class </span>FLACPP_API File: <span class="keyword">public</span> Stream {
155 00233 <span class="keyword">public</span>:
156 00234 File();
157 00235 <span class="keyword">virtual</span> ~File();
158 00236
159 00237 <a class="code" href="group__flac__stream__encoder.html#ga66">virtual ::FLAC__StreamEncoderInitStatus</a> init(FILE *file);
160 00238 <a class="code" href="group__flac__stream__encoder.html#ga66">virtual ::FLAC__StreamEncoderInitStatus</a> init(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename);
161 00239 <a class="code" href="group__flac__stream__encoder.html#ga66">virtual ::FLAC__StreamEncoderInitStatus</a> init(<span class="keyword">const</span> std::string &amp;filename);
162 00240 <a class="code" href="group__flac__stream__encoder.html#ga66">virtual ::FLAC__StreamEncoderInitStatus</a> init_ogg(FILE *file);
163 00241 <a class="code" href="group__flac__stream__encoder.html#ga66">virtual ::FLAC__StreamEncoderInitStatus</a> init_ogg(<span class="keyword">const</span> <span class="keywordtype">char</span> *filename);
164 00242 <a class="code" href="group__flac__stream__encoder.html#ga66">virtual ::FLAC__StreamEncoderInitStatus</a> init_ogg(<span class="keyword">const</span> std::string &amp;filename);
165 00243 <span class="keyword">protected</span>:
166 00245 <span class="keyword">virtual</span> <span class="keywordtype">void</span> progress_callback(FLAC__uint64 bytes_written, FLAC__uint64 samples_written, <span class="keywordtype">unsigned</span> frames_written, <span class="keywordtype">unsigned</span> total_frames_estimate);
167 00246
168 00248 <a class="code" href="group__flac__stream__encoder.html#ga68">virtual ::FLAC__StreamEncoderWriteStatus</a> write_callback(<span class="keyword">const</span> FLAC__byte buffer[], size_t bytes, <span class="keywordtype">unsigned</span> samples, <span class="keywordtype">unsigned</span> current_frame);
169 00249 <span class="keyword">private</span>:
170 00250 <span class="keyword">static</span> <span class="keywordtype">void</span> progress_callback_(<span class="keyword">const</span> ::<a class="code" href="structFLAC____StreamEncoder.html">FLAC__StreamEncoder</a> *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, <span class="keywordtype">unsigned</span> frames_written, <span class="keywordtype">unsigned</span> total_frames_estimate, <span class="keywordtype">void</span> *client_data);
171 00251
172 00252 <span class="comment">// Private and undefined so you can't use them:</span>
173 00253 File(<span class="keyword">const</span> Stream &amp;);
174 00254 <span class="keywordtype">void</span> operator=(<span class="keyword">const</span> Stream &amp;);
175 00255 };
176 00256
177 00257 }
178 00258 }
179 00259
180 00260 <span class="preprocessor">#endif</span>
181 </pre></div>
182 <hr size="1">
183 <div class="copyright">
184 <!-- @@@ oh so hacky -->
185 <table>
186 <tr>
187 <td align="left">
188 Copyright (c) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson
189 </td>
190 <td width="1%" align="right">
191 <a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=13478&amp;type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a>
192 </td>
193 </tr>
194 </table>
195 </div>
196 <!-- Copyright (c) 2000,2001,2002,2003,2004,2005,2006,2007 Josh Coalson -->
197 <!-- Permission is granted to copy, distribute and/or modify this document -->
198 <!-- under the terms of the GNU Free Documentation License, Version 1.1 -->
199 <!-- or any later version published by the Free Software Foundation; -->
200 <!-- with no invariant sections. -->
201 <!-- A copy of the license can be found at http://www.gnu.org/copyleft/fdl.html -->
202 </body>
203 </html>