LMMS
Loading...
Searching...
No Matches
stream_encoder.h
Go to the documentation of this file.
1/* libFLAC - Free Lossless Audio Codec library
2 * Copyright (C) 2000-2009 Josh Coalson
3 * Copyright (C) 2011-2014 Xiph.Org Foundation
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 *
12 * - Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * - Neither the name of the Xiph.org Foundation nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR
24 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 */
32
33#ifndef FLAC__STREAM_ENCODER_H
34#define FLAC__STREAM_ENCODER_H
35
36#include "export.h"
37#include "format.h"
38#include "stream_decoder.h"
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44
54
73
230
231
281
287extern FLAC_API const char * const FLAC__StreamEncoderStateString[];
288
289
351
357extern FLAC_API const char * const FLAC__StreamEncoderInitStatusString[];
358
359
377
383extern FLAC_API const char * const FLAC__StreamEncoderReadStatusString[];
384
385
397
403extern FLAC_API const char * const FLAC__StreamEncoderWriteStatusString[];
404
405
420
426extern FLAC_API const char * const FLAC__StreamEncoderSeekStatusString[];
427
428
443
449extern FLAC_API const char * const FLAC__StreamEncoderTellStatusString[];
450
451
452/***********************************************************************
453 *
454 * class FLAC__StreamEncoder
455 *
456 ***********************************************************************/
457
464typedef struct {
465 struct FLAC__StreamEncoderProtected *protected_; /* avoid the C++ keyword 'protected' */
466 struct FLAC__StreamEncoderPrivate *private_; /* avoid the C++ keyword 'private' */
468
519
556typedef FLAC__StreamEncoderWriteStatus (*FLAC__StreamEncoderWriteCallback)(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data);
557
591
636
655
678
679
680/***********************************************************************
681 *
682 * Class constructor/destructor
683 *
684 ***********************************************************************/
685
694
702
703
704/***********************************************************************
705 *
706 * Public class method prototypes
707 *
708 ***********************************************************************/
709
728
744
762
774
790
802
865
880
894
910
976
988
1006
1020
1032
1046
1069
1092
1104
1120
1203
1213
1225
1238
1257
1267
1277
1287
1297
1307
1317
1327
1337
1347
1357
1367
1377
1387
1397
1407
1417
1430
1493
1561
1596
1631
1663
1695
1723
1749FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 * const buffer[], unsigned samples);
1750
1782
1783/* \} */
1784
1785#ifdef __cplusplus
1786}
1787#endif
1788
1789#endif
static char filename[]
Definition features.c:5
static PuglViewHint int value
Definition pugl.h:1708
#define FLAC_API
Definition export.h:73
FLAC__StreamDecoderState
Definition stream_decoder.h:201
FLAC_API const char *const FLAC__StreamEncoderWriteStatusString[]
Definition stream_encoder.c:467
FLAC_API FLAC__bool FLAC__stream_encoder_set_compression_level(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1574
FLAC_API FLAC__bool FLAC__stream_encoder_get_verify(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:1981
FLAC_API const char *const FLAC__StreamEncoderInitStatusString[]
Definition stream_encoder.c:443
FLAC_API const char *const FLAC__StreamEncoderReadStatusString[]
Definition stream_encoder.c:460
FLAC_API FLAC__bool FLAC__stream_encoder_get_do_escape_coding(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2077
FLAC_API FLAC__bool FLAC__stream_encoder_set_qlp_coeff_precision(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1765
void(* FLAC__StreamEncoderMetadataCallback)(const FLAC__StreamEncoder *encoder, const FLAC__StreamMetadata *metadata, void *client_data)
Definition stream_encoder.h:654
FLAC_API FLAC__bool FLAC__stream_encoder_set_total_samples_estimate(FLAC__StreamEncoder *encoder, FLAC__uint64 value)
Definition stream_encoder.c:1852
FLAC_API FLAC__bool FLAC__stream_encoder_set_sample_rate(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1563
FLAC_API FLAC__bool FLAC__stream_encoder_set_streamable_subset(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1519
FLAC__StreamEncoderReadStatus(* FLAC__StreamEncoderReadCallback)(const FLAC__StreamEncoder *encoder, FLAC__byte buffer[], size_t *bytes, void *client_data)
Definition stream_encoder.h:518
struct FLAC__StreamEncoderProtected * protected_
Definition stream_encoder.h:465
FLAC_API unsigned FLAC__stream_encoder_get_max_lpc_order(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2053
FLAC__StreamEncoderReadStatus
Definition stream_encoder.h:362
FLAC_API FLAC__bool FLAC__stream_encoder_get_do_mid_side_stereo(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2037
FLAC__StreamEncoderWriteStatus
Definition stream_encoder.h:388
FLAC_API FLAC__bool FLAC__stream_encoder_set_do_qlp_coeff_prec_search(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1776
FLAC__StreamEncoderInitStatus
Definition stream_encoder.h:292
FLAC_API FLAC__StreamEncoder * FLAC__stream_encoder_new(void)
Definition stream_encoder.c:502
FLAC_API void FLAC__stream_encoder_get_verify_decoder_error_stats(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_sample, unsigned *frame_number, unsigned *channel, unsigned *sample, FLAC__int32 *expected, FLAC__int32 *got)
Definition stream_encoder.c:1962
FLAC_API unsigned FLAC__stream_encoder_get_qlp_coeff_precision(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2061
FLAC_API const char *const FLAC__StreamEncoderStateString[]
Definition stream_encoder.c:431
FLAC_API unsigned FLAC__stream_encoder_get_channels(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2005
FLAC__StreamEncoderWriteStatus(* FLAC__StreamEncoderWriteCallback)(const FLAC__StreamEncoder *encoder, const FLAC__byte buffer[], size_t bytes, unsigned samples, unsigned current_frame, void *client_data)
Definition stream_encoder.h:556
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_file(FLAC__StreamEncoder *encoder, const char *filename, FLAC__StreamEncoderProgressCallback progress_callback, void *client_data)
FLAC_API FLAC__bool FLAC__stream_encoder_get_loose_mid_side_stereo(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2045
FLAC_API const char *const FLAC__StreamEncoderTellStatusString[]
Definition stream_encoder.c:478
FLAC_API FLAC__bool FLAC__stream_encoder_set_bits_per_sample(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1552
FLAC_API FLAC__bool FLAC__stream_encoder_set_verify(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1506
FLAC_API FLAC__bool FLAC__stream_encoder_set_ogg_serial_number(FLAC__StreamEncoder *encoder, long serial_number)
Definition stream_encoder.c:1489
FLAC_API FLAC__bool FLAC__stream_encoder_set_rice_parameter_search_dist(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1836
FLAC_API unsigned FLAC__stream_encoder_get_rice_parameter_search_dist(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2109
FLAC_API FLAC__bool FLAC__stream_encoder_set_metadata(FLAC__StreamEncoder *encoder, FLAC__StreamMetadata **metadata, unsigned num_blocks)
Definition stream_encoder.c:1863
FLAC_API FLAC__bool FLAC__stream_encoder_process_interleaved(FLAC__StreamEncoder *encoder, const FLAC__int32 buffer[], unsigned samples)
Definition stream_encoder.c:2177
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_file(FLAC__StreamEncoder *encoder, const char *filename, FLAC__StreamEncoderProgressCallback progress_callback, void *client_data)
struct FLAC__StreamEncoderPrivate * private_
Definition stream_encoder.h:466
FLAC__StreamEncoderSeekStatus
Definition stream_encoder.h:408
FLAC_API FLAC__bool FLAC__stream_encoder_set_max_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1825
void(* FLAC__StreamEncoderProgressCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 bytes_written, FLAC__uint64 samples_written, unsigned frames_written, unsigned total_frames_estimate, void *client_data)
Definition stream_encoder.h:677
FLAC__StreamEncoderSeekStatus(* FLAC__StreamEncoderSeekCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 absolute_byte_offset, void *client_data)
Definition stream_encoder.h:590
FLAC_API unsigned FLAC__stream_encoder_get_blocksize(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2029
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_FILE(FLAC__StreamEncoder *encoder, FILE *file, FLAC__StreamEncoderProgressCallback progress_callback, void *client_data)
FLAC_API FLAC__bool FLAC__stream_encoder_set_loose_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1629
FLAC_API FLAC__bool FLAC__stream_encoder_set_do_exhaustive_model_search(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1803
FLAC_API FLAC__bool FLAC__stream_encoder_set_apodization(FLAC__StreamEncoder *encoder, const char *specification)
Definition stream_encoder.c:1641
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_stream(FLAC__StreamEncoder *encoder, FLAC__StreamEncoderWriteCallback write_callback, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderTellCallback tell_callback, FLAC__StreamEncoderMetadataCallback metadata_callback, void *client_data)
Definition stream_encoder.c:1237
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_stream(FLAC__StreamEncoder *encoder, FLAC__StreamEncoderReadCallback read_callback, FLAC__StreamEncoderWriteCallback write_callback, FLAC__StreamEncoderSeekCallback seek_callback, FLAC__StreamEncoderTellCallback tell_callback, FLAC__StreamEncoderMetadataCallback metadata_callback, void *client_data)
Definition stream_encoder.c:1258
FLAC_API FLAC__uint64 FLAC__stream_encoder_get_total_samples_estimate(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2117
FLAC_API unsigned FLAC__stream_encoder_get_max_residual_partition_order(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2101
FLAC_API void FLAC__stream_encoder_delete(FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:574
FLAC_API FLAC__bool FLAC__stream_encoder_get_do_qlp_coeff_prec_search(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2069
FLAC_API FLAC__bool FLAC__stream_encoder_set_do_escape_coding(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1787
FLAC_API FLAC__bool FLAC__stream_encoder_finish(FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:1421
FLAC_API FLAC__StreamEncoderInitStatus FLAC__stream_encoder_init_ogg_FILE(FLAC__StreamEncoder *encoder, FILE *file, FLAC__StreamEncoderProgressCallback progress_callback, void *client_data)
FLAC__StreamEncoderTellStatus
Definition stream_encoder.h:431
FLAC_API FLAC__bool FLAC__stream_encoder_get_streamable_subset(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:1989
FLAC__StreamEncoderTellStatus(* FLAC__StreamEncoderTellCallback)(const FLAC__StreamEncoder *encoder, FLAC__uint64 *absolute_byte_offset, void *client_data)
Definition stream_encoder.h:635
FLAC_API FLAC__bool FLAC__stream_encoder_set_channels(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1541
FLAC_API FLAC__bool FLAC__stream_encoder_set_max_lpc_order(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1754
FLAC__StreamEncoderState
Definition stream_encoder.h:240
FLAC_API FLAC__StreamDecoderState FLAC__stream_encoder_get_verify_decoder_state(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:1940
FLAC_API unsigned FLAC__stream_encoder_get_bits_per_sample(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2013
FLAC_API unsigned FLAC__stream_encoder_get_sample_rate(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2021
FLAC_API unsigned FLAC__stream_encoder_get_min_residual_partition_order(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2093
FLAC_API FLAC__bool FLAC__stream_encoder_get_do_exhaustive_model_search(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:2085
FLAC_API FLAC__bool FLAC__stream_encoder_set_do_mid_side_stereo(FLAC__StreamEncoder *encoder, FLAC__bool value)
Definition stream_encoder.c:1618
FLAC_API FLAC__bool FLAC__stream_encoder_process(FLAC__StreamEncoder *encoder, const FLAC__int32 *const buffer[], unsigned samples)
Definition stream_encoder.c:2125
FLAC_API FLAC__bool FLAC__stream_encoder_set_min_residual_partition_order(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1814
FLAC_API FLAC__bool FLAC__stream_encoder_set_blocksize(FLAC__StreamEncoder *encoder, unsigned value)
Definition stream_encoder.c:1607
FLAC_API const char *const FLAC__StreamEncoderSeekStatusString[]
Definition stream_encoder.c:472
FLAC_API const char * FLAC__stream_encoder_get_resolved_state_string(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:1951
FLAC_API FLAC__StreamEncoderState FLAC__stream_encoder_get_state(const FLAC__StreamEncoder *encoder)
Definition stream_encoder.c:1932
@ FLAC__STREAM_ENCODER_READ_STATUS_CONTINUE
Definition stream_encoder.h:364
@ FLAC__STREAM_ENCODER_READ_STATUS_END_OF_STREAM
Definition stream_encoder.h:367
@ FLAC__STREAM_ENCODER_READ_STATUS_ABORT
Definition stream_encoder.h:370
@ FLAC__STREAM_ENCODER_READ_STATUS_UNSUPPORTED
Definition stream_encoder.h:373
@ FLAC__STREAM_ENCODER_WRITE_STATUS_FATAL_ERROR
Definition stream_encoder.h:393
@ FLAC__STREAM_ENCODER_WRITE_STATUS_OK
Definition stream_encoder.h:390
@ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_NUMBER_OF_CHANNELS
Definition stream_encoder.h:308
@ FLAC__STREAM_ENCODER_INIT_STATUS_OK
Definition stream_encoder.h:294
@ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_MAX_LPC_ORDER
Definition stream_encoder.h:323
@ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_QLP_COEFF_PRECISION
Definition stream_encoder.h:326
@ FLAC__STREAM_ENCODER_INIT_STATUS_BLOCK_SIZE_TOO_SMALL_FOR_LPC_ORDER
Definition stream_encoder.h:329
@ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BLOCK_SIZE
Definition stream_encoder.h:320
@ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_SAMPLE_RATE
Definition stream_encoder.h:317
@ FLAC__STREAM_ENCODER_INIT_STATUS_UNSUPPORTED_CONTAINER
Definition stream_encoder.h:300
@ FLAC__STREAM_ENCODER_INIT_STATUS_ENCODER_ERROR
Definition stream_encoder.h:297
@ FLAC__STREAM_ENCODER_INIT_STATUS_NOT_STREAMABLE
Definition stream_encoder.h:332
@ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_METADATA
Definition stream_encoder.h:335
@ FLAC__STREAM_ENCODER_INIT_STATUS_ALREADY_INITIALIZED
Definition stream_encoder.h:344
@ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_CALLBACKS
Definition stream_encoder.h:305
@ FLAC__STREAM_ENCODER_INIT_STATUS_INVALID_BITS_PER_SAMPLE
Definition stream_encoder.h:311
@ FLAC__STREAM_ENCODER_SEEK_STATUS_UNSUPPORTED
Definition stream_encoder.h:416
@ FLAC__STREAM_ENCODER_SEEK_STATUS_OK
Definition stream_encoder.h:410
@ FLAC__STREAM_ENCODER_SEEK_STATUS_ERROR
Definition stream_encoder.h:413
@ FLAC__STREAM_ENCODER_TELL_STATUS_OK
Definition stream_encoder.h:433
@ FLAC__STREAM_ENCODER_TELL_STATUS_UNSUPPORTED
Definition stream_encoder.h:439
@ FLAC__STREAM_ENCODER_TELL_STATUS_ERROR
Definition stream_encoder.h:436
@ FLAC__STREAM_ENCODER_VERIFY_MISMATCH_IN_AUDIO_DATA
Definition stream_encoder.h:259
@ FLAC__STREAM_ENCODER_UNINITIALIZED
Definition stream_encoder.h:245
@ FLAC__STREAM_ENCODER_FRAMING_ERROR
Definition stream_encoder.h:272
@ FLAC__STREAM_ENCODER_MEMORY_ALLOCATION_ERROR
Definition stream_encoder.h:277
@ FLAC__STREAM_ENCODER_OK
Definition stream_encoder.h:242
@ FLAC__STREAM_ENCODER_VERIFY_DECODER_ERROR
Definition stream_encoder.h:254
@ FLAC__STREAM_ENCODER_CLIENT_ERROR
Definition stream_encoder.h:264
@ FLAC__STREAM_ENCODER_OGG_ERROR
Definition stream_encoder.h:251
@ FLAC__STREAM_ENCODER_IO_ERROR
Definition stream_encoder.h:267
JBLOCKROW JDIMENSION num_blocks
Definition jpegint.h:377
int32_t FLAC__int32
Definition ordinals.h:62
FLAC__uint8 FLAC__byte
Definition ordinals.h:72
int FLAC__bool
Definition ordinals.h:70
uint64_t FLAC__uint64
Definition ordinals.h:66
Definition stream_encoder.h:464
Definition stream_encoder.c:309
FLAC__StreamEncoderProgressCallback progress_callback
Definition stream_encoder.c:375
FLAC__uint64 samples_written
Definition stream_encoder.c:380
FLAC__StreamEncoderTellCallback tell_callback
Definition stream_encoder.c:372
unsigned frames_written
Definition stream_encoder.c:381
unsigned total_frames_estimate
Definition stream_encoder.c:382
FLAC__StreamEncoderReadCallback read_callback
Definition stream_encoder.c:370
unsigned frame_number
Definition stream_encoder.c:415
void * client_data
Definition stream_encoder.c:376
FLAC__int32 expected
Definition stream_encoder.c:418
unsigned channel
Definition stream_encoder.c:416
FLAC__int32 got
Definition stream_encoder.c:419
FLAC__StreamEncoderMetadataCallback metadata_callback
Definition stream_encoder.c:374
FLAC__uint64 bytes_written
Definition stream_encoder.c:379
FLAC__StreamEncoderWriteCallback write_callback
Definition stream_encoder.c:373
FLAC__uint64 absolute_sample
Definition stream_encoder.c:414
FLAC__StreamEncoderSeekCallback seek_callback
Definition stream_encoder.c:371
Definition stream_encoder.h:86
Definition format.h:834
signed int sample
Definition tap_dynamics_m.c:41
#define void
Definition unzip.h:396
struct zdirent * file
Definition win32.c:1500