new flac + fix protoc

This commit is contained in:
philippe44
2023-03-27 23:38:33 -07:00
parent 31184b6946
commit e070965990
20 changed files with 544 additions and 1584 deletions

View File

@@ -1,6 +1,6 @@
/* libFLAC - Free Lossless Audio Codec library
* Copyright (C) 2000-2009 Josh Coalson
* Copyright (C) 2011-2014 Xiph.Org Foundation
* Copyright (C) 2011-2022 Xiph.Org Foundation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -228,7 +228,7 @@ typedef enum {
*/
FLAC__STREAM_DECODER_ABORTED,
/**< The decoder was aborted by the read callback. */
/**< The decoder was aborted by the read or write callback. */
FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR,
/**< An error occurred allocating memory. The decoder is in an invalid
@@ -422,7 +422,11 @@ extern FLAC_API const char * const FLAC__StreamDecoderWriteStatusString[];
* could be because the decoder encountered a valid frame made by a future
* version of the encoder which it cannot parse, or because of a false
* sync making it appear as though an encountered frame was generated by
* a future encoder.
* a future encoder. \c FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA is
* caused by finding data that doesn't fit a metadata block (too large
* or too small) or finding inconsistencies in the metadata, for example
* a PICTURE block with an image that exceeds the size of the metadata
* block.
*/
typedef enum {
@@ -435,9 +439,12 @@ typedef enum {
FLAC__STREAM_DECODER_ERROR_STATUS_FRAME_CRC_MISMATCH,
/**< The frame's data did not match the CRC in the footer. */
FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM
FLAC__STREAM_DECODER_ERROR_STATUS_UNPARSEABLE_STREAM,
/**< The decoder encountered reserved fields in use in the stream. */
FLAC__STREAM_DECODER_ERROR_STATUS_BAD_METADATA
/**< The decoder encountered a corrupted metadata block. */
} FLAC__StreamDecoderErrorStatus;
/** Maps a FLAC__StreamDecoderErrorStatus to a C string.
@@ -674,7 +681,7 @@ typedef FLAC__bool (*FLAC__StreamDecoderEofCallback)(const FLAC__StreamDecoder *
* samples of length \a frame->header.blocksize.
* Channels will be ordered according to the FLAC
* specification; see the documentation for the
* <A HREF="../format.html#frame_header">frame header</A>.
* <A HREF="https://xiph.org/flac/format.html#frame_header">frame header</A>.
* \param client_data The callee's client data set through
* FLAC__stream_decoder_init_*().
* \retval FLAC__StreamDecoderWriteStatus
@@ -920,7 +927,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_get_md5_checking(const FLAC__StreamDeco
* \param decoder A decoder instance to query.
* \assert
* \code decoder != NULL \endcode
* \retval unsigned
* \retval uint32_t
* See above.
*/
FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamDecoder *decoder);
@@ -932,10 +939,10 @@ FLAC_API FLAC__uint64 FLAC__stream_decoder_get_total_samples(const FLAC__StreamD
* \param decoder A decoder instance to query.
* \assert
* \code decoder != NULL \endcode
* \retval unsigned
* \retval uint32_t
* See above.
*/
FLAC_API unsigned FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder);
FLAC_API uint32_t FLAC__stream_decoder_get_channels(const FLAC__StreamDecoder *decoder);
/** Get the current channel assignment in the stream being decoded.
* Will only be valid after decoding has started and will contain the
@@ -956,10 +963,10 @@ FLAC_API FLAC__ChannelAssignment FLAC__stream_decoder_get_channel_assignment(con
* \param decoder A decoder instance to query.
* \assert
* \code decoder != NULL \endcode
* \retval unsigned
* \retval uint32_t
* See above.
*/
FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder);
FLAC_API uint32_t FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDecoder *decoder);
/** Get the current sample rate in Hz of the stream being decoded.
* Will only be valid after decoding has started and will contain the
@@ -968,10 +975,10 @@ FLAC_API unsigned FLAC__stream_decoder_get_bits_per_sample(const FLAC__StreamDec
* \param decoder A decoder instance to query.
* \assert
* \code decoder != NULL \endcode
* \retval unsigned
* \retval uint32_t
* See above.
*/
FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder);
FLAC_API uint32_t FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder *decoder);
/** Get the current blocksize of the stream being decoded.
* Will only be valid after decoding has started and will contain the
@@ -980,10 +987,10 @@ FLAC_API unsigned FLAC__stream_decoder_get_sample_rate(const FLAC__StreamDecoder
* \param decoder A decoder instance to query.
* \assert
* \code decoder != NULL \endcode
* \retval unsigned
* \retval uint32_t
* See above.
*/
FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder);
FLAC_API uint32_t FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *decoder);
/** Returns the decoder's current read position within the stream.
* The position is the byte offset from the start of the stream.
@@ -1006,6 +1013,16 @@ FLAC_API unsigned FLAC__stream_decoder_get_blocksize(const FLAC__StreamDecoder *
*/
FLAC_API FLAC__bool FLAC__stream_decoder_get_decode_position(const FLAC__StreamDecoder *decoder, FLAC__uint64 *position);
/** Return client_data from decoder.
* The data pointed to by the pointer should not be modified.
*
* \param decoder A decoder instance.
* \retval const void *
* The callee's client data set through FLAC__stream_decoder_init_*().
* Do not modify the contents.
*/
FLAC_API const void *FLAC__stream_decoder_get_client_data(FLAC__StreamDecoder *decoder);
/** Initialize the decoder instance to decode native FLAC streams.
*
* This flavor of initialization sets up the decoder to decode from a
@@ -1184,7 +1201,7 @@ FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_stream(
* Unless \a file is \c stdin, it will be closed
* when FLAC__stream_decoder_finish() is called.
* Note however that seeking will not work when
* decoding from \c stdout since it is not seekable.
* decoding from \c stdin since it is not seekable.
* \param write_callback See FLAC__StreamDecoderWriteCallback. This
* pointer must not be \c NULL.
* \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This
@@ -1234,7 +1251,7 @@ FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_FILE(
* Unless \a file is \c stdin, it will be closed
* when FLAC__stream_decoder_finish() is called.
* Note however that seeking will not work when
* decoding from \c stdout since it is not seekable.
* decoding from \c stdin since it is not seekable.
* \param write_callback See FLAC__StreamDecoderWriteCallback. This
* pointer must not be \c NULL.
* \param metadata_callback See FLAC__StreamDecoderMetadataCallback. This
@@ -1263,11 +1280,15 @@ FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_ogg_FILE(
/** Initialize the decoder instance to decode native FLAC files.
*
* This flavor of initialization sets up the decoder to decode from a plain
* native FLAC file. If POSIX fopen() semantics are not sufficient, (for
* example, with Unicode filenames on Windows), you must use
* FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream()
* native FLAC file. If POSIX fopen() semantics are not sufficient, you must
* use FLAC__stream_decoder_init_FILE(), or FLAC__stream_decoder_init_stream()
* and provide callbacks for the I/O.
*
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
* internally translates to an appropriate representation to use with
* _wfopen. On all other systems, filename is passed to fopen without
* any translation.
*
* This function should be called after FLAC__stream_decoder_new() and
* FLAC__stream_decoder_set_*() but before any of the
* FLAC__stream_decoder_process_*() functions. Will set and return the
@@ -1305,11 +1326,15 @@ FLAC_API FLAC__StreamDecoderInitStatus FLAC__stream_decoder_init_file(
/** Initialize the decoder instance to decode Ogg FLAC files.
*
* This flavor of initialization sets up the decoder to decode from a plain
* Ogg FLAC file. If POSIX fopen() semantics are not sufficient, (for
* example, with Unicode filenames on Windows), you must use
* Ogg FLAC file. If POSIX fopen() semantics are not sufficient, you must use
* FLAC__stream_decoder_init_ogg_FILE(), or FLAC__stream_decoder_init_ogg_stream()
* and provide callbacks for the I/O.
*
* On Windows, filename must be a UTF-8 encoded filename, which libFLAC
* internally translates to an appropriate representation to use with
* _wfopen. On all other systems, filename is passed to fopen without
* any translation.
*
* This function should be called after FLAC__stream_decoder_new() and
* FLAC__stream_decoder_set_*() but before any of the
* FLAC__stream_decoder_process_*() functions. Will set and return the
@@ -1403,8 +1428,7 @@ FLAC_API FLAC__bool FLAC__stream_decoder_flush(FLAC__StreamDecoder *decoder);
* and is not seekable (i.e. no seek callback was provided or the seek
* callback returns \c FLAC__STREAM_DECODER_SEEK_STATUS_UNSUPPORTED), it
* is the duty of the client to start feeding data from the beginning of
* the stream on the next FLAC__stream_decoder_process() or
* FLAC__stream_decoder_process_interleaved() call.
* the stream on the next FLAC__stream_decoder_process_*() call.
*
* \param decoder A decoder instance.
* \assert