From 52375ba5677e54ebd5dc4e14ffaa0a3e9b676ce7 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Wed, 19 Oct 2011 13:16:01 -0400 Subject: flvenc: adjust for negative DTS for all codecs, not just H.264 --- libavformat/flvenc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libavformat') diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 23d19cd506..851ce491b0 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -410,9 +410,9 @@ 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; } + 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) { -- cgit v1.2.3 From 4ee247a2bdf2fbe81026a428d4affc46c81f28db Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Wed, 19 Oct 2011 13:20:15 -0400 Subject: flvenc: check packet duration in speex using timestamps Using AVCodecContext.frame_size is not reliable. --- libavformat/flvenc.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'libavformat') diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index 851ce491b0..cf77157636 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -58,7 +58,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){ @@ -75,11 +75,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) { @@ -220,7 +215,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 @@ -349,7 +344,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) { - put_avc_eos_tag(pb, flv->last_video_ts); + put_avc_eos_tag(pb, flv->last_ts); } } @@ -415,10 +410,17 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) 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_ -- cgit v1.2.3 From 0e69c0477399a5545d42456d6c3aec4a3650bb67 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Wed, 19 Oct 2011 13:28:12 -0400 Subject: ogg/speex: set correct timestamp and duration for the first packet. The first timestamp should be negative due to delay. Also, do not set AVCodecContext.frame_size unnecessarily. --- libavformat/oggparsespeex.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'libavformat') diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c index 2f4aec7f07..bbeeb20d60 100644 --- a/libavformat/oggparsespeex.c +++ b/libavformat/oggparsespeex.c @@ -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 Libav. 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 -- cgit v1.2.3 From 9ef6c7977f827e73fcc6e7f5ef6165936142eab4 Mon Sep 17 00:00:00 2001 From: Justin Ruggles Date: Wed, 19 Oct 2011 14:00:06 -0400 Subject: avformat: do not require frame_size for Speex. Having it there forces decoding of a frame in order to get frame_size, but it is not really needed for proper demuxing or decoding. --- libavformat/utils.c | 1 - 1 file changed, 1 deletion(-) (limited to 'libavformat') diff --git a/libavformat/utils.c b/libavformat/utils.c index 9735d455d9..5e3e60b198 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2070,7 +2070,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; -- cgit v1.2.3 From 1fa395e471d563166f3fe3071fce8148e27679a8 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 08:58:50 +0200 Subject: lavf: use avpriv_ prefix for ff_new_chapter(). It's used in libavdevice. --- libavdevice/libcdio.c | 2 +- libavformat/asfdec.c | 2 +- libavformat/ffmetadec.c | 2 +- libavformat/internal.h | 4 ++-- libavformat/matroskadec.c | 2 +- libavformat/mov.c | 4 ++-- libavformat/nutdec.c | 2 +- libavformat/oggparsevorbis.c | 2 +- libavformat/utils.c | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) (limited to 'libavformat') diff --git a/libavdevice/libcdio.c b/libavdevice/libcdio.c index bade74e5f0..6d0671a609 100644 --- a/libavdevice/libcdio.c +++ b/libavdevice/libcdio.c @@ -97,7 +97,7 @@ static av_cold int read_header(AVFormatContext *ctx, AVFormatParameters *ap) for (i = 0; i < s->drive->tracks; i++) { char title[16]; snprintf(title, sizeof(title), "track %02d", s->drive->disc_toc[i].bTrack); - ff_new_chapter(ctx, i, st->time_base, s->drive->disc_toc[i].dwStartSector, + avpriv_new_chapter(ctx, i, st->time_base, s->drive->disc_toc[i].dwStartSector, s->drive->disc_toc[i+1].dwStartSector, title); } diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 48ecec78b4..88091a5c9e 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -573,7 +573,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; diff --git a/libavformat/ffmetadec.c b/libavformat/ffmetadec.c index b2415155f1..21e5ee9da4 100644 --- a/libavformat/ffmetadec.c +++ b/libavformat/ffmetadec.c @@ -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) diff --git a/libavformat/internal.h b/libavformat/internal.h index 8440e6bd0a..9ef9d64051 100644 --- a/libavformat/internal.h +++ b/libavformat/internal.h @@ -225,8 +225,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 diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 78b27b6bd3..b3466db003 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1599,7 +1599,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, diff --git a/libavformat/mov.c b/libavformat/mov.c index d93969ce2a..62c3be36a2 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -287,7 +287,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; } @@ -2420,7 +2420,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: diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 730d6884cf..fb5ccf7fa9 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -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; diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 86951f3e2f..8a406976b5 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -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); diff --git a/libavformat/utils.c b/libavformat/utils.c index 5e3e60b198..1c1a7482e5 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2739,7 +2739,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; -- cgit v1.2.3 From ab88b25f99a29b131ff72bf9a833425fe5db5a3b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 08:58:50 +0200 Subject: lavf: use avpriv_ prefix for some dv functions. They are used in libavdevice. --- libavdevice/dv1394.c | 6 +++--- libavformat/avidec.c | 6 +++--- libavformat/dv.c | 12 ++++++------ libavformat/dv.h | 6 +++--- libavformat/mov.c | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) (limited to 'libavformat') diff --git a/libavdevice/dv1394.c b/libavdevice/dv1394.c index 3e286dcb4c..1ac9a81c97 100644 --- a/libavdevice/dv1394.c +++ b/libavdevice/dv1394.c @@ -86,7 +86,7 @@ static int dv1394_read_header(AVFormatContext * context, AVFormatParameters * ap { struct dv1394_data *dv = context->priv_data; - dv->dv_demux = dv_init_demux(context); + dv->dv_demux = avpriv_dv_init_demux(context); if (!dv->dv_demux) goto failed; @@ -124,7 +124,7 @@ static int dv1394_read_packet(AVFormatContext *context, AVPacket *pkt) struct dv1394_data *dv = context->priv_data; int size; - size = dv_get_packet(dv->dv_demux, pkt); + size = avpriv_dv_get_packet(dv->dv_demux, pkt); if (size > 0) return size; @@ -186,7 +186,7 @@ restart_poll: av_dlog(context, "index %d, avail %d, done %d\n", dv->index, dv->avail, dv->done); - size = dv_produce_packet(dv->dv_demux, pkt, + size = avpriv_dv_produce_packet(dv->dv_demux, pkt, dv->ring + (dv->index * DV1394_PAL_FRAME_SIZE), DV1394_PAL_FRAME_SIZE); dv->index = (dv->index + 1) % DV1394_RING_FRAMES; diff --git a/libavformat/avidec.c b/libavformat/avidec.c index 71aa0365d3..68d652a120 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -462,7 +462,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; } @@ -979,7 +979,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; } @@ -1079,7 +1079,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->destruct = dstr; pkt->flags |= AV_PKT_FLAG_KEY; diff --git a/libavformat/dv.c b/libavformat/dv.c index 5b229e9f07..5b6fb6210b 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -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,7 +316,7 @@ 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) { int size, i; @@ -407,7 +407,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; @@ -450,7 +450,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) { if (!c->dv_demux->sys) @@ -459,7 +459,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); + size = avpriv_dv_produce_packet(c->dv_demux, pkt, c->buf, size); } return size; diff --git a/libavformat/dv.h b/libavformat/dv.h index 650699d2d7..b4bb10d4bc 100644 --- a/libavformat/dv.h +++ b/libavformat/dv.h @@ -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); +DVDemuxContext* avpriv_dv_init_demux(AVFormatContext* s); +int avpriv_dv_get_packet(DVDemuxContext*, AVPacket *); +int avpriv_dv_produce_packet(DVDemuxContext*, AVPacket*, uint8_t*, int); void dv_offset_reset(DVDemuxContext *c, int64_t frame_offset); typedef struct DVMuxContext DVMuxContext; diff --git a/libavformat/mov.c b/libavformat/mov.c index 62c3be36a2..6baddebb82 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1249,7 +1249,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; @@ -2528,10 +2528,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); + avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size); 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; } -- cgit v1.2.3 From 8d74bf17c6d6280195854f4dadb19ef37d054566 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:14:04 +0200 Subject: lavf: hide private symbols. Overhead as reported by rbelf-size goes from 40147 to 20877. --- libavformat/libavformat.v | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'libavformat') diff --git a/libavformat/libavformat.v b/libavformat/libavformat.v index 0ec1c3c4de..2a49539f0a 100644 --- a/libavformat/libavformat.v +++ b/libavformat/libavformat.v @@ -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: *; }; -- cgit v1.2.3 From 73ae27e17be5fd0a4e34e7ea8a449ca59bc09664 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:22:04 +0200 Subject: lavc: use avpriv_ prefix for ff_aac_parse_header(). It's used in lavf. --- libavcodec/aac_adtstoasc_bsf.c | 2 +- libavcodec/aac_parser.c | 2 +- libavcodec/aacadtsdec.c | 2 +- libavcodec/aacadtsdec.h | 2 +- libavcodec/aacdec.c | 2 +- libavformat/spdifdec.c | 2 +- libavformat/spdifenc.c | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/aac_adtstoasc_bsf.c b/libavcodec/aac_adtstoasc_bsf.c index d1310c4149..be12e99587 100644 --- a/libavcodec/aac_adtstoasc_bsf.c +++ b/libavcodec/aac_adtstoasc_bsf.c @@ -55,7 +55,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc, if (show_bits(&gb, 12) != 0xfff) return 0; - if (ff_aac_parse_header(&gb, &hdr) < 0) { + if (avpriv_aac_parse_header(&gb, &hdr) < 0) { av_log(avctx, AV_LOG_ERROR, "Error parsing ADTS frame header!\n"); return -1; } diff --git a/libavcodec/aac_parser.c b/libavcodec/aac_parser.c index 1c5546e7aa..ca016d1b89 100644 --- a/libavcodec/aac_parser.c +++ b/libavcodec/aac_parser.c @@ -40,7 +40,7 @@ static int aac_sync(uint64_t state, AACAC3ParseContext *hdr_info, tmp.u64 = av_be2ne64(state); init_get_bits(&bits, tmp.u8+8-AAC_ADTS_HEADER_SIZE, AAC_ADTS_HEADER_SIZE * 8); - if ((size = ff_aac_parse_header(&bits, &hdr)) < 0) + if ((size = avpriv_aac_parse_header(&bits, &hdr)) < 0) return 0; *need_next_header = 0; *new_frame_start = 1; diff --git a/libavcodec/aacadtsdec.c b/libavcodec/aacadtsdec.c index a9ff8ef63d..09bf1392c4 100644 --- a/libavcodec/aacadtsdec.c +++ b/libavcodec/aacadtsdec.c @@ -26,7 +26,7 @@ #include "get_bits.h" #include "mpeg4audio.h" -int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr) +int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr) { int size, rdb, ch, sr; int aot, crc_abs; diff --git a/libavcodec/aacadtsdec.h b/libavcodec/aacadtsdec.h index 2fa1b4b2fc..60fdd221a2 100644 --- a/libavcodec/aacadtsdec.h +++ b/libavcodec/aacadtsdec.h @@ -49,6 +49,6 @@ typedef struct { * -2 if the version element is invalid, -3 if the sample rate * element is invalid, or -4 if the bit rate element is invalid. */ -int ff_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr); +int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr); #endif /* AVCODEC_AACADTSDEC_H */ diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 8e7e74e10d..d03363d782 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -2075,7 +2075,7 @@ static int parse_adts_frame_header(AACContext *ac, GetBitContext *gb) int size; AACADTSHeaderInfo hdr_info; - size = ff_aac_parse_header(gb, &hdr_info); + size = avpriv_aac_parse_header(gb, &hdr_info); if (size > 0) { if (ac->output_configured != OC_LOCKED && hdr_info.chan_config) { enum ChannelPosition new_che_pos[4][MAX_ELEM_ID]; diff --git a/libavformat/spdifdec.c b/libavformat/spdifdec.c index 0cbbc54e0f..3daf23fb69 100644 --- a/libavformat/spdifdec.c +++ b/libavformat/spdifdec.c @@ -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; diff --git a/libavformat/spdifenc.c b/libavformat/spdifenc.c index 9e571518d8..d541aba848 100644 --- a/libavformat/spdifenc.c +++ b/libavformat/spdifenc.c @@ -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; -- cgit v1.2.3 From 82ab61f9015659419e0a2766ee031c367e3f2908 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:28:53 +0200 Subject: lavc: use avpriv_ prefix for some mpegaudio symbols used in lavf. Specifically, ff_mpa_freq_tab, ff_mpa_bitrate_tab, ff_mpa_decode_header, ff_mpegaudio_decode_header. --- libavcodec/mp3_header_decompress_bsf.c | 4 ++-- libavcodec/mpegaudio_parser.c | 2 +- libavcodec/mpegaudiodata.c | 4 ++-- libavcodec/mpegaudiodata.h | 4 ++-- libavcodec/mpegaudiodec.c | 6 +++--- libavcodec/mpegaudiodecheader.c | 10 +++++----- libavcodec/mpegaudiodecheader.h | 4 ++-- libavcodec/mpegaudioenc.c | 6 +++--- libavformat/isom.c | 2 +- libavformat/mp3dec.c | 4 ++-- libavformat/mp3enc.c | 8 ++++---- libavformat/nutenc.c | 4 ++-- 12 files changed, 29 insertions(+), 29 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/mp3_header_decompress_bsf.c b/libavcodec/mp3_header_decompress_bsf.c index 3f3074286a..78025ccc41 100644 --- a/libavcodec/mp3_header_decompress_bsf.c +++ b/libavcodec/mp3_header_decompress_bsf.c @@ -50,10 +50,10 @@ static int mp3_header_decompress(AVBitStreamFilterContext *bsfc, AVCodecContext lsf = sample_rate < (24000+32000)/2; mpeg25 = sample_rate < (12000+16000)/2; sample_rate_index= (header>>10)&3; - sample_rate= ff_mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25); //in case sample rate is a little off + sample_rate= avpriv_mpa_freq_tab[sample_rate_index] >> (lsf + mpeg25); //in case sample rate is a little off for(bitrate_index=2; bitrate_index<30; bitrate_index++){ - frame_size = ff_mpa_bitrate_tab[lsf][2][bitrate_index>>1]; + frame_size = avpriv_mpa_bitrate_tab[lsf][2][bitrate_index>>1]; frame_size = (frame_size * 144000) / (sample_rate << lsf) + (bitrate_index&1); if(frame_size == buf_size + 4) break; diff --git a/libavcodec/mpegaudio_parser.c b/libavcodec/mpegaudio_parser.c index f07d34bd29..17d329dc1c 100644 --- a/libavcodec/mpegaudio_parser.c +++ b/libavcodec/mpegaudio_parser.c @@ -64,7 +64,7 @@ static int mpegaudio_parse(AVCodecParserContext *s1, state= (state<<8) + buf[i++]; - ret = ff_mpa_decode_header(avctx, state, &sr, &channels, &frame_size, &bit_rate); + ret = avpriv_mpa_decode_header(avctx, state, &sr, &channels, &frame_size, &bit_rate); if (ret < 4) { s->header_count= -2; } else { diff --git a/libavcodec/mpegaudiodata.c b/libavcodec/mpegaudiodata.c index b850d22c9e..81a43656a9 100644 --- a/libavcodec/mpegaudiodata.c +++ b/libavcodec/mpegaudiodata.c @@ -27,7 +27,7 @@ #include "mpegaudiodata.h" -const uint16_t ff_mpa_bitrate_tab[2][3][15] = { +const uint16_t avpriv_mpa_bitrate_tab[2][3][15] = { { {0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 }, {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 }, {0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 } }, @@ -37,7 +37,7 @@ const uint16_t ff_mpa_bitrate_tab[2][3][15] = { } }; -const uint16_t ff_mpa_freq_tab[3] = { 44100, 48000, 32000 }; +const uint16_t avpriv_mpa_freq_tab[3] = { 44100, 48000, 32000 }; /*******************************************************/ /* half mpeg encoding window (full precision) */ diff --git a/libavcodec/mpegaudiodata.h b/libavcodec/mpegaudiodata.h index 84458836fa..24ea536a6c 100644 --- a/libavcodec/mpegaudiodata.h +++ b/libavcodec/mpegaudiodata.h @@ -32,8 +32,8 @@ #define MODE_EXT_MS_STEREO 2 #define MODE_EXT_I_STEREO 1 -extern const uint16_t ff_mpa_bitrate_tab[2][3][15]; -extern const uint16_t ff_mpa_freq_tab[3]; +extern const uint16_t avpriv_mpa_bitrate_tab[2][3][15]; +extern const uint16_t avpriv_mpa_freq_tab[3]; extern const int32_t ff_mpa_enwindow[257]; extern const int ff_mpa_sblimit_table[5]; extern const int ff_mpa_quant_steps[17]; diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index 6f841e87b1..1b36937e69 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -1790,7 +1790,7 @@ static int decode_frame(AVCodecContext * avctx, return -1; } - if (ff_mpegaudio_decode_header((MPADecodeHeader *)s, header) == 1) { + if (avpriv_mpegaudio_decode_header((MPADecodeHeader *)s, header) == 1) { /* free format: prepare to compute frame size */ s->frame_size = -1; return -1; @@ -1863,7 +1863,7 @@ static int decode_frame_adu(AVCodecContext * avctx, return buf_size; } - ff_mpegaudio_decode_header((MPADecodeHeader *)s, header); + avpriv_mpegaudio_decode_header((MPADecodeHeader *)s, header); /* update codec info */ avctx->sample_rate = s->sample_rate; avctx->channels = s->nb_channels; @@ -2016,7 +2016,7 @@ static int decode_frame_mp3on4(AVCodecContext * avctx, if (ff_mpa_check_header(header) < 0) // Bad header, discard block break; - ff_mpegaudio_decode_header((MPADecodeHeader *)m, header); + avpriv_mpegaudio_decode_header((MPADecodeHeader *)m, header); out_size += mp_decode_frame(m, outptr, buf, fsize); buf += fsize; len -= fsize; diff --git a/libavcodec/mpegaudiodecheader.c b/libavcodec/mpegaudiodecheader.c index be7abc619d..dbd67ff0e3 100644 --- a/libavcodec/mpegaudiodecheader.c +++ b/libavcodec/mpegaudiodecheader.c @@ -31,7 +31,7 @@ #include "mpegaudiodecheader.h" -int ff_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header) +int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header) { int sample_rate, frame_size, mpeg25, padding; int sample_rate_index, bitrate_index; @@ -46,7 +46,7 @@ int ff_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header) s->layer = 4 - ((header >> 17) & 3); /* extract frequency */ sample_rate_index = (header >> 10) & 3; - sample_rate = ff_mpa_freq_tab[sample_rate_index] >> (s->lsf + mpeg25); + sample_rate = avpriv_mpa_freq_tab[sample_rate_index] >> (s->lsf + mpeg25); sample_rate_index += 3 * (s->lsf + mpeg25); s->sample_rate_index = sample_rate_index; s->error_protection = ((header >> 16) & 1) ^ 1; @@ -67,7 +67,7 @@ int ff_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header) s->nb_channels = 2; if (bitrate_index != 0) { - frame_size = ff_mpa_bitrate_tab[s->lsf][s->layer - 1][bitrate_index]; + frame_size = avpriv_mpa_bitrate_tab[s->lsf][s->layer - 1][bitrate_index]; s->bit_rate = frame_size * 1000; switch(s->layer) { case 1: @@ -109,14 +109,14 @@ int ff_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header) return 0; } -int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate) +int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bit_rate) { MPADecodeHeader s1, *s = &s1; if (ff_mpa_check_header(head) != 0) return -1; - if (ff_mpegaudio_decode_header(s, head) != 0) { + if (avpriv_mpegaudio_decode_header(s, head) != 0) { return -1; } diff --git a/libavcodec/mpegaudiodecheader.h b/libavcodec/mpegaudiodecheader.h index 2991595b02..764e8abde4 100644 --- a/libavcodec/mpegaudiodecheader.h +++ b/libavcodec/mpegaudiodecheader.h @@ -50,11 +50,11 @@ typedef struct MPADecodeHeader { /* header decoding. MUST check the header before because no consistency check is done there. Return 1 if free format found and that the frame size must be computed externally */ -int ff_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header); +int avpriv_mpegaudio_decode_header(MPADecodeHeader *s, uint32_t header); /* useful helper to get mpeg audio stream infos. Return -1 if error in header, otherwise the coded frame size in bytes */ -int ff_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate); +int avpriv_mpa_decode_header(AVCodecContext *avctx, uint32_t head, int *sample_rate, int *channels, int *frame_size, int *bitrate); /* fast header check for resync */ static inline int ff_mpa_check_header(uint32_t header){ diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c index 1cadef7175..71ea39373e 100644 --- a/libavcodec/mpegaudioenc.c +++ b/libavcodec/mpegaudioenc.c @@ -84,9 +84,9 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) /* encoding freq */ s->lsf = 0; for(i=0;i<3;i++) { - if (ff_mpa_freq_tab[i] == freq) + if (avpriv_mpa_freq_tab[i] == freq) break; - if ((ff_mpa_freq_tab[i] / 2) == freq) { + if ((avpriv_mpa_freq_tab[i] / 2) == freq) { s->lsf = 1; break; } @@ -99,7 +99,7 @@ static av_cold int MPA_encode_init(AVCodecContext *avctx) /* encoding bitrate & frequency */ for(i=0;i<15;i++) { - if (ff_mpa_bitrate_tab[s->lsf][1][i] == bitrate) + if (avpriv_mpa_bitrate_tab[s->lsf][1][i] == bitrate) break; } if (i == 15){ diff --git a/libavformat/isom.c b/libavformat/isom.c index d7c0af101e..e5fd859472 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -437,7 +437,7 @@ int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext 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 diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c index 09494de136..9011f9f996 100644 --- a/libavformat/mp3dec.c +++ b/libavformat/mp3dec.c @@ -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; diff --git a/libavformat/mp3enc.c b/libavformat/mp3enc.c index 07c28e176d..64f8957a4c 100644 --- a/libavformat/mp3enc.c +++ b/libavformat/mp3enc.c @@ -217,12 +217,12 @@ static void mp3_write_xing(AVFormatContext *s) MPADecodeHeader mpah; int srate_idx, i, channels; - 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; } @@ -240,7 +240,7 @@ static void mp3_write_xing(AVFormatContext *s) header |= channels << 6; avio_wb32(s->pb, header); - ff_mpegaudio_decode_header(&mpah, header); + avpriv_mpegaudio_decode_header(&mpah, header); ffio_fill(s->pb, 0, xing_offset); ffio_wfourcc(s->pb, "Xing"); diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index f8a078cb8a..bde6ba26a8 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -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) -- cgit v1.2.3 From 59a9a235811dc5f6a2c8b631a320968a06a867d1 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:28:53 +0200 Subject: lavc: use avpriv_ prefix for some mpeg4audio symbols used in lavf. Specifically, ff_mpeg4audio_sample_rates, ff_mpeg4audio_get_config and ff_copy_pce_data --- libavcodec/aac_adtstoasc_bsf.c | 2 +- libavcodec/aacadtsdec.c | 4 ++-- libavcodec/aacdec.c | 2 +- libavcodec/aacenc.c | 2 +- libavcodec/alsdec.c | 2 +- libavcodec/libvo-aacenc.c | 2 +- libavcodec/mpeg4audio.c | 8 ++++---- libavcodec/mpeg4audio.h | 6 +++--- libavcodec/mpegaudiodec.c | 2 +- libavformat/adtsenc.c | 4 ++-- libavformat/flvdec.c | 2 +- libavformat/isom.c | 2 +- libavformat/latmenc.c | 4 ++-- libavformat/matroskadec.c | 4 ++-- libavformat/matroskaenc.c | 2 +- libavformat/sdp.c | 2 +- 16 files changed, 25 insertions(+), 25 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/aac_adtstoasc_bsf.c b/libavcodec/aac_adtstoasc_bsf.c index be12e99587..55181bbf55 100644 --- a/libavcodec/aac_adtstoasc_bsf.c +++ b/libavcodec/aac_adtstoasc_bsf.c @@ -78,7 +78,7 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc, return -1; } init_put_bits(&pb, pce_data, MAX_PCE_SIZE); - pce_size = ff_copy_pce_data(&pb, &gb)/8; + pce_size = avpriv_copy_pce_data(&pb, &gb)/8; flush_put_bits(&pb); buf_size -= get_bits_count(&gb)/8; buf += get_bits_count(&gb)/8; diff --git a/libavcodec/aacadtsdec.c b/libavcodec/aacadtsdec.c index 09bf1392c4..30f92e0b10 100644 --- a/libavcodec/aacadtsdec.c +++ b/libavcodec/aacadtsdec.c @@ -39,7 +39,7 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr) crc_abs = get_bits1(gbc); /* protection_absent */ aot = get_bits(gbc, 2); /* profile_objecttype */ sr = get_bits(gbc, 4); /* sample_frequency_index */ - if(!ff_mpeg4audio_sample_rates[sr]) + if(!avpriv_mpeg4audio_sample_rates[sr]) return AAC_AC3_PARSE_ERROR_SAMPLE_RATE; skip_bits1(gbc); /* private_bit */ ch = get_bits(gbc, 3); /* channel_configuration */ @@ -62,7 +62,7 @@ int avpriv_aac_parse_header(GetBitContext *gbc, AACADTSHeaderInfo *hdr) hdr->crc_absent = crc_abs; hdr->num_aac_frames = rdb + 1; hdr->sampling_index = sr; - hdr->sample_rate = ff_mpeg4audio_sample_rates[sr]; + hdr->sample_rate = avpriv_mpeg4audio_sample_rates[sr]; hdr->samples = (rdb + 1) * 1024; hdr->bit_rate = size * 8 * hdr->sample_rate / hdr->samples; diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index d03363d782..a3a6b429d5 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -470,7 +470,7 @@ static int decode_audio_specific_config(AACContext *ac, init_get_bits(&gb, data, data_size * 8); - if ((i = ff_mpeg4audio_get_config(m4ac, data, data_size)) < 0) + if ((i = avpriv_mpeg4audio_get_config(m4ac, data, data_size)) < 0) return -1; if (m4ac->sampling_index > 12) { av_log(avctx, AV_LOG_ERROR, "invalid sampling rate index %d\n", m4ac->sampling_index); diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index d5021a4f51..31d740f57a 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -171,7 +171,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) avctx->frame_size = 1024; for (i = 0; i < 16; i++) - if (avctx->sample_rate == ff_mpeg4audio_sample_rates[i]) + if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[i]) break; if (i == 16) { av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n", avctx->sample_rate); diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index 1ab72ad4dd..4301fab72f 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -289,7 +289,7 @@ static av_cold int read_specific_config(ALSDecContext *ctx) init_get_bits(&gb, avctx->extradata, avctx->extradata_size * 8); - config_offset = ff_mpeg4audio_get_config(&m4ac, avctx->extradata, + config_offset = avpriv_mpeg4audio_get_config(&m4ac, avctx->extradata, avctx->extradata_size); if (config_offset < 0) diff --git a/libavcodec/libvo-aacenc.c b/libavcodec/libvo-aacenc.c index 18aa8240d8..647971a892 100644 --- a/libavcodec/libvo-aacenc.c +++ b/libavcodec/libvo-aacenc.c @@ -63,7 +63,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) } for (index = 0; index < 16; index++) - if (avctx->sample_rate == ff_mpeg4audio_sample_rates[index]) + if (avctx->sample_rate == avpriv_mpeg4audio_sample_rates[index]) break; if (index == 16) { av_log(avctx, AV_LOG_ERROR, "Unsupported sample rate %d\n", diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c index f0399af8fe..aa5ae4d463 100644 --- a/libavcodec/mpeg4audio.c +++ b/libavcodec/mpeg4audio.c @@ -52,7 +52,7 @@ static int parse_config_ALS(GetBitContext *gb, MPEG4AudioConfig *c) return 0; } -const int ff_mpeg4audio_sample_rates[16] = { +const int avpriv_mpeg4audio_sample_rates[16] = { 96000, 88200, 64000, 48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000, 7350 }; @@ -73,10 +73,10 @@ static inline int get_sample_rate(GetBitContext *gb, int *index) { *index = get_bits(gb, 4); return *index == 0x0f ? get_bits(gb, 24) : - ff_mpeg4audio_sample_rates[*index]; + avpriv_mpeg4audio_sample_rates[*index]; } -int ff_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_size) +int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_size) { GetBitContext gb; int specific_config_bitindex; @@ -151,7 +151,7 @@ static av_always_inline unsigned int copy_bits(PutBitContext *pb, return el; } -int ff_copy_pce_data(PutBitContext *pb, GetBitContext *gb) +int avpriv_copy_pce_data(PutBitContext *pb, GetBitContext *gb) { int five_bit_ch, four_bit_ch, comment_size, bits; int offset = put_bits_count(pb); diff --git a/libavcodec/mpeg4audio.h b/libavcodec/mpeg4audio.h index c729c04660..d6730b97b3 100644 --- a/libavcodec/mpeg4audio.h +++ b/libavcodec/mpeg4audio.h @@ -40,7 +40,7 @@ typedef struct { int ps; ///< -1 implicit, 1 presence } MPEG4AudioConfig; -extern const int ff_mpeg4audio_sample_rates[16]; +extern const int avpriv_mpeg4audio_sample_rates[16]; extern const uint8_t ff_mpeg4audio_channels[8]; /** * Parse MPEG-4 systems extradata to retrieve audio configuration. @@ -49,7 +49,7 @@ extern const uint8_t ff_mpeg4audio_channels[8]; * @param[in] buf_size Extradata size. * @return On error -1 is returned, on success AudioSpecificConfig bit index in extradata. */ -int ff_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_size); +int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf, int buf_size); enum AudioObjectType { AOT_NULL, @@ -101,6 +101,6 @@ enum AudioObjectType { #define MAX_PCE_SIZE 304 ///extradata, avctx->extradata_size); + avpriv_mpeg4audio_get_config(&cfg, avctx->extradata, avctx->extradata_size); if (!cfg.chan_config || cfg.chan_config > 7) { av_log(avctx, AV_LOG_ERROR, "Invalid channel config number.\n"); return -1; diff --git a/libavformat/adtsenc.c b/libavformat/adtsenc.c index 7f61e948fb..ce002fe4db 100644 --- a/libavformat/adtsenc.c +++ b/libavformat/adtsenc.c @@ -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); } diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 5e354b11be..395c8f8a57 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -531,7 +531,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) diff --git a/libavformat/isom.c b/libavformat/isom.c index e5fd859472..c5b01f22e3 100644 --- a/libavformat/isom.c +++ b/libavformat/isom.c @@ -433,7 +433,7 @@ 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 diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c index 7c6d1eaf72..2e72c489bc 100644 --- a/libavformat/latmenc.c +++ b/libavformat/latmenc.c @@ -54,7 +54,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); @@ -111,7 +111,7 @@ static int latm_write_frame_header(AVFormatContext *s, PutBitContext *bs) ff_copy_bits(bs, avctx->extradata, ctx->off + 3); if (!ctx->channel_conf) { - ff_copy_pce_data(bs, &gb); + avpriv_copy_pce_data(bs, &gb); } } diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index b3466db003..8ee3698ac4 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1263,8 +1263,8 @@ static int matroska_aac_sri(int samplerate) { int sri; - for (sri=0; sriextradata, 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; } diff --git a/libavformat/sdp.c b/libavformat/sdp.c index a586690d3f..5adf14dfd1 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -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"); -- cgit v1.2.3 From d9cca9fc6a4796c0a4235b25f5f7fd7191813f3a Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:28:53 +0200 Subject: 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 --- libavcodec/flac.h | 14 +++++++------- libavcodec/flacdec.c | 16 ++++++++-------- libavformat/flacdec.c | 4 ++-- libavformat/flacenc.c | 2 +- libavformat/flacenc_header.c | 2 +- libavformat/oggenc.c | 2 +- libavformat/oggparseflac.c | 2 +- 7 files changed, 21 insertions(+), 21 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/flac.h b/libavcodec/flac.h index 6ec8a3752d..b826fd43bd 100644 --- a/libavcodec/flac.h +++ b/libavcodec/flac.h @@ -95,8 +95,8 @@ typedef struct FLACFrameInfo { * @param[out] s where parsed information is stored * @param[in] buffer pointer to start of 34-byte streaminfo data */ -void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, - const uint8_t *buffer); +void avpriv_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *s, + const uint8_t *buffer); /** * Validate the FLAC extradata. @@ -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. * @return 1 if valid, 0 if not valid. */ -int ff_flac_is_extradata_valid(AVCodecContext *avctx, - enum FLACExtradataFormat *format, - uint8_t **streaminfo_start); +int avpriv_flac_is_extradata_valid(AVCodecContext *avctx, + enum FLACExtradataFormat *format, + uint8_t **streaminfo_start); /** * Parse the metadata block parameters from the header. @@ -116,8 +116,8 @@ int ff_flac_is_extradata_valid(AVCodecContext *avctx, * @param[out] type metadata block type * @param[out] size metadata block size */ -void ff_flac_parse_block_header(const uint8_t *block_header, - int *last, int *type, int *size); +void avpriv_flac_parse_block_header(const uint8_t *block_header, + int *last, int *type, int *size); /** * Calculate an estimate for the maximum frame size based on verbatim mode. diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 3eb117acf6..633a1386ae 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -63,7 +63,7 @@ typedef struct FLACContext { 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, uint8_t **streaminfo_start) { @@ -104,11 +104,11 @@ static av_cold int flac_decode_init(AVCodecContext *avctx) if (!avctx->extradata) return 0; - if (!ff_flac_is_extradata_valid(avctx, &format, &streaminfo)) + if (!avpriv_flac_is_extradata_valid(avctx, &format, &streaminfo)) return -1; /* 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) avctx->sample_fmt = AV_SAMPLE_FMT_S32; else @@ -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) { GetBitContext gb; @@ -174,7 +174,7 @@ void ff_flac_parse_streaminfo(AVCodecContext *avctx, struct FLACStreaminfo *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 tmp = bytestream_get_byte(&block_header); @@ -201,12 +201,12 @@ static int parse_streaminfo(FLACContext *s, const uint8_t *buf, int buf_size) /* need more data */ 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 || metadata_size != FLAC_STREAMINFO_SIZE) { 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); s->got_streaminfo = 1; @@ -228,7 +228,7 @@ static int get_metadata_size(const uint8_t *buf, int buf_size) do { if (buf_end - buf < 4) 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; if (buf_end - buf < metadata_size) { /* need more data in order to read the complete header */ diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index e6098adf4a..41912854b7 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -48,7 +48,7 @@ static int flac_read_header(AVFormatContext *s, /* process metadata blocks */ while (!s->pb->eof_reached && !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) { diff --git a/libavformat/flacenc.c b/libavformat/flacenc.c index f14b30b0c5..00e89002fe 100644 --- a/libavformat/flacenc.c +++ b/libavformat/flacenc.c @@ -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) { diff --git a/libavformat/flacenc_header.c b/libavformat/flacenc_header.c index 90c5a776d3..ad8d55b380 100644 --- a/libavformat/flacenc_header.c +++ b/libavformat/flacenc_header.c @@ -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 */ diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 49dedb35d7..d554b07c5b 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -254,7 +254,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 diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c index 53cd0fa582..e5f517fbdb 100644 --- a/libavformat/oggparseflac.c +++ b/libavformat/oggparseflac.c @@ -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; -- cgit v1.2.3 From 242c73a0fd664be8fc1d69cc3e383c13524914b5 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:28:53 +0200 Subject: lavc: use avpriv_ prefix for some dv symbols used in lavf. Specifically, ff_dv_frame_profile and ff_dv_codec_profile. --- libavcodec/dv.c | 6 +++--- libavcodec/dvdata.c | 4 ++-- libavcodec/dvdata.h | 6 +++--- libavformat/dv.c | 6 +++--- libavformat/dvenc.c | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/dv.c b/libavcodec/dv.c index 976242235b..f16ed624e7 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -349,7 +349,7 @@ static av_cold int dvvideo_init(AVCodecContext *avctx) static av_cold int dvvideo_init_encoder(AVCodecContext *avctx) { - if (!ff_dv_codec_profile(avctx)) { + if (!avpriv_dv_codec_profile(avctx)) { av_log(avctx, AV_LOG_ERROR, "Found no DV profile for %ix%i %s video\n", avctx->width, avctx->height, av_get_pix_fmt_name(avctx->pix_fmt)); return -1; @@ -1072,7 +1072,7 @@ static int dvvideo_decode_frame(AVCodecContext *avctx, const uint8_t* vsc_pack; int apt, is16_9; - s->sys = ff_dv_frame_profile(s->sys, buf, buf_size); + s->sys = avpriv_dv_frame_profile(s->sys, buf, buf_size); if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys)) { av_log(avctx, AV_LOG_ERROR, "could not find dv frame profile\n"); return -1; /* NOTE: we only accept several full frames */ @@ -1245,7 +1245,7 @@ static int dvvideo_encode_frame(AVCodecContext *c, uint8_t *buf, int buf_size, { DVVideoContext *s = c->priv_data; - s->sys = ff_dv_codec_profile(c); + s->sys = avpriv_dv_codec_profile(c); if (!s->sys || buf_size < s->sys->frame_size || dv_init_dynamic_tables(s->sys)) return -1; diff --git a/libavcodec/dvdata.c b/libavcodec/dvdata.c index a80d2da803..3a135a9ac7 100644 --- a/libavcodec/dvdata.c +++ b/libavcodec/dvdata.c @@ -245,7 +245,7 @@ static const DVprofile dv_profiles[] = { } }; -const DVprofile* ff_dv_frame_profile(const DVprofile *sys, +const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys, const uint8_t* frame, unsigned buf_size) { int i; @@ -270,7 +270,7 @@ const DVprofile* ff_dv_frame_profile(const DVprofile *sys, return NULL; } -const DVprofile* ff_dv_codec_profile(AVCodecContext* codec) +const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec) { int i; diff --git a/libavcodec/dvdata.h b/libavcodec/dvdata.h index 817b50639f..b2fb127ae6 100644 --- a/libavcodec/dvdata.h +++ b/libavcodec/dvdata.h @@ -274,9 +274,9 @@ enum dv_pack_type { */ #define DV_MAX_BPM 8 -const DVprofile* ff_dv_frame_profile(const DVprofile *sys, - const uint8_t* frame, unsigned buf_size); -const DVprofile* ff_dv_codec_profile(AVCodecContext* codec); +const DVprofile* avpriv_dv_frame_profile(const DVprofile *sys, + const uint8_t* frame, unsigned buf_size); +const DVprofile* avpriv_dv_codec_profile(AVCodecContext* codec); static inline int dv_write_dif_id(enum dv_section_type t, uint8_t chan_num, uint8_t seq_num, uint8_t dif_num, diff --git a/libavformat/dv.c b/libavformat/dv.c index 5b6fb6210b..2813bc3b67 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -323,7 +323,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, 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 */ } @@ -369,7 +369,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; @@ -432,7 +432,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; diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index 5c55338e2c..bffad44b9f 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -325,7 +325,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; -- cgit v1.2.3 From 2361e59b98f1c78d9720e72aabfb847dd9906f12 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:45:27 +0200 Subject: lavc: use avpriv_ prefix for ff_dirac_parse_sequence_header. It's used in lavf. --- libavcodec/dirac.c | 2 +- libavcodec/dirac.h | 4 ++-- libavformat/oggparsedirac.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index 09da1cbd56..543a342525 100644 --- a/libavcodec/dirac.c +++ b/libavcodec/dirac.c @@ -242,7 +242,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, return 0; } -int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, +int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, dirac_source_params *source) { unsigned version_major; diff --git a/libavcodec/dirac.h b/libavcodec/dirac.h index 0be66c2d91..f8063d9e28 100644 --- a/libavcodec/dirac.h +++ b/libavcodec/dirac.h @@ -51,7 +51,7 @@ typedef struct { uint8_t color_spec_index; ///< index into dirac_color_spec_presets[] } dirac_source_params; -int ff_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, - dirac_source_params *source); +int avpriv_dirac_parse_sequence_header(AVCodecContext *avctx, GetBitContext *gb, + dirac_source_params *source); #endif /* AVCODEC_DIRAC_H */ diff --git a/libavformat/oggparsedirac.c b/libavformat/oggparsedirac.c index f6afafd0e4..9991d5692c 100644 --- a/libavformat/oggparsedirac.c +++ b/libavformat/oggparsedirac.c @@ -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; -- cgit v1.2.3 From 357db4c263bb7edfd9790414f0f378e752f924e9 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:45:27 +0200 Subject: lavc: use avpriv_ prefix for ff_split_xiph_headers. It's used in lavf. --- libavcodec/vorbisdec.c | 2 +- libavcodec/vp3.c | 2 +- libavcodec/xiph.c | 2 +- libavcodec/xiph.h | 6 +++--- libavformat/matroskaenc.c | 2 +- libavformat/oggenc.c | 2 +- libavformat/sdp.c | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/vorbisdec.c b/libavcodec/vorbisdec.c index 7c07de646a..2662a6cf15 100644 --- a/libavcodec/vorbisdec.c +++ b/libavcodec/vorbisdec.c @@ -987,7 +987,7 @@ static av_cold int vorbis_decode_init(AVCodecContext *avccontext) return -1; } - if (ff_split_xiph_headers(headers, headers_len, 30, header_start, header_len) < 0) { + if (avpriv_split_xiph_headers(headers, headers_len, 30, header_start, header_len) < 0) { av_log(avccontext, AV_LOG_ERROR, "Extradata corrupt.\n"); return -1; } diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 9262c27f05..36715bb0c7 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2275,7 +2275,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) return -1; } - if (ff_split_xiph_headers(avctx->extradata, avctx->extradata_size, + if (avpriv_split_xiph_headers(avctx->extradata, avctx->extradata_size, 42, header_start, header_len) < 0) { av_log(avctx, AV_LOG_ERROR, "Corrupt extradata\n"); return -1; diff --git a/libavcodec/xiph.c b/libavcodec/xiph.c index 0bcfd45eea..7c3c7100c6 100644 --- a/libavcodec/xiph.c +++ b/libavcodec/xiph.c @@ -21,7 +21,7 @@ #include "libavutil/intreadwrite.h" #include "xiph.h" -int ff_split_xiph_headers(uint8_t *extradata, int extradata_size, +int avpriv_split_xiph_headers(uint8_t *extradata, int extradata_size, int first_header_size, uint8_t *header_start[3], int header_len[3]) { diff --git a/libavcodec/xiph.h b/libavcodec/xiph.h index da18c9c094..afaece7cee 100644 --- a/libavcodec/xiph.h +++ b/libavcodec/xiph.h @@ -36,8 +36,8 @@ * @param[out] header_len The sizes of each of the three headers. * @return On error a negative value is returned, on success zero. */ -int ff_split_xiph_headers(uint8_t *extradata, int extradata_size, - int first_header_size, uint8_t *header_start[3], - int header_len[3]); +int avpriv_split_xiph_headers(uint8_t *extradata, int extradata_size, + int first_header_size, uint8_t *header_start[3], + int header_len[3]); #endif /* AVCODEC_XIPH_H */ diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index a35a2fa09a..1adb479dd8 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -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; diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index d554b07c5b..7549b3a0a3 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -377,7 +377,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"); diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 5adf14dfd1..ba3d4dd611 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -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"); -- cgit v1.2.3 From 773375c3d04bc3436563d7128311f06767432e22 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:51:55 +0200 Subject: lavc: rename ff_find_start_code to avpriv_mpv_find_start_code It's used in lavf. --- libavcodec/cavsdec.c | 2 +- libavcodec/h264_parser.c | 2 +- libavcodec/mpeg12.c | 8 ++++---- libavcodec/mpegvideo.c | 2 +- libavcodec/mpegvideo.h | 2 +- libavcodec/mpegvideo_parser.c | 2 +- libavformat/mpegtsenc.c | 2 +- libavformat/rtpenc_mpv.c | 2 +- 8 files changed, 11 insertions(+), 11 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 88034068ff..ed3538c121 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -663,7 +663,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, buf_ptr = buf; buf_end = buf + buf_size; for(;;) { - buf_ptr = ff_find_start_code(buf_ptr,buf_end, &stc); + buf_ptr = avpriv_mpv_find_start_code(buf_ptr,buf_end, &stc); if((stc & 0xFFFFFE00) || buf_ptr == buf_end) return FFMAX(0, buf_ptr - buf - s->parse_context.last_index); input_size = (buf_end - buf_ptr)*8; diff --git a/libavcodec/h264_parser.c b/libavcodec/h264_parser.c index 56102691a8..52ff88b3a4 100644 --- a/libavcodec/h264_parser.c +++ b/libavcodec/h264_parser.c @@ -131,7 +131,7 @@ static inline int parse_nal_units(AVCodecParserContext *s, for(;;) { int src_length, dst_length, consumed; - buf = ff_find_start_code(buf, buf_end, &state); + buf = avpriv_mpv_find_start_code(buf, buf_end, &state); if(buf >= buf_end) break; --buf; diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 4e95e02a9b..16e27e873a 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1697,7 +1697,7 @@ static int mpeg_decode_slice(Mpeg1Context *s1, int mb_y, if (avctx->hwaccel) { const uint8_t *buf_end, *buf_start = *buf - 4; /* include start_code */ int start_code = -1; - buf_end = ff_find_start_code(buf_start + 2, *buf + buf_size, &start_code); + buf_end = avpriv_mpv_find_start_code(buf_start + 2, *buf + buf_size, &start_code); if (buf_end < *buf + buf_size) buf_end -= 4; s->mb_y = mb_y; @@ -1888,7 +1888,7 @@ static int slice_decode_thread(AVCodecContext *c, void *arg) return 0; start_code = -1; - buf = ff_find_start_code(buf, s->gb.buffer_end, &start_code); + buf = avpriv_mpv_find_start_code(buf, s->gb.buffer_end, &start_code); mb_y= (start_code - SLICE_MIN_START_CODE) << field_pic; if (s->picture_structure == PICT_BOTTOM_FIELD) mb_y++; @@ -2168,7 +2168,7 @@ int ff_mpeg1_find_frame_end(ParseContext *pc, const uint8_t *buf, int buf_size, } state++; } else { - i = ff_find_start_code(buf + i, buf + buf_size, &state) - buf - 1; + i = avpriv_mpv_find_start_code(buf + i, buf + buf_size, &state) - buf - 1; if (pc->frame_start_found == 0 && state >= SLICE_MIN_START_CODE && state <= SLICE_MAX_START_CODE) { i++; pc->frame_start_found = 4; @@ -2259,7 +2259,7 @@ static int decode_chunks(AVCodecContext *avctx, for (;;) { /* find next start code */ uint32_t start_code = -1; - buf_ptr = ff_find_start_code(buf_ptr, buf_end, &start_code); + buf_ptr = avpriv_mpv_find_start_code(buf_ptr, buf_end, &start_code); if (start_code > 0x1ff) { if (s2->pict_type != AV_PICTURE_TYPE_B || avctx->skip_frame <= AVDISCARD_DEFAULT) { if (HAVE_THREADS && (avctx->active_thread_type & FF_THREAD_SLICE)) { diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index cbc7d99818..7b0cac19e3 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -122,7 +122,7 @@ const enum PixelFormat ff_hwaccel_pixfmt_list_420[] = { PIX_FMT_NONE }; -const uint8_t *ff_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){ +const uint8_t *avpriv_mpv_find_start_code(const uint8_t * restrict p, const uint8_t *end, uint32_t * restrict state){ int i; assert(p<=end); diff --git a/libavcodec/mpegvideo.h b/libavcodec/mpegvideo.h index 7de72172b1..f1627c463b 100644 --- a/libavcodec/mpegvideo.h +++ b/libavcodec/mpegvideo.h @@ -719,7 +719,7 @@ void ff_update_duplicate_context(MpegEncContext *dst, MpegEncContext *src); int MPV_lowest_referenced_row(MpegEncContext *s, int dir); void MPV_report_decode_progress(MpegEncContext *s); int ff_mpeg_update_thread_context(AVCodecContext *dst, const AVCodecContext *src); -const uint8_t *ff_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state); +const uint8_t *avpriv_mpv_find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state); void ff_set_qscale(MpegEncContext * s, int qscale); void ff_er_frame_start(MpegEncContext *s); diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index 9688e18625..93001f7b14 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -40,7 +40,7 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, while (buf < buf_end) { start_code= -1; - buf= ff_find_start_code(buf, buf_end, &start_code); + buf= avpriv_mpv_find_start_code(buf, buf_end, &start_code); bytes_left = buf_end - buf; switch(start_code) { case PICTURE_START_CODE: diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index d600d18b62..9f45f13247 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -950,7 +950,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); diff --git a/libavformat/rtpenc_mpv.c b/libavformat/rtpenc_mpv.c index f6a5d7726a..1c67f9593b 100644 --- a/libavformat/rtpenc_mpv.c +++ b/libavformat/rtpenc_mpv.c @@ -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) { -- cgit v1.2.3 From 9138a130cd69e6828da5796a0555eac5a0af2357 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 09:59:31 +0200 Subject: lavc: use avpriv_ prefix for ff_frame_rate_tab. It's used in lavf. --- libavcodec/cavsdec.c | 4 ++-- libavcodec/dirac.c | 2 +- libavcodec/mpeg12.c | 8 ++++---- libavcodec/mpeg12data.c | 2 +- libavcodec/mpeg12data.h | 2 +- libavcodec/mpeg12enc.c | 8 ++++---- libavcodec/mpegvideo_parser.c | 4 ++-- libavformat/gxf.c | 4 ++-- 8 files changed, 17 insertions(+), 17 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index ed3538c121..514752afc9 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -624,8 +624,8 @@ static int decode_seq_header(AVSContext *h) { s->low_delay = get_bits1(&s->gb); h->mb_width = (s->width + 15) >> 4; h->mb_height = (s->height + 15) >> 4; - h->s.avctx->time_base.den = ff_frame_rate_tab[frame_rate_code].num; - h->s.avctx->time_base.num = ff_frame_rate_tab[frame_rate_code].den; + h->s.avctx->time_base.den = avpriv_frame_rate_tab[frame_rate_code].num; + h->s.avctx->time_base.num = avpriv_frame_rate_tab[frame_rate_code].den; h->s.avctx->width = s->width; h->s.avctx->height = s->height; if(!h->top_qp) diff --git a/libavcodec/dirac.c b/libavcodec/dirac.c index 543a342525..bf56088c75 100644 --- a/libavcodec/dirac.c +++ b/libavcodec/dirac.c @@ -145,7 +145,7 @@ static int parse_source_parameters(AVCodecContext *avctx, GetBitContext *gb, } if (source->frame_rate_index > 0) { if (source->frame_rate_index <= 8) - frame_rate = ff_frame_rate_tab[source->frame_rate_index]; + frame_rate = avpriv_frame_rate_tab[source->frame_rate_index]; else frame_rate = dirac_frame_rate[source->frame_rate_index-9]; } diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 16e27e873a..b7b8abd285 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -1253,8 +1253,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) assert((avctx->sub_id == 1) == (avctx->codec_id == CODEC_ID_MPEG1VIDEO)); if (avctx->codec_id == CODEC_ID_MPEG1VIDEO) { //MPEG-1 fps - avctx->time_base.den = ff_frame_rate_tab[s->frame_rate_index].num; - avctx->time_base.num = ff_frame_rate_tab[s->frame_rate_index].den; + avctx->time_base.den = avpriv_frame_rate_tab[s->frame_rate_index].num; + avctx->time_base.num = avpriv_frame_rate_tab[s->frame_rate_index].den; //MPEG-1 aspect avctx->sample_aspect_ratio = av_d2q(1.0/ff_mpeg1_aspect[s->aspect_ratio_info], 255); avctx->ticks_per_frame=1; @@ -1262,8 +1262,8 @@ static int mpeg_decode_postinit(AVCodecContext *avctx) //MPEG-2 fps av_reduce(&s->avctx->time_base.den, &s->avctx->time_base.num, - ff_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num*2, - ff_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den, + avpriv_frame_rate_tab[s->frame_rate_index].num * s1->frame_rate_ext.num*2, + avpriv_frame_rate_tab[s->frame_rate_index].den * s1->frame_rate_ext.den, 1 << 30); avctx->ticks_per_frame = 2; //MPEG-2 aspect diff --git a/libavcodec/mpeg12data.c b/libavcodec/mpeg12data.c index 299215f91e..5ac8c243a5 100644 --- a/libavcodec/mpeg12data.c +++ b/libavcodec/mpeg12data.c @@ -305,7 +305,7 @@ const uint8_t ff_mpeg12_mbMotionVectorTable[17][2] = { { 0xc, 10 }, }; -const AVRational ff_frame_rate_tab[] = { +const AVRational avpriv_frame_rate_tab[] = { { 0, 0}, {24000, 1001}, { 24, 1}, diff --git a/libavcodec/mpeg12data.h b/libavcodec/mpeg12data.h index 3586a614aa..86ba3ec15f 100644 --- a/libavcodec/mpeg12data.h +++ b/libavcodec/mpeg12data.h @@ -48,7 +48,7 @@ extern const uint8_t ff_mpeg12_mbPatTable[64][2]; extern const uint8_t ff_mpeg12_mbMotionVectorTable[17][2]; -extern const AVRational ff_frame_rate_tab[]; +extern const AVRational avpriv_frame_rate_tab[]; extern const float ff_mpeg1_aspect[16]; extern const AVRational ff_mpeg2_aspect[16]; diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 90a26177ee..738af99d68 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -120,7 +120,7 @@ static int find_frame_rate_index(MpegEncContext *s){ int64_t d; for(i=1;i<14;i++) { - int64_t n0= 1001LL/ff_frame_rate_tab[i].den*ff_frame_rate_tab[i].num*s->avctx->time_base.num; + int64_t n0= 1001LL/avpriv_frame_rate_tab[i].den*avpriv_frame_rate_tab[i].num*s->avctx->time_base.num; int64_t n1= 1001LL*s->avctx->time_base.den; if(s->avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL && i>=9) break; @@ -211,7 +211,7 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s) if(aspect_ratio==0.0) aspect_ratio= 1.0; //pixel aspect 1:1 (VGA) if (s->current_picture.f.key_frame) { - AVRational framerate= ff_frame_rate_tab[s->frame_rate_index]; + AVRational framerate= avpriv_frame_rate_tab[s->frame_rate_index]; /* mpeg1 header repeated every gop */ put_header(s, SEQ_START_CODE); @@ -972,7 +972,7 @@ AVCodec ff_mpeg1video_encoder = { .init = encode_init, .encode = MPV_encode_picture, .close = MPV_encode_end, - .supported_framerates= ff_frame_rate_tab+1, + .supported_framerates= avpriv_frame_rate_tab+1, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_NONE}, .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, .long_name= NULL_IF_CONFIG_SMALL("MPEG-1 video"), @@ -987,7 +987,7 @@ AVCodec ff_mpeg2video_encoder = { .init = encode_init, .encode = MPV_encode_picture, .close = MPV_encode_end, - .supported_framerates= ff_frame_rate_tab+1, + .supported_framerates= avpriv_frame_rate_tab+1, .pix_fmts= (const enum PixelFormat[]){PIX_FMT_YUV420P, PIX_FMT_YUV422P, PIX_FMT_NONE}, .capabilities= CODEC_CAP_DELAY | CODEC_CAP_SLICE_THREADS, .long_name= NULL_IF_CONFIG_SMALL("MPEG-2 video"), diff --git a/libavcodec/mpegvideo_parser.c b/libavcodec/mpegvideo_parser.c index 93001f7b14..b4066ba720 100644 --- a/libavcodec/mpegvideo_parser.c +++ b/libavcodec/mpegvideo_parser.c @@ -57,8 +57,8 @@ static void mpegvideo_extract_headers(AVCodecParserContext *s, did_set_size=1; } frame_rate_index = buf[3] & 0xf; - pc->frame_rate.den = avctx->time_base.den = ff_frame_rate_tab[frame_rate_index].num; - pc->frame_rate.num = avctx->time_base.num = ff_frame_rate_tab[frame_rate_index].den; + pc->frame_rate.den = avctx->time_base.den = avpriv_frame_rate_tab[frame_rate_index].num; + pc->frame_rate.num = avctx->time_base.num = avpriv_frame_rate_tab[frame_rate_index].den; avctx->bit_rate = ((buf[4]<<10) | (buf[5]<<2) | (buf[6]>>6))*400; avctx->codec_id = CODEC_ID_MPEG1VIDEO; avctx->sub_id = 1; diff --git a/libavformat/gxf.c b/libavformat/gxf.c index 283e3a6246..473f33a427 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -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 } /** -- cgit v1.2.3 From 6f89efeaa7eceb3408abb6e593d892ec819177a7 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 10:04:12 +0200 Subject: lavc: use avpriv_ prefix for ff_ac3_parse_header. It's used in lavf. --- libavcodec/ac3_parser.c | 4 ++-- libavcodec/ac3_parser.h | 2 +- libavcodec/ac3dec.c | 2 +- libavformat/ac3dec.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/ac3_parser.c b/libavcodec/ac3_parser.c index 82eeda3e61..a6bdd5490f 100644 --- a/libavcodec/ac3_parser.c +++ b/libavcodec/ac3_parser.c @@ -35,7 +35,7 @@ static const uint8_t eac3_blocks[4] = { }; -int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) +int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr) { int frame_size_code; @@ -141,7 +141,7 @@ static int ac3_sync(uint64_t state, AACAC3ParseContext *hdr_info, GetBitContext gbc; init_get_bits(&gbc, tmp.u8+8-AC3_HEADER_SIZE, 54); - err = ff_ac3_parse_header(&gbc, &hdr); + err = avpriv_ac3_parse_header(&gbc, &hdr); if(err < 0) return 0; diff --git a/libavcodec/ac3_parser.h b/libavcodec/ac3_parser.h index d62490bc77..9322550ea5 100644 --- a/libavcodec/ac3_parser.h +++ b/libavcodec/ac3_parser.h @@ -36,6 +36,6 @@ * -2 if the bsid (version) element is invalid, -3 if the fscod (sample rate) * element is invalid, or -4 if the frmsizecod (bit rate) element is invalid. */ -int ff_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr); +int avpriv_ac3_parse_header(GetBitContext *gbc, AC3HeaderInfo *hdr); #endif /* AVCODEC_AC3_PARSER_H */ diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 86a4fd5cc0..134e0b5d11 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -261,7 +261,7 @@ static int parse_frame_header(AC3DecodeContext *s) AC3HeaderInfo hdr; int err; - err = ff_ac3_parse_header(&s->gbc, &hdr); + err = avpriv_ac3_parse_header(&s->gbc, &hdr); if(err) return err; diff --git a/libavformat/ac3dec.c b/libavformat/ac3dec.c index 2cb068e57c..ca6aee3685 100644 --- a/libavformat/ac3dec.c +++ b/libavformat/ac3dec.c @@ -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)) -- cgit v1.2.3 From 9f51c682ee83ecf0995648d4574ac09b52bbcb24 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 10:10:42 +0200 Subject: lavc: use avpriv_ prefix for ff_copy_bits and align_put_bits. They are used in lavf. --- libavcodec/aacenc.c | 2 +- libavcodec/asv1.c | 2 +- libavcodec/bitstream.c | 4 ++-- libavcodec/cljr.c | 2 +- libavcodec/flvenc.c | 2 +- libavcodec/h261enc.c | 2 +- libavcodec/ituh263enc.c | 2 +- libavcodec/jpeglsenc.c | 2 +- libavcodec/mpeg12enc.c | 2 +- libavcodec/mpeg4audio.c | 2 +- libavcodec/mpeg4videoenc.c | 4 ++-- libavcodec/mpegvideo_enc.c | 10 +++++----- libavcodec/msmpeg4.c | 2 +- libavcodec/put_bits.h | 8 ++++---- libavcodec/rv10enc.c | 2 +- libavcodec/svq1enc.c | 4 ++-- libavcodec/vcr1.c | 2 +- libavcodec/wmaenc.c | 4 ++-- libavcodec/wmaprodec.c | 4 ++-- libavcodec/wmavoice.c | 4 ++-- libavcodec/xsubenc.c | 4 ++-- libavformat/latmenc.c | 6 +++--- 22 files changed, 38 insertions(+), 38 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 31d740f57a..b112fa8555 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -482,7 +482,7 @@ static void put_bitstream_info(AVCodecContext *avctx, AACEncContext *s, put_bits(&s->pb, 8, namelen - 16); put_bits(&s->pb, 4, 0); //extension type - filler padbits = 8 - (put_bits_count(&s->pb) & 7); - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); for (i = 0; i < namelen - 2; i++) put_bits(&s->pb, 8, name[i]); put_bits(&s->pb, 12 - padbits, 0); diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index 97c5e681fe..8db23c07ef 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -497,7 +497,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, } emms_c(); - align_put_bits(&a->pb); + avpriv_align_put_bits(&a->pb); while(put_bits_count(&a->pb)&31) put_bits(&a->pb, 8, 0); diff --git a/libavcodec/bitstream.c b/libavcodec/bitstream.c index 70717883c1..68ea3e0bda 100644 --- a/libavcodec/bitstream.c +++ b/libavcodec/bitstream.c @@ -41,7 +41,7 @@ const uint8_t ff_log2_run[41]={ 24, }; -void align_put_bits(PutBitContext *s) +void avpriv_align_put_bits(PutBitContext *s) { put_bits(s,s->bit_left & 7,0); } @@ -56,7 +56,7 @@ void ff_put_string(PutBitContext *pb, const char *string, int terminate_string) put_bits(pb, 8, 0); } -void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length) +void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length) { int words= length>>4; int bits= length&15; diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index b1cb6f07e3..2bfe03580b 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -105,7 +105,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, emms_c(); - align_put_bits(&a->pb); + avpriv_align_put_bits(&a->pb); while(get_bit_count(&a->pb)&31) put_bits(&a->pb, 8, 0); diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index ec637dc385..c0d9a04f62 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -25,7 +25,7 @@ void ff_flv_encode_picture_header(MpegEncContext * s, int picture_number) { int format; - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); put_bits(&s->pb, 17, 1); put_bits(&s->pb, 5, (s->h263_flv-1)); /* 0: h263 escape codes 1: 11-bit escape codes */ diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index 1c702de326..034237654b 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -53,7 +53,7 @@ void ff_h261_encode_picture_header(MpegEncContext * s, int picture_number){ H261Context * h = (H261Context *) s; int format, temp_ref; - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); /* Update the pointer to last GOB */ s->ptr_lastgob = put_bits_ptr(&s->pb); diff --git a/libavcodec/ituh263enc.c b/libavcodec/ituh263enc.c index 783a04f64d..b9888f0ba7 100644 --- a/libavcodec/ituh263enc.c +++ b/libavcodec/ituh263enc.c @@ -126,7 +126,7 @@ void h263_encode_picture_header(MpegEncContext * s, int picture_number) coded_frame_rate= 1800000; coded_frame_rate_base= (1000+best_clock_code)*best_divisor; - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); /* Update the pointer to last GOB */ s->ptr_lastgob = put_bits_ptr(&s->pb); diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c index d15269e91d..2b6e54ddd4 100644 --- a/libavcodec/jpeglsenc.c +++ b/libavcodec/jpeglsenc.c @@ -357,7 +357,7 @@ static int encode_picture_ls(AVCodecContext *avctx, unsigned char *buf, int buf_ put_bits(&pb, 8, v); } } - align_put_bits(&pb); + avpriv_align_put_bits(&pb); av_free(buf2); /* End of image */ diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 738af99d68..5dedabd268 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -192,7 +192,7 @@ static av_cold int encode_init(AVCodecContext *avctx) static void put_header(MpegEncContext *s, int header) { - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); put_bits(&s->pb, 16, header>>16); put_sbits(&s->pb, 16, header); } diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c index aa5ae4d463..f9e866f405 100644 --- a/libavcodec/mpeg4audio.c +++ b/libavcodec/mpeg4audio.c @@ -173,7 +173,7 @@ int avpriv_copy_pce_data(PutBitContext *pb, GetBitContext *gb) copy_bits(pb, gb, 16); if (bits) copy_bits(pb, gb, bits); - align_put_bits(pb); + avpriv_align_put_bits(pb); align_get_bits(gb); comment_size = copy_bits(pb, gb, 8); for (; comment_size > 0; comment_size--) diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index b45890f654..2f3e1d7061 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -1258,8 +1258,8 @@ void ff_mpeg4_merge_partitions(MpegEncContext *s) flush_put_bits(&s->tex_pb); set_put_bits_buffer_size(&s->pb, s->pb2.buf_end - s->pb.buf); - ff_copy_bits(&s->pb, s->pb2.buf , pb2_len); - ff_copy_bits(&s->pb, s->tex_pb.buf, tex_pb_len); + avpriv_copy_bits(&s->pb, s->pb2.buf , pb2_len); + avpriv_copy_bits(&s->pb, s->tex_pb.buf, tex_pb_len); s->last_bits= put_bits_count(&s->pb); } diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 6154384e31..ce7630ec7f 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -2044,7 +2044,7 @@ static void write_slice_end(MpegEncContext *s){ ff_mjpeg_encode_stuffing(&s->pb); } - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); flush_put_bits(&s->pb); if((s->flags&CODEC_FLAG_PASS1) && !s->partitioned_frame) @@ -2480,18 +2480,18 @@ static int encode_thread(AVCodecContext *c, void *arg){ pb_bits_count= put_bits_count(&s->pb); flush_put_bits(&s->pb); - ff_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count); + avpriv_copy_bits(&backup_s.pb, bit_buf[next_block^1], pb_bits_count); s->pb= backup_s.pb; if(s->data_partitioning){ pb2_bits_count= put_bits_count(&s->pb2); flush_put_bits(&s->pb2); - ff_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count); + avpriv_copy_bits(&backup_s.pb2, bit_buf2[next_block^1], pb2_bits_count); s->pb2= backup_s.pb2; tex_pb_bits_count= put_bits_count(&s->tex_pb); flush_put_bits(&s->tex_pb); - ff_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count); + avpriv_copy_bits(&backup_s.tex_pb, bit_buf_tex[next_block^1], tex_pb_bits_count); s->tex_pb= backup_s.tex_pb; } s->last_bits= put_bits_count(&s->pb); @@ -2714,7 +2714,7 @@ static void merge_context_after_encode(MpegEncContext *dst, MpegEncContext *src) assert(put_bits_count(&src->pb) % 8 ==0); assert(put_bits_count(&dst->pb) % 8 ==0); - ff_copy_bits(&dst->pb, src->pb.buf, put_bits_count(&src->pb)); + avpriv_copy_bits(&dst->pb, src->pb.buf, put_bits_count(&src->pb)); flush_put_bits(&dst->pb); } diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index eca2add828..cfdfd8ef28 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -351,7 +351,7 @@ void msmpeg4_encode_picture_header(MpegEncContext * s, int picture_number) { find_best_tables(s); - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); put_bits(&s->pb, 2, s->pict_type - 1); put_bits(&s->pb, 5, s->qscale); diff --git a/libavcodec/put_bits.h b/libavcodec/put_bits.h index f77cfbba97..6e812670b8 100644 --- a/libavcodec/put_bits.h +++ b/libavcodec/put_bits.h @@ -97,14 +97,14 @@ static inline void flush_put_bits(PutBitContext *s) } #ifdef BITSTREAM_WRITER_LE -#define align_put_bits align_put_bits_unsupported_here +#define avpriv_align_put_bits align_put_bits_unsupported_here #define ff_put_string ff_put_string_unsupported_here -#define ff_copy_bits ff_copy_bits_unsupported_here +#define avpriv_copy_bits avpriv_copy_bits_unsupported_here #else /** * Pad the bitstream with zeros up to the next byte boundary. */ -void align_put_bits(PutBitContext *s); +void avpriv_align_put_bits(PutBitContext *s); /** * Put the string string in the bitstream. @@ -118,7 +118,7 @@ void ff_put_string(PutBitContext *pb, const char *string, int terminate_string); * * @param length the number of bits of src to copy */ -void ff_copy_bits(PutBitContext *pb, const uint8_t *src, int length); +void avpriv_copy_bits(PutBitContext *pb, const uint8_t *src, int length); #endif /** diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c index 6fda11486d..e96e473c20 100644 --- a/libavcodec/rv10enc.c +++ b/libavcodec/rv10enc.c @@ -32,7 +32,7 @@ void rv10_encode_picture_header(MpegEncContext *s, int picture_number) { int full_frame= 0; - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); put_bits(&s->pb, 1, 1); /* marker */ diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 36787cfdce..79aaa6cb26 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -461,7 +461,7 @@ static int svq1_encode_plane(SVQ1Context *s, int plane, unsigned char *src_plane s->rd_total += score[best]; for(i=5; i>=0; i--){ - ff_copy_bits(&s->pb, reorder_buffer[best][i], count[best][i]); + avpriv_copy_bits(&s->pb, reorder_buffer[best][i], count[best][i]); } if(best==0){ s->dsp.put_pixels_tab[0][0](decoded, temp, stride, 16); @@ -540,7 +540,7 @@ static int svq1_encode_frame(AVCodecContext *avctx, unsigned char *buf, return -1; } -// align_put_bits(&s->pb); +// avpriv_align_put_bits(&s->pb); while(put_bits_count(&s->pb) & 31) put_bits(&s->pb, 1, 0); diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index f745089422..8c64afe570 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -132,7 +132,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, emms_c(); - align_put_bits(&a->pb); + avpriv_align_put_bits(&a->pb); while(get_bit_count(&a->pb)&31) put_bits(&a->pb, 8, 0); diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 2abc97a082..c762a723b9 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -311,7 +311,7 @@ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], put_bits(&s->pb, s->coef_vlcs[tindex]->huffbits[1], s->coef_vlcs[tindex]->huffcodes[1]); } if (s->version == 1 && s->nb_channels >= 2) { - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); } } return 0; @@ -327,7 +327,7 @@ static int encode_frame(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], return INT_MAX; } - align_put_bits(&s->pb); + avpriv_align_put_bits(&s->pb); return put_bits_count(&s->pb)/8 - s->block_align; } diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index 2811302435..b3ba9abe15 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -1446,14 +1446,14 @@ static void save_bits(WMAProDecodeCtx *s, GetBitContext* gb, int len, s->num_saved_bits += len; if (!append) { - ff_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), + avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), s->num_saved_bits); } else { int align = 8 - (get_bits_count(gb) & 7); align = FFMIN(align, len); put_bits(&s->pb, align, get_bits(gb, align)); len -= align; - ff_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len); + avpriv_copy_bits(&s->pb, gb->buffer + (get_bits_count(gb) >> 3), len); } skip_bits_long(gb, len); diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index 3b805ac04b..2096d69870 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -1872,7 +1872,7 @@ static int parse_packet_header(WMAVoiceContext *s) * @param size size of the source data, in bytes * @param gb bit I/O context specifying the current position in the source. * data. This function might use this to align the bit position to - * a whole-byte boundary before calling #ff_copy_bits() on aligned + * a whole-byte boundary before calling #avpriv_copy_bits() on aligned * source data * @param nbits the amount of bits to copy from source to target * @@ -1893,7 +1893,7 @@ static void copy_bits(PutBitContext *pb, rmn_bits &= 7; rmn_bytes >>= 3; if ((rmn_bits = FFMIN(rmn_bits, nbits)) > 0) put_bits(pb, rmn_bits, get_bits(gb, rmn_bits)); - ff_copy_bits(pb, data + size - rmn_bytes, + avpriv_copy_bits(pb, data + size - rmn_bytes, FFMIN(nbits - rmn_bits, rmn_bytes << 3)); } diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c index b33640dd2c..bd66f86501 100644 --- a/libavcodec/xsubenc.c +++ b/libavcodec/xsubenc.c @@ -90,7 +90,7 @@ static int xsub_encode_rle(PutBitContext *pb, const uint8_t *bitmap, if (color != PADDING_COLOR && (PADDING + (w&1))) put_xsub_rle(pb, PADDING + (w&1), PADDING_COLOR); - align_put_bits(pb); + avpriv_align_put_bits(pb); bitmap += linesize; } @@ -194,7 +194,7 @@ static int xsub_encode(AVCodecContext *avctx, unsigned char *buf, // Enforce total height to be be multiple of 2 if (h->rects[0]->h & 1) { put_xsub_rle(&pb, h->rects[0]->w, PADDING_COLOR); - align_put_bits(&pb); + avpriv_align_put_bits(&pb); } flush_put_bits(&pb); diff --git a/libavformat/latmenc.c b/libavformat/latmenc.c index 2e72c489bc..679f2cc9c6 100644 --- a/libavformat/latmenc.c +++ b/libavformat/latmenc.c @@ -106,9 +106,9 @@ 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) { avpriv_copy_pce_data(bs, &gb); @@ -161,7 +161,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; -- cgit v1.2.3 From 0842d58998f441768b5e4376aa0c1d7be0e07a8b Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Mon, 17 Oct 2011 10:12:51 +0200 Subject: lavc: use avpriv_ prefix for ff_toupper4. It's used in lavf. --- libavcodec/internal.h | 2 +- libavcodec/mpegvideo.c | 4 ++-- libavcodec/utils.c | 2 +- libavformat/utils.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'libavformat') diff --git a/libavcodec/internal.h b/libavcodec/internal.h index 9a444fcae7..e676148d75 100644 --- a/libavcodec/internal.h +++ b/libavcodec/internal.h @@ -53,6 +53,6 @@ AVHWAccel *ff_find_hwaccel(enum CodecID codec_id, enum PixelFormat pix_fmt); */ int ff_match_2uint16(const uint16_t (*tab)[2], int size, int a, int b); -unsigned int ff_toupper4(unsigned int x); +unsigned int avpriv_toupper4(unsigned int x); #endif /* AVCODEC_INTERNAL_H */ diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index 7b0cac19e3..c1cd1f7a1d 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -646,9 +646,9 @@ av_cold int MPV_common_init(MpegEncContext *s) yc_size = y_size + 2 * c_size; /* convert fourcc to upper case */ - s->codec_tag = ff_toupper4(s->avctx->codec_tag); + s->codec_tag = avpriv_toupper4(s->avctx->codec_tag); - s->stream_codec_tag = ff_toupper4(s->avctx->stream_codec_tag); + s->stream_codec_tag = avpriv_toupper4(s->avctx->stream_codec_tag); s->avctx->coded_frame= (AVFrame*)&s->current_picture; diff --git a/libavcodec/utils.c b/libavcodec/utils.c index ac4de7da4a..c1a5c19e04 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -1269,7 +1269,7 @@ int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op)) return 0; } -unsigned int ff_toupper4(unsigned int x) +unsigned int avpriv_toupper4(unsigned int x) { return toupper( x &0xFF) + (toupper((x>>8 )&0xFF)<<8 ) diff --git a/libavformat/utils.c b/libavformat/utils.c index 1c1a7482e5..d0a7fb90be 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2148,7 +2148,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; @@ -2807,7 +2807,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; -- cgit v1.2.3