Skip to content

Commit

Permalink
Replace all CODEC_ID_* with AV_CODEC_ID_*
Browse files Browse the repository at this point in the history
  • Loading branch information
elenril committed Aug 7, 2012
1 parent 104e10f commit 36ef536
Show file tree
Hide file tree
Showing 582 changed files with 3,512 additions and 3,512 deletions.
22 changes: 11 additions & 11 deletions avconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ static void do_subtitle_out(AVFormatContext *s,
/* Note: DVB subtitle need one packet to draw them and one other
packet to clear them */
/* XXX: signal it in the codec context ? */
if (enc->codec_id == CODEC_ID_DVB_SUBTITLE)
if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE)
nb = 2;
else
nb = 1;
Expand All @@ -1363,7 +1363,7 @@ static void do_subtitle_out(AVFormatContext *s,
pkt.data = subtitle_out;
pkt.size = subtitle_out_size;
pkt.pts = av_rescale_q(sub->pts, AV_TIME_BASE_Q, ost->st->time_base);
if (enc->codec_id == CODEC_ID_DVB_SUBTITLE) {
if (enc->codec_id == AV_CODEC_ID_DVB_SUBTITLE) {
/* XXX: the pts correction is handled here. Maybe handling
it in the codec would be better */
if (i == 0)
Expand Down Expand Up @@ -1416,7 +1416,7 @@ static void do_video_out(AVFormatContext *s,
return;

if (s->oformat->flags & AVFMT_RAWPICTURE &&
enc->codec->id == CODEC_ID_RAWVIDEO) {
enc->codec->id == AV_CODEC_ID_RAWVIDEO) {
/* raw pictures are written as AVPicture structure to
avoid any copies. We support temporarily the older
method. */
Expand Down Expand Up @@ -1736,7 +1736,7 @@ static void flush_encoders(void)

if (ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <= 1)
continue;
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE) && enc->codec->id == CODEC_ID_RAWVIDEO)
if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE) && enc->codec->id == AV_CODEC_ID_RAWVIDEO)
continue;

for (;;) {
Expand Down Expand Up @@ -1850,10 +1850,10 @@ static void do_streamcopy(InputStream *ist, OutputStream *ost, const AVPacket *p
opkt.flags = pkt->flags;

// FIXME remove the following 2 lines they shall be replaced by the bitstream filters
if ( ost->st->codec->codec_id != CODEC_ID_H264
&& ost->st->codec->codec_id != CODEC_ID_MPEG1VIDEO
&& ost->st->codec->codec_id != CODEC_ID_MPEG2VIDEO
&& ost->st->codec->codec_id != CODEC_ID_VC1
if ( ost->st->codec->codec_id != AV_CODEC_ID_H264
&& ost->st->codec->codec_id != AV_CODEC_ID_MPEG1VIDEO
&& ost->st->codec->codec_id != AV_CODEC_ID_MPEG2VIDEO
&& ost->st->codec->codec_id != AV_CODEC_ID_VC1
) {
if (av_parser_change(ist->st->parser, ost->st->codec, &opkt.data, &opkt.size, pkt->data, pkt->size, pkt->flags & AV_PKT_FLAG_KEY))
opkt.destruct = av_destruct_packet;
Expand Down Expand Up @@ -4230,7 +4230,7 @@ static void opt_output_file(void *optctx, const char *filename)
}

/* video: highest resolution */
if (!o->video_disable && oc->oformat->video_codec != CODEC_ID_NONE) {
if (!o->video_disable && oc->oformat->video_codec != AV_CODEC_ID_NONE) {
int area = 0, idx = -1;
for (i = 0; i < nb_input_streams; i++) {
ist = input_streams[i];
Expand All @@ -4244,7 +4244,7 @@ static void opt_output_file(void *optctx, const char *filename)
}

/* audio: most channels */
if (!o->audio_disable && oc->oformat->audio_codec != CODEC_ID_NONE) {
if (!o->audio_disable && oc->oformat->audio_codec != AV_CODEC_ID_NONE) {
int channels = 0, idx = -1;
for (i = 0; i < nb_input_streams; i++) {
ist = input_streams[i];
Expand All @@ -4258,7 +4258,7 @@ static void opt_output_file(void *optctx, const char *filename)
}

/* subtitles: pick first */
if (!o->subtitle_disable && oc->oformat->subtitle_codec != CODEC_ID_NONE) {
if (!o->subtitle_disable && oc->oformat->subtitle_codec != AV_CODEC_ID_NONE) {
for (i = 0; i < nb_input_streams; i++)
if (input_streams[i]->st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) {
NEW_STREAM(subtitle, i);
Expand Down
2 changes: 1 addition & 1 deletion avprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ static int open_input_file(AVFormatContext **fmt_ctx_ptr, const char *filename)
AVStream *stream = fmt_ctx->streams[i];
AVCodec *codec;

if (stream->codec->codec_id == CODEC_ID_PROBE) {
if (stream->codec->codec_id == AV_CODEC_ID_PROBE) {
fprintf(stderr, "Failed to probe codec for input stream %d\n",
stream->index);
} else if (!(codec = avcodec_find_decoder(stream->codec->codec_id))) {
Expand Down
36 changes: 18 additions & 18 deletions avserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -3539,7 +3539,7 @@ static void extract_mpeg4_header(AVFormatContext *infile)
mpeg4_count = 0;
for(i=0;i<infile->nb_streams;i++) {
st = infile->streams[i];
if (st->codec->codec_id == CODEC_ID_MPEG4 &&
if (st->codec->codec_id == AV_CODEC_ID_MPEG4 &&
st->codec->extradata_size == 0) {
mpeg4_count++;
}
Expand All @@ -3552,7 +3552,7 @@ static void extract_mpeg4_header(AVFormatContext *infile)
if (av_read_packet(infile, &pkt) < 0)
break;
st = infile->streams[pkt.stream_index];
if (st->codec->codec_id == CODEC_ID_MPEG4 &&
if (st->codec->codec_id == AV_CODEC_ID_MPEG4 &&
st->codec->extradata_size == 0) {
av_freep(&st->codec->extradata);
/* fill extradata with the header */
Expand Down Expand Up @@ -3866,22 +3866,22 @@ static void add_codec(FFStream *stream, AVCodecContext *av)
memcpy(st->codec, av, sizeof(AVCodecContext));
}

static enum CodecID opt_audio_codec(const char *arg)
static enum AVCodecID opt_audio_codec(const char *arg)
{
AVCodec *p= avcodec_find_encoder_by_name(arg);

if (p == NULL || p->type != AVMEDIA_TYPE_AUDIO)
return CODEC_ID_NONE;
return AV_CODEC_ID_NONE;

return p->id;
}

static enum CodecID opt_video_codec(const char *arg)
static enum AVCodecID opt_video_codec(const char *arg)
{
AVCodec *p= avcodec_find_encoder_by_name(arg);

if (p == NULL || p->type != AVMEDIA_TYPE_VIDEO)
return CODEC_ID_NONE;
return AV_CODEC_ID_NONE;

return p->id;
}
Expand Down Expand Up @@ -3924,7 +3924,7 @@ static int avserver_opt_default(const char *opt, const char *arg,

static int avserver_opt_preset(const char *arg,
AVCodecContext *avctx, int type,
enum CodecID *audio_id, enum CodecID *video_id)
enum AVCodecID *audio_id, enum AVCodecID *video_id)
{
FILE *f=NULL;
char filename[1000], tmp[1000], tmp2[1000], line[1000];
Expand Down Expand Up @@ -4006,7 +4006,7 @@ static int parse_ffconfig(const char *filename)
FFStream **last_stream, *stream, *redirect;
FFStream **last_feed, *feed, *s;
AVCodecContext audio_enc, video_enc;
enum CodecID audio_id, video_id;
enum AVCodecID audio_id, video_id;

f = fopen(filename, "r");
if (!f) {
Expand All @@ -4023,8 +4023,8 @@ static int parse_ffconfig(const char *filename)
stream = NULL;
feed = NULL;
redirect = NULL;
audio_id = CODEC_ID_NONE;
video_id = CODEC_ID_NONE;
audio_id = AV_CODEC_ID_NONE;
video_id = AV_CODEC_ID_NONE;

#define ERROR(...) report_config_error(filename, line_num, &errors, __VA_ARGS__)
for(;;) {
Expand Down Expand Up @@ -4216,8 +4216,8 @@ static int parse_ffconfig(const char *filename)
stream->fmt = avserver_guess_format(NULL, stream->filename, NULL);
avcodec_get_context_defaults3(&video_enc, NULL);
avcodec_get_context_defaults3(&audio_enc, NULL);
audio_id = CODEC_ID_NONE;
video_id = CODEC_ID_NONE;
audio_id = AV_CODEC_ID_NONE;
video_id = AV_CODEC_ID_NONE;
if (stream->fmt) {
audio_id = stream->fmt->audio_codec;
video_id = stream->fmt->video_codec;
Expand Down Expand Up @@ -4299,13 +4299,13 @@ static int parse_ffconfig(const char *filename)
} else if (!av_strcasecmp(cmd, "AudioCodec")) {
get_arg(arg, sizeof(arg), &p);
audio_id = opt_audio_codec(arg);
if (audio_id == CODEC_ID_NONE) {
if (audio_id == AV_CODEC_ID_NONE) {
ERROR("Unknown AudioCodec: %s\n", arg);
}
} else if (!av_strcasecmp(cmd, "VideoCodec")) {
get_arg(arg, sizeof(arg), &p);
video_id = opt_video_codec(arg);
if (video_id == CODEC_ID_NONE) {
if (video_id == AV_CODEC_ID_NONE) {
ERROR("Unknown VideoCodec: %s\n", arg);
}
} else if (!av_strcasecmp(cmd, "MaxTime")) {
Expand Down Expand Up @@ -4496,9 +4496,9 @@ static int parse_ffconfig(const char *filename)
if (stream)
video_enc.dark_masking = atof(arg);
} else if (!av_strcasecmp(cmd, "NoVideo")) {
video_id = CODEC_ID_NONE;
video_id = AV_CODEC_ID_NONE;
} else if (!av_strcasecmp(cmd, "NoAudio")) {
audio_id = CODEC_ID_NONE;
audio_id = AV_CODEC_ID_NONE;
} else if (!av_strcasecmp(cmd, "ACL")) {
parse_acl_row(stream, feed, NULL, p, filename, line_num);
} else if (!av_strcasecmp(cmd, "DynamicACL")) {
Expand Down Expand Up @@ -4536,12 +4536,12 @@ static int parse_ffconfig(const char *filename)
ERROR("No corresponding <Stream> for </Stream>\n");
} else {
if (stream->feed && stream->fmt && strcmp(stream->fmt->name, "ffm") != 0) {
if (audio_id != CODEC_ID_NONE) {
if (audio_id != AV_CODEC_ID_NONE) {
audio_enc.codec_type = AVMEDIA_TYPE_AUDIO;
audio_enc.codec_id = audio_id;
add_codec(stream, &audio_enc);
}
if (video_id != CODEC_ID_NONE) {
if (video_id != AV_CODEC_ID_NONE) {
video_enc.codec_type = AVMEDIA_TYPE_VIDEO;
video_enc.codec_id = video_id;
add_codec(stream, &video_enc);
Expand Down
2 changes: 1 addition & 1 deletion cmdutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec)
return AVERROR(EINVAL);
}

AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id,
AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
AVFormatContext *s, AVStream *st, AVCodec *codec)
{
AVDictionary *ret = NULL;
Expand Down
2 changes: 1 addition & 1 deletion cmdutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ int check_stream_specifier(AVFormatContext *s, AVStream *st, const char *spec);
* If null, the default one is looked up according to the codec id.
* @return a pointer to the created dictionary
*/
AVDictionary *filter_codec_opts(AVDictionary *opts, enum CodecID codec_id,
AVDictionary *filter_codec_opts(AVDictionary *opts, enum AVCodecID codec_id,
AVFormatContext *s, AVStream *st, AVCodec *codec);

/**
Expand Down
2 changes: 1 addition & 1 deletion doc/developer.texi
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ send a reminder by email. Your patch should eventually be dealt with.
@item
Did you register it in @file{allcodecs.c} or @file{allformats.c}?
@item
Did you add the CodecID to @file{avcodec.h}?
Did you add the AVCodecID to @file{avcodec.h}?
@item
If it has a fourcc, did you add it to @file{libavformat/riff.c},
even if it is only a decoder?
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/4xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
AVCodec ff_fourxm_decoder = {
.name = "4xm",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_4XM,
.id = AV_CODEC_ID_4XM,
.priv_data_size = sizeof(FourXContext),
.init = decode_init,
.close = decode_end,
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/8bps.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static av_cold int decode_end(AVCodecContext *avctx)
AVCodec ff_eightbps_decoder = {
.name = "8bps",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_8BPS,
.id = AV_CODEC_ID_8BPS,
.priv_data_size = sizeof(EightBpsContext),
.init = decode_init,
.close = decode_end,
Expand Down
14 changes: 7 additions & 7 deletions libavcodec/8svx.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ static int eightsvx_decode_frame(AVCodecContext *avctx, void *data,
int buf_size;
uint8_t *out_data;
int ret;
int is_compr = (avctx->codec_id != CODEC_ID_PCM_S8_PLANAR);
int is_compr = (avctx->codec_id != AV_CODEC_ID_PCM_S8_PLANAR);

/* for the first packet, copy data to buffer */
if (avpkt->data) {
Expand Down Expand Up @@ -180,13 +180,13 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx)
}

switch(avctx->codec->id) {
case CODEC_ID_8SVX_FIB:
case AV_CODEC_ID_8SVX_FIB:
esc->table = fibonacci;
break;
case CODEC_ID_8SVX_EXP:
case AV_CODEC_ID_8SVX_EXP:
esc->table = exponential;
break;
case CODEC_ID_PCM_S8_PLANAR:
case AV_CODEC_ID_PCM_S8_PLANAR:
break;
default:
return -1;
Expand All @@ -212,7 +212,7 @@ static av_cold int eightsvx_decode_close(AVCodecContext *avctx)
AVCodec ff_eightsvx_fib_decoder = {
.name = "8svx_fib",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_8SVX_FIB,
.id = AV_CODEC_ID_8SVX_FIB,
.priv_data_size = sizeof (EightSvxContext),
.init = eightsvx_decode_init,
.close = eightsvx_decode_close,
Expand All @@ -224,7 +224,7 @@ AVCodec ff_eightsvx_fib_decoder = {
AVCodec ff_eightsvx_exp_decoder = {
.name = "8svx_exp",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_8SVX_EXP,
.id = AV_CODEC_ID_8SVX_EXP,
.priv_data_size = sizeof (EightSvxContext),
.init = eightsvx_decode_init,
.close = eightsvx_decode_close,
Expand All @@ -236,7 +236,7 @@ AVCodec ff_eightsvx_exp_decoder = {
AVCodec ff_pcm_s8_planar_decoder = {
.name = "pcm_s8_planar",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_PCM_S8_PLANAR,
.id = AV_CODEC_ID_PCM_S8_PLANAR,
.priv_data_size = sizeof(EightSvxContext),
.init = eightsvx_decode_init,
.close = eightsvx_decode_close,
Expand Down
6 changes: 3 additions & 3 deletions libavcodec/a64multienc.c
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ static av_cold int a64multi_init_encoder(AVCodecContext *avctx)
av_log(avctx, AV_LOG_INFO, "charset lifetime set to %d frame(s)\n", c->mc_lifetime);

c->mc_frame_counter = 0;
c->mc_use_5col = avctx->codec->id == CODEC_ID_A64_MULTI5;
c->mc_use_5col = avctx->codec->id == AV_CODEC_ID_A64_MULTI5;
c->mc_pal_size = 4 + c->mc_use_5col;

/* precalc luma values for later use */
Expand Down Expand Up @@ -373,7 +373,7 @@ static int a64multi_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
AVCodec ff_a64multi_encoder = {
.name = "a64multi",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_A64_MULTI,
.id = AV_CODEC_ID_A64_MULTI,
.priv_data_size = sizeof(A64Context),
.init = a64multi_init_encoder,
.encode2 = a64multi_encode_frame,
Expand All @@ -386,7 +386,7 @@ AVCodec ff_a64multi_encoder = {
AVCodec ff_a64multi5_encoder = {
.name = "a64multi5",
.type = AVMEDIA_TYPE_VIDEO,
.id = CODEC_ID_A64_MULTI5,
.id = AV_CODEC_ID_A64_MULTI5,
.priv_data_size = sizeof(A64Context),
.init = a64multi_init_encoder,
.encode2 = a64multi_encode_frame,
Expand Down
6 changes: 3 additions & 3 deletions libavcodec/aac_ac3_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ int ff_aac_ac3_parse(AVCodecParserContext *s1,
and total number of samples found in an AAC ADTS header are not
reliable. Bit rate is still accurate because the total frame duration in
seconds is still correct (as is the number of bits in the frame). */
if (avctx->codec_id != CODEC_ID_AAC) {
if (avctx->codec_id != AV_CODEC_ID_AAC) {
avctx->sample_rate = s->sample_rate;

/* allow downmixing to stereo (or mono for AC-3) */
if(avctx->request_channels > 0 &&
avctx->request_channels < s->channels &&
(avctx->request_channels <= 2 ||
(avctx->request_channels == 1 &&
(avctx->codec_id == CODEC_ID_AC3 ||
avctx->codec_id == CODEC_ID_EAC3)))) {
(avctx->codec_id == AV_CODEC_ID_AC3 ||
avctx->codec_id == AV_CODEC_ID_EAC3)))) {
avctx->channels = avctx->request_channels;
} else {
avctx->channels = s->channels;
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/aac_ac3_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ typedef struct AACAC3ParseContext {
uint64_t state;

int need_next_header;
enum CodecID codec_id;
enum AVCodecID codec_id;
} AACAC3ParseContext;

int ff_aac_ac3_parse(AVCodecParserContext *s1,
Expand Down
2 changes: 1 addition & 1 deletion libavcodec/aac_parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static av_cold int aac_parse_init(AVCodecParserContext *s1)


AVCodecParser ff_aac_parser = {
.codec_ids = { CODEC_ID_AAC },
.codec_ids = { AV_CODEC_ID_AAC },
.priv_data_size = sizeof(AACAC3ParseContext),
.parser_init = aac_parse_init,
.parser_parse = ff_aac_ac3_parse,
Expand Down
4 changes: 2 additions & 2 deletions libavcodec/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2841,7 +2841,7 @@ static av_cold int latm_decode_init(AVCodecContext *avctx)
AVCodec ff_aac_decoder = {
.name = "aac",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_AAC,
.id = AV_CODEC_ID_AAC,
.priv_data_size = sizeof(AACContext),
.init = aac_decode_init,
.close = aac_decode_close,
Expand All @@ -2862,7 +2862,7 @@ AVCodec ff_aac_decoder = {
AVCodec ff_aac_latm_decoder = {
.name = "aac_latm",
.type = AVMEDIA_TYPE_AUDIO,
.id = CODEC_ID_AAC_LATM,
.id = AV_CODEC_ID_AAC_LATM,
.priv_data_size = sizeof(struct LATMContext),
.init = latm_decode_init,
.close = aac_decode_close,
Expand Down
Loading

0 comments on commit 36ef536

Please sign in to comment.