~ubuntu-branches/ubuntu/maverick/flac/maverick

« back to all changes in this revision

Viewing changes to include/OggFLAC/seekable_stream_encoder.h

  • Committer: Bazaar Package Importer
  • Author(s): Joshua Kwan
  • Date: 2007-05-29 22:56:36 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529225636-ljeff8xxip09qaap
Tags: 1.1.4-1
* New upstream release. closes: #405167, #411311
  - libOggFLAC and libOggFLAC++ have been merged into libFLAC, so
    remove their corresponding packages.
  - Because of the API changes required to effect the above, there has
    been yet another soname bump. libflac7 -> libflac8 and
    libflac++5 -> libflac++6. Emails have been dispatched to the
    maintainers of dependent packages.
* Some notes on patches that were removed:
  - 02_stdin_stdout, 06_manpage_mention_utf8_convert: merged upstream
  - 08_manpage_warnings: Upstream has changed the manpage so it defintely
    can't fit in in 80 cols, so just forget about it. We'll live.
  - 05_eof_warnings_are_errors: Upstream decided to add a -w option to
    flac to treat all warnings as errors. I am going to defer to that
    for now, but if people think it's stupid let me know and I'll port
    the patch forward.
  - 04_stack_smasher: was a backport from 1.1.3, so it's obsolete.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* libOggFLAC - Free Lossless Audio Codec + Ogg library
2
 
 * Copyright (C) 2002,2003,2004,2005  Josh Coalson
3
 
 *
4
 
 * Redistribution and use in source and binary forms, with or without
5
 
 * modification, are permitted provided that the following conditions
6
 
 * are met:
7
 
 *
8
 
 * - Redistributions of source code must retain the above copyright
9
 
 * notice, this list of conditions and the following disclaimer.
10
 
 *
11
 
 * - Redistributions in binary form must reproduce the above copyright
12
 
 * notice, this list of conditions and the following disclaimer in the
13
 
 * documentation and/or other materials provided with the distribution.
14
 
 *
15
 
 * - Neither the name of the Xiph.org Foundation nor the names of its
16
 
 * contributors may be used to endorse or promote products derived from
17
 
 * this software without specific prior written permission.
18
 
 *
19
 
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20
 
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21
 
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22
 
 * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
23
 
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24
 
 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25
 
 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26
 
 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27
 
 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28
 
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29
 
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30
 
 */
31
 
 
32
 
#ifndef OggFLAC__SEEKABLE_STREAM_ENCODER_H
33
 
#define OggFLAC__SEEKABLE_STREAM_ENCODER_H
34
 
 
35
 
#include "export.h"
36
 
 
37
 
#include "FLAC/stream_encoder.h"
38
 
#include "FLAC/seekable_stream_encoder.h"
39
 
 
40
 
#ifdef __cplusplus
41
 
extern "C" {
42
 
#endif
43
 
 
44
 
 
45
 
/** \file include/OggFLAC/seekable_stream_encoder.h
46
 
 *
47
 
 *  \brief
48
 
 *  This module contains the functions which implement the seekable
49
 
 *  stream encoder.
50
 
 *
51
 
 *  See the detailed documentation in the
52
 
 *  \link oggflac_seekable_stream_encoder seekable stream encoder \endlink module.
53
 
 */
54
 
 
55
 
/** \defgroup oggflac_seekable_stream_encoder OggFLAC/seekable_stream_encoder.h: seekable stream encoder interface
56
 
 *  \ingroup oggflac_encoder
57
 
 *
58
 
 *  \brief
59
 
 *  This module contains the functions which implement the seekable
60
 
 *  stream encoder.  The Ogg seekable stream encoder is derived
61
 
 *  from the FLAC seekable stream encoder.
62
 
 *
63
 
 * The interface here is nearly identical to FLAC's seekable stream
64
 
 * encoder, including the callbacks, with the addition of a new required
65
 
 * read callback (needed when writing back STREAMINFO after encoding) and
66
 
 * OggFLAC__seekable_stream_encoder_set_serial_number().  See the
67
 
 * \link flac_seekable_stream_encoder FLAC seekable stream encoder module \endlink
68
 
 * for full documentation.
69
 
 *
70
 
 * \{
71
 
 */
72
 
 
73
 
 
74
 
/** State values for an OggFLAC__SeekableStreamEncoder
75
 
 *
76
 
 *  The encoder's state can be obtained by calling OggFLAC__stream_encoder_get_state().
77
 
 */
78
 
typedef enum {
79
 
 
80
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_OK = 0,
81
 
        /**< The encoder is in the normal OK state. */
82
 
 
83
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_OGG_ERROR,
84
 
        /**< An error occurred in the underlying Ogg layer.  */
85
 
 
86
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR,
87
 
        /**< An error occurred in the underlying FLAC stream encoder;
88
 
         * check OggFLAC__seekable_stream_encoder_get_FLAC_stream_encoder_state().
89
 
         */
90
 
 
91
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_MEMORY_ALLOCATION_ERROR,
92
 
        /**< Memory allocation failed. */
93
 
 
94
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_WRITE_ERROR,
95
 
        /**< The write callback returned an error. */
96
 
 
97
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_READ_ERROR,
98
 
        /**< The read callback returned an error. */
99
 
 
100
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_SEEK_ERROR,
101
 
        /**< The seek callback returned an error. */
102
 
 
103
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_TELL_ERROR,
104
 
        /**< The tell callback returned an error. */
105
 
 
106
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_ALREADY_INITIALIZED,
107
 
        /**< OggFLAC__seekable_stream_encoder_init() was called when the encoder was
108
 
         * already initialized, usually because
109
 
         * OggFLAC__seekable_stream_encoder_finish() was not called.
110
 
         */
111
 
 
112
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_INVALID_CALLBACK,
113
 
        /**< OggFLAC__seekable_stream_encoder_init() was called without all
114
 
         * callbacks being set.
115
 
         */
116
 
 
117
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_INVALID_SEEKTABLE,
118
 
        /**< An invalid seek table was passed is the metadata to
119
 
         * OggFLAC__seekable_stream_encoder_set_metadata().
120
 
         */
121
 
 
122
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED
123
 
        /**< The encoder is in the uninitialized state. */
124
 
 
125
 
} OggFLAC__SeekableStreamEncoderState;
126
 
 
127
 
/** Maps an OggFLAC__StreamEncoderState to a C string.
128
 
 *
129
 
 *  Using an OggFLAC__StreamEncoderState as the index to this array
130
 
 *  will give the string equivalent.  The contents should not be modified.
131
 
 */
132
 
extern OggFLAC_API const char * const OggFLAC__SeekableStreamEncoderStateString[];
133
 
 
134
 
 
135
 
/** Return values for the OggFLAC__SeekableStreamEncoder read callback.
136
 
 */
137
 
typedef enum {
138
 
 
139
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_READ_STATUS_CONTINUE,
140
 
        /**< The read was OK and decoding can continue. */
141
 
 
142
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_READ_STATUS_END_OF_STREAM,
143
 
        /**< The read was attempted at the end of the stream. */
144
 
 
145
 
        OggFLAC__SEEKABLE_STREAM_ENCODER_READ_STATUS_ABORT
146
 
        /**< An unrecoverable error occurred. */
147
 
 
148
 
} OggFLAC__SeekableStreamEncoderReadStatus;
149
 
 
150
 
/** Maps a OggFLAC__SeekableStreamEncoderReadStatus to a C string.
151
 
 *
152
 
 *  Using a OggFLAC__SeekableStreamEncoderReadStatus as the index to this array
153
 
 *  will give the string equivalent.  The contents should not be modified.
154
 
 */
155
 
extern OggFLAC_API const char * const OggFLAC__SeekableStreamEncoderReadStatusString[];
156
 
 
157
 
 
158
 
/***********************************************************************
159
 
 *
160
 
 * class OggFLAC__StreamEncoder
161
 
 *
162
 
 ***********************************************************************/
163
 
 
164
 
struct OggFLAC__SeekableStreamEncoderProtected;
165
 
struct OggFLAC__SeekableStreamEncoderPrivate;
166
 
/** The opaque structure definition for the seekable stream encoder type.
167
 
 *  See the \link oggflac_seekable_stream_encoder seekable stream encoder module \endlink
168
 
 *  for a detailed description.
169
 
 */
170
 
typedef struct {
171
 
        struct OggFLAC__SeekableStreamEncoderProtected *protected_; /* avoid the C++ keyword 'protected' */
172
 
        struct OggFLAC__SeekableStreamEncoderPrivate *private_; /* avoid the C++ keyword 'private' */
173
 
} OggFLAC__SeekableStreamEncoder;
174
 
 
175
 
/** Signature for the read callback.
176
 
 *  See OggFLAC__seekable_stream_encoder_set_read_callback() for more info.
177
 
 *
178
 
 * \param  encoder  The encoder instance calling the callback.
179
 
 * \param  buffer   A pointer to a location for the callee to store
180
 
 *                  data to be encoded.
181
 
 * \param  bytes    A pointer to the size of the buffer.  On entry
182
 
 *                  to the callback, it contains the maximum number
183
 
 *                  of bytes that may be stored in \a buffer.  The
184
 
 *                  callee must set it to the actual number of bytes
185
 
 *                  stored (0 in case of error or end-of-stream) before
186
 
 *                  returning.
187
 
 * \param  client_data  The callee's client data set through
188
 
 *                      OggFLAC__seekable_stream_encoder_set_client_data().
189
 
 * \retval OggFLAC__SeekableStreamEncoderReadStatus
190
 
 *    The callee's return status.
191
 
 */
192
 
typedef OggFLAC__SeekableStreamEncoderReadStatus (*OggFLAC__SeekableStreamEncoderReadCallback)(const OggFLAC__SeekableStreamEncoder *encoder, FLAC__byte buffer[], unsigned *bytes, void *client_data);
193
 
 
194
 
/** Signature for the seek callback.
195
 
 *  See OggFLAC__seekable_stream_encoder_set_seek_callback()
196
 
 *  and FLAC__SeekableStreamEncoderSeekCallback for more info.
197
 
 *
198
 
 * \param  encoder  The encoder instance calling the callback.
199
 
 * \param  absolute_byte_offset  The offset from the beginning of the stream
200
 
 *                               to seek to.
201
 
 * \param  client_data  The callee's client data set through
202
 
 *                      OggFLAC__seekable_stream_encoder_set_client_data().
203
 
 * \retval FLAC__SeekableStreamEncoderSeekStatus
204
 
 *    The callee's return status.
205
 
 */
206
 
typedef FLAC__SeekableStreamEncoderSeekStatus (*OggFLAC__SeekableStreamEncoderSeekCallback)(const OggFLAC__SeekableStreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data);
207
 
 
208
 
/** Signature for the tell callback.
209
 
 *  See OggFLAC__seekable_stream_encoder_set_tell_callback()
210
 
 *  and FLAC__SeekableStreamEncoderTellCallback for more info.
211
 
 *
212
 
 * \param  encoder  The encoder instance calling the callback.
213
 
 * \param  absolute_byte_offset  The address at which to store the current
214
 
 *                               position of the output.
215
 
 * \param  client_data  The callee's client data set through
216
 
 *                      OggFLAC__seekable_stream_encoder_set_client_data().
217
 
 * \retval FLAC__SeekableStreamEncoderTellStatus
218
 
 *    The callee's return status.
219
 
 */
220
 
typedef FLAC__SeekableStreamEncoderTellStatus (*OggFLAC__SeekableStreamEncoderTellCallback)(const OggFLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data);
221
 
 
222
 
/** Signature for the write callback.
223
 
 *  See OggFLAC__seekable_stream_encoder_set_write_callback()
224
 
 *  and FLAC__SeekableStreamEncoderWriteCallback for more info.
225
 
 *
226
 
 * \param  encoder  The encoder instance calling the callback.
227
 
 * \param  buffer   An array of encoded data of length \a bytes.
228
 
 * \param  bytes    The byte length of \a buffer.
229
 
 * \param  samples  The number of samples encoded by \a buffer.
230
 
 *                  \c 0 has a special meaning; see
231
 
 *                  OggFLAC__seekable_stream_encoder_set_write_callback().
232
 
 * \param  current_frame  The number of current frame being encoded.
233
 
 * \param  client_data  The callee's client data set through
234
 
 *                      OggFLAC__seekable_stream_encoder_set_client_data().
235
 
 * \retval FLAC__StreamEncoderWriteStatus
236
 
 *    The callee's return status.
237
 
 */
238
 
typedef FLAC__StreamEncoderWriteStatus (*OggFLAC__SeekableStreamEncoderWriteCallback)(const OggFLAC__SeekableStreamEncoder *encoder, const FLAC__byte buffer[], unsigned bytes, unsigned samples, unsigned current_frame, void *client_data);
239
 
 
240
 
 
241
 
/***********************************************************************
242
 
 *
243
 
 * Class constructor/destructor
244
 
 *
245
 
 ***********************************************************************/
246
 
 
247
 
/** Create a new seekable stream encoder instance.  The instance is created with
248
 
 *  default settings; see the individual OggFLAC__seekable_stream_encoder_set_*()
249
 
 *  functions for each setting's default.
250
 
 *
251
 
 * \retval OggFLAC__SeekableStreamEncoder*
252
 
 *    \c NULL if there was an error allocating memory, else the new instance.
253
 
 */
254
 
OggFLAC_API OggFLAC__SeekableStreamEncoder *OggFLAC__seekable_stream_encoder_new();
255
 
 
256
 
/** Free an encoder instance.  Deletes the object pointed to by \a encoder.
257
 
 *
258
 
 * \param encoder  A pointer to an existing encoder.
259
 
 * \assert
260
 
 *    \code encoder != NULL \endcode
261
 
 */
262
 
OggFLAC_API void OggFLAC__seekable_stream_encoder_delete(OggFLAC__SeekableStreamEncoder *encoder);
263
 
 
264
 
 
265
 
/***********************************************************************
266
 
 *
267
 
 * Public class method prototypes
268
 
 *
269
 
 ***********************************************************************/
270
 
 
271
 
/** Set the serial number for the FLAC stream.
272
 
 *
273
 
 * \default \c 0
274
 
 * \param  encoder        An encoder instance to set.
275
 
 * \param  serial_number  See above.
276
 
 * \assert
277
 
 *    \code encoder != NULL \endcode
278
 
 * \retval FLAC__bool
279
 
 *    \c false if the encoder is already initialized, else \c true.
280
 
 */
281
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_serial_number(OggFLAC__SeekableStreamEncoder *encoder, long serial_number);
282
 
 
283
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_verify()
284
 
 *
285
 
 * \default \c false
286
 
 * \param  encoder  An encoder instance to set.
287
 
 * \param  value    Flag value (see above).
288
 
 * \assert
289
 
 *    \code encoder != NULL \endcode
290
 
 * \retval FLAC__bool
291
 
 *    \c false if the encoder is already initialized, else \c true.
292
 
 */
293
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_verify(OggFLAC__SeekableStreamEncoder *encoder, FLAC__bool value);
294
 
 
295
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_streamable_subset()
296
 
 *
297
 
 * \default \c true
298
 
 * \param  encoder  An encoder instance to set.
299
 
 * \param  value    Flag value (see above).
300
 
 * \assert
301
 
 *    \code encoder != NULL \endcode
302
 
 * \retval FLAC__bool
303
 
 *    \c false if the encoder is already initialized, else \c true.
304
 
 */
305
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_streamable_subset(OggFLAC__SeekableStreamEncoder *encoder, FLAC__bool value);
306
 
 
307
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_do_mid_side_stereo()
308
 
 *
309
 
 * \default \c false
310
 
 * \param  encoder  An encoder instance to set.
311
 
 * \param  value    Flag value (see above).
312
 
 * \assert
313
 
 *    \code encoder != NULL \endcode
314
 
 * \retval FLAC__bool
315
 
 *    \c false if the encoder is already initialized, else \c true.
316
 
 */
317
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_do_mid_side_stereo(OggFLAC__SeekableStreamEncoder *encoder, FLAC__bool value);
318
 
 
319
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_loose_mid_side_stereo()
320
 
 *
321
 
 * \default \c false
322
 
 * \param  encoder  An encoder instance to set.
323
 
 * \param  value    Flag value (see above).
324
 
 * \assert
325
 
 *    \code encoder != NULL \endcode
326
 
 * \retval FLAC__bool
327
 
 *    \c false if the encoder is already initialized, else \c true.
328
 
 */
329
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_loose_mid_side_stereo(OggFLAC__SeekableStreamEncoder *encoder, FLAC__bool value);
330
 
 
331
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_channels()
332
 
 *
333
 
 * \default \c 2
334
 
 * \param  encoder  An encoder instance to set.
335
 
 * \param  value    See above.
336
 
 * \assert
337
 
 *    \code encoder != NULL \endcode
338
 
 * \retval FLAC__bool
339
 
 *    \c false if the encoder is already initialized, else \c true.
340
 
 */
341
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_channels(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
342
 
 
343
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_bits_per_sample()
344
 
 *
345
 
 * \default \c 16
346
 
 * \param  encoder  An encoder instance to set.
347
 
 * \param  value    See above.
348
 
 * \assert
349
 
 *    \code encoder != NULL \endcode
350
 
 * \retval FLAC__bool
351
 
 *    \c false if the encoder is already initialized, else \c true.
352
 
 */
353
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_bits_per_sample(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
354
 
 
355
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_sample_rate()
356
 
 *
357
 
 * \default \c 44100
358
 
 * \param  encoder  An encoder instance to set.
359
 
 * \param  value    See above.
360
 
 * \assert
361
 
 *    \code encoder != NULL \endcode
362
 
 * \retval FLAC__bool
363
 
 *    \c false if the encoder is already initialized, else \c true.
364
 
 */
365
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_sample_rate(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
366
 
 
367
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_blocksize()
368
 
 *
369
 
 * \default \c 1152
370
 
 * \param  encoder  An encoder instance to set.
371
 
 * \param  value    See above.
372
 
 * \assert
373
 
 *    \code encoder != NULL \endcode
374
 
 * \retval FLAC__bool
375
 
 *    \c false if the encoder is already initialized, else \c true.
376
 
 */
377
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_blocksize(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
378
 
 
379
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_max_lpc_order()
380
 
 *
381
 
 * \default \c 0
382
 
 * \param  encoder  An encoder instance to set.
383
 
 * \param  value    See above.
384
 
 * \assert
385
 
 *    \code encoder != NULL \endcode
386
 
 * \retval FLAC__bool
387
 
 *    \c false if the encoder is already initialized, else \c true.
388
 
 */
389
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_max_lpc_order(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
390
 
 
391
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_qlp_coeff_precision()
392
 
 *
393
 
 * \default \c 0
394
 
 * \param  encoder  An encoder instance to set.
395
 
 * \param  value    See above.
396
 
 * \assert
397
 
 *    \code encoder != NULL \endcode
398
 
 * \retval FLAC__bool
399
 
 *    \c false if the encoder is already initialized, else \c true.
400
 
 */
401
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_qlp_coeff_precision(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
402
 
 
403
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_qlp_coeff_prec_search()
404
 
 *
405
 
 * \default \c false
406
 
 * \param  encoder  An encoder instance to set.
407
 
 * \param  value    See above.
408
 
 * \assert
409
 
 *    \code encoder != NULL \endcode
410
 
 * \retval FLAC__bool
411
 
 *    \c false if the encoder is already initialized, else \c true.
412
 
 */
413
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_do_qlp_coeff_prec_search(OggFLAC__SeekableStreamEncoder *encoder, FLAC__bool value);
414
 
 
415
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_do_escape_coding()
416
 
 *
417
 
 * \default \c false
418
 
 * \param  encoder  An encoder instance to set.
419
 
 * \param  value    See above.
420
 
 * \assert
421
 
 *    \code encoder != NULL \endcode
422
 
 * \retval FLAC__bool
423
 
 *    \c false if the encoder is already initialized, else \c true.
424
 
 */
425
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_do_escape_coding(OggFLAC__SeekableStreamEncoder *encoder, FLAC__bool value);
426
 
 
427
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_do_exhaustive_model_search()
428
 
 *
429
 
 * \default \c false
430
 
 * \param  encoder  An encoder instance to set.
431
 
 * \param  value    See above.
432
 
 * \assert
433
 
 *    \code encoder != NULL \endcode
434
 
 * \retval FLAC__bool
435
 
 *    \c false if the encoder is already initialized, else \c true.
436
 
 */
437
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_do_exhaustive_model_search(OggFLAC__SeekableStreamEncoder *encoder, FLAC__bool value);
438
 
 
439
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_min_residual_partition_order()
440
 
 *
441
 
 * \default \c 0
442
 
 * \param  encoder  An encoder instance to set.
443
 
 * \param  value    See above.
444
 
 * \assert
445
 
 *    \code encoder != NULL \endcode
446
 
 * \retval FLAC__bool
447
 
 *    \c false if the encoder is already initialized, else \c true.
448
 
 */
449
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_min_residual_partition_order(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
450
 
 
451
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_max_residual_partition_order()
452
 
 *
453
 
 * \default \c 0
454
 
 * \param  encoder  An encoder instance to set.
455
 
 * \param  value    See above.
456
 
 * \assert
457
 
 *    \code encoder != NULL \endcode
458
 
 * \retval FLAC__bool
459
 
 *    \c false if the encoder is already initialized, else \c true.
460
 
 */
461
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_max_residual_partition_order(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
462
 
 
463
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_rice_parameter_search_dist()
464
 
 *
465
 
 * \default \c 0
466
 
 * \param  encoder  An encoder instance to set.
467
 
 * \param  value    See above.
468
 
 * \assert
469
 
 *    \code encoder != NULL \endcode
470
 
 * \retval FLAC__bool
471
 
 *    \c false if the encoder is already initialized, else \c true.
472
 
 */
473
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_rice_parameter_search_dist(OggFLAC__SeekableStreamEncoder *encoder, unsigned value);
474
 
 
475
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_total_samples_estimate()
476
 
 *
477
 
 * \default \c 0
478
 
 * \param  encoder  An encoder instance to set.
479
 
 * \param  value    See above.
480
 
 * \assert
481
 
 *    \code encoder != NULL \endcode
482
 
 * \retval FLAC__bool
483
 
 *    \c false if the encoder is already initialized, else \c true.
484
 
 */
485
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_total_samples_estimate(OggFLAC__SeekableStreamEncoder *encoder, FLAC__uint64 value);
486
 
 
487
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_set_metadata()
488
 
 *
489
 
 * \note The Ogg FLAC mapping requires that the VORBIS_COMMENT block be
490
 
 * the second metadata block of the stream.  The encoder already supplies
491
 
 * the STREAMINFO block automatically.  If \a metadata does not contain a
492
 
 * VORBIS_COMMENT block, the encoder will supply that too.  Otherwise, if
493
 
 * \a metadata does contain a VORBIS_COMMENT block and it is not the
494
 
 * first, this function will reorder \a metadata by moving the
495
 
 * VORBIS_COMMENT block to the front; the relative ordering of the other
496
 
 * blocks will remain as they were.
497
 
 *
498
 
 * \note The Ogg FLAC mapping limits the number of metadata blocks per
499
 
 * stream to \c 65535.  If \a num_blocks exceeds this the function will
500
 
 * return \c false.
501
 
 *
502
 
 * \default \c NULL, 0
503
 
 * \param  encoder     An encoder instance to set.
504
 
 * \param  metadata    See above.
505
 
 * \param  num_blocks  See above.
506
 
 * \assert
507
 
 *    \code encoder != NULL \endcode
508
 
 * \retval FLAC__bool
509
 
 *    \c false if the encoder is already initialized, or if
510
 
 *    \a num_blocks > 65535, else \c true.
511
 
 */
512
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_metadata(OggFLAC__SeekableStreamEncoder *encoder, FLAC__StreamMetadata **metadata, unsigned num_blocks);
513
 
 
514
 
/** Set the read callback.
515
 
 *  The supplied function will be called when the encoder needs to read back
516
 
 *  encoded data.  This happens during the metadata callback, when the encoder
517
 
 *  has to read, modify, and rewrite the metadata (e.g. seekpoints) gathered
518
 
 *  while encoding.  The address of the buffer to be filled is supplied, along
519
 
 *  with the number of bytes the buffer can hold.  The callback may choose to
520
 
 *  supply less data and modify the byte count but must be careful not to
521
 
 *  overflow the buffer.  The callback then returns a status code chosen from
522
 
 *  OggFLAC__SeekableStreamEncoderReadStatus.
523
 
 *
524
 
 * \note
525
 
 * The callback is mandatory and must be set before initialization.
526
 
 *
527
 
 * \default \c NULL
528
 
 * \param  encoder  A encoder instance to set.
529
 
 * \param  value    See above.
530
 
 * \assert
531
 
 *    \code encoder != NULL \endcode
532
 
 *    \code value != NULL \endcode
533
 
 * \retval FLAC__bool
534
 
 *    \c false if the encoder is already initialized, else \c true.
535
 
 */
536
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_read_callback(OggFLAC__SeekableStreamEncoder *encoder, OggFLAC__SeekableStreamEncoderReadCallback value);
537
 
 
538
 
/** Set the seek callback.
539
 
 *  The supplied function will be called when the encoder needs to seek
540
 
 *  the output stream.  The encoder will pass the absolute byte offset
541
 
 *  to seek to, 0 meaning the beginning of the stream.
542
 
 *
543
 
 * \note
544
 
 * The callback is mandatory and must be set before initialization.
545
 
 *
546
 
 * \default \c NULL
547
 
 * \param  encoder  An encoder instance to set.
548
 
 * \param  value    See above.
549
 
 * \assert
550
 
 *    \code encoder != NULL \endcode
551
 
 *    \code value != NULL \endcode
552
 
 * \retval FLAC__bool
553
 
 *    \c false if the encoder is already initialized, else \c true.
554
 
 */
555
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_seek_callback(OggFLAC__SeekableStreamEncoder *encoder, OggFLAC__SeekableStreamEncoderSeekCallback value);
556
 
 
557
 
/** Set the tell callback.
558
 
 *  The supplied function will be called when the encoder needs to know
559
 
 *  the current position of the output stream.
560
 
 *
561
 
 * \note
562
 
 * The callback is mandatory and must be set before initialization.
563
 
 *
564
 
 * \default \c NULL
565
 
 * \param  encoder  An encoder instance to set.
566
 
 * \param  value    See above.
567
 
 * \assert
568
 
 *    \code encoder != NULL \endcode
569
 
 *    \code value != NULL \endcode
570
 
 * \retval FLAC__bool
571
 
 *    \c false if the encoder is already initialized, else \c true.
572
 
 */
573
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_tell_callback(OggFLAC__SeekableStreamEncoder *encoder, OggFLAC__SeekableStreamEncoderTellCallback value);
574
 
 
575
 
/** Set the write callback.
576
 
 *  This is inherited from FLAC__StreamEncoder; see
577
 
 *  FLAC__stream_encoder_set_write_callback().
578
 
 *
579
 
 * \note
580
 
 * Unlike the FLAC seekable stream encoder write callback, the Ogg
581
 
 * seekable stream encoder write callback will be called twice when
582
 
 * writing audio frames; once for the page header, and once for the page
583
 
 * body.  When writing the page header, the \a samples argument to the
584
 
 * write callback will be \c 0.
585
 
 *
586
 
 * \note
587
 
 * The callback is mandatory and must be set before initialization.
588
 
 *
589
 
 * \default \c NULL
590
 
 * \param  encoder  An encoder instance to set.
591
 
 * \param  value    See above.
592
 
 * \assert
593
 
 *    \code encoder != NULL \endcode
594
 
 *    \code value != NULL \endcode
595
 
 * \retval FLAC__bool
596
 
 *    \c false if the encoder is already initialized, else \c true.
597
 
 */
598
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_write_callback(OggFLAC__SeekableStreamEncoder *encoder, OggFLAC__SeekableStreamEncoderWriteCallback value);
599
 
 
600
 
/** Set the client data to be passed back to callbacks.
601
 
 *  This value will be supplied to callbacks in their \a client_data
602
 
 *  argument.
603
 
 *
604
 
 * \default \c NULL
605
 
 * \param  encoder  An encoder instance to set.
606
 
 * \param  value    See above.
607
 
 * \assert
608
 
 *    \code encoder != NULL \endcode
609
 
 * \retval FLAC__bool
610
 
 *    \c false if the encoder is already initialized, else \c true.
611
 
 */
612
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_set_client_data(OggFLAC__SeekableStreamEncoder *encoder, void *value);
613
 
 
614
 
/** Get the current encoder state.
615
 
 *
616
 
 * \param  encoder  An encoder instance to query.
617
 
 * \assert
618
 
 *    \code encoder != NULL \endcode
619
 
 * \retval OggFLAC__SeekableStreamEncoderState
620
 
 *    The current encoder state.
621
 
 */
622
 
OggFLAC_API OggFLAC__SeekableStreamEncoderState OggFLAC__seekable_stream_encoder_get_state(const OggFLAC__SeekableStreamEncoder *encoder);
623
 
 
624
 
/** Get the state of the underlying FLAC stream encoder.
625
 
 *  Useful when the seekable stream encoder state is
626
 
 *  \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR.
627
 
 *
628
 
 * \param  encoder  An encoder instance to query.
629
 
 * \assert
630
 
 *    \code encoder != NULL \endcode
631
 
 * \retval FLAC__StreamEncoderState
632
 
 *    The FLAC stream encoder state.
633
 
 */
634
 
OggFLAC_API FLAC__StreamEncoderState OggFLAC__seekable_stream_encoder_get_FLAC_stream_encoder_state(const OggFLAC__SeekableStreamEncoder *encoder);
635
 
 
636
 
/** Get the state of the underlying FLAC encoder's verify decoder.
637
 
 *  Useful when the seekable stream encoder state is
638
 
 *  \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR
639
 
 *  and the FLAC stream encoder state is
640
 
 *  \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR.
641
 
 *
642
 
 * \param  encoder  An encoder instance to query.
643
 
 * \assert
644
 
 *    \code encoder != NULL \endcode
645
 
 * \retval FLAC__StreamDecoderState
646
 
 *    The FLAC verify decoder state.
647
 
 */
648
 
OggFLAC_API FLAC__StreamDecoderState OggFLAC__seekable_stream_encoder_get_verify_decoder_state(const OggFLAC__SeekableStreamEncoder *encoder);
649
 
 
650
 
/** Get the current encoder state as a C string.
651
 
 *  This version automatically resolves
652
 
 *  \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR
653
 
 *  by getting the FLAC stream encoder's resolved state.
654
 
 *
655
 
 * \param  encoder  A encoder instance to query.
656
 
 * \assert
657
 
 *    \code encoder != NULL \endcode
658
 
 * \retval const char *
659
 
 *    The encoder state as a C string.  Do not modify the contents.
660
 
 */
661
 
OggFLAC_API const char *OggFLAC__seekable_stream_encoder_get_resolved_state_string(const OggFLAC__SeekableStreamEncoder *encoder);
662
 
 
663
 
/** Get relevant values about the nature of a verify decoder error.
664
 
 *  Inherited from FLAC__stream_encoder_get_verify_decoder_error_stats().
665
 
 *  Useful when the seekable stream encoder state is
666
 
 *  \c OggFLAC__SEEKABLE_STREAM_ENCODER_FLAC_STREAM_ENCODER_ERROR
667
 
 *  and the FLAC stream encoder state is
668
 
 *  \c FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR.
669
 
 *
670
 
 * \param  encoder  An encoder instance to query.
671
 
 * \param  absolute_sample  The absolute sample number of the mismatch.
672
 
 * \param  frame_number  The number of the frame in which the mismatch occurred.
673
 
 * \param  channel       The channel in which the mismatch occurred.
674
 
 * \param  sample        The number of the sample (relative to the frame) in
675
 
 *                       which the mismatch occurred.
676
 
 * \param  expected      The expected value for the sample in question.
677
 
 * \param  got           The actual value returned by the decoder.
678
 
 * \assert
679
 
 *    \code encoder != NULL \endcode
680
 
 *    \code absolute_sample != NULL \endcode
681
 
 *    \code frame_number != NULL \endcode
682
 
 *    \code channel != NULL \endcode
683
 
 *    \code sample != NULL \endcode
684
 
 *    \code expected != NULL \endcode
685
 
 */
686
 
OggFLAC_API void OggFLAC__seekable_stream_encoder_get_verify_decoder_error_stats(const OggFLAC__SeekableStreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got);
687
 
 
688
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_verify()
689
 
 *
690
 
 * \param  encoder  An encoder instance to query.
691
 
 * \assert
692
 
 *    \code encoder != NULL \endcode
693
 
 * \retval FLAC__bool
694
 
 *    See OggFLAC__seekable_stream_encoder_set_verify().
695
 
 */
696
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_get_verify(const OggFLAC__SeekableStreamEncoder *encoder);
697
 
 
698
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_streamable_subset()
699
 
 *
700
 
 * \param  encoder  An encoder instance to query.
701
 
 * \assert
702
 
 *    \code encoder != NULL \endcode
703
 
 * \retval FLAC__bool
704
 
 *    See OggFLAC__seekable_stream_encoder_set_streamable_subset().
705
 
 */
706
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_get_streamable_subset(const OggFLAC__SeekableStreamEncoder *encoder);
707
 
 
708
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_do_mid_side_stereo()
709
 
 *
710
 
 * \param  encoder  An encoder instance to query.
711
 
 * \assert
712
 
 *    \code encoder != NULL \endcode
713
 
 * \retval FLAC__bool
714
 
 *    See OggFLAC__seekable_stream_encoder_get_do_mid_side_stereo().
715
 
 */
716
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_get_do_mid_side_stereo(const OggFLAC__SeekableStreamEncoder *encoder);
717
 
 
718
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_loose_mid_side_stereo()
719
 
 *
720
 
 * \param  encoder  An encoder instance to query.
721
 
 * \assert
722
 
 *    \code encoder != NULL \endcode
723
 
 * \retval FLAC__bool
724
 
 *    See OggFLAC__seekable_stream_encoder_set_loose_mid_side_stereo().
725
 
 */
726
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_get_loose_mid_side_stereo(const OggFLAC__SeekableStreamEncoder *encoder);
727
 
 
728
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_channels()
729
 
 *
730
 
 * \param  encoder  An encoder instance to query.
731
 
 * \assert
732
 
 *    \code encoder != NULL \endcode
733
 
 * \retval unsigned
734
 
 *    See OggFLAC__seekable_stream_encoder_set_channels().
735
 
 */
736
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_channels(const OggFLAC__SeekableStreamEncoder *encoder);
737
 
 
738
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_bits_per_sample()
739
 
 *
740
 
 * \param  encoder  An encoder instance to query.
741
 
 * \assert
742
 
 *    \code encoder != NULL \endcode
743
 
 * \retval unsigned
744
 
 *    See OggFLAC__seekable_stream_encoder_set_bits_per_sample().
745
 
 */
746
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_bits_per_sample(const OggFLAC__SeekableStreamEncoder *encoder);
747
 
 
748
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_sample_rate()
749
 
 *
750
 
 * \param  encoder  An encoder instance to query.
751
 
 * \assert
752
 
 *    \code encoder != NULL \endcode
753
 
 * \retval unsigned
754
 
 *    See OggFLAC__seekable_stream_encoder_set_sample_rate().
755
 
 */
756
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_sample_rate(const OggFLAC__SeekableStreamEncoder *encoder);
757
 
 
758
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_blocksize()
759
 
 *
760
 
 * \param  encoder  An encoder instance to query.
761
 
 * \assert
762
 
 *    \code encoder != NULL \endcode
763
 
 * \retval unsigned
764
 
 *    See OggFLAC__seekable_stream_encoder_set_blocksize().
765
 
 */
766
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_blocksize(const OggFLAC__SeekableStreamEncoder *encoder);
767
 
 
768
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_max_lpc_order()
769
 
 *
770
 
 * \param  encoder  An encoder instance to query.
771
 
 * \assert
772
 
 *    \code encoder != NULL \endcode
773
 
 * \retval unsigned
774
 
 *    See OggFLAC__seekable_stream_encoder_set_max_lpc_order().
775
 
 */
776
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_max_lpc_order(const OggFLAC__SeekableStreamEncoder *encoder);
777
 
 
778
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_qlp_coeff_precision()
779
 
 *
780
 
 * \param  encoder  An encoder instance to query.
781
 
 * \assert
782
 
 *    \code encoder != NULL \endcode
783
 
 * \retval unsigned
784
 
 *    See OggFLAC__seekable_stream_encoder_set_qlp_coeff_precision().
785
 
 */
786
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_qlp_coeff_precision(const OggFLAC__SeekableStreamEncoder *encoder);
787
 
 
788
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_do_qlp_coeff_prec_search()
789
 
 *
790
 
 * \param  encoder  An encoder instance to query.
791
 
 * \assert
792
 
 *    \code encoder != NULL \endcode
793
 
 * \retval FLAC__bool
794
 
 *    See OggFLAC__seekable_stream_encoder_set_do_qlp_coeff_prec_search().
795
 
 */
796
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_get_do_qlp_coeff_prec_search(const OggFLAC__SeekableStreamEncoder *encoder);
797
 
 
798
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_do_escape_coding()
799
 
 *
800
 
 * \param  encoder  An encoder instance to query.
801
 
 * \assert
802
 
 *    \code encoder != NULL \endcode
803
 
 * \retval FLAC__bool
804
 
 *    See OggFLAC__seekable_stream_encoder_set_do_escape_coding().
805
 
 */
806
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_get_do_escape_coding(const OggFLAC__SeekableStreamEncoder *encoder);
807
 
 
808
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_do_exhaustive_model_search()
809
 
 *
810
 
 * \param  encoder  An encoder instance to query.
811
 
 * \assert
812
 
 *    \code encoder != NULL \endcode
813
 
 * \retval FLAC__bool
814
 
 *    See OggFLAC__seekable_stream_encoder_set_do_exhaustive_model_search().
815
 
 */
816
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_get_do_exhaustive_model_search(const OggFLAC__SeekableStreamEncoder *encoder);
817
 
 
818
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_min_residual_partition_order()
819
 
 *
820
 
 * \param  encoder  An encoder instance to query.
821
 
 * \assert
822
 
 *    \code encoder != NULL \endcode
823
 
 * \retval unsigned
824
 
 *    See OggFLAC__seekable_stream_encoder_set_min_residual_partition_order().
825
 
 */
826
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_min_residual_partition_order(const OggFLAC__SeekableStreamEncoder *encoder);
827
 
 
828
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_man_residual_partition_order()
829
 
 *
830
 
 * \param  encoder  An encoder instance to query.
831
 
 * \assert
832
 
 *    \code encoder != NULL \endcode
833
 
 * \retval unsigned
834
 
 *    See OggFLAC__seekable_stream_encoder_set_max_residual_partition_order().
835
 
 */
836
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_max_residual_partition_order(const OggFLAC__SeekableStreamEncoder *encoder);
837
 
 
838
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_rice_parameter_search_dist()
839
 
 *
840
 
 * \param  encoder  An encoder instance to query.
841
 
 * \assert
842
 
 *    \code encoder != NULL \endcode
843
 
 * \retval unsigned
844
 
 *    See OggFLAC__seekable_stream_encoder_set_rice_parameter_search_dist().
845
 
 */
846
 
OggFLAC_API unsigned OggFLAC__seekable_stream_encoder_get_rice_parameter_search_dist(const OggFLAC__SeekableStreamEncoder *encoder);
847
 
 
848
 
/** This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_get_total_samples_estimate()
849
 
 *
850
 
 * \param  encoder  An encoder instance to set.
851
 
 * \assert
852
 
 *    \code encoder != NULL \endcode
853
 
 * \retval FLAC__uint64
854
 
 *    See OggFLAC__seekable_stream_encoder_get_total_samples_estimate().
855
 
 */
856
 
OggFLAC_API FLAC__uint64 OggFLAC__seekable_stream_encoder_get_total_samples_estimate(const OggFLAC__SeekableStreamEncoder *encoder);
857
 
 
858
 
/** Initialize the encoder instance.
859
 
 *  Should be called after OggFLAC__seekable_stream_encoder_new() and
860
 
 *  OggFLAC__seekable_stream_encoder_set_*() but before OggFLAC__seekable_stream_encoder_process()
861
 
 *  or OggFLAC__seekable_stream_encoder_process_interleaved().  Will set and return
862
 
 *  the encoder state, which will be OggFLAC__SEEKABLE_STREAM_ENCODER_OK if
863
 
 *  initialization succeeded.
864
 
 *
865
 
 *  The call to OggFLAC__seekable_stream_encoder_init() currently will also immediately
866
 
 *  call the write callback several times, once with the \c fLaC signature,
867
 
 *  and once for each encoded metadata block.
868
 
 *
869
 
 * \param  encoder  An uninitialized encoder instance.
870
 
 * \assert
871
 
 *    \code encoder != NULL \endcode
872
 
 * \retval OggFLAC__SeekableStreamEncoderState
873
 
 *    \c OggFLAC__SEEKABLE_STREAM_ENCODER_OK if initialization was successful; see
874
 
 *    OggFLAC__SeekableStreamEncoderState for the meanings of other return values.
875
 
 */
876
 
OggFLAC_API OggFLAC__SeekableStreamEncoderState OggFLAC__seekable_stream_encoder_init(OggFLAC__SeekableStreamEncoder *encoder);
877
 
 
878
 
/** Finish the encoding process.
879
 
 *  Flushes the encoding buffer, releases resources, resets the encoder
880
 
 *  settings to their defaults, and returns the encoder state to
881
 
 *  OggFLAC__SEEKABLE_STREAM_ENCODER_UNINITIALIZED.  Note that this can generate
882
 
 *  one or more write callbacks before returning.
883
 
 *
884
 
 *  In the event of a prematurely-terminated encode, it is not strictly
885
 
 *  necessary to call this immediately before OggFLAC__seekable_stream_encoder_delete()
886
 
 *  but it is good practice to match every OggFLAC__seekable_stream_encoder_init()
887
 
 *  with an OggFLAC__seekable_stream_encoder_finish().
888
 
 *
889
 
 * \param  encoder  An uninitialized encoder instance.
890
 
 * \assert
891
 
 *    \code encoder != NULL \endcode
892
 
 */
893
 
OggFLAC_API void OggFLAC__seekable_stream_encoder_finish(OggFLAC__SeekableStreamEncoder *encoder);
894
 
 
895
 
/** Submit data for encoding.
896
 
 * This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_process().
897
 
 *
898
 
 * \param  encoder  An initialized encoder instance in the OK state.
899
 
 * \param  buffer   An array of pointers to each channel's signal.
900
 
 * \param  samples  The number of samples in one channel.
901
 
 * \assert
902
 
 *    \code encoder != NULL \endcode
903
 
 *    \code OggFLAC__seekable_stream_encoder_get_state(encoder) == OggFLAC__SEEKABLE_STREAM_ENCODER_OK \endcode
904
 
 * \retval FLAC__bool
905
 
 *    \c true if successful, else \c false; in this case, check the
906
 
 *    encoder state with OggFLAC__seekable_stream_encoder_get_state() to see what
907
 
 *    went wrong.
908
 
 */
909
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_process(OggFLAC__SeekableStreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples);
910
 
 
911
 
/** Submit data for encoding.
912
 
 * This is inherited from FLAC__StreamEncoder; see FLAC__stream_encoder_process_interleaved().
913
 
 *
914
 
 * \param  encoder  An initialized encoder instance in the OK state.
915
 
 * \param  buffer   An array of channel-interleaved data (see above).
916
 
 * \param  samples  The number of samples in one channel, the same as for
917
 
 *                  OggFLAC__seekable_stream_encoder_process().  For example, if
918
 
 *                  encoding two channels, \c 1000 \a samples corresponds
919
 
 *                  to a \a buffer of 2000 values.
920
 
 * \assert
921
 
 *    \code encoder != NULL \endcode
922
 
 *    \code OggFLAC__seekable_stream_encoder_get_state(encoder) == OggFLAC__SEEKABLE_STREAM_ENCODER_OK \endcode
923
 
 * \retval FLAC__bool
924
 
 *    \c true if successful, else \c false; in this case, check the
925
 
 *    encoder state with OggFLAC__seekable_stream_encoder_get_state() to see what
926
 
 *    went wrong.
927
 
 */
928
 
OggFLAC_API FLAC__bool OggFLAC__seekable_stream_encoder_process_interleaved(OggFLAC__SeekableStreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples);
929
 
 
930
 
/* \} */
931
 
 
932
 
#ifdef __cplusplus
933
 
}
934
 
#endif
935
 
 
936
 
#endif