Commit d9cca9fc authored by Anton Khirnov's avatar Anton Khirnov

lavc: use avpriv_ prefix for some flac symbols used in lavf.

Specifically, ff_flac_parse_streaminfo, ff_flac_is_extradata_valid and
ff_flac_parse_block_header
parent 59a9a235
...@@ -95,8 +95,8 @@ typedef struct FLACFrameInfo { ...@@ -95,8 +95,8 @@ typedef struct FLACFrameInfo {
* @param[out] s where parsed information is stored * @param[out] s where parsed information is stored
* @param[in] buffer pointer to start of 34-byte streaminfo data * @param[in] buffer pointer to start of 34-byte streaminfo data
*/ */
void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
const uint8_t *buffer); const uint8_t *buffer);
/** /**
* Validate the FLAC extradata. * Validate the FLAC extradata.
...@@ -105,9 +105,9 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, ...@@ -105,9 +105,9 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
* @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data. * @param[out] streaminfo_start pointer to start of 34-byte STREAMINFO data.
* @return 1 if valid, 0 if not valid. * @return 1 if valid, 0 if not valid.
*/ */
int ff_flac_is_extradata_valid(AVCodecContext *avctx, int avpriv_flac_is_extradata_valid(AVCodecContext *avctx,
enum FLACExtradataFormat *format, enum FLACExtradataFormat *format,
uint8_t **streaminfo_start); uint8_t **streaminfo_start);
/** /**
* Parse the metadata block parameters from the header. * Parse the metadata block parameters from the header.
...@@ -116,8 +116,8 @@ int ff_flac_is_extradata_valid(AVCodecContext *avctx, ...@@ -116,8 +116,8 @@ int ff_flac_is_extradata_valid(AVCodecContext *avctx,
* @param[out] type metadata block type * @param[out] type metadata block type
* @param[out] size metadata block size * @param[out] size metadata block size
*/ */
void ff_flac_parse_block_header(const uint8_t *block_header, void avpriv_flac_parse_block_header(const uint8_t *block_header,
int *last, int *type, int *size); int *last, int *type, int *size);
/** /**
* Calculate an estimate for the maximum frame size based on verbatim mode. * Calculate an estimate for the maximum frame size based on verbatim mode.
......
...@@ -63,7 +63,7 @@ typedef struct FLACContext { ...@@ -63,7 +63,7 @@ typedef struct FLACContext {
static void allocate_buffers(FLACContext *s); static void allocate_buffers(FLACContext *s);
int ff_flac_is_extradata_valid(AVCodecContext *avctx, int avpriv_flac_is_extradata_valid(AVCodecContext *avctx,
enum FLACExtradataFormat *format, enum FLACExtradataFormat *format,
uint8_t **streaminfo_start) uint8_t **streaminfo_start)
{ {
...@@ -104,11 +104,11 @@ static av_cold int flac_decode_init(AVCodecContext *avctx) ...@@ -104,11 +104,11 @@ static av_cold int flac_decode_init(AVCodecContext *avctx)
if (!avctx->extradata) if (!avctx->extradata)
return 0; return 0;
if (!ff_flac_is_extradata_valid(avctx, &format, &streaminfo)) if (!avpriv_flac_is_extradata_valid(avctx, &format, &streaminfo))
return -1; return -1;
/* initialize based on the demuxer-supplied streamdata header */ /* initialize based on the demuxer-supplied streamdata header */
ff_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo); avpriv_flac_parse_streaminfo(avctx, (FLACStreaminfo *)s, streaminfo);
if (s->bps > 16) if (s->bps > 16)
avctx->sample_fmt = AV_SAMPLE_FMT_S32; avctx->sample_fmt = AV_SAMPLE_FMT_S32;
else else
...@@ -140,7 +140,7 @@ static void allocate_buffers(FLACContext *s) ...@@ -140,7 +140,7 @@ static void allocate_buffers(FLACContext *s)
} }
} }
void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
const uint8_t *buffer) const uint8_t *buffer)
{ {
GetBitContext gb; GetBitContext gb;
...@@ -174,7 +174,7 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, ...@@ -174,7 +174,7 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s,
dump_headers(avctx, s); dump_headers(avctx, s);
} }
void ff_flac_parse_block_header(const uint8_t *block_header, void avpriv_flac_parse_block_header(const uint8_t *block_header,
int *last, int *type, int *size) int *last, int *type, int *size)
{ {
int tmp = bytestream_get_byte(&block_header); int tmp = bytestream_get_byte(&block_header);
...@@ -201,12 +201,12 @@ static int parse_streaminfo(FLACContext *s, const uint8_t *buf, int buf_size) ...@@ -201,12 +201,12 @@ static int parse_streaminfo(FLACContext *s, const uint8_t *buf, int buf_size)
/* need more data */ /* need more data */
return 0; return 0;
} }
ff_flac_parse_block_header(&buf[4], NULL, &metadata_type, &metadata_size); avpriv_flac_parse_block_header(&buf[4], NULL, &metadata_type, &metadata_size);
if (metadata_type != FLAC_METADATA_TYPE_STREAMINFO || if (metadata_type != FLAC_METADATA_TYPE_STREAMINFO ||
metadata_size != FLAC_STREAMINFO_SIZE) { metadata_size != FLAC_STREAMINFO_SIZE) {
return AVERROR_INVALIDDATA; return AVERROR_INVALIDDATA;
} }
ff_flac_parse_streaminfo(s->avctx, (FLACStreaminfo *)s, &buf[8]); avpriv_flac_parse_streaminfo(s->avctx, (FLACStreaminfo *)s, &buf[8]);
allocate_buffers(s); allocate_buffers(s);
s->got_streaminfo = 1; s->got_streaminfo = 1;
...@@ -228,7 +228,7 @@ static int get_metadata_size(const uint8_t *buf, int buf_size) ...@@ -228,7 +228,7 @@ static int get_metadata_size(const uint8_t *buf, int buf_size)
do { do {
if (buf_end - buf < 4) if (buf_end - buf < 4)
return 0; return 0;
ff_flac_parse_block_header(buf, &metadata_last, NULL, &metadata_size); avpriv_flac_parse_block_header(buf, &metadata_last, NULL, &metadata_size);
buf += 4; buf += 4;
if (buf_end - buf < metadata_size) { if (buf_end - buf < metadata_size) {
/* need more data in order to read the complete header */ /* need more data in order to read the complete header */
......
...@@ -48,7 +48,7 @@ static int flac_read_header(AVFormatContext *s, ...@@ -48,7 +48,7 @@ static int flac_read_header(AVFormatContext *s,
/* process metadata blocks */ /* process metadata blocks */
while (!s->pb->eof_reached && !metadata_last) { while (!s->pb->eof_reached && !metadata_last) {
avio_read(s->pb, header, 4); avio_read(s->pb, header, 4);
ff_flac_parse_block_header(header, &metadata_last, &metadata_type, avpriv_flac_parse_block_header(header, &metadata_last, &metadata_type,
&metadata_size); &metadata_size);
switch (metadata_type) { switch (metadata_type) {
/* allocate and read metadata block for supported types */ /* allocate and read metadata block for supported types */
...@@ -87,7 +87,7 @@ static int flac_read_header(AVFormatContext *s, ...@@ -87,7 +87,7 @@ static int flac_read_header(AVFormatContext *s,
buffer = NULL; buffer = NULL;
/* get codec params from STREAMINFO header */ /* get codec params from STREAMINFO header */
ff_flac_parse_streaminfo(st->codec, &si, st->codec->extradata); avpriv_flac_parse_streaminfo(st->codec, &si, st->codec->extradata);
/* set time base and duration */ /* set time base and duration */
if (si.samplerate > 0) { if (si.samplerate > 0) {
......
...@@ -94,7 +94,7 @@ static int flac_write_trailer(struct AVFormatContext *s) ...@@ -94,7 +94,7 @@ static int flac_write_trailer(struct AVFormatContext *s)
enum FLACExtradataFormat format; enum FLACExtradataFormat format;
int64_t file_size; int64_t file_size;
if (!ff_flac_is_extradata_valid(s->streams[0]->codec, &format, &streaminfo)) if (!avpriv_flac_is_extradata_valid(s->streams[0]->codec, &format, &streaminfo))
return -1; return -1;
if (pb->seekable) { if (pb->seekable) {
......
...@@ -34,7 +34,7 @@ int ff_flac_write_header(AVIOContext *pb, AVCodecContext *codec, ...@@ -34,7 +34,7 @@ int ff_flac_write_header(AVIOContext *pb, AVCodecContext *codec,
enum FLACExtradataFormat format; enum FLACExtradataFormat format;
header[4] = last_block ? 0x80 : 0x00; header[4] = last_block ? 0x80 : 0x00;
if (!ff_flac_is_extradata_valid(codec, &format, &streaminfo)) if (!avpriv_flac_is_extradata_valid(codec, &format, &streaminfo))
return -1; return -1;
/* write "fLaC" stream marker and first metadata block header if needed */ /* write "fLaC" stream marker and first metadata block header if needed */
......
...@@ -254,7 +254,7 @@ static int ogg_build_flac_headers(AVCodecContext *avctx, ...@@ -254,7 +254,7 @@ static int ogg_build_flac_headers(AVCodecContext *avctx,
uint8_t *streaminfo; uint8_t *streaminfo;
uint8_t *p; uint8_t *p;
if (!ff_flac_is_extradata_valid(avctx, &format, &streaminfo)) if (!avpriv_flac_is_extradata_valid(avctx, &format, &streaminfo))
return -1; return -1;
// first packet: STREAMINFO // first packet: STREAMINFO
......
...@@ -55,7 +55,7 @@ flac_header (AVFormatContext * s, int idx) ...@@ -55,7 +55,7 @@ flac_header (AVFormatContext * s, int idx)
if (get_bits_long(&gb, 32) != FLAC_STREAMINFO_SIZE) if (get_bits_long(&gb, 32) != FLAC_STREAMINFO_SIZE)
return -1; return -1;
ff_flac_parse_streaminfo(st->codec, &si, streaminfo_start); avpriv_flac_parse_streaminfo(st->codec, &si, streaminfo_start);
st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = CODEC_ID_FLAC; st->codec->codec_id = CODEC_ID_FLAC;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment