Merge remote-tracking branch 'qatar/master'

* qatar/master: (47 commits)
  lavc: hide private symbols.
  lavc: deprecate img_get_alpha_info().
  lavc: use avpriv_ prefix for ff_toupper4.
  lavc: use avpriv_ prefix for ff_copy_bits and align_put_bits.
  lavc: use avpriv_ prefix for ff_ac3_parse_header.
  lavc: use avpriv_ prefix for ff_frame_rate_tab.
  lavc: rename ff_find_start_code to avpriv_mpv_find_start_code
  lavc: use avpriv_ prefix for ff_split_xiph_headers.
  lavc: use avpriv_ prefix for ff_dirac_parse_sequence_header.
  lavc: use avpriv_ prefix for some dv symbols used in lavf.
  lavc: use avpriv_ prefix for some flac symbols used in lavf.
  lavc: use avpriv_ prefix for some mpeg4audio symbols used in lavf.
  lavc: use avpriv_ prefix for some mpegaudio symbols used in lavf.
  lavc: use avpriv_ prefix for ff_aac_parse_header().
  lavf: hide private symbols.
  lavf: use avpriv_ prefix for some dv functions.
  lavf: use avpriv_ prefix for ff_new_chapter().
  avcodec: add CODEC_CAP_DELAY note to avcodec_decode_audio3() documentation
  avcodec: clarify the CODEC_CAP_DELAY note in avcodec_decode_video2()
  avcodec: clarify documentation of CODEC_CAP_DELAY
  ...

Conflicts:
	configure
	doc/general.texi
	libavcodec/Makefile
	libavcodec/aacdec.c
	libavcodec/allcodecs.c
	libavcodec/avcodec.h
	libavcodec/dv.c
	libavcodec/dvdata.c
	libavcodec/dvdata.h
	libavcodec/libspeexenc.c
	libavcodec/mpegvideo.c
	libavcodec/version.h
	libavformat/avidec.c
	libavformat/dv.c
	libavformat/dv.h
	libavformat/flvenc.c
	libavformat/mov.c
	libavformat/mp3enc.c
	libavformat/oggparsespeex.c

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2011-10-21 01:27:28 +02:00
commit dd8ffc1925
113 changed files with 871 additions and 610 deletions

View file

@ -41,7 +41,7 @@ static int ac3_eac3_probe(AVProbeData *p, enum CodecID expected_codec_id)
for(frames = 0; buf2 < end; frames++) {
init_get_bits(&gbc, buf2, 54);
if(ff_ac3_parse_header(&gbc, &hdr) < 0)
if(avpriv_ac3_parse_header(&gbc, &hdr) < 0)
break;
if(buf2 + hdr.frame_size > end ||
av_crc(av_crc_get_table(AV_CRC_16_ANSI), 0, buf2 + 2, hdr.frame_size - 2))

View file

@ -35,7 +35,7 @@ int ff_adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf
int off;
init_get_bits(&gb, buf, size * 8);
off = ff_mpeg4audio_get_config(&m4ac, buf, size);
off = avpriv_mpeg4audio_get_config(&m4ac, buf, size);
if (off < 0)
return off;
skip_bits_long(&gb, off);
@ -67,7 +67,7 @@ int ff_adts_decode_extradata(AVFormatContext *s, ADTSContext *adts, uint8_t *buf
init_put_bits(&pb, adts->pce_data, MAX_PCE_SIZE);
put_bits(&pb, 3, 5); //ID_PCE
adts->pce_size = (ff_copy_pce_data(&pb, &gb) + 3) / 8;
adts->pce_size = (avpriv_copy_pce_data(&pb, &gb) + 3) / 8;
flush_put_bits(&pb);
}

View file

@ -569,7 +569,7 @@ static int asf_read_marker(AVFormatContext *s, int64_t size)
name_len = avio_rl32(pb); // name length
if ((ret = avio_get_str16le(pb, name_len * 2, name, sizeof(name))) < name_len)
avio_skip(pb, name_len - ret);
ff_new_chapter(s, i, (AVRational){1, 10000000}, pres_time, AV_NOPTS_VALUE, name );
avpriv_new_chapter(s, i, (AVRational){1, 10000000}, pres_time, AV_NOPTS_VALUE, name );
}
return 0;

View file

@ -490,7 +490,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
av_freep(&s->streams[0]);
s->nb_streams = 0;
if (CONFIG_DV_DEMUXER) {
avi->dv_demux = dv_init_demux(s);
avi->dv_demux = avpriv_dv_init_demux(s);
if (!avi->dv_demux)
goto fail;
}
@ -1012,7 +1012,7 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
void* dstr;
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
int size = dv_get_packet(avi->dv_demux, pkt);
int size = avpriv_dv_get_packet(avi->dv_demux, pkt);
if (size >= 0)
return size;
}
@ -1115,7 +1115,7 @@ resync:
if (CONFIG_DV_DEMUXER && avi->dv_demux) {
dstr = pkt->destruct;
size = dv_produce_packet(avi->dv_demux, pkt,
size = avpriv_dv_produce_packet(avi->dv_demux, pkt,
pkt->data, pkt->size, pkt->pos);
pkt->destruct = dstr;
pkt->flags |= AV_PKT_FLAG_KEY;

View file

@ -270,7 +270,7 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
* The following 3 functions constitute our interface to the world
*/
DVDemuxContext* dv_init_demux(AVFormatContext *s)
DVDemuxContext* avpriv_dv_init_demux(AVFormatContext *s)
{
DVDemuxContext *c;
@ -299,7 +299,7 @@ DVDemuxContext* dv_init_demux(AVFormatContext *s)
return c;
}
int dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
{
int size = -1;
int i;
@ -316,14 +316,14 @@ int dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
return size;
}
int dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
uint8_t* buf, int buf_size, int64_t pos)
{
int size, i;
uint8_t *ppcm[4] = {0};
if (buf_size < DV_PROFILE_BYTES ||
!(c->sys = ff_dv_frame_profile(c->sys, buf, buf_size)) ||
!(c->sys = avpriv_dv_frame_profile(c->sys, buf, buf_size)) ||
buf_size < c->sys->frame_size) {
return -1; /* Broken frame, or not enough data */
}
@ -371,7 +371,7 @@ static int64_t dv_frame_offset(AVFormatContext *s, DVDemuxContext *c,
int64_t timestamp, int flags)
{
// FIXME: sys may be wrong if last dv_read_packet() failed (buffer is junk)
const DVprofile* sys = ff_dv_codec_profile(c->vst->codec);
const DVprofile* sys = avpriv_dv_codec_profile(c->vst->codec);
int64_t offset;
int64_t size = avio_size(s->pb) - s->data_offset;
int64_t max_offset = ((size-1) / sys->frame_size) * sys->frame_size;
@ -409,7 +409,7 @@ static int dv_read_header(AVFormatContext *s,
unsigned state, marker_pos = 0;
RawDVContext *c = s->priv_data;
c->dv_demux = dv_init_demux(s);
c->dv_demux = avpriv_dv_init_demux(s);
if (!c->dv_demux)
return -1;
@ -434,7 +434,7 @@ static int dv_read_header(AVFormatContext *s,
avio_seek(s->pb, -DV_PROFILE_BYTES, SEEK_CUR) < 0)
return AVERROR(EIO);
c->dv_demux->sys = ff_dv_frame_profile(c->dv_demux->sys, c->buf, DV_PROFILE_BYTES);
c->dv_demux->sys = avpriv_dv_frame_profile(c->dv_demux->sys, c->buf, DV_PROFILE_BYTES);
if (!c->dv_demux->sys) {
av_log(s, AV_LOG_ERROR, "Can't determine profile of DV input stream.\n");
return -1;
@ -452,7 +452,7 @@ static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
int size;
RawDVContext *c = s->priv_data;
size = dv_get_packet(c->dv_demux, pkt);
size = avpriv_dv_get_packet(c->dv_demux, pkt);
if (size < 0) {
int64_t pos = avio_tell(s->pb);
@ -462,7 +462,7 @@ static int dv_read_packet(AVFormatContext *s, AVPacket *pkt)
if (avio_read(s->pb, c->buf, size) <= 0)
return AVERROR(EIO);
size = dv_produce_packet(c->dv_demux, pkt, c->buf, size, pos);
size = avpriv_dv_produce_packet(c->dv_demux, pkt, c->buf, size, pos);
}
return size;

View file

@ -31,9 +31,9 @@
#include "avformat.h"
typedef struct DVDemuxContext DVDemuxContext;
DVDemuxContext* dv_init_demux(AVFormatContext* s);
int dv_get_packet(DVDemuxContext*, AVPacket *);
int dv_produce_packet(DVDemuxContext*, AVPacket*, uint8_t*, int, int64_t);
DVDemuxContext* avpriv_dv_init_demux(AVFormatContext* s);
int avpriv_dv_get_packet(DVDemuxContext*, AVPacket *);
int avpriv_dv_produce_packet(DVDemuxContext*, AVPacket*, uint8_t*, int, int64_t);
void dv_offset_reset(DVDemuxContext *c, int64_t frame_offset);
typedef struct DVMuxContext DVMuxContext;

View file

@ -320,7 +320,7 @@ static DVMuxContext* dv_init_mux(AVFormatContext* s)
c->ast[i]->codec->channels != 2))
goto bail_out;
}
c->sys = ff_dv_codec_profile(vst->codec);
c->sys = avpriv_dv_codec_profile(vst->codec);
if (!c->sys)
goto bail_out;

View file

@ -75,7 +75,7 @@ static AVChapter *read_chapter(AVFormatContext *s)
end = AV_NOPTS_VALUE;
}
return ff_new_chapter(s, s->nb_chapters, tb, start, end, NULL);
return avpriv_new_chapter(s, s->nb_chapters, tb, start, end, NULL);
}
static uint8_t *unescape(uint8_t *buf, int size)

View file

@ -48,7 +48,7 @@ static int flac_read_header(AVFormatContext *s,
/* process metadata blocks */
while (!url_feof(s->pb) && !metadata_last) {
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);
switch (metadata_type) {
/* allocate and read metadata block for supported types */
@ -87,7 +87,7 @@ static int flac_read_header(AVFormatContext *s,
buffer = NULL;
/* 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 */
if (si.samplerate > 0) {

View file

@ -94,7 +94,7 @@ static int flac_write_trailer(struct AVFormatContext *s)
enum FLACExtradataFormat format;
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;
if (pb->seekable) {

View file

@ -34,7 +34,7 @@ int ff_flac_write_header(AVIOContext *pb, AVCodecContext *codec,
enum FLACExtradataFormat format;
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;
/* write "fLaC" stream marker and first metadata block header if needed */

View file

@ -542,7 +542,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
return ret;
if (st->codec->codec_id == CODEC_ID_AAC) {
MPEG4AudioConfig cfg;
ff_mpeg4audio_get_config(&cfg, st->codec->extradata,
avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
st->codec->extradata_size);
st->codec->channels = cfg.channels;
if (cfg.ext_sample_rate)

View file

@ -61,7 +61,7 @@ typedef struct FLVContext {
int64_t filesize_offset;
int64_t duration;
int delay; ///< first dts delay for AVC
int64_t last_video_ts;
int64_t last_ts;
} FLVContext;
static int get_audio_flags(AVCodecContext *enc){
@ -78,11 +78,6 @@ static int get_audio_flags(AVCodecContext *enc){
av_log(enc, AV_LOG_ERROR, "flv only supports mono Speex audio\n");
return -1;
}
if (enc->frame_size / 320 > 8) {
av_log(enc, AV_LOG_WARNING, "Warning: Speex stream has more than "
"8 frames per packet. Adobe Flash "
"Player cannot handle this!\n");
}
return FLV_CODECID_SPEEX | FLV_SAMPLERATE_11025HZ | FLV_SAMPLESSIZE_16BIT;
} else {
switch (enc->sample_rate) {
@ -223,7 +218,7 @@ static int flv_write_header(AVFormatContext *s)
}
}
flv->last_video_ts = -1;
flv->last_ts = -1;
/* write meta_tag */
avio_w8(pb, 18); // tag type META
@ -368,7 +363,7 @@ static int flv_write_trailer(AVFormatContext *s)
AVCodecContext *enc = s->streams[i]->codec;
if (enc->codec_type == AVMEDIA_TYPE_VIDEO &&
(enc->codec_id == CODEC_ID_H264 || enc->codec_id == CODEC_ID_MPEG4)) {
put_avc_eos_tag(pb, flv->last_video_ts);
put_avc_eos_tag(pb, flv->last_ts);
}
}
@ -434,19 +429,26 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
if (ff_avc_parse_nal_units_buf(pkt->data, &data, &size) < 0)
return -1;
}
if (!flv->delay && pkt->dts < 0)
flv->delay = -pkt->dts;
} else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
return -1;
}
if (!flv->delay && pkt->dts < 0)
flv->delay = -pkt->dts;
ts = pkt->dts + flv->delay; // add delay to force positive dts
if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
if (flv->last_video_ts < ts)
flv->last_video_ts = ts;
/* check Speex packet duration */
if (enc->codec_id == CODEC_ID_SPEEX && ts - flv->last_ts > 160) {
av_log(s, AV_LOG_WARNING, "Warning: Speex stream has more than "
"8 frames per packet. Adobe Flash "
"Player cannot handle this!\n");
}
if (flv->last_ts < ts)
flv->last_ts = ts;
avio_wb24(pb,size + flags_size);
avio_wb24(pb,ts);
avio_w8(pb,(ts >> 24) & 0x7F); // timestamps are 32bits _signed_

View file

@ -185,9 +185,9 @@ static void gxf_material_tags(AVIOContext *pb, int *len, struct gxf_stream_info
* @return fps as AVRational, or 0 / 0 if unknown
*/
static AVRational fps_tag2avr(int32_t fps) {
extern const AVRational ff_frame_rate_tab[];
extern const AVRational avpriv_frame_rate_tab[];
if (fps < 1 || fps > 9) fps = 9;
return ff_frame_rate_tab[9 - fps]; // values have opposite order
return avpriv_frame_rate_tab[9 - fps]; // values have opposite order
}
/**

View file

@ -223,8 +223,8 @@ int ff_add_index_entry(AVIndexEntry **index_entries,
*
* @return AVChapter or NULL on error
*/
AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base,
int64_t start, int64_t end, const char *title);
AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base,
int64_t start, int64_t end, const char *title);
/**
* Ensure the index uses less memory than the maximum specified in

View file

@ -433,11 +433,11 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext
st->codec->extradata_size = len;
if (st->codec->codec_id == CODEC_ID_AAC) {
MPEG4AudioConfig cfg;
ff_mpeg4audio_get_config(&cfg, st->codec->extradata,
avpriv_mpeg4audio_get_config(&cfg, st->codec->extradata,
st->codec->extradata_size);
st->codec->channels = cfg.channels;
if (cfg.object_type == 29 && cfg.sampling_index < 3) // old mp3on4
st->codec->sample_rate = ff_mpa_freq_tab[cfg.sampling_index];
st->codec->sample_rate = avpriv_mpa_freq_tab[cfg.sampling_index];
else if (cfg.ext_sample_rate)
st->codec->sample_rate = cfg.ext_sample_rate;
else

View file

@ -55,7 +55,7 @@ static int latm_decode_extradata(LATMContext *ctx, uint8_t *buf, int size)
MPEG4AudioConfig m4ac;
init_get_bits(&gb, buf, size * 8);
ctx->off = ff_mpeg4audio_get_config(&m4ac, buf, size);
ctx->off = avpriv_mpeg4audio_get_config(&m4ac, buf, size);
if (ctx->off < 0)
return ctx->off;
skip_bits_long(&gb, ctx->off);
@ -110,12 +110,12 @@ static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs)
/* AudioSpecificConfig */
if (ctx->object_type == AOT_ALS) {
header_size = avctx->extradata_size-(ctx->off + 7) >> 3;
ff_copy_bits(bs, &avctx->extradata[ctx->off], header_size);
avpriv_copy_bits(bs, &avctx->extradata[ctx->off], header_size);
} else {
ff_copy_bits(bs, avctx->extradata, ctx->off + 3);
avpriv_copy_bits(bs, avctx->extradata, ctx->off + 3);
if (!ctx->channel_conf) {
ff_copy_pce_data(bs, &gb);
avpriv_copy_pce_data(bs, &gb);
}
}
@ -168,7 +168,7 @@ static int latm_write_packet(AVFormatContext *s, AVPacket *pkt)
for (i = 0; i < pkt->size; i++)
put_bits(&bs, 8, pkt->data[i]);
align_put_bits(&bs);
avpriv_align_put_bits(&bs);
flush_put_bits(&bs);
len = put_bits_count(&bs) >> 3;

View file

@ -1,7 +1,23 @@
LIBAVFORMAT_$MAJOR {
global: *;
local:
ff_*_demuxer;
ff_*_muxer;
ff_*_protocol;
global: av*;
#FIXME those are for avserver
ff_inet_aton;
ff_socket_nonblock;
ffm_set_write_index;
ffm_read_write_index;
ffm_write_write_index;
ff_rtsp_parse_line;
ff_rtp_get_local_rtp_port;
ff_rtp_get_local_rtcp_port;
ffio_open_dyn_packet_buf;
url_open;
url_close;
url_write;
url_get_max_packet_size;
#those are deprecated, remove on next bump
find_info_tag;
parse_date;
dump_format;
url_*;
local: *;
};

View file

@ -1303,8 +1303,8 @@ static int matroska_aac_sri(int samplerate)
{
int sri;
for (sri=0; sri<FF_ARRAY_ELEMS(ff_mpeg4audio_sample_rates); sri++)
if (ff_mpeg4audio_sample_rates[sri] == samplerate)
for (sri=0; sri<FF_ARRAY_ELEMS(avpriv_mpeg4audio_sample_rates); sri++)
if (avpriv_mpeg4audio_sample_rates[sri] == samplerate)
break;
return sri;
}
@ -1668,7 +1668,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (chapters[i].start != AV_NOPTS_VALUE && chapters[i].uid
&& (max_start==0 || chapters[i].start > max_start)) {
chapters[i].chapter =
ff_new_chapter(s, chapters[i].uid, (AVRational){1, 1000000000},
avpriv_new_chapter(s, chapters[i].uid, (AVRational){1, 1000000000},
chapters[i].start, chapters[i].end,
chapters[i].title);
av_dict_set(&chapters[i].chapter->metadata,

View file

@ -423,7 +423,7 @@ static int put_xiph_codecpriv(AVFormatContext *s, AVIOContext *pb, AVCodecContex
else
first_header_size = 42;
if (ff_split_xiph_headers(codec->extradata, codec->extradata_size,
if (avpriv_split_xiph_headers(codec->extradata, codec->extradata_size,
first_header_size, header_start, header_len) < 0) {
av_log(s, AV_LOG_ERROR, "Extradata corrupt.\n");
return -1;
@ -443,7 +443,7 @@ static void get_aac_sample_rates(AVFormatContext *s, AVCodecContext *codec, int
{
MPEG4AudioConfig mp4ac;
if (ff_mpeg4audio_get_config(&mp4ac, codec->extradata, codec->extradata_size) < 0) {
if (avpriv_mpeg4audio_get_config(&mp4ac, codec->extradata, codec->extradata_size) < 0) {
av_log(s, AV_LOG_WARNING, "Error parsing AAC extradata, unable to determine samplerate.\n");
return;
}

View file

@ -289,7 +289,7 @@ static int mov_read_chpl(MOVContext *c, AVIOContext *pb, MOVAtom atom)
avio_read(pb, str, str_len);
str[str_len] = 0;
ff_new_chapter(c->fc, i, (AVRational){1,10000000}, start, AV_NOPTS_VALUE, str);
avpriv_new_chapter(c->fc, i, (AVRational){1,10000000}, start, AV_NOPTS_VALUE, str);
}
return 0;
}
@ -1291,7 +1291,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
#if CONFIG_DV_DEMUXER
case CODEC_ID_DVAUDIO:
c->dv_fctx = avformat_alloc_context();
c->dv_demux = dv_init_demux(c->dv_fctx);
c->dv_demux = avpriv_dv_init_demux(c->dv_fctx);
if (!c->dv_demux) {
av_log(c->fc, AV_LOG_ERROR, "dv demux context init error\n");
return -1;
@ -2484,7 +2484,7 @@ static void mov_read_chapters(AVFormatContext *s)
}
}
ff_new_chapter(s, i, st->time_base, sample->timestamp, end, title);
avpriv_new_chapter(s, i, st->time_base, sample->timestamp, end, title);
av_freep(&title);
}
finish:
@ -2592,10 +2592,10 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
}
#if CONFIG_DV_DEMUXER
if (mov->dv_demux && sc->dv_audio_container) {
dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, pkt->pos);
avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, pkt->pos);
av_free(pkt->data);
pkt->size = 0;
ret = dv_get_packet(mov->dv_demux, pkt);
ret = avpriv_dv_get_packet(mov->dv_demux, pkt);
if (ret < 0)
return ret;
}

View file

@ -51,7 +51,7 @@ static int mp3_read_probe(AVProbeData *p)
for(frames = 0; buf2 < end; frames++) {
header = AV_RB32(buf2);
fsize = ff_mpa_decode_header(&avctx, header, &sample_rate, &sample_rate, &sample_rate, &sample_rate);
fsize = avpriv_mpa_decode_header(&avctx, header, &sample_rate, &sample_rate, &sample_rate, &sample_rate);
if(fsize < 0)
break;
buf2 += fsize;
@ -86,7 +86,7 @@ static int mp3_parse_vbr_tags(AVFormatContext *s, AVStream *st, int64_t base)
if(ff_mpa_check_header(v) < 0)
return -1;
if (ff_mpegaudio_decode_header(&c, v) == 0)
if (avpriv_mpegaudio_decode_header(&c, v) == 0)
vbrtag_size = c.frame_size;
if(c.layer != 3)
return -1;

View file

@ -235,12 +235,12 @@ static int mp3_write_xing(AVFormatContext *s)
int srate_idx, i, channels;
int needed;
for (i = 0; i < FF_ARRAY_ELEMS(ff_mpa_freq_tab); i++)
if (ff_mpa_freq_tab[i] == codec->sample_rate) {
for (i = 0; i < FF_ARRAY_ELEMS(avpriv_mpa_freq_tab); i++)
if (avpriv_mpa_freq_tab[i] == codec->sample_rate) {
srate_idx = i;
break;
}
if (i == FF_ARRAY_ELEMS(ff_mpa_freq_tab)) {
if (i == FF_ARRAY_ELEMS(avpriv_mpa_freq_tab)) {
av_log(s, AV_LOG_ERROR, "Unsupported sample rate.\n");
return -1;
}
@ -263,7 +263,7 @@ static int mp3_write_xing(AVFormatContext *s)
mask = (bitrate_idx << 4) << 8;
header |= mask;
ff_mpegaudio_decode_header(&c, header);
avpriv_mpegaudio_decode_header(&c, header);
xing_offset=xing_offtbl[c.lsf == 1][c.nb_channels == 1];
needed = 4 // header
+ xing_offset

View file

@ -979,7 +979,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
}
do {
p = ff_find_start_code(p, buf_end, &state);
p = avpriv_mpv_find_start_code(p, buf_end, &state);
//av_log(s, AV_LOG_INFO, "nal %d\n", state & 0x1f);
} while (p < buf_end && (state & 0x1f) != 9 &&
(state & 0x1f) != 5 && (state & 0x1f) != 1);

View file

@ -416,7 +416,7 @@ static int decode_info_header(NUTContext *nut){
if(chapter_id && !stream_id_plus1){
int64_t start= chapter_start / nut->time_base_count;
chapter= ff_new_chapter(s, chapter_id,
chapter= avpriv_new_chapter(s, chapter_id,
nut->time_base[chapter_start % nut->time_base_count],
start, start + chapter_len, NULL);
metadata = &chapter->metadata;

View file

@ -59,10 +59,10 @@ static int find_expected_header(AVCodecContext *c, int size, int key_frame, uint
else if(sample_rate < (44100 + 48000)/2) sample_rate_index=0;
else sample_rate_index=1;
sample_rate= ff_mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25);
sample_rate= avpriv_mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25);
for(bitrate_index=2; bitrate_index<30; bitrate_index++){
frame_size = ff_mpa_bitrate_tab[lsf][layer-1][bitrate_index>>1];
frame_size = avpriv_mpa_bitrate_tab[lsf][layer-1][bitrate_index>>1];
frame_size = (frame_size * 144000) / (sample_rate << lsf) + (bitrate_index&1);
if(frame_size == size)

View file

@ -274,7 +274,7 @@ static int ogg_build_flac_headers(AVCodecContext *avctx,
uint8_t *streaminfo;
uint8_t *p;
if (!ff_flac_is_extradata_valid(avctx, &format, &streaminfo))
if (!avpriv_flac_is_extradata_valid(avctx, &format, &streaminfo))
return -1;
// first packet: STREAMINFO
@ -397,7 +397,7 @@ static int ogg_write_header(AVFormatContext *s)
int header_type = st->codec->codec_id == CODEC_ID_VORBIS ? 3 : 0x81;
int framing_bit = st->codec->codec_id == CODEC_ID_VORBIS ? 1 : 0;
if (ff_split_xiph_headers(st->codec->extradata, st->codec->extradata_size,
if (avpriv_split_xiph_headers(st->codec->extradata, st->codec->extradata_size,
st->codec->codec_id == CODEC_ID_VORBIS ? 30 : 42,
oggstream->header, oggstream->header_len) < 0) {
av_log(s, AV_LOG_ERROR, "Extradata corrupted\n");

View file

@ -36,7 +36,7 @@ static int dirac_header(AVFormatContext *s, int idx)
return 0;
init_get_bits(&gb, os->buf + os->pstart + 13, (os->psize - 13) * 8);
if (ff_dirac_parse_sequence_header(st->codec, &gb, &source) < 0)
if (avpriv_dirac_parse_sequence_header(st->codec, &gb, &source) < 0)
return -1;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;

View file

@ -55,7 +55,7 @@ flac_header (AVFormatContext * s, int idx)
if (get_bits_long(&gb, 32) != FLAC_STREAMINFO_SIZE)
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_id = CODEC_ID_FLAC;

View file

@ -31,6 +31,7 @@
#include "oggdec.h"
struct speex_params {
int packet_size;
int final_packet_duration;
int seq;
};
@ -58,14 +59,10 @@ static int speex_header(AVFormatContext *s, int idx) {
st->codec->sample_rate = AV_RL32(p + 36);
st->codec->channels = AV_RL32(p + 48);
/* We treat the whole Speex packet as a single frame everywhere Speex
is handled in FFmpeg. This avoids the complexities of splitting
and joining individual Speex frames, which are not always
byte-aligned. */
st->codec->frame_size = AV_RL32(p + 56);
frames_per_packet = AV_RL32(p + 64);
spxp->packet_size = AV_RL32(p + 56);
frames_per_packet = AV_RL32(p + 64);
if (frames_per_packet)
st->codec->frame_size *= frames_per_packet;
spxp->packet_size *= frames_per_packet;
st->codec->extradata_size = os->psize;
st->codec->extradata = av_malloc(st->codec->extradata_size
@ -95,7 +92,7 @@ static int speex_packet(AVFormatContext *s, int idx)
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + idx;
struct speex_params *spxp = os->private;
int packet_size = s->streams[idx]->codec->frame_size;
int packet_size = spxp->packet_size;
if (os->flags & OGG_FLAG_EOS && os->lastpts != AV_NOPTS_VALUE &&
os->granule > 0) {
@ -108,9 +105,10 @@ static int speex_packet(AVFormatContext *s, int idx)
if (!os->lastpts && os->granule > 0)
/* first packet */
os->pduration = os->granule - packet_size * (ogg_page_packets(os) - 1);
else if (os->flags & OGG_FLAG_EOS && os->segp == os->nsegs &&
spxp->final_packet_duration)
os->lastpts = os->lastdts = os->granule - packet_size *
ogg_page_packets(os);
if (os->flags & OGG_FLAG_EOS && os->segp == os->nsegs &&
spxp->final_packet_duration)
/* final packet */
os->pduration = spxp->final_packet_duration;
else

View file

@ -45,7 +45,7 @@ static int ogm_chapter(AVFormatContext *as, uint8_t *key, uint8_t *val)
if (sscanf(val, "%02d:%02d:%02d.%03d", &h, &m, &s, &ms) < 4)
return 0;
ff_new_chapter(as, cnum, (AVRational){1,1000},
avpriv_new_chapter(as, cnum, (AVRational){1,1000},
ms + 1000*(s + 60*(m + 60*h)),
AV_NOPTS_VALUE, NULL);
av_free(val);

View file

@ -56,7 +56,7 @@ void ff_rtp_send_mpegvideo(AVFormatContext *s1, const uint8_t *buf1, int size)
r1 = buf1;
while (1) {
start_code = -1;
r = ff_find_start_code(r1, end, &start_code);
r = avpriv_mpv_find_start_code(r1, end, &start_code);
if((start_code & 0xFFFFFF00) == 0x100) {
/* New start code found */
if (start_code == 0x100) {

View file

@ -252,7 +252,7 @@ static char *xiph_extradata2config(AVCodecContext *c)
return NULL;
}
if (ff_split_xiph_headers(c->extradata, c->extradata_size,
if (avpriv_split_xiph_headers(c->extradata, c->extradata_size,
first_header_size, header_start,
header_len) < 0) {
av_log(c, AV_LOG_ERROR, "Extradata corrupt.\n");
@ -342,7 +342,7 @@ static char *latm_context2config(AVCodecContext *c)
char *config;
for (rate_index = 0; rate_index < 16; rate_index++)
if (ff_mpeg4audio_sample_rates[rate_index] == c->sample_rate)
if (avpriv_mpeg4audio_sample_rates[rate_index] == c->sample_rate)
break;
if (rate_index == 16) {
av_log(c, AV_LOG_ERROR, "Unsupported sample rate\n");

View file

@ -57,7 +57,7 @@ static int spdif_get_offset_and_codec(AVFormatContext *s,
break;
case IEC61937_MPEG2_AAC:
init_get_bits(&gbc, buf, AAC_ADTS_HEADER_SIZE * 8);
if (ff_aac_parse_header(&gbc, &aac_hdr)) {
if (avpriv_aac_parse_header(&gbc, &aac_hdr)) {
if (s) /* be silent during a probe */
av_log(s, AV_LOG_ERROR, "Invalid AAC packet in IEC 61937\n");
return AVERROR_INVALIDDATA;

View file

@ -349,7 +349,7 @@ static int spdif_header_aac(AVFormatContext *s, AVPacket *pkt)
int ret;
init_get_bits(&gbc, pkt->data, AAC_ADTS_HEADER_SIZE * 8);
ret = ff_aac_parse_header(&gbc, &hdr);
ret = avpriv_aac_parse_header(&gbc, &hdr);
if (ret < 0) {
av_log(s, AV_LOG_ERROR, "Wrong AAC file format\n");
return AVERROR_INVALIDDATA;

View file

@ -2143,7 +2143,6 @@ static int has_codec_parameters(AVCodecContext *avctx)
avctx->codec_id == CODEC_ID_MP1 ||
avctx->codec_id == CODEC_ID_MP2 ||
avctx->codec_id == CODEC_ID_MP3 ||
avctx->codec_id == CODEC_ID_SPEEX ||
avctx->codec_id == CODEC_ID_CELT))
return 0;
break;
@ -2224,7 +2223,7 @@ enum CodecID ff_codec_get_id(const AVCodecTag *tags, unsigned int tag)
return tags[i].id;
}
for(i=0; tags[i].id != CODEC_ID_NONE; i++) {
if (ff_toupper4(tag) == ff_toupper4(tags[i].tag))
if (avpriv_toupper4(tag) == avpriv_toupper4(tags[i].tag))
return tags[i].id;
}
return CODEC_ID_NONE;
@ -2845,7 +2844,7 @@ AVProgram *av_new_program(AVFormatContext *ac, int id)
return program;
}
AVChapter *ff_new_chapter(AVFormatContext *s, int id, AVRational time_base, int64_t start, int64_t end, const char *title)
AVChapter *avpriv_new_chapter(AVFormatContext *s, int id, AVRational time_base, int64_t start, int64_t end, const char *title)
{
AVChapter *chapter = NULL;
int i;
@ -2969,7 +2968,7 @@ static int validate_codec_tag(AVFormatContext *s, AVStream *st)
for (n = 0; s->oformat->codec_tag[n]; n++) {
avctag = s->oformat->codec_tag[n];
while (avctag->id != CODEC_ID_NONE) {
if (ff_toupper4(avctag->tag) == ff_toupper4(st->codec->codec_tag)) {
if (avpriv_toupper4(avctag->tag) == avpriv_toupper4(st->codec->codec_tag)) {
id = avctag->id;
if (id == st->codec->codec_id)
return 1;