From 72415b2adb2c25f95ceede49001bb97ed9247dbb Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Tue, 30 Mar 2010 23:30:55 +0000 Subject: [PATCH] Define AVMediaType enum, and use it instead of enum CodecType, which is deprecated and will be dropped at the next major bump. Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk --- cmdutils.c | 16 ++-- cmdutils.h | 2 +- ffmpeg.c | 150 ++++++++++++++++---------------- ffplay.c | 92 ++++++++++---------- ffprobe.c | 20 ++--- ffserver.c | 38 ++++---- libavcodec/4xm.c | 2 +- libavcodec/8bps.c | 2 +- libavcodec/8svx.c | 4 +- libavcodec/aac.c | 2 +- libavcodec/aacenc.c | 2 +- libavcodec/aasc.c | 2 +- libavcodec/ac3dec.c | 4 +- libavcodec/ac3enc.c | 2 +- libavcodec/adpcm.c | 4 +- libavcodec/adxdec.c | 2 +- libavcodec/adxenc.c | 2 +- libavcodec/alac.c | 2 +- libavcodec/alacenc.c | 2 +- libavcodec/alsdec.c | 2 +- libavcodec/amrnbdec.c | 2 +- libavcodec/anm.c | 2 +- libavcodec/apedec.c | 2 +- libavcodec/asv1.c | 8 +- libavcodec/atrac1.c | 2 +- libavcodec/atrac3.c | 2 +- libavcodec/aura.c | 2 +- libavcodec/avcodec.h | 42 +++++---- libavcodec/avs.c | 2 +- libavcodec/bethsoftvideo.c | 2 +- libavcodec/bfi.c | 2 +- libavcodec/bink.c | 2 +- libavcodec/binkaudio.c | 4 +- libavcodec/bmp.c | 2 +- libavcodec/bmpenc.c | 2 +- libavcodec/c93.c | 2 +- libavcodec/cavsdec.c | 2 +- libavcodec/cdgraphics.c | 2 +- libavcodec/cinepak.c | 2 +- libavcodec/cljr.c | 4 +- libavcodec/cook.c | 2 +- libavcodec/cscd.c | 2 +- libavcodec/cyuv.c | 4 +- libavcodec/dca.c | 2 +- libavcodec/dnxhddec.c | 2 +- libavcodec/dnxhdenc.c | 2 +- libavcodec/dpcm.c | 2 +- libavcodec/dpx.c | 2 +- libavcodec/dsicinav.c | 4 +- libavcodec/dv.c | 4 +- libavcodec/dvbsub.c | 2 +- libavcodec/dvbsubdec.c | 2 +- libavcodec/dvdsubdec.c | 2 +- libavcodec/dvdsubenc.c | 2 +- libavcodec/dxa.c | 2 +- libavcodec/dxva2_h264.c | 2 +- libavcodec/dxva2_vc1.c | 4 +- libavcodec/eacmv.c | 2 +- libavcodec/eamad.c | 2 +- libavcodec/eatgq.c | 2 +- libavcodec/eatgv.c | 2 +- libavcodec/eatqi.c | 2 +- libavcodec/escape124.c | 2 +- libavcodec/ffv1.c | 4 +- libavcodec/flacdec.c | 2 +- libavcodec/flacenc.c | 2 +- libavcodec/flashsv.c | 2 +- libavcodec/flashsvenc.c | 2 +- libavcodec/flicvideo.c | 2 +- libavcodec/flvdec.c | 2 +- libavcodec/flvenc.c | 2 +- libavcodec/fraps.c | 2 +- libavcodec/frwu.c | 2 +- libavcodec/g726.c | 4 +- libavcodec/g729dec.c | 2 +- libavcodec/gif.c | 2 +- libavcodec/gifdec.c | 2 +- libavcodec/h261dec.c | 2 +- libavcodec/h261enc.c | 2 +- libavcodec/h263dec.c | 2 +- libavcodec/h264.c | 4 +- libavcodec/huffyuv.c | 8 +- libavcodec/idcinvideo.c | 2 +- libavcodec/iff.c | 4 +- libavcodec/imc.c | 2 +- libavcodec/indeo2.c | 2 +- libavcodec/indeo3.c | 2 +- libavcodec/indeo5.c | 2 +- libavcodec/intelh263dec.c | 2 +- libavcodec/interplayvideo.c | 2 +- libavcodec/jpeglsdec.c | 2 +- libavcodec/jpeglsenc.c | 2 +- libavcodec/kgv1dec.c | 2 +- libavcodec/kmvc.c | 2 +- libavcodec/lcldec.c | 4 +- libavcodec/lclenc.c | 2 +- libavcodec/libdiracdec.c | 2 +- libavcodec/libdiracenc.c | 2 +- libavcodec/libfaac.c | 2 +- libavcodec/libfaad.c | 2 +- libavcodec/libgsm.c | 8 +- libavcodec/libmp3lame.c | 2 +- libavcodec/libopencore-amr.c | 6 +- libavcodec/libopenjpeg.c | 2 +- libavcodec/libschroedingerdec.c | 2 +- libavcodec/libschroedingerenc.c | 2 +- libavcodec/libspeexdec.c | 2 +- libavcodec/libtheoraenc.c | 2 +- libavcodec/libvorbis.c | 2 +- libavcodec/libx264.c | 2 +- libavcodec/libxvidff.c | 2 +- libavcodec/ljpegenc.c | 2 +- libavcodec/loco.c | 2 +- libavcodec/mace.c | 4 +- libavcodec/mdec.c | 2 +- libavcodec/mimic.c | 2 +- libavcodec/mjpegbdec.c | 2 +- libavcodec/mjpegdec.c | 4 +- libavcodec/mjpegenc.c | 2 +- libavcodec/mlpdec.c | 4 +- libavcodec/mmvideo.c | 2 +- libavcodec/motionpixels.c | 2 +- libavcodec/mpc7.c | 2 +- libavcodec/mpc8.c | 2 +- libavcodec/mpeg12.c | 12 +-- libavcodec/mpeg12enc.c | 4 +- libavcodec/mpeg4videodec.c | 4 +- libavcodec/mpeg4videoenc.c | 2 +- libavcodec/mpegaudiodec.c | 10 +-- libavcodec/mpegaudioenc.c | 2 +- libavcodec/mpegvideo_enc.c | 12 +-- libavcodec/msmpeg4.c | 8 +- libavcodec/msrle.c | 2 +- libavcodec/msvideo1.c | 2 +- libavcodec/nellymoserdec.c | 2 +- libavcodec/nellymoserenc.c | 2 +- libavcodec/nuv.c | 2 +- libavcodec/options.c | 14 +-- libavcodec/pamenc.c | 2 +- libavcodec/pcm-mpeg.c | 2 +- libavcodec/pcm.c | 4 +- libavcodec/pcx.c | 2 +- libavcodec/pcxenc.c | 2 +- libavcodec/pgssubdec.c | 2 +- libavcodec/pngdec.c | 2 +- libavcodec/pngenc.c | 2 +- libavcodec/pnmdec.c | 10 +-- libavcodec/pnmenc.c | 8 +- libavcodec/ptx.c | 2 +- libavcodec/qcelpdec.c | 2 +- libavcodec/qdm2.c | 2 +- libavcodec/qdrw.c | 2 +- libavcodec/qpeg.c | 2 +- libavcodec/qtrle.c | 2 +- libavcodec/qtrleenc.c | 2 +- libavcodec/r210dec.c | 2 +- libavcodec/ra144.c | 2 +- libavcodec/ra288.c | 2 +- libavcodec/rawdec.c | 2 +- libavcodec/rawenc.c | 2 +- libavcodec/rl2.c | 2 +- libavcodec/roqaudioenc.c | 2 +- libavcodec/roqvideodec.c | 2 +- libavcodec/roqvideoenc.c | 2 +- libavcodec/rpza.c | 2 +- libavcodec/rv10.c | 4 +- libavcodec/rv10enc.c | 2 +- libavcodec/rv20enc.c | 2 +- libavcodec/rv30.c | 2 +- libavcodec/rv40.c | 2 +- libavcodec/sgidec.c | 2 +- libavcodec/sgienc.c | 2 +- libavcodec/shorten.c | 2 +- libavcodec/sipr.c | 2 +- libavcodec/smacker.c | 4 +- libavcodec/smc.c | 2 +- libavcodec/snow.c | 4 +- libavcodec/sonic.c | 6 +- libavcodec/sp5xdec.c | 4 +- libavcodec/sunrast.c | 2 +- libavcodec/svq1dec.c | 2 +- libavcodec/svq1enc.c | 2 +- libavcodec/svq3.c | 2 +- libavcodec/targa.c | 2 +- libavcodec/targaenc.c | 2 +- libavcodec/tiertexseqv.c | 2 +- libavcodec/tiff.c | 2 +- libavcodec/tiffenc.c | 2 +- libavcodec/tmv.c | 2 +- libavcodec/truemotion1.c | 2 +- libavcodec/truemotion2.c | 2 +- libavcodec/truespeech.c | 2 +- libavcodec/tscc.c | 2 +- libavcodec/tta.c | 2 +- libavcodec/twinvq.c | 2 +- libavcodec/txd.c | 2 +- libavcodec/ulti.c | 2 +- libavcodec/utils.c | 22 ++--- libavcodec/v210dec.c | 2 +- libavcodec/v210enc.c | 2 +- libavcodec/v210x.c | 2 +- libavcodec/vaapi_h264.c | 2 +- libavcodec/vaapi_mpeg2.c | 2 +- libavcodec/vaapi_mpeg4.c | 4 +- libavcodec/vaapi_vc1.c | 4 +- libavcodec/vb.c | 2 +- libavcodec/vc1dec.c | 8 +- libavcodec/vcr1.c | 4 +- libavcodec/vmdav.c | 4 +- libavcodec/vmnc.c | 2 +- libavcodec/vorbis_dec.c | 2 +- libavcodec/vorbis_enc.c | 2 +- libavcodec/vp3.c | 4 +- libavcodec/vp5.c | 2 +- libavcodec/vp6.c | 6 +- libavcodec/vqavideo.c | 2 +- libavcodec/wavpack.c | 2 +- libavcodec/wmadec.c | 4 +- libavcodec/wmaenc.c | 4 +- libavcodec/wmaprodec.c | 2 +- libavcodec/wmavoice.c | 2 +- libavcodec/wmv2dec.c | 2 +- libavcodec/wmv2enc.c | 2 +- libavcodec/wnv1.c | 2 +- libavcodec/ws-snd1.c | 2 +- libavcodec/xan.c | 4 +- libavcodec/xl.c | 2 +- libavcodec/xsubdec.c | 2 +- libavcodec/xsubenc.c | 2 +- libavcodec/yop.c | 2 +- libavcodec/zmbv.c | 2 +- libavcodec/zmbvenc.c | 2 +- libavdevice/alsa-audio-dec.c | 2 +- libavdevice/bktr.c | 2 +- libavdevice/jack_audio.c | 2 +- libavdevice/libdc1394.c | 2 +- libavdevice/oss_audio.c | 2 +- libavdevice/v4l.c | 2 +- libavdevice/v4l2.c | 2 +- libavdevice/vfwcap.c | 2 +- libavdevice/x11grab.c | 2 +- libavfilter/avfilter.h | 2 +- libavfilter/vf_aspect.c | 8 +- libavfilter/vf_crop.c | 4 +- libavfilter/vf_format.c | 8 +- libavfilter/vf_null.c | 4 +- libavfilter/vf_scale.c | 4 +- libavfilter/vf_slicify.c | 4 +- libavfilter/vf_vflip.c | 4 +- libavfilter/vsink_nullsink.c | 2 +- libavfilter/vsrc_nullsrc.c | 2 +- libavformat/4xm.c | 4 +- libavformat/aea.c | 2 +- libavformat/aiffdec.c | 2 +- libavformat/amr.c | 2 +- libavformat/anm.c | 2 +- libavformat/apc.c | 2 +- libavformat/ape.c | 2 +- libavformat/asfdec.c | 20 ++--- libavformat/asfenc.c | 18 ++-- libavformat/assdec.c | 2 +- libavformat/au.c | 2 +- libavformat/audiointerleave.c | 8 +- libavformat/avformat.h | 2 +- libavformat/avidec.c | 26 +++--- libavformat/avienc.c | 40 ++++----- libavformat/avisynth.c | 4 +- libavformat/avs.c | 4 +- libavformat/bethsoftvid.c | 4 +- libavformat/bfi.c | 4 +- libavformat/bink.c | 4 +- libavformat/c93.c | 4 +- libavformat/cafdec.c | 2 +- libavformat/cdg.c | 2 +- libavformat/daud.c | 2 +- libavformat/dsicin.c | 4 +- libavformat/dv.c | 4 +- libavformat/dvenc.c | 8 +- libavformat/dxa.c | 2 +- libavformat/eacdata.c | 2 +- libavformat/electronicarts.c | 4 +- libavformat/ffmdec.c | 4 +- libavformat/ffmenc.c | 4 +- libavformat/filmstripdec.c | 2 +- libavformat/flacdec.c | 2 +- libavformat/flic.c | 2 +- libavformat/flvdec.c | 6 +- libavformat/flvenc.c | 8 +- libavformat/gif.c | 4 +- libavformat/gxf.c | 20 ++--- libavformat/gxfenc.c | 16 ++-- libavformat/idcin.c | 4 +- libavformat/idroq.c | 4 +- libavformat/iff.c | 14 +-- libavformat/img2.c | 8 +- libavformat/ipmovie.c | 4 +- libavformat/iss.c | 2 +- libavformat/iv8.c | 2 +- libavformat/libnut.c | 12 +-- libavformat/lmlm4.c | 4 +- libavformat/matroskadec.c | 8 +- libavformat/matroskaenc.c | 14 +-- libavformat/mm.c | 4 +- libavformat/mmf.c | 2 +- libavformat/mov.c | 38 ++++---- libavformat/movenc.c | 52 +++++------ libavformat/mp3.c | 2 +- libavformat/mpc.c | 2 +- libavformat/mpc8.c | 2 +- libavformat/mpeg.c | 36 ++++---- libavformat/mpegenc.c | 10 +-- libavformat/mpegts.c | 58 ++++++------ libavformat/mpegtsenc.c | 22 ++--- libavformat/msnwc_tcp.c | 2 +- libavformat/mtv.c | 4 +- libavformat/mvi.c | 4 +- libavformat/mxf.c | 6 +- libavformat/mxfdec.c | 6 +- libavformat/mxfenc.c | 6 +- libavformat/ncdec.c | 2 +- libavformat/nsvdec.c | 4 +- libavformat/nutdec.c | 12 +-- libavformat/nutenc.c | 12 +-- libavformat/nuv.c | 4 +- libavformat/oggdec.c | 2 +- libavformat/oggenc.c | 4 +- libavformat/oggparsedirac.c | 4 +- libavformat/oggparseflac.c | 4 +- libavformat/oggparseogm.c | 12 +-- libavformat/oggparseskeleton.c | 2 +- libavformat/oggparsespeex.c | 2 +- libavformat/oggparsetheora.c | 2 +- libavformat/oggparsevorbis.c | 2 +- libavformat/oma.c | 2 +- libavformat/output-example.c | 4 +- libavformat/psxstr.c | 4 +- libavformat/pva.c | 4 +- libavformat/qcp.c | 2 +- libavformat/r3d.c | 4 +- libavformat/raw.c | 14 +-- libavformat/rdt.c | 8 +- libavformat/riff.c | 6 +- libavformat/rl2.c | 4 +- libavformat/rmdec.c | 18 ++-- libavformat/rmenc.c | 10 +-- libavformat/rpl.c | 8 +- libavformat/rtp.c | 58 ++++++------ libavformat/rtp.h | 2 +- libavformat/rtpdec.c | 6 +- libavformat/rtpdec.h | 2 +- libavformat/rtpdec_amr.c | 4 +- libavformat/rtpdec_asf.c | 4 +- libavformat/rtpdec_h263.c | 4 +- libavformat/rtpdec_h264.c | 2 +- libavformat/rtpdec_theora.c | 2 +- libavformat/rtpdec_vorbis.c | 2 +- libavformat/rtpenc.c | 8 +- libavformat/rtsp.c | 14 +-- libavformat/sdp.c | 8 +- libavformat/segafilm.c | 4 +- libavformat/sierravmd.c | 4 +- libavformat/siff.c | 4 +- libavformat/smacker.c | 4 +- libavformat/sol.c | 2 +- libavformat/soxdec.c | 2 +- libavformat/swfdec.c | 14 +-- libavformat/swfenc.c | 6 +- libavformat/thp.c | 4 +- libavformat/tiertexseq.c | 4 +- libavformat/tmv.c | 4 +- libavformat/tta.c | 2 +- libavformat/txd.c | 2 +- libavformat/utils.c | 76 ++++++++-------- libavformat/vc1test.c | 2 +- libavformat/vocdec.c | 2 +- libavformat/vocenc.c | 2 +- libavformat/vqf.c | 2 +- libavformat/wc3movie.c | 4 +- libavformat/westwood.c | 6 +- libavformat/wv.c | 2 +- libavformat/xa.c | 2 +- libavformat/yop.c | 4 +- libavformat/yuv4mpeg.c | 2 +- 383 files changed, 1041 insertions(+), 1029 deletions(-) diff --git a/cmdutils.c b/cmdutils.c index 1ffe2e8f94..7964befd4c 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -48,7 +48,7 @@ const char **opt_names; static int opt_name_count; -AVCodecContext *avcodec_opts[CODEC_TYPE_NB]; +AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB]; AVFormatContext *avformat_opts; struct SwsContext *sws_opts; @@ -191,7 +191,7 @@ int opt_default(const char *opt, const char *arg){ const AVOption *o= NULL; int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0}; - for(type=0; type= 0; type++){ + for(type=0; type= 0; type++){ const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]); if(o2) ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o); @@ -202,11 +202,11 @@ int opt_default(const char *opt, const char *arg){ ret = av_set_string3(sws_opts, opt, arg, 1, &o); if(!o){ if(opt[0] == 'a') - ret = av_set_string3(avcodec_opts[CODEC_TYPE_AUDIO], opt+1, arg, 1, &o); + ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o); else if(opt[0] == 'v') - ret = av_set_string3(avcodec_opts[CODEC_TYPE_VIDEO], opt+1, arg, 1, &o); + ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o); else if(opt[0] == 's') - ret = av_set_string3(avcodec_opts[CODEC_TYPE_SUBTITLE], opt+1, arg, 1, &o); + ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o); } if (o && ret < 0) { fprintf(stderr, "Invalid value '%s' for option '%s'\n", arg, opt); @@ -535,13 +535,13 @@ void show_codecs(void) last_name= p2->name; switch(p2->type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: type_str = "V"; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: type_str = "A"; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: type_str = "S"; break; default: diff --git a/cmdutils.h b/cmdutils.h index 9190a81fd9..549ade8767 100644 --- a/cmdutils.h +++ b/cmdutils.h @@ -40,7 +40,7 @@ extern const int program_birth_year; extern const int this_year; extern const char **opt_names; -extern AVCodecContext *avcodec_opts[CODEC_TYPE_NB]; +extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB]; extern AVFormatContext *avformat_opts; extern struct SwsContext *sws_opts; diff --git a/ffmpeg.c b/ffmpeg.c index 30a80505cd..c053a23955 100644 --- a/ffmpeg.c +++ b/ffmpeg.c @@ -452,7 +452,7 @@ static int av_exit(int ret) powerpc_display_perf_report(); #endif /* CONFIG_POWERPC_PERF */ - for (i=0;icodec, ic->streams[i]->codec, sizeof(AVCodecContext)); s->streams[i] = st; - if (st->codec->codec_type == CODEC_TYPE_AUDIO && audio_stream_copy) + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && audio_stream_copy) st->stream_copy = 1; - else if (st->codec->codec_type == CODEC_TYPE_VIDEO && video_stream_copy) + else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && video_stream_copy) st->stream_copy = 1; if(!st->codec->thread_count) @@ -967,7 +967,7 @@ static void do_video_out(AVFormatContext *s, }else ost->sync_opts= lrintf(sync_ipts); - nb_frames= FFMIN(nb_frames, max_frames[CODEC_TYPE_VIDEO] - ost->frame_number); + nb_frames= FFMIN(nb_frames, max_frames[AVMEDIA_TYPE_VIDEO] - ost->frame_number); if (nb_frames <= 0) return; @@ -1088,7 +1088,7 @@ static void do_video_out(AVFormatContext *s, /* better than nothing: use input picture interlaced settings */ big_picture.interlaced_frame = in_picture->interlaced_frame; - if(avcodec_opts[CODEC_TYPE_VIDEO]->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)){ + if(avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)){ if(top_field_first == -1) big_picture.top_field_first = in_picture->top_field_first; else @@ -1163,7 +1163,7 @@ static void do_video_stats(AVFormatContext *os, AVOutputStream *ost, } enc = ost->st->codec; - if (enc->codec_type == CODEC_TYPE_VIDEO) { + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { frame_number = ost->frame_number; fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA); if (enc->flags&CODEC_FLAG_PSNR) @@ -1223,12 +1223,12 @@ static void print_report(AVFormatContext **output_files, for(i=0;ist->codec; - if (vid && enc->codec_type == CODEC_TYPE_VIDEO) { + if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ", !ost->st->stream_copy ? enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1); } - if (!vid && enc->codec_type == CODEC_TYPE_VIDEO) { + if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) { float t = (av_gettime()-timer_start) / 1000000.0; frame_number = ost->frame_number; @@ -1360,7 +1360,7 @@ static int output_packet(AVInputStream *ist, int ist_index, subtitle_to_free = NULL; if (ist->decoding_needed) { switch(ist->st->codec->codec_type) { - case CODEC_TYPE_AUDIO:{ + case AVMEDIA_TYPE_AUDIO:{ if(pkt && samples_size < FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE)) { samples_size = FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE); av_free(samples); @@ -1386,7 +1386,7 @@ static int output_packet(AVInputStream *ist, int ist_index, ist->next_pts += ((int64_t)AV_TIME_BASE/bps * decoded_data_size) / (ist->st->codec->sample_rate * ist->st->codec->channels); break;} - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: decoded_data_size = (ist->st->codec->width * ist->st->codec->height * 3) / 2; /* XXX: allocate picture correctly */ avcodec_get_frame_defaults(&picture); @@ -1408,7 +1408,7 @@ static int output_packet(AVInputStream *ist, int ist_index, } avpkt.size = 0; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: ret = avcodec_decode_subtitle2(ist->st->codec, &subtitle, &got_subtitle, &avpkt); if (ret < 0) @@ -1424,11 +1424,11 @@ static int output_packet(AVInputStream *ist, int ist_index, } } else { switch(ist->st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) / ist->st->codec->sample_rate; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (ist->st->codec->time_base.num != 0) { int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame; ist->next_pts += ((int64_t)AV_TIME_BASE * @@ -1442,13 +1442,13 @@ static int output_packet(AVInputStream *ist, int ist_index, } buffer_to_free = NULL; - if (ist->st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { pre_process_video_frame(ist, (AVPicture *)&picture, &buffer_to_free); } // preprocess audio (volume) - if (ist->st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (audio_volume != 256) { short *volp; volp = samples; @@ -1485,15 +1485,15 @@ static int output_packet(AVInputStream *ist, int ist_index, if (ost->encoding_needed) { assert(ist->decoding_needed); switch(ost->st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: do_audio_out(os, ost, ist, decoded_data_buf, decoded_data_size); break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: do_video_out(os, ost, ist, &picture, &frame_size); if (vstats_filename && frame_size) do_video_stats(os, ost, frame_size); break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: do_subtitle_out(os, ost, ist, &subtitle, pkt->pts); break; @@ -1517,9 +1517,9 @@ static int output_packet(AVInputStream *ist, int ist_index, ost->st->codec->coded_frame= &avframe; avframe.key_frame = pkt->flags & PKT_FLAG_KEY; - if(ost->st->codec->codec_type == CODEC_TYPE_AUDIO) + if(ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) audio_size += data_size; - else if (ost->st->codec->codec_type == CODEC_TYPE_VIDEO) { + else if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { video_size += data_size; ost->sync_opts++; } @@ -1583,9 +1583,9 @@ static int output_packet(AVInputStream *ist, int ist_index, AVCodecContext *enc= ost->st->codec; os = output_files[ost->file_index]; - if(ost->st->codec->codec_type == CODEC_TYPE_AUDIO && enc->frame_size <=1) + if(ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <=1) continue; - if(ost->st->codec->codec_type == CODEC_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE)) + if(ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE)) continue; if (ost->encoding_needed) { @@ -1596,7 +1596,7 @@ static int output_packet(AVInputStream *ist, int ist_index, pkt.stream_index= ost->index; switch(ost->st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: fifo_bytes = av_fifo_size(ost->fifo); ret = 0; /* encode any samples remaining in fifo */ @@ -1629,7 +1629,7 @@ static int output_packet(AVInputStream *ist, int ist_index, audio_size += ret; pkt.flags |= PKT_FLAG_KEY; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: ret = avcodec_encode_video(enc, bit_buffer, bit_buffer_size, NULL); if (ret < 0) { fprintf(stderr, "Video encoding failed\n"); @@ -1946,7 +1946,7 @@ static int av_encode(AVFormatContext **output_files, }else codec->time_base = ist->st->time_base; switch(codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if(audio_volume != 256) { fprintf(stderr,"-acodec copy and -vol are incompatible (frames are not decoded)\n"); av_exit(1); @@ -1961,13 +1961,13 @@ static int av_encode(AVFormatContext **output_files, if(codec->codec_id == CODEC_ID_AC3) codec->block_align= 0; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: codec->pix_fmt = icodec->pix_fmt; codec->width = icodec->width; codec->height = icodec->height; codec->has_b_frames = icodec->has_b_frames; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: codec->width = icodec->width; codec->height = icodec->height; break; @@ -1976,7 +1976,7 @@ static int av_encode(AVFormatContext **output_files, } } else { switch(codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: ost->fifo= av_fifo_alloc(1024); if(!ost->fifo) goto fail; @@ -1986,7 +1986,7 @@ static int av_encode(AVFormatContext **output_files, ist->decoding_needed = 1; ost->encoding_needed = 1; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (ost->st->codec->pix_fmt == PIX_FMT_NONE) { fprintf(stderr, "Video pixel format is unknown, stream cannot be encoded\n"); av_exit(1); @@ -2050,7 +2050,7 @@ static int av_encode(AVFormatContext **output_files, ost->encoding_needed = 1; ist->decoding_needed = 1; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: ost->encoding_needed = 1; ist->decoding_needed = 1; break; @@ -2098,7 +2098,7 @@ static int av_encode(AVFormatContext **output_files, } } } - if(codec->codec_type == CODEC_TYPE_VIDEO){ + if(codec->codec_type == AVMEDIA_TYPE_VIDEO){ int size= codec->width * codec->height; bit_buffer_size= FFMAX(bit_buffer_size, 6*size + 200); } @@ -2155,7 +2155,7 @@ static int av_encode(AVFormatContext **output_files, ret = AVERROR(EINVAL); goto dump_format; } - //if (ist->st->codec->codec_type == CODEC_TYPE_VIDEO) + //if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) // ist->st->codec->flags |= CODEC_FLAG_REPEAT_FIELD; } } @@ -2528,7 +2528,7 @@ static int opt_frame_rate(const char *opt, const char *arg) static int opt_bitrate(const char *opt, const char *arg) { - int codec_type = opt[0]=='a' ? CODEC_TYPE_AUDIO : CODEC_TYPE_VIDEO; + int codec_type = opt[0]=='a' ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO; opt_default(opt, arg); @@ -2781,7 +2781,7 @@ static void opt_codec(int *pstream_copy, char **pcodec_name, static void opt_audio_codec(const char *arg) { - opt_codec(&audio_stream_copy, &audio_codec_name, CODEC_TYPE_AUDIO, arg); + opt_codec(&audio_stream_copy, &audio_codec_name, AVMEDIA_TYPE_AUDIO, arg); } static void opt_audio_tag(const char *arg) @@ -2804,12 +2804,12 @@ static void opt_video_tag(const char *arg) static void opt_video_codec(const char *arg) { - opt_codec(&video_stream_copy, &video_codec_name, CODEC_TYPE_VIDEO, arg); + opt_codec(&video_stream_copy, &video_codec_name, AVMEDIA_TYPE_VIDEO, arg); } static void opt_subtitle_codec(const char *arg) { - opt_codec(&subtitle_stream_copy, &subtitle_codec_name, CODEC_TYPE_SUBTITLE, arg); + opt_codec(&subtitle_stream_copy, &subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, arg); } static void opt_subtitle_tag(const char *arg) @@ -2965,9 +2965,9 @@ static void opt_input_file(const char *filename) set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM); - ic->video_codec_id = find_codec_or_die(video_codec_name , CODEC_TYPE_VIDEO , 0); - ic->audio_codec_id = find_codec_or_die(audio_codec_name , CODEC_TYPE_AUDIO , 0); - ic->subtitle_codec_id= find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 0); + ic->video_codec_id = find_codec_or_die(video_codec_name , AVMEDIA_TYPE_VIDEO , 0); + ic->audio_codec_id = find_codec_or_die(audio_codec_name , AVMEDIA_TYPE_AUDIO , 0); + ic->subtitle_codec_id= find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0); ic->flags |= AVFMT_FLAG_NONBLOCK; if(pgmyuv_compatibility_hack) @@ -3035,8 +3035,8 @@ static void opt_input_file(const char *filename) AVCodecContext *enc = st->codec; avcodec_thread_init(enc, thread_count); switch(enc->codec_type) { - case CODEC_TYPE_AUDIO: - set_context_opts(enc, avcodec_opts[CODEC_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM); + case AVMEDIA_TYPE_AUDIO: + set_context_opts(enc, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM); //fprintf(stderr, "\nInput Audio channels: %d", enc->channels); channel_layout = enc->channel_layout; audio_channels = enc->channels; @@ -3046,8 +3046,8 @@ static void opt_input_file(const char *filename) if(audio_disable) st->discard= AVDISCARD_ALL; break; - case CODEC_TYPE_VIDEO: - set_context_opts(enc, avcodec_opts[CODEC_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM); + case AVMEDIA_TYPE_VIDEO: + set_context_opts(enc, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM); frame_height = enc->height; frame_width = enc->width; if(ic->streams[i]->sample_aspect_ratio.num) @@ -3084,15 +3084,15 @@ static void opt_input_file(const char *filename) else if(video_discard) st->discard= video_discard; break; - case CODEC_TYPE_DATA: + case AVMEDIA_TYPE_DATA: break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(subtitle_codec_name); if(subtitle_disable) st->discard = AVDISCARD_ALL; break; - case CODEC_TYPE_ATTACHMENT: - case CODEC_TYPE_UNKNOWN: + case AVMEDIA_TYPE_ATTACHMENT: + case AVMEDIA_TYPE_UNKNOWN: nb_icodecs++; break; default: @@ -3129,18 +3129,18 @@ static void check_audio_video_sub_inputs(int *has_video_ptr, int *has_audio_ptr, for(i=0;inb_streams;i++) { AVCodecContext *enc = ic->streams[i]->codec; switch(enc->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: has_audio = 1; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: has_video = 1; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: has_subtitle = 1; break; - case CODEC_TYPE_DATA: - case CODEC_TYPE_ATTACHMENT: - case CODEC_TYPE_UNKNOWN: + case AVMEDIA_TYPE_DATA: + case AVMEDIA_TYPE_ATTACHMENT: + case AVMEDIA_TYPE_UNKNOWN: break; default: abort(); @@ -3163,7 +3163,7 @@ static void new_video_stream(AVFormatContext *oc) fprintf(stderr, "Could not alloc stream\n"); av_exit(1); } - avcodec_get_context_defaults2(st->codec, CODEC_TYPE_VIDEO); + avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_VIDEO); bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters; video_bitstream_filters= NULL; @@ -3177,16 +3177,16 @@ static void new_video_stream(AVFormatContext *oc) if( (video_global_header&1) || (video_global_header==0 && (oc->oformat->flags & AVFMT_GLOBALHEADER))){ video_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; - avcodec_opts[CODEC_TYPE_VIDEO]->flags|= CODEC_FLAG_GLOBAL_HEADER; + avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags|= CODEC_FLAG_GLOBAL_HEADER; } if(video_global_header&2){ video_enc->flags2 |= CODEC_FLAG2_LOCAL_HEADER; - avcodec_opts[CODEC_TYPE_VIDEO]->flags2|= CODEC_FLAG2_LOCAL_HEADER; + avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags2|= CODEC_FLAG2_LOCAL_HEADER; } if (video_stream_copy) { st->stream_copy = 1; - video_enc->codec_type = CODEC_TYPE_VIDEO; + video_enc->codec_type = AVMEDIA_TYPE_VIDEO; video_enc->sample_aspect_ratio = st->sample_aspect_ratio = av_d2q(frame_aspect_ratio*frame_height/frame_width, 255); } else { @@ -3196,17 +3196,17 @@ static void new_video_stream(AVFormatContext *oc) AVRational fps= frame_rate.num ? frame_rate : (AVRational){25,1}; if (video_codec_name) { - codec_id = find_codec_or_die(video_codec_name, CODEC_TYPE_VIDEO, 1); + codec_id = find_codec_or_die(video_codec_name, AVMEDIA_TYPE_VIDEO, 1); codec = avcodec_find_encoder_by_name(video_codec_name); output_codecs[nb_ocodecs] = codec; } else { - codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO); + codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO); codec = avcodec_find_encoder(codec_id); } video_enc->codec_id = codec_id; - set_context_opts(video_enc, avcodec_opts[CODEC_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM); + set_context_opts(video_enc, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM); if (codec && codec->supported_framerates && !force_fps) fps = codec->supported_framerates[av_find_nearest_q_idx(fps, codec->supported_framerates)]; @@ -3300,7 +3300,7 @@ static void new_audio_stream(AVFormatContext *oc) fprintf(stderr, "Could not alloc stream\n"); av_exit(1); } - avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO); + avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_AUDIO); bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters; audio_bitstream_filters= NULL; @@ -3308,14 +3308,14 @@ static void new_audio_stream(AVFormatContext *oc) avcodec_thread_init(st->codec, thread_count); audio_enc = st->codec; - audio_enc->codec_type = CODEC_TYPE_AUDIO; + audio_enc->codec_type = AVMEDIA_TYPE_AUDIO; if(audio_codec_tag) audio_enc->codec_tag= audio_codec_tag; if (oc->oformat->flags & AVFMT_GLOBALHEADER) { audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER; - avcodec_opts[CODEC_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER; + avcodec_opts[AVMEDIA_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER; } if (audio_stream_copy) { st->stream_copy = 1; @@ -3323,14 +3323,14 @@ static void new_audio_stream(AVFormatContext *oc) } else { AVCodec *codec; - set_context_opts(audio_enc, avcodec_opts[CODEC_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM); + set_context_opts(audio_enc, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM); if (audio_codec_name) { - codec_id = find_codec_or_die(audio_codec_name, CODEC_TYPE_AUDIO, 1); + codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1); codec = avcodec_find_encoder_by_name(audio_codec_name); output_codecs[nb_ocodecs] = codec; } else { - codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_AUDIO); + codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_AUDIO); codec = avcodec_find_encoder(codec_id); } audio_enc->codec_id = codec_id; @@ -3370,13 +3370,13 @@ static void new_subtitle_stream(AVFormatContext *oc) fprintf(stderr, "Could not alloc stream\n"); av_exit(1); } - avcodec_get_context_defaults2(st->codec, CODEC_TYPE_SUBTITLE); + avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_SUBTITLE); bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters; subtitle_bitstream_filters= NULL; subtitle_enc = st->codec; - subtitle_enc->codec_type = CODEC_TYPE_SUBTITLE; + subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE; if(subtitle_codec_tag) subtitle_enc->codec_tag= subtitle_codec_tag; @@ -3384,8 +3384,8 @@ static void new_subtitle_stream(AVFormatContext *oc) if (subtitle_stream_copy) { st->stream_copy = 1; } else { - set_context_opts(avcodec_opts[CODEC_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM); - subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 1); + set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM); + subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1); output_codecs[nb_ocodecs] = avcodec_find_encoder_by_name(subtitle_codec_name); } nb_ocodecs++; @@ -3739,7 +3739,7 @@ static void opt_target(const char *arg) for(j = 0; j < nb_input_files; j++) { for(i = 0; i < input_files[j]->nb_streams; i++) { AVCodecContext *c = input_files[j]->streams[i]->codec; - if(c->codec_type != CODEC_TYPE_VIDEO) + if(c->codec_type != AVMEDIA_TYPE_VIDEO) continue; fr = c->time_base.den * 1000 / c->time_base.num; if(fr == 25000) { @@ -3965,7 +3965,7 @@ static const OptionDef options[] = { { "itsscale", HAS_ARG, {(void*)opt_input_ts_scale}, "set the input ts scale", "stream:scale" }, { "timestamp", OPT_FUNC2 | HAS_ARG, {(void*)opt_rec_timestamp}, "set the timestamp ('now' to set the current time)", "time" }, { "metadata", OPT_FUNC2 | HAS_ARG, {(void*)opt_metadata}, "add metadata", "string=string" }, - { "dframes", OPT_INT | HAS_ARG, {(void*)&max_frames[CODEC_TYPE_DATA]}, "set the number of data frames to record", "number" }, + { "dframes", OPT_INT | HAS_ARG, {(void*)&max_frames[AVMEDIA_TYPE_DATA]}, "set the number of data frames to record", "number" }, { "benchmark", OPT_BOOL | OPT_EXPERT, {(void*)&do_benchmark}, "add timings for benchmarking" }, { "timelimit", OPT_FUNC2 | HAS_ARG, {(void*)opt_timelimit}, "set max runtime in seconds", "limit" }, @@ -3993,7 +3993,7 @@ static const OptionDef options[] = { /* video options */ { "b", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" }, { "vb", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" }, - { "vframes", OPT_INT | HAS_ARG | OPT_VIDEO, {(void*)&max_frames[CODEC_TYPE_VIDEO]}, "set the number of video frames to record", "number" }, + { "vframes", OPT_INT | HAS_ARG | OPT_VIDEO, {(void*)&max_frames[AVMEDIA_TYPE_VIDEO]}, "set the number of video frames to record", "number" }, { "r", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_frame_rate}, "set frame rate (Hz value, fraction or abbreviation)", "rate" }, { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" }, { "aspect", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_aspect_ratio}, "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)", "aspect" }, @@ -4035,7 +4035,7 @@ static const OptionDef options[] = { /* audio options */ { "ab", OPT_FUNC2 | HAS_ARG | OPT_AUDIO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" }, - { "aframes", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&max_frames[CODEC_TYPE_AUDIO]}, "set the number of audio frames to record", "number" }, + { "aframes", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&max_frames[AVMEDIA_TYPE_AUDIO]}, "set the number of audio frames to record", "number" }, { "aq", OPT_FLOAT | HAS_ARG | OPT_AUDIO, {(void*)&audio_qscale}, "set audio quality (codec-specific)", "quality", }, { "ar", HAS_ARG | OPT_FUNC2 | OPT_AUDIO, {(void*)opt_audio_rate}, "set audio sampling rate (in Hz)", "rate" }, { "ac", HAS_ARG | OPT_FUNC2 | OPT_AUDIO, {(void*)opt_audio_channels}, "set number of audio channels", "channels" }, @@ -4090,7 +4090,7 @@ int main(int argc, char **argv) url_set_interrupt_cb(decode_interrupt_cb); #endif - for(i=0; istreams[stream_index]->codec; /* prepare audio output */ - if (avctx->codec_type == CODEC_TYPE_AUDIO) { + if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { if (avctx->channels > 0) { avctx->request_channels = FFMIN(2, avctx->channels); } else { @@ -2152,7 +2152,7 @@ static int stream_component_open(VideoState *is, int stream_index) return -1; /* prepare audio output */ - if (avctx->codec_type == CODEC_TYPE_AUDIO) { + if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) { wanted_spec.freq = avctx->sample_rate; wanted_spec.format = AUDIO_S16SYS; wanted_spec.channels = avctx->channels; @@ -2170,7 +2170,7 @@ static int stream_component_open(VideoState *is, int stream_index) ic->streams[stream_index]->discard = AVDISCARD_DEFAULT; switch(avctx->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: is->audio_stream = stream_index; is->audio_st = ic->streams[stream_index]; is->audio_buf_size = 0; @@ -2187,7 +2187,7 @@ static int stream_component_open(VideoState *is, int stream_index) packet_queue_init(&is->audioq); SDL_PauseAudio(0); break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: is->video_stream = stream_index; is->video_st = ic->streams[stream_index]; @@ -2196,7 +2196,7 @@ static int stream_component_open(VideoState *is, int stream_index) packet_queue_init(&is->videoq); is->video_tid = SDL_CreateThread(video_thread, is); break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: is->subtitle_stream = stream_index; is->subtitle_st = ic->streams[stream_index]; packet_queue_init(&is->subtitleq); @@ -2219,7 +2219,7 @@ static void stream_component_close(VideoState *is, int stream_index) avctx = ic->streams[stream_index]->codec; switch(avctx->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: packet_queue_abort(&is->audioq); SDL_CloseAudio(); @@ -2229,7 +2229,7 @@ static void stream_component_close(VideoState *is, int stream_index) av_audio_convert_free(is->reformat_ctx); is->reformat_ctx = NULL; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: packet_queue_abort(&is->videoq); /* note: we also signal this mutex to make sure we deblock the @@ -2242,7 +2242,7 @@ static void stream_component_close(VideoState *is, int stream_index) packet_queue_end(&is->videoq); break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: packet_queue_abort(&is->subtitleq); /* note: we also signal this mutex to make sure we deblock the @@ -2264,15 +2264,15 @@ static void stream_component_close(VideoState *is, int stream_index) ic->streams[stream_index]->discard = AVDISCARD_ALL; avcodec_close(avctx); switch(avctx->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: is->audio_st = NULL; is->audio_stream = -1; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: is->video_st = NULL; is->video_stream = -1; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: is->subtitle_st = NULL; is->subtitle_stream = -1; break; @@ -2296,9 +2296,9 @@ static int decode_thread(void *arg) VideoState *is = arg; AVFormatContext *ic; int err, i, ret; - int st_index[CODEC_TYPE_NB]; - int st_count[CODEC_TYPE_NB]={0}; - int st_best_packet_count[CODEC_TYPE_NB]; + int st_index[AVMEDIA_TYPE_NB]; + int st_count[AVMEDIA_TYPE_NB]={0}; + int st_best_packet_count[AVMEDIA_TYPE_NB]; AVPacket pkt1, *pkt = &pkt1; AVFormatParameters params, *ap = ¶ms; int eof=0; @@ -2366,7 +2366,7 @@ static int decode_thread(void *arg) AVStream *st= ic->streams[i]; AVCodecContext *avctx = st->codec; ic->streams[i]->discard = AVDISCARD_ALL; - if(avctx->codec_type >= (unsigned)CODEC_TYPE_NB) + if(avctx->codec_type >= (unsigned)AVMEDIA_TYPE_NB) continue; if(st_count[avctx->codec_type]++ != wanted_stream[avctx->codec_type] && wanted_stream[avctx->codec_type] >= 0) continue; @@ -2376,12 +2376,12 @@ static int decode_thread(void *arg) st_best_packet_count[avctx->codec_type]= st->codec_info_nb_frames; switch(avctx->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (!audio_disable) - st_index[CODEC_TYPE_AUDIO] = i; + st_index[AVMEDIA_TYPE_AUDIO] = i; break; - case CODEC_TYPE_VIDEO: - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_VIDEO: + case AVMEDIA_TYPE_SUBTITLE: if (!video_disable) st_index[avctx->codec_type] = i; break; @@ -2394,13 +2394,13 @@ static int decode_thread(void *arg) } /* open the streams */ - if (st_index[CODEC_TYPE_AUDIO] >= 0) { - stream_component_open(is, st_index[CODEC_TYPE_AUDIO]); + if (st_index[AVMEDIA_TYPE_AUDIO] >= 0) { + stream_component_open(is, st_index[AVMEDIA_TYPE_AUDIO]); } ret=-1; - if (st_index[CODEC_TYPE_VIDEO] >= 0) { - ret= stream_component_open(is, st_index[CODEC_TYPE_VIDEO]); + if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) { + ret= stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]); } is->refresh_tid = SDL_CreateThread(refresh_thread, is); if(ret<0) { @@ -2408,8 +2408,8 @@ static int decode_thread(void *arg) is->show_audio = 2; } - if (st_index[CODEC_TYPE_SUBTITLE] >= 0) { - stream_component_open(is, st_index[CODEC_TYPE_SUBTITLE]); + if (st_index[AVMEDIA_TYPE_SUBTITLE] >= 0) { + stream_component_open(is, st_index[AVMEDIA_TYPE_SUBTITLE]); } if (is->video_stream < 0 && is->audio_stream < 0) { @@ -2612,19 +2612,19 @@ static void stream_cycle_channel(VideoState *is, int codec_type) int start_index, stream_index; AVStream *st; - if (codec_type == CODEC_TYPE_VIDEO) + if (codec_type == AVMEDIA_TYPE_VIDEO) start_index = is->video_stream; - else if (codec_type == CODEC_TYPE_AUDIO) + else if (codec_type == AVMEDIA_TYPE_AUDIO) start_index = is->audio_stream; else start_index = is->subtitle_stream; - if (start_index < (codec_type == CODEC_TYPE_SUBTITLE ? -1 : 0)) + if (start_index < (codec_type == AVMEDIA_TYPE_SUBTITLE ? -1 : 0)) return; stream_index = start_index; for(;;) { if (++stream_index >= is->ic->nb_streams) { - if (codec_type == CODEC_TYPE_SUBTITLE) + if (codec_type == AVMEDIA_TYPE_SUBTITLE) { stream_index = -1; goto the_end; @@ -2637,13 +2637,13 @@ static void stream_cycle_channel(VideoState *is, int codec_type) if (st->codec->codec_type == codec_type) { /* check that parameters are OK */ switch(codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (st->codec->sample_rate != 0 && st->codec->channels != 0) goto the_end; break; - case CODEC_TYPE_VIDEO: - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_VIDEO: + case AVMEDIA_TYPE_SUBTITLE: goto the_end; default: break; @@ -2690,7 +2690,7 @@ static void do_exit(void) stream_close(cur_stream); cur_stream = NULL; } - for (i = 0; i < CODEC_TYPE_NB; i++) + for (i = 0; i < AVMEDIA_TYPE_NB; i++) av_free(avcodec_opts[i]); av_free(avformat_opts); av_free(sws_opts); @@ -2743,15 +2743,15 @@ static void event_loop(void) break; case SDLK_a: if (cur_stream) - stream_cycle_channel(cur_stream, CODEC_TYPE_AUDIO); + stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO); break; case SDLK_v: if (cur_stream) - stream_cycle_channel(cur_stream, CODEC_TYPE_VIDEO); + stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO); break; case SDLK_t: if (cur_stream) - stream_cycle_channel(cur_stream, CODEC_TYPE_SUBTITLE); + stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE); break; case SDLK_w: toggle_audio_display(); @@ -2943,9 +2943,9 @@ static const OptionDef options[] = { { "fs", OPT_BOOL, {(void*)&is_full_screen}, "force full screen" }, { "an", OPT_BOOL, {(void*)&audio_disable}, "disable audio" }, { "vn", OPT_BOOL, {(void*)&video_disable}, "disable video" }, - { "ast", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[CODEC_TYPE_AUDIO]}, "select desired audio stream", "stream_number" }, - { "vst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[CODEC_TYPE_VIDEO]}, "select desired video stream", "stream_number" }, - { "sst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[CODEC_TYPE_SUBTITLE]}, "select desired subtitle stream", "stream_number" }, + { "ast", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_AUDIO]}, "select desired audio stream", "stream_number" }, + { "vst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_VIDEO]}, "select desired video stream", "stream_number" }, + { "sst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_SUBTITLE]}, "select desired subtitle stream", "stream_number" }, { "ss", HAS_ARG | OPT_FUNC2, {(void*)&opt_seek}, "seek to a given position in seconds", "pos" }, { "bytes", OPT_INT | HAS_ARG, {(void*)&seek_by_bytes}, "seek by bytes 0=off 1=on -1=auto", "val" }, { "nodisp", OPT_BOOL, {(void*)&display_disable}, "disable graphical display" }, @@ -3032,7 +3032,7 @@ int main(int argc, char **argv) #endif av_register_all(); - for(i=0; icodec_type)); + printf("codec_type=%s\n", media_type_string(dec_ctx->codec_type)); printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den); /* print AVI/FourCC tag */ @@ -150,7 +150,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) printf("\ncodec_tag=0x%04x\n", dec_ctx->codec_tag); switch (dec_ctx->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: printf("width=%d\n", dec_ctx->width); printf("height=%d\n", dec_ctx->height); printf("has_b_frames=%d\n", dec_ctx->has_b_frames); @@ -162,7 +162,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown"); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: printf("sample_rate=%s\n", value_string(val_str, sizeof(val_str), dec_ctx->sample_rate, unit_hertz_str)); diff --git a/ffserver.c b/ffserver.c index 37b9a8ee1d..076635fa04 100644 --- a/ffserver.c +++ b/ffserver.c @@ -1805,7 +1805,7 @@ static void compute_status(HTTPContext *c) AVStream *st = stream->streams[i]; AVCodec *codec = avcodec_find_encoder(st->codec->codec_id); switch(st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: audio_bit_rate += st->codec->bit_rate; if (codec) { if (*audio_codec_name) @@ -1813,7 +1813,7 @@ static void compute_status(HTTPContext *c) audio_codec_name = codec->name; } break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: video_bit_rate += st->codec->bit_rate; if (codec) { if (*video_codec_name) @@ -1821,7 +1821,7 @@ static void compute_status(HTTPContext *c) video_codec_name = codec->name; } break; - case CODEC_TYPE_DATA: + case AVMEDIA_TYPE_DATA: video_bit_rate += st->codec->bit_rate; break; default: @@ -1894,11 +1894,11 @@ static void compute_status(HTTPContext *c) parameters[0] = 0; switch(st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: type = "audio"; snprintf(parameters, sizeof(parameters), "%d channel(s), %d Hz", st->codec->channels, st->codec->sample_rate); break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: type = "video"; snprintf(parameters, sizeof(parameters), "%dx%d, q=%d-%d, fps=%d", st->codec->width, st->codec->height, st->codec->qmin, st->codec->qmax, st->codec->time_base.den / st->codec->time_base.num); @@ -2047,7 +2047,7 @@ static int open_input_stream(HTTPContext *c, const char *info) c->pts_stream_index = 0; for(i=0;istream->nb_streams;i++) { if (c->pts_stream_index == 0 && - c->stream->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) { + c->stream->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { c->pts_stream_index = i; } } @@ -2210,7 +2210,7 @@ static int http_prepare_data(HTTPContext *c) AVStream *st = c->fmt_in->streams[source_index]; pkt.stream_index = i; if (pkt.flags & PKT_FLAG_KEY && - (st->codec->codec_type == CODEC_TYPE_VIDEO || + (st->codec->codec_type == AVMEDIA_TYPE_VIDEO || c->stream->nb_streams == 1)) c->got_key_frame = 1; if (!c->stream->send_on_key || c->got_key_frame) @@ -3346,12 +3346,12 @@ static int add_av_stream(FFStream *feed, AVStream *st) av1->bit_rate == av->bit_rate) { switch(av->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (av1->channels == av->channels && av1->sample_rate == av->sample_rate) goto found; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (av1->width == av->width && av1->height == av->height && av1->time_base.den == av->time_base.den && @@ -3549,7 +3549,7 @@ static void build_feed_streams(void) } else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) { http_log("Codec bitrates do not match for stream %d\n", i); matches = 0; - } else if (ccf->codec_type == CODEC_TYPE_VIDEO) { + } else if (ccf->codec_type == AVMEDIA_TYPE_VIDEO) { if (CHECK_CODEC(time_base.den) || CHECK_CODEC(time_base.num) || CHECK_CODEC(width) || @@ -3557,7 +3557,7 @@ static void build_feed_streams(void) http_log("Codec width, height and framerate do not match for stream %d\n", i); matches = 0; } - } else if (ccf->codec_type == CODEC_TYPE_AUDIO) { + } else if (ccf->codec_type == AVMEDIA_TYPE_AUDIO) { if (CHECK_CODEC(sample_rate) || CHECK_CODEC(channels) || CHECK_CODEC(frame_size)) { @@ -3651,8 +3651,8 @@ static void compute_bandwidth(void) for(i=0;inb_streams;i++) { AVStream *st = stream->streams[i]; switch(st->codec->codec_type) { - case CODEC_TYPE_AUDIO: - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_AUDIO: + case AVMEDIA_TYPE_VIDEO: bandwidth += st->codec->bit_rate; break; default: @@ -3670,7 +3670,7 @@ static void add_codec(FFStream *stream, AVCodecContext *av) /* compute default parameters */ switch(av->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (av->bit_rate == 0) av->bit_rate = 64000; if (av->sample_rate == 0) @@ -3678,7 +3678,7 @@ static void add_codec(FFStream *stream, AVCodecContext *av) if (av->channels == 0) av->channels = 1; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (av->bit_rate == 0) av->bit_rate = 64000; if (av->time_base.num == 0){ @@ -3742,7 +3742,7 @@ static enum CodecID opt_audio_codec(const char *arg) { AVCodec *p= avcodec_find_encoder_by_name(arg); - if (p == NULL || p->type != CODEC_TYPE_AUDIO) + if (p == NULL || p->type != AVMEDIA_TYPE_AUDIO) return CODEC_ID_NONE; return p->id; @@ -3752,7 +3752,7 @@ static enum CodecID opt_video_codec(const char *arg) { AVCodec *p= avcodec_find_encoder_by_name(arg); - if (p == NULL || p->type != CODEC_TYPE_VIDEO) + if (p == NULL || p->type != AVMEDIA_TYPE_VIDEO) return CODEC_ID_NONE; return p->id; @@ -4445,12 +4445,12 @@ static int parse_ffconfig(const char *filename) } else { if (stream->feed && stream->fmt && strcmp(stream->fmt->name, "ffm") != 0) { if (audio_id != CODEC_ID_NONE) { - audio_enc.codec_type = CODEC_TYPE_AUDIO; + audio_enc.codec_type = AVMEDIA_TYPE_AUDIO; audio_enc.codec_id = audio_id; add_codec(stream, &audio_enc); } if (video_id != CODEC_ID_NONE) { - video_enc.codec_type = CODEC_TYPE_VIDEO; + video_enc.codec_type = AVMEDIA_TYPE_VIDEO; video_enc.codec_id = video_id; add_codec(stream, &video_enc); } diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c index 92ff9f6d7a..ec25b9b7a9 100644 --- a/libavcodec/4xm.c +++ b/libavcodec/4xm.c @@ -842,7 +842,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec fourxm_decoder = { "4xm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_4XM, sizeof(FourXContext), decode_init, diff --git a/libavcodec/8bps.c b/libavcodec/8bps.c index fb5ef71732..be5735f608 100644 --- a/libavcodec/8bps.c +++ b/libavcodec/8bps.c @@ -221,7 +221,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec eightbps_decoder = { "8bps", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_8BPS, sizeof(EightBpsContext), decode_init, diff --git a/libavcodec/8svx.c b/libavcodec/8svx.c index c139e5d40b..2afd57dce6 100644 --- a/libavcodec/8svx.c +++ b/libavcodec/8svx.c @@ -94,7 +94,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx) AVCodec eightsvx_fib_decoder = { .name = "8svx_fib", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_8SVX_FIB, .priv_data_size = sizeof (EightSvxContext), .init = eightsvx_decode_init, @@ -104,7 +104,7 @@ AVCodec eightsvx_fib_decoder = { AVCodec eightsvx_exp_decoder = { .name = "8svx_exp", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_8SVX_EXP, .priv_data_size = sizeof (EightSvxContext), .init = eightsvx_decode_init, diff --git a/libavcodec/aac.c b/libavcodec/aac.c index 26555e9dea..c4636015a7 100644 --- a/libavcodec/aac.c +++ b/libavcodec/aac.c @@ -2091,7 +2091,7 @@ static av_cold int aac_decode_close(AVCodecContext *avccontext) AVCodec aac_decoder = { "aac", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC, sizeof(AACContext), aac_decode_init, diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index d32ae5e286..eb32d1464c 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -629,7 +629,7 @@ static av_cold int aac_encode_end(AVCodecContext *avctx) AVCodec aac_encoder = { "aac", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC, sizeof(AACEncContext), aac_encode_init, diff --git a/libavcodec/aasc.c b/libavcodec/aasc.c index 46f64f7e9e..c5e8fd0894 100644 --- a/libavcodec/aasc.c +++ b/libavcodec/aasc.c @@ -111,7 +111,7 @@ static av_cold int aasc_decode_end(AVCodecContext *avctx) AVCodec aasc_decoder = { "aasc", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_AASC, sizeof(AascContext), aasc_decode_init, diff --git a/libavcodec/ac3dec.c b/libavcodec/ac3dec.c index 1656a4c540..9b1aeeceaa 100644 --- a/libavcodec/ac3dec.c +++ b/libavcodec/ac3dec.c @@ -1439,7 +1439,7 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx) AVCodec ac3_decoder = { .name = "ac3", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_AC3, .priv_data_size = sizeof (AC3DecodeContext), .init = ac3_decode_init, @@ -1451,7 +1451,7 @@ AVCodec ac3_decoder = { #if CONFIG_EAC3_DECODER AVCodec eac3_decoder = { .name = "eac3", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_EAC3, .priv_data_size = sizeof (AC3DecodeContext), .init = ac3_decode_init, diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c index 6f8fe009af..9ff309e7bd 100644 --- a/libavcodec/ac3enc.c +++ b/libavcodec/ac3enc.c @@ -1393,7 +1393,7 @@ void test_ac3(void) AVCodec ac3_encoder = { "ac3", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3, sizeof(AC3EncodeContext), AC3_encode_init, diff --git a/libavcodec/adpcm.c b/libavcodec/adpcm.c index 6abe18495c..e1234fc1c7 100644 --- a/libavcodec/adpcm.c +++ b/libavcodec/adpcm.c @@ -1638,7 +1638,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, #define ADPCM_ENCODER(id,name,long_name_) \ AVCodec name ## _encoder = { \ #name, \ - CODEC_TYPE_AUDIO, \ + AVMEDIA_TYPE_AUDIO, \ id, \ sizeof(ADPCMContext), \ adpcm_encode_init, \ @@ -1656,7 +1656,7 @@ AVCodec name ## _encoder = { \ #define ADPCM_DECODER(id,name,long_name_) \ AVCodec name ## _decoder = { \ #name, \ - CODEC_TYPE_AUDIO, \ + AVMEDIA_TYPE_AUDIO, \ id, \ sizeof(ADPCMContext), \ adpcm_decode_init, \ diff --git a/libavcodec/adxdec.c b/libavcodec/adxdec.c index 94ee793cfa..9828b1beff 100644 --- a/libavcodec/adxdec.c +++ b/libavcodec/adxdec.c @@ -168,7 +168,7 @@ static int adx_decode_frame(AVCodecContext *avctx, AVCodec adpcm_adx_decoder = { "adpcm_adx", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_ADPCM_ADX, sizeof(ADXContext), adx_decode_init, diff --git a/libavcodec/adxenc.c b/libavcodec/adxenc.c index 04e9b789b5..833dde8bd3 100644 --- a/libavcodec/adxenc.c +++ b/libavcodec/adxenc.c @@ -185,7 +185,7 @@ static int adx_encode_frame(AVCodecContext *avctx, AVCodec adpcm_adx_encoder = { "adpcm_adx", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_ADPCM_ADX, sizeof(ADXContext), adx_encode_init, diff --git a/libavcodec/alac.c b/libavcodec/alac.c index 959bc6208a..b896e32bb9 100644 --- a/libavcodec/alac.c +++ b/libavcodec/alac.c @@ -701,7 +701,7 @@ static av_cold int alac_decode_close(AVCodecContext *avctx) AVCodec alac_decoder = { "alac", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_ALAC, sizeof(ALACContext), alac_decode_init, diff --git a/libavcodec/alacenc.c b/libavcodec/alacenc.c index 70b3b0f2b1..90c27884db 100644 --- a/libavcodec/alacenc.c +++ b/libavcodec/alacenc.c @@ -521,7 +521,7 @@ static av_cold int alac_encode_close(AVCodecContext *avctx) AVCodec alac_encoder = { "alac", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_ALAC, sizeof(AlacEncodeContext), alac_encode_init, diff --git a/libavcodec/alsdec.c b/libavcodec/alsdec.c index c39fced3a1..5050d0bcc9 100644 --- a/libavcodec/alsdec.c +++ b/libavcodec/alsdec.c @@ -1622,7 +1622,7 @@ static av_cold void flush(AVCodecContext *avctx) AVCodec als_decoder = { "als", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MP4ALS, sizeof(ALSDecContext), decode_init, diff --git a/libavcodec/amrnbdec.c b/libavcodec/amrnbdec.c index e5a82b493a..653a03e927 100644 --- a/libavcodec/amrnbdec.c +++ b/libavcodec/amrnbdec.c @@ -1071,7 +1071,7 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVCodec amrnb_decoder = { .name = "amrnb", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_AMR_NB, .priv_data_size = sizeof(AMRContext), .init = amrnb_decode_init, diff --git a/libavcodec/anm.c b/libavcodec/anm.c index 963f077194..bccffabad4 100644 --- a/libavcodec/anm.c +++ b/libavcodec/anm.c @@ -185,7 +185,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec anm_decoder = { "anm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ANM, sizeof(AnmContext), decode_init, diff --git a/libavcodec/apedec.c b/libavcodec/apedec.c index f7b6e07d6d..9930e2139c 100644 --- a/libavcodec/apedec.c +++ b/libavcodec/apedec.c @@ -879,7 +879,7 @@ static int ape_decode_frame(AVCodecContext * avctx, AVCodec ape_decoder = { "ape", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_APE, sizeof(APEContext), ape_decode_init, diff --git a/libavcodec/asv1.c b/libavcodec/asv1.c index 078fc656f6..978e6b68d9 100644 --- a/libavcodec/asv1.c +++ b/libavcodec/asv1.c @@ -615,7 +615,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec asv1_decoder = { "asv1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ASV1, sizeof(ASV1Context), decode_init, @@ -628,7 +628,7 @@ AVCodec asv1_decoder = { AVCodec asv2_decoder = { "asv2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ASV2, sizeof(ASV1Context), decode_init, @@ -642,7 +642,7 @@ AVCodec asv2_decoder = { #if CONFIG_ASV1_ENCODER AVCodec asv1_encoder = { "asv1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ASV1, sizeof(ASV1Context), encode_init, @@ -656,7 +656,7 @@ AVCodec asv1_encoder = { #if CONFIG_ASV2_ENCODER AVCodec asv2_encoder = { "asv2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ASV2, sizeof(ASV1Context), encode_init, diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c index 4954dd8bb5..202ed8f5ea 100644 --- a/libavcodec/atrac1.c +++ b/libavcodec/atrac1.c @@ -372,7 +372,7 @@ static av_cold int atrac1_decode_end(AVCodecContext * avctx) { AVCodec atrac1_decoder = { .name = "atrac1", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_ATRAC1, .priv_data_size = sizeof(AT1Ctx), .init = atrac1_decode_init, diff --git a/libavcodec/atrac3.c b/libavcodec/atrac3.c index dd69e4d87b..aa5a7536a9 100644 --- a/libavcodec/atrac3.c +++ b/libavcodec/atrac3.c @@ -1016,7 +1016,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) AVCodec atrac3_decoder = { .name = "atrac3", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_ATRAC3, .priv_data_size = sizeof(ATRAC3Context), .init = atrac3_decode_init, diff --git a/libavcodec/aura.c b/libavcodec/aura.c index f783010223..dd22328a01 100644 --- a/libavcodec/aura.c +++ b/libavcodec/aura.c @@ -124,7 +124,7 @@ static av_cold int aura_decode_end(AVCodecContext *avctx) AVCodec aura2_decoder = { "aura2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_AURA2, sizeof(AuraDecodeContext), aura_decode_init, diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h index 5a461c623c..2fb4fd49df 100644 --- a/libavcodec/avcodec.h +++ b/libavcodec/avcodec.h @@ -30,7 +30,7 @@ #include "libavutil/avutil.h" #define LIBAVCODEC_VERSION_MAJOR 52 -#define LIBAVCODEC_VERSION_MINOR 63 +#define LIBAVCODEC_VERSION_MINOR 64 #define LIBAVCODEC_VERSION_MICRO 0 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ @@ -355,16 +355,28 @@ enum CodecID { * stream (only used by libavformat) */ }; -enum CodecType { - CODEC_TYPE_UNKNOWN = -1, - CODEC_TYPE_VIDEO, - CODEC_TYPE_AUDIO, - CODEC_TYPE_DATA, - CODEC_TYPE_SUBTITLE, - CODEC_TYPE_ATTACHMENT, - CODEC_TYPE_NB +enum AVMediaType { + AVMEDIA_TYPE_UNKNOWN = -1, + AVMEDIA_TYPE_VIDEO, + AVMEDIA_TYPE_AUDIO, + AVMEDIA_TYPE_DATA, + AVMEDIA_TYPE_SUBTITLE, + AVMEDIA_TYPE_ATTACHMENT, + AVMEDIA_TYPE_NB }; +#if LIBAVCODEC_VERSION_MAJOR < 53 +#define CodecType AVMediaType + +#define CODEC_TYPE_UNKNOWN AVMEDIA_TYPE_UNKNOWN +#define CODEC_TYPE_VIDEO AVMEDIA_TYPE_VIDEO +#define CODEC_TYPE_AUDIO AVMEDIA_TYPE_AUDIO +#define CODEC_TYPE_DATA AVMEDIA_TYPE_DATA +#define CODEC_TYPE_SUBTITLE AVMEDIA_TYPE_SUBTITLE +#define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT +#define CODEC_TYPE_NB AVMEDIA_TYPE_NB +#endif + /** * all in native-endian format */ @@ -1277,7 +1289,7 @@ typedef struct AVCodecContext { void *opaque; char codec_name[32]; - enum CodecType codec_type; /* see CODEC_TYPE_xxx */ + enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ enum CodecID codec_id; /* see CODEC_ID_xxx */ /** @@ -2657,7 +2669,7 @@ typedef struct AVCodec { * This is the primary way to find a codec from the user perspective. */ const char *name; - enum CodecType type; + enum AVMediaType type; enum CodecID id; int priv_data_size; int (*init)(AVCodecContext *); @@ -2701,9 +2713,9 @@ typedef struct AVHWAccel { /** * Type of codec implemented by the hardware accelerator. * - * See CODEC_TYPE_xxx + * See AVMEDIA_TYPE_xxx */ - enum CodecType type; + enum AVMediaType type; /** * Codec implemented by the hardware accelerator. @@ -3241,7 +3253,7 @@ void avcodec_get_context_defaults(AVCodecContext *s); /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! * we WILL change its arguments and name a few times! */ -void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType); +void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType); /** * Allocates an AVCodecContext and sets its fields to default values. The @@ -3254,7 +3266,7 @@ AVCodecContext *avcodec_alloc_context(void); /** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! * we WILL change its arguments and name a few times! */ -AVCodecContext *avcodec_alloc_context2(enum CodecType); +AVCodecContext *avcodec_alloc_context2(enum AVMediaType); /** * Sets the fields of the given AVFrame to default values. diff --git a/libavcodec/avs.c b/libavcodec/avs.c index a53a068c15..f65a25a8e3 100644 --- a/libavcodec/avs.c +++ b/libavcodec/avs.c @@ -152,7 +152,7 @@ static av_cold int avs_decode_init(AVCodecContext * avctx) AVCodec avs_decoder = { "avs", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_AVS, sizeof(AvsContext), avs_decode_init, diff --git a/libavcodec/bethsoftvideo.c b/libavcodec/bethsoftvideo.c index 6b4a5acabd..4ed48c2a1a 100644 --- a/libavcodec/bethsoftvideo.c +++ b/libavcodec/bethsoftvideo.c @@ -132,7 +132,7 @@ static av_cold int bethsoftvid_decode_end(AVCodecContext *avctx) AVCodec bethsoftvid_decoder = { .name = "bethsoftvid", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_BETHSOFTVID, .priv_data_size = sizeof(BethsoftvidContext), .init = bethsoftvid_decode_init, diff --git a/libavcodec/bfi.c b/libavcodec/bfi.c index 31b914927e..2581b377a4 100644 --- a/libavcodec/bfi.c +++ b/libavcodec/bfi.c @@ -173,7 +173,7 @@ static av_cold int bfi_decode_close(AVCodecContext * avctx) AVCodec bfi_decoder = { .name = "bfi", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_BFI, .priv_data_size = sizeof(BFIContext), .init = bfi_decode_init, diff --git a/libavcodec/bink.c b/libavcodec/bink.c index f7b17b144f..a988a34933 100644 --- a/libavcodec/bink.c +++ b/libavcodec/bink.c @@ -1001,7 +1001,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec bink_decoder = { "binkvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_BINKVIDEO, sizeof(BinkContext), decode_init, diff --git a/libavcodec/binkaudio.c b/libavcodec/binkaudio.c index 5fbc2de6d6..ff2906077a 100644 --- a/libavcodec/binkaudio.c +++ b/libavcodec/binkaudio.c @@ -288,7 +288,7 @@ static int decode_frame(AVCodecContext *avctx, AVCodec binkaudio_rdft_decoder = { "binkaudio_rdft", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_BINKAUDIO_RDFT, sizeof(BinkAudioContext), decode_init, @@ -300,7 +300,7 @@ AVCodec binkaudio_rdft_decoder = { AVCodec binkaudio_dct_decoder = { "binkaudio_dct", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_BINKAUDIO_DCT, sizeof(BinkAudioContext), decode_init, diff --git a/libavcodec/bmp.c b/libavcodec/bmp.c index 43e7f2f91b..da7bb787d0 100644 --- a/libavcodec/bmp.c +++ b/libavcodec/bmp.c @@ -337,7 +337,7 @@ static av_cold int bmp_decode_end(AVCodecContext *avctx) AVCodec bmp_decoder = { "bmp", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_BMP, sizeof(BMPContext), bmp_decode_init, diff --git a/libavcodec/bmpenc.c b/libavcodec/bmpenc.c index edb4dadf1f..ee85f3cfae 100644 --- a/libavcodec/bmpenc.c +++ b/libavcodec/bmpenc.c @@ -133,7 +133,7 @@ static int bmp_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_s AVCodec bmp_encoder = { "bmp", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_BMP, sizeof(BMPContext), bmp_encode_init, diff --git a/libavcodec/c93.c b/libavcodec/c93.c index 0e362cad98..d713ff8e26 100644 --- a/libavcodec/c93.c +++ b/libavcodec/c93.c @@ -244,7 +244,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, AVCodec c93_decoder = { "c93", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_C93, sizeof(C93DecoderContext), decode_init, diff --git a/libavcodec/cavsdec.c b/libavcodec/cavsdec.c index 5929c8e2fb..b4ae451ed6 100644 --- a/libavcodec/cavsdec.c +++ b/libavcodec/cavsdec.c @@ -711,7 +711,7 @@ static int cavs_decode_frame(AVCodecContext * avctx,void *data, int *data_size, AVCodec cavs_decoder = { "cavs", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_CAVS, sizeof(AVSContext), ff_cavs_init, diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c index 8f04e01297..5ad6e51c1c 100644 --- a/libavcodec/cdgraphics.c +++ b/libavcodec/cdgraphics.c @@ -369,7 +369,7 @@ static av_cold int cdg_decode_end(AVCodecContext *avctx) AVCodec cdgraphics_decoder = { "cdgraphics", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_CDGRAPHICS, sizeof(CDGraphicsContext), cdg_decode_init, diff --git a/libavcodec/cinepak.c b/libavcodec/cinepak.c index 45ca1a93e3..90c2a6410d 100644 --- a/libavcodec/cinepak.c +++ b/libavcodec/cinepak.c @@ -457,7 +457,7 @@ static av_cold int cinepak_decode_end(AVCodecContext *avctx) AVCodec cinepak_decoder = { "cinepak", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_CINEPAK, sizeof(CinepakContext), cinepak_decode_init, diff --git a/libavcodec/cljr.c b/libavcodec/cljr.c index 2164bf20f4..b7c3443675 100644 --- a/libavcodec/cljr.c +++ b/libavcodec/cljr.c @@ -137,7 +137,7 @@ static av_cold int encode_init(AVCodecContext *avctx){ AVCodec cljr_decoder = { "cljr", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_CLJR, sizeof(CLJRContext), decode_init, @@ -151,7 +151,7 @@ AVCodec cljr_decoder = { #if CONFIG_CLJR_ENCODER AVCodec cljr_encoder = { "cljr", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_CLJR, sizeof(CLJRContext), encode_init, diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 4948acfb89..f7efe9e60c 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1288,7 +1288,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) AVCodec cook_decoder = { .name = "cook", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_COOK, .priv_data_size = sizeof(COOKContext), .init = cook_decode_init, diff --git a/libavcodec/cscd.c b/libavcodec/cscd.c index 45edca382c..e4f4b8f825 100644 --- a/libavcodec/cscd.c +++ b/libavcodec/cscd.c @@ -249,7 +249,7 @@ static av_cold int decode_end(AVCodecContext *avctx) { AVCodec cscd_decoder = { "camstudio", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_CSCD, sizeof(CamStudioContext), decode_init, diff --git a/libavcodec/cyuv.c b/libavcodec/cyuv.c index c947165478..cfc7000897 100644 --- a/libavcodec/cyuv.c +++ b/libavcodec/cyuv.c @@ -180,7 +180,7 @@ static av_cold int cyuv_decode_end(AVCodecContext *avctx) #if CONFIG_AURA_DECODER AVCodec aura_decoder = { "aura", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_AURA, sizeof(CyuvDecodeContext), cyuv_decode_init, @@ -196,7 +196,7 @@ AVCodec aura_decoder = { #if CONFIG_CYUV_DECODER AVCodec cyuv_decoder = { "cyuv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_CYUV, sizeof(CyuvDecodeContext), cyuv_decode_init, diff --git a/libavcodec/dca.c b/libavcodec/dca.c index dfa8945e3d..18074cf404 100644 --- a/libavcodec/dca.c +++ b/libavcodec/dca.c @@ -1330,7 +1330,7 @@ static av_cold int dca_decode_end(AVCodecContext * avctx) AVCodec dca_decoder = { .name = "dca", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_DTS, .priv_data_size = sizeof(DCAContext), .init = dca_decode_init, diff --git a/libavcodec/dnxhddec.c b/libavcodec/dnxhddec.c index f78cb0d7db..8b7c343d09 100644 --- a/libavcodec/dnxhddec.c +++ b/libavcodec/dnxhddec.c @@ -346,7 +346,7 @@ static av_cold int dnxhd_decode_close(AVCodecContext *avctx) AVCodec dnxhd_decoder = { "dnxhd", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DNXHD, sizeof(DNXHDContext), dnxhd_decode_init, diff --git a/libavcodec/dnxhdenc.c b/libavcodec/dnxhdenc.c index 5c986452e3..6b089299e9 100644 --- a/libavcodec/dnxhdenc.c +++ b/libavcodec/dnxhdenc.c @@ -850,7 +850,7 @@ static int dnxhd_encode_end(AVCodecContext *avctx) AVCodec dnxhd_encoder = { "dnxhd", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DNXHD, sizeof(DNXHDEncContext), dnxhd_encode_init, diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c index 69c7002ad7..7c5351686e 100644 --- a/libavcodec/dpcm.c +++ b/libavcodec/dpcm.c @@ -301,7 +301,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, #define DPCM_DECODER(id, name, long_name_) \ AVCodec name ## _decoder = { \ #name, \ - CODEC_TYPE_AUDIO, \ + AVMEDIA_TYPE_AUDIO, \ id, \ sizeof(DPCMContext), \ dpcm_decode_init, \ diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index ec0f435610..94a91816c5 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -216,7 +216,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec dpx_decoder = { "dpx", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DPX, sizeof(DPXContext), decode_init, diff --git a/libavcodec/dsicinav.c b/libavcodec/dsicinav.c index 6e5ff12446..03ea3c9e54 100644 --- a/libavcodec/dsicinav.c +++ b/libavcodec/dsicinav.c @@ -345,7 +345,7 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, AVCodec dsicinvideo_decoder = { "dsicinvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DSICINVIDEO, sizeof(CinVideoContext), cinvideo_decode_init, @@ -358,7 +358,7 @@ AVCodec dsicinvideo_decoder = { AVCodec dsicinaudio_decoder = { "dsicinaudio", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_DSICINAUDIO, sizeof(CinAudioContext), cinaudio_decode_init, diff --git a/libavcodec/dv.c b/libavcodec/dv.c index e3b1064a95..182fe29d38 100644 --- a/libavcodec/dv.c +++ b/libavcodec/dv.c @@ -1282,7 +1282,7 @@ static int dvvideo_close(AVCodecContext *c) #if CONFIG_DVVIDEO_ENCODER AVCodec dvvideo_encoder = { "dvvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DVVIDEO, sizeof(DVVideoContext), dvvideo_init_encoder, @@ -1295,7 +1295,7 @@ AVCodec dvvideo_encoder = { #if CONFIG_DVVIDEO_DECODER AVCodec dvvideo_decoder = { "dvvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DVVIDEO, sizeof(DVVideoContext), dvvideo_init, diff --git a/libavcodec/dvbsub.c b/libavcodec/dvbsub.c index 3788d55933..0f098266d8 100644 --- a/libavcodec/dvbsub.c +++ b/libavcodec/dvbsub.c @@ -404,7 +404,7 @@ static int dvbsub_encode(AVCodecContext *avctx, AVCodec dvbsub_encoder = { "dvbsub", - CODEC_TYPE_SUBTITLE, + AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE, sizeof(DVBSubtitleContext), NULL, diff --git a/libavcodec/dvbsubdec.c b/libavcodec/dvbsubdec.c index b810ef9e49..54c74b5b41 100644 --- a/libavcodec/dvbsubdec.c +++ b/libavcodec/dvbsubdec.c @@ -1413,7 +1413,7 @@ static int dvbsub_decode(AVCodecContext *avctx, AVCodec dvbsub_decoder = { "dvbsub", - CODEC_TYPE_SUBTITLE, + AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE, sizeof(DVBSubContext), dvbsub_init_decoder, diff --git a/libavcodec/dvdsubdec.c b/libavcodec/dvdsubdec.c index 142241217c..75b52566d3 100644 --- a/libavcodec/dvdsubdec.c +++ b/libavcodec/dvdsubdec.c @@ -488,7 +488,7 @@ static int dvdsub_decode(AVCodecContext *avctx, AVCodec dvdsub_decoder = { "dvdsub", - CODEC_TYPE_SUBTITLE, + AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVD_SUBTITLE, 0, NULL, diff --git a/libavcodec/dvdsubenc.c b/libavcodec/dvdsubenc.c index 4dc58e7bde..4ee0f37c9d 100644 --- a/libavcodec/dvdsubenc.c +++ b/libavcodec/dvdsubenc.c @@ -217,7 +217,7 @@ static int dvdsub_encode(AVCodecContext *avctx, AVCodec dvdsub_encoder = { "dvdsub", - CODEC_TYPE_SUBTITLE, + AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVD_SUBTITLE, 0, NULL, diff --git a/libavcodec/dxa.c b/libavcodec/dxa.c index c06ab85cc7..97420c13e8 100644 --- a/libavcodec/dxa.c +++ b/libavcodec/dxa.c @@ -319,7 +319,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec dxa_decoder = { "dxa", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DXA, sizeof(DxaDecContext), decode_init, diff --git a/libavcodec/dxva2_h264.c b/libavcodec/dxva2_h264.c index 9262bb8957..22c76df601 100644 --- a/libavcodec/dxva2_h264.c +++ b/libavcodec/dxva2_h264.c @@ -425,7 +425,7 @@ static int end_frame(AVCodecContext *avctx) AVHWAccel h264_dxva2_hwaccel = { .name = "h264_dxva2", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H264, .pix_fmt = PIX_FMT_DXVA2_VLD, .capabilities = 0, diff --git a/libavcodec/dxva2_vc1.c b/libavcodec/dxva2_vc1.c index 95a55849be..a11121347a 100644 --- a/libavcodec/dxva2_vc1.c +++ b/libavcodec/dxva2_vc1.c @@ -266,7 +266,7 @@ static int end_frame(AVCodecContext *avctx) #if CONFIG_WMV3_DXVA2_HWACCEL AVHWAccel wmv3_dxva2_hwaccel = { .name = "wmv3_dxva2", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_WMV3, .pix_fmt = PIX_FMT_DXVA2_VLD, .capabilities = 0, @@ -279,7 +279,7 @@ AVHWAccel wmv3_dxva2_hwaccel = { AVHWAccel vc1_dxva2_hwaccel = { .name = "vc1_dxva2", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_VC1, .pix_fmt = PIX_FMT_DXVA2_VLD, .capabilities = 0, diff --git a/libavcodec/eacmv.c b/libavcodec/eacmv.c index 30eaf3cfd2..a39705de87 100644 --- a/libavcodec/eacmv.c +++ b/libavcodec/eacmv.c @@ -205,7 +205,7 @@ static av_cold int cmv_decode_end(AVCodecContext *avctx){ AVCodec eacmv_decoder = { "eacmv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_CMV, sizeof(CmvContext), cmv_decode_init, diff --git a/libavcodec/eamad.c b/libavcodec/eamad.c index 2e9fa8b452..91f5ec0c6f 100644 --- a/libavcodec/eamad.c +++ b/libavcodec/eamad.c @@ -307,7 +307,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec eamad_decoder = { "eamad", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MAD, sizeof(MadContext), decode_init, diff --git a/libavcodec/eatgq.c b/libavcodec/eatgq.c index e5c39912c7..1a28e09d2d 100644 --- a/libavcodec/eatgq.c +++ b/libavcodec/eatgq.c @@ -245,7 +245,7 @@ static av_cold int tgq_decode_end(AVCodecContext *avctx){ AVCodec eatgq_decoder = { "eatgq", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TGQ, sizeof(TgqContext), tgq_decode_init, diff --git a/libavcodec/eatgv.c b/libavcodec/eatgv.c index 5eb31b7fc8..ce0be4bae7 100644 --- a/libavcodec/eatgv.c +++ b/libavcodec/eatgv.c @@ -335,7 +335,7 @@ static av_cold int tgv_decode_end(AVCodecContext *avctx) AVCodec eatgv_decoder = { "eatgv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TGV, sizeof(TgvContext), tgv_decode_init, diff --git a/libavcodec/eatqi.c b/libavcodec/eatqi.c index e917be9fe8..bedfaadc15 100644 --- a/libavcodec/eatqi.c +++ b/libavcodec/eatqi.c @@ -156,7 +156,7 @@ static av_cold int tqi_decode_end(AVCodecContext *avctx) AVCodec eatqi_decoder = { "eatqi", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TQI, sizeof(TqiContext), tqi_decode_init, diff --git a/libavcodec/escape124.c b/libavcodec/escape124.c index 80b1484b75..b51206a0b5 100644 --- a/libavcodec/escape124.c +++ b/libavcodec/escape124.c @@ -374,7 +374,7 @@ static int escape124_decode_frame(AVCodecContext *avctx, AVCodec escape124_decoder = { "escape124", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ESCAPE124, sizeof(Escape124Context), escape124_decode_init, diff --git a/libavcodec/ffv1.c b/libavcodec/ffv1.c index e3b71f7bb1..5566b0a7cd 100644 --- a/libavcodec/ffv1.c +++ b/libavcodec/ffv1.c @@ -1125,7 +1125,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac AVCodec ffv1_decoder = { "ffv1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FFV1, sizeof(FFV1Context), decode_init, @@ -1140,7 +1140,7 @@ AVCodec ffv1_decoder = { #if CONFIG_FFV1_ENCODER AVCodec ffv1_encoder = { "ffv1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FFV1, sizeof(FFV1Context), encode_init, diff --git a/libavcodec/flacdec.c b/libavcodec/flacdec.c index 0ebc23d6cf..89b09e8720 100644 --- a/libavcodec/flacdec.c +++ b/libavcodec/flacdec.c @@ -799,7 +799,7 @@ static void flac_flush(AVCodecContext *avctx) AVCodec flac_decoder = { "flac", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_FLAC, sizeof(FLACContext), flac_decode_init, diff --git a/libavcodec/flacenc.c b/libavcodec/flacenc.c index c1f862a684..33d8133a37 100644 --- a/libavcodec/flacenc.c +++ b/libavcodec/flacenc.c @@ -1253,7 +1253,7 @@ static av_cold int flac_encode_close(AVCodecContext *avctx) AVCodec flac_encoder = { "flac", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_FLAC, sizeof(FlacEncodeContext), flac_encode_init, diff --git a/libavcodec/flashsv.c b/libavcodec/flashsv.c index b2bdffe7c9..9d581c7099 100644 --- a/libavcodec/flashsv.c +++ b/libavcodec/flashsv.c @@ -252,7 +252,7 @@ static av_cold int flashsv_decode_end(AVCodecContext *avctx) AVCodec flashsv_decoder = { "flashsv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FLASHSV, sizeof(FlashSVContext), flashsv_decode_init, diff --git a/libavcodec/flashsvenc.c b/libavcodec/flashsvenc.c index 4d2b47979f..852b344396 100644 --- a/libavcodec/flashsvenc.c +++ b/libavcodec/flashsvenc.c @@ -282,7 +282,7 @@ static av_cold int flashsv_encode_end(AVCodecContext *avctx) AVCodec flashsv_encoder = { "flashsv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FLASHSV, sizeof(FlashSVContext), flashsv_encode_init, diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c index 2ee7837f60..e2bb0e90ec 100644 --- a/libavcodec/flicvideo.c +++ b/libavcodec/flicvideo.c @@ -739,7 +739,7 @@ static av_cold int flic_decode_end(AVCodecContext *avctx) AVCodec flic_decoder = { "flic", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FLIC, sizeof(FlicDecodeContext), flic_decode_init, diff --git a/libavcodec/flvdec.c b/libavcodec/flvdec.c index 50f7b25191..cf9661ce1c 100644 --- a/libavcodec/flvdec.c +++ b/libavcodec/flvdec.c @@ -119,7 +119,7 @@ int ff_flv_decode_picture_header(MpegEncContext *s) AVCodec flv_decoder = { "flv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FLV1, sizeof(MpegEncContext), ff_h263_decode_init, diff --git a/libavcodec/flvenc.c b/libavcodec/flvenc.c index 80dd46b60d..bf320f2ffe 100644 --- a/libavcodec/flvenc.c +++ b/libavcodec/flvenc.c @@ -86,7 +86,7 @@ void ff_flv2_encode_ac_esc(PutBitContext *pb, int slevel, int level, int run, in AVCodec flv_encoder = { "flv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FLV1, sizeof(MpegEncContext), MPV_encode_init, diff --git a/libavcodec/fraps.c b/libavcodec/fraps.c index da1bf0dd72..4e85f6106a 100644 --- a/libavcodec/fraps.c +++ b/libavcodec/fraps.c @@ -366,7 +366,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec fraps_decoder = { "fraps", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FRAPS, sizeof(FrapsContext), decode_init, diff --git a/libavcodec/frwu.c b/libavcodec/frwu.c index 28ed612df0..b685248b5f 100644 --- a/libavcodec/frwu.c +++ b/libavcodec/frwu.c @@ -111,7 +111,7 @@ static av_cold int decode_close(AVCodecContext *avctx) AVCodec frwu_decoder = { "FRWU", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FRWU, 0, decode_init, diff --git a/libavcodec/g726.c b/libavcodec/g726.c index a4b2099832..5e0051171b 100644 --- a/libavcodec/g726.c +++ b/libavcodec/g726.c @@ -387,7 +387,7 @@ static int g726_decode_frame(AVCodecContext *avctx, #if CONFIG_ADPCM_G726_ENCODER AVCodec adpcm_g726_encoder = { "g726", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_ADPCM_G726, sizeof(G726Context), g726_init, @@ -401,7 +401,7 @@ AVCodec adpcm_g726_encoder = { AVCodec adpcm_g726_decoder = { "g726", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_ADPCM_G726, sizeof(G726Context), g726_init, diff --git a/libavcodec/g729dec.c b/libavcodec/g729dec.c index be243606cf..3a6fb0fb7a 100644 --- a/libavcodec/g729dec.c +++ b/libavcodec/g729dec.c @@ -315,7 +315,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVCodec g729_decoder = { "g729", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_G729, sizeof(G729Context), decoder_init, diff --git a/libavcodec/gif.c b/libavcodec/gif.c index 8c7f72ba80..c04f8bbc1d 100644 --- a/libavcodec/gif.c +++ b/libavcodec/gif.c @@ -168,7 +168,7 @@ static int gif_encode_close(AVCodecContext *avctx) AVCodec gif_encoder = { "gif", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_GIF, sizeof(GIFContext), gif_encode_init, diff --git a/libavcodec/gifdec.c b/libavcodec/gifdec.c index 70da4e2a57..1daf1b7b1a 100644 --- a/libavcodec/gifdec.c +++ b/libavcodec/gifdec.c @@ -328,7 +328,7 @@ static av_cold int gif_decode_close(AVCodecContext *avctx) AVCodec gif_decoder = { "gif", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_GIF, sizeof(GifState), gif_decode_init, diff --git a/libavcodec/h261dec.c b/libavcodec/h261dec.c index ab266a0f6c..328e959637 100644 --- a/libavcodec/h261dec.c +++ b/libavcodec/h261dec.c @@ -643,7 +643,7 @@ static av_cold int h261_decode_end(AVCodecContext *avctx) AVCodec h261_decoder = { "h261", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_H261, sizeof(H261Context), h261_decode_init, diff --git a/libavcodec/h261enc.c b/libavcodec/h261enc.c index 68d60f872d..9538567999 100644 --- a/libavcodec/h261enc.c +++ b/libavcodec/h261enc.c @@ -323,7 +323,7 @@ static void h261_encode_block(H261Context * h, DCTELEM * block, int n){ AVCodec h261_encoder = { "h261", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_H261, sizeof(H261Context), MPV_encode_init, diff --git a/libavcodec/h263dec.c b/libavcodec/h263dec.c index e690583010..f85f15abe3 100644 --- a/libavcodec/h263dec.c +++ b/libavcodec/h263dec.c @@ -727,7 +727,7 @@ av_log(avctx, AV_LOG_DEBUG, "%"PRId64"\n", rdtsc()-time); AVCodec h263_decoder = { "h263", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_H263, sizeof(MpegEncContext), ff_h263_decode_init, diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 16ece73693..62c74a3325 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -3148,7 +3148,7 @@ av_cold int ff_h264_decode_end(AVCodecContext *avctx) AVCodec h264_decoder = { "h264", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_H264, sizeof(H264Context), ff_h264_decode_init, @@ -3164,7 +3164,7 @@ AVCodec h264_decoder = { #if CONFIG_H264_VDPAU_DECODER AVCodec h264_vdpau_decoder = { "h264_vdpau", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_H264, sizeof(H264Context), ff_h264_decode_init, diff --git a/libavcodec/huffyuv.c b/libavcodec/huffyuv.c index 3b56bb3869..1a55abbe4c 100644 --- a/libavcodec/huffyuv.c +++ b/libavcodec/huffyuv.c @@ -1414,7 +1414,7 @@ static av_cold int encode_end(AVCodecContext *avctx) #if CONFIG_HUFFYUV_DECODER AVCodec huffyuv_decoder = { "huffyuv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_HUFFYUV, sizeof(HYuvContext), decode_init, @@ -1430,7 +1430,7 @@ AVCodec huffyuv_decoder = { #if CONFIG_FFVHUFF_DECODER AVCodec ffvhuff_decoder = { "ffvhuff", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FFVHUFF, sizeof(HYuvContext), decode_init, @@ -1446,7 +1446,7 @@ AVCodec ffvhuff_decoder = { #if CONFIG_HUFFYUV_ENCODER AVCodec huffyuv_encoder = { "huffyuv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_HUFFYUV, sizeof(HYuvContext), encode_init, @@ -1460,7 +1460,7 @@ AVCodec huffyuv_encoder = { #if CONFIG_FFVHUFF_ENCODER AVCodec ffvhuff_encoder = { "ffvhuff", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_FFVHUFF, sizeof(HYuvContext), encode_init, diff --git a/libavcodec/idcinvideo.c b/libavcodec/idcinvideo.c index 7ce9c42a39..7cb887c8eb 100644 --- a/libavcodec/idcinvideo.c +++ b/libavcodec/idcinvideo.c @@ -255,7 +255,7 @@ static av_cold int idcin_decode_end(AVCodecContext *avctx) AVCodec idcin_decoder = { "idcinvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_IDCIN, sizeof(IdcinContext), idcin_decode_init, diff --git a/libavcodec/iff.c b/libavcodec/iff.c index 19671d767f..a5d8c93e78 100644 --- a/libavcodec/iff.c +++ b/libavcodec/iff.c @@ -218,7 +218,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec iff_ilbm_decoder = { "iff_ilbm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_IFF_ILBM, sizeof(IffContext), decode_init, @@ -231,7 +231,7 @@ AVCodec iff_ilbm_decoder = { AVCodec iff_byterun1_decoder = { "iff_byterun1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_IFF_BYTERUN1, sizeof(IffContext), decode_init, diff --git a/libavcodec/imc.c b/libavcodec/imc.c index c8bf3367ac..4dd73b6a4c 100644 --- a/libavcodec/imc.c +++ b/libavcodec/imc.c @@ -823,7 +823,7 @@ static av_cold int imc_decode_close(AVCodecContext * avctx) AVCodec imc_decoder = { .name = "imc", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_IMC, .priv_data_size = sizeof(IMCContext), .init = imc_decode_init, diff --git a/libavcodec/indeo2.c b/libavcodec/indeo2.c index 6755014110..f210a4bf09 100644 --- a/libavcodec/indeo2.c +++ b/libavcodec/indeo2.c @@ -226,7 +226,7 @@ static av_cold int ir2_decode_end(AVCodecContext *avctx){ AVCodec indeo2_decoder = { "indeo2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_INDEO2, sizeof(Ir2Context), ir2_decode_init, diff --git a/libavcodec/indeo3.c b/libavcodec/indeo3.c index 05f79258b3..e5df32c672 100644 --- a/libavcodec/indeo3.c +++ b/libavcodec/indeo3.c @@ -1138,7 +1138,7 @@ static av_cold int indeo3_decode_end(AVCodecContext *avctx) AVCodec indeo3_decoder = { "indeo3", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_INDEO3, sizeof(Indeo3DecodeContext), indeo3_decode_init, diff --git a/libavcodec/indeo5.c b/libavcodec/indeo5.c index 9dea301d8a..eb8961cbfa 100644 --- a/libavcodec/indeo5.c +++ b/libavcodec/indeo5.c @@ -817,7 +817,7 @@ static av_cold int decode_close(AVCodecContext *avctx) AVCodec indeo5_decoder = { .name = "indeo5", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_INDEO5, .priv_data_size = sizeof(IVI5DecContext), .init = decode_init, diff --git a/libavcodec/intelh263dec.c b/libavcodec/intelh263dec.c index e522ed4ada..5e451294da 100644 --- a/libavcodec/intelh263dec.c +++ b/libavcodec/intelh263dec.c @@ -117,7 +117,7 @@ int ff_intel_h263_decode_picture_header(MpegEncContext *s) AVCodec h263i_decoder = { "h263i", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_H263I, sizeof(MpegEncContext), ff_h263_decode_init, diff --git a/libavcodec/interplayvideo.c b/libavcodec/interplayvideo.c index 8992a1de30..e1d6baf8c7 100644 --- a/libavcodec/interplayvideo.c +++ b/libavcodec/interplayvideo.c @@ -1095,7 +1095,7 @@ static av_cold int ipvideo_decode_end(AVCodecContext *avctx) AVCodec interplay_video_decoder = { "interplayvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_INTERPLAY_VIDEO, sizeof(IpvideoContext), ipvideo_decode_init, diff --git a/libavcodec/jpeglsdec.c b/libavcodec/jpeglsdec.c index bc80d13d68..0df3c4bcd8 100644 --- a/libavcodec/jpeglsdec.c +++ b/libavcodec/jpeglsdec.c @@ -365,7 +365,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor AVCodec jpegls_decoder = { "jpegls", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_JPEGLS, sizeof(MJpegDecodeContext), ff_mjpeg_decode_init, diff --git a/libavcodec/jpeglsenc.c b/libavcodec/jpeglsenc.c index ea12ddaae4..91e0f2d496 100644 --- a/libavcodec/jpeglsenc.c +++ b/libavcodec/jpeglsenc.c @@ -384,7 +384,7 @@ static av_cold int encode_init_ls(AVCodecContext *ctx) { AVCodec jpegls_encoder = { //FIXME avoid MPV_* lossless JPEG should not need them "jpegls", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_JPEGLS, sizeof(JpeglsContext), encode_init_ls, diff --git a/libavcodec/kgv1dec.c b/libavcodec/kgv1dec.c index d786578a95..f07d2367ec 100644 --- a/libavcodec/kgv1dec.c +++ b/libavcodec/kgv1dec.c @@ -165,7 +165,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec kgv1_decoder = { "kgv1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_KGV1, sizeof(KgvContext), decode_init, diff --git a/libavcodec/kmvc.c b/libavcodec/kmvc.c index f4b54a138f..48c7ca44a2 100644 --- a/libavcodec/kmvc.c +++ b/libavcodec/kmvc.c @@ -403,7 +403,7 @@ static av_cold int decode_end(AVCodecContext * avctx) AVCodec kmvc_decoder = { "kmvc", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_KMVC, sizeof(KmvcContext), decode_init, diff --git a/libavcodec/lcldec.c b/libavcodec/lcldec.c index d4fe65cceb..b6dc266b46 100644 --- a/libavcodec/lcldec.c +++ b/libavcodec/lcldec.c @@ -611,7 +611,7 @@ static av_cold int decode_end(AVCodecContext *avctx) #if CONFIG_MSZH_DECODER AVCodec mszh_decoder = { "mszh", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSZH, sizeof(LclDecContext), decode_init, @@ -626,7 +626,7 @@ AVCodec mszh_decoder = { #if CONFIG_ZLIB_DECODER AVCodec zlib_decoder = { "zlib", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ZLIB, sizeof(LclDecContext), decode_init, diff --git a/libavcodec/lclenc.c b/libavcodec/lclenc.c index 4c43916fd1..abaa86891a 100644 --- a/libavcodec/lclenc.c +++ b/libavcodec/lclenc.c @@ -180,7 +180,7 @@ static av_cold int encode_end(AVCodecContext *avctx) AVCodec zlib_encoder = { "zlib", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ZLIB, sizeof(LclEncContext), encode_init, diff --git a/libavcodec/libdiracdec.c b/libavcodec/libdiracdec.c index b403094198..273a9501f3 100644 --- a/libavcodec/libdiracdec.c +++ b/libavcodec/libdiracdec.c @@ -195,7 +195,7 @@ static void libdirac_flush(AVCodecContext *avccontext) AVCodec libdirac_decoder = { "libdirac", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC, sizeof(FfmpegDiracDecoderParams), libdirac_decode_init, diff --git a/libavcodec/libdiracenc.c b/libavcodec/libdiracenc.c index 6770eb7c3f..65b088c2b3 100644 --- a/libavcodec/libdiracenc.c +++ b/libavcodec/libdiracenc.c @@ -393,7 +393,7 @@ static av_cold int libdirac_encode_close(AVCodecContext *avccontext) AVCodec libdirac_encoder = { "libdirac", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC, sizeof(FfmpegDiracEncoderParams), libdirac_encode_init, diff --git a/libavcodec/libfaac.c b/libavcodec/libfaac.c index 18b056b04f..e8514e11b8 100644 --- a/libavcodec/libfaac.c +++ b/libavcodec/libfaac.c @@ -147,7 +147,7 @@ static av_cold int Faac_encode_close(AVCodecContext *avctx) AVCodec libfaac_encoder = { "libfaac", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC, sizeof(FaacAudioContext), Faac_encode_init, diff --git a/libavcodec/libfaad.c b/libavcodec/libfaad.c index e417467d01..eff5089db2 100644 --- a/libavcodec/libfaad.c +++ b/libavcodec/libfaad.c @@ -322,7 +322,7 @@ static av_cold int faac_decode_init(AVCodecContext *avctx) AVCodec libfaad_decoder = { "libfaad", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC, sizeof(FAACContext), faac_decode_init, diff --git a/libavcodec/libgsm.c b/libavcodec/libgsm.c index 9dfad1392c..d8122488db 100644 --- a/libavcodec/libgsm.c +++ b/libavcodec/libgsm.c @@ -114,7 +114,7 @@ static int libgsm_encode_frame(AVCodecContext *avctx, AVCodec libgsm_encoder = { "libgsm", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_GSM, 0, libgsm_init, @@ -126,7 +126,7 @@ AVCodec libgsm_encoder = { AVCodec libgsm_ms_encoder = { "libgsm_ms", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_GSM_MS, 0, libgsm_init, @@ -158,7 +158,7 @@ static int libgsm_decode_frame(AVCodecContext *avctx, AVCodec libgsm_decoder = { "libgsm", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_GSM, 0, libgsm_init, @@ -170,7 +170,7 @@ AVCodec libgsm_decoder = { AVCodec libgsm_ms_decoder = { "libgsm_ms", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_GSM_MS, 0, libgsm_init, diff --git a/libavcodec/libmp3lame.c b/libavcodec/libmp3lame.c index 62f6c02179..31190cc5d0 100644 --- a/libavcodec/libmp3lame.c +++ b/libavcodec/libmp3lame.c @@ -216,7 +216,7 @@ static av_cold int MP3lame_encode_close(AVCodecContext *avctx) AVCodec libmp3lame_encoder = { "libmp3lame", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3, sizeof(Mp3AudioContext), MP3lame_encode_init, diff --git a/libavcodec/libopencore-amr.c b/libavcodec/libopencore-amr.c index 8aee7c5817..266164514f 100644 --- a/libavcodec/libopencore-amr.c +++ b/libavcodec/libopencore-amr.c @@ -141,7 +141,7 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data, AVCodec libopencore_amrnb_decoder = { "libopencore_amrnb", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_AMR_NB, sizeof(AMRContext), amr_nb_decode_init, @@ -215,7 +215,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, AVCodec libopencore_amrnb_encoder = { "libopencore_amrnb", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_AMR_NB, sizeof(AMRContext), amr_nb_encode_init, @@ -312,7 +312,7 @@ static int amr_wb_decode_close(AVCodecContext *avctx) AVCodec libopencore_amrwb_decoder = { "libopencore_amrwb", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_AMR_WB, sizeof(AMRWBContext), amr_wb_decode_init, diff --git a/libavcodec/libopenjpeg.c b/libavcodec/libopenjpeg.c index 387ea8b5d9..86282f7163 100644 --- a/libavcodec/libopenjpeg.c +++ b/libavcodec/libopenjpeg.c @@ -185,7 +185,7 @@ static av_cold int libopenjpeg_decode_close(AVCodecContext *avctx) AVCodec libopenjpeg_decoder = { "libopenjpeg", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_JPEG2000, sizeof(LibOpenJPEGContext), libopenjpeg_decode_init, diff --git a/libavcodec/libschroedingerdec.c b/libavcodec/libschroedingerdec.c index 53ded57ba4..1e623c0ec2 100644 --- a/libavcodec/libschroedingerdec.c +++ b/libavcodec/libschroedingerdec.c @@ -347,7 +347,7 @@ static void libschroedinger_flush(AVCodecContext *avccontext) AVCodec libschroedinger_decoder = { "libschroedinger", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC, sizeof(FfmpegSchroDecoderParams), libschroedinger_decode_init, diff --git a/libavcodec/libschroedingerenc.c b/libavcodec/libschroedingerenc.c index 44d4dcd428..d4430bf3ac 100644 --- a/libavcodec/libschroedingerenc.c +++ b/libavcodec/libschroedingerenc.c @@ -407,7 +407,7 @@ static int libschroedinger_encode_close(AVCodecContext *avccontext) AVCodec libschroedinger_encoder = { "libschroedinger", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC, sizeof(FfmpegSchroEncoderParams), libschroedinger_encode_init, diff --git a/libavcodec/libspeexdec.c b/libavcodec/libspeexdec.c index 153e395eb0..c5cfbd5108 100644 --- a/libavcodec/libspeexdec.c +++ b/libavcodec/libspeexdec.c @@ -140,7 +140,7 @@ static av_cold int libspeex_decode_close(AVCodecContext *avctx) AVCodec libspeex_decoder = { "libspeex", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_SPEEX, sizeof(LibSpeexContext), libspeex_decode_init, diff --git a/libavcodec/libtheoraenc.c b/libavcodec/libtheoraenc.c index ac015ff200..0ae03bfb1c 100644 --- a/libavcodec/libtheoraenc.c +++ b/libavcodec/libtheoraenc.c @@ -361,7 +361,7 @@ static av_cold int encode_close(AVCodecContext* avc_context) /*! AVCodec struct exposed to libavcodec */ AVCodec libtheora_encoder = { .name = "libtheora", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_THEORA, .priv_data_size = sizeof(TheoraContext), .init = encode_init, diff --git a/libavcodec/libvorbis.c b/libavcodec/libvorbis.c index 530db5c14c..afa6c04693 100644 --- a/libavcodec/libvorbis.c +++ b/libavcodec/libvorbis.c @@ -217,7 +217,7 @@ static av_cold int oggvorbis_encode_close(AVCodecContext *avccontext) { AVCodec libvorbis_encoder = { "libvorbis", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_VORBIS, sizeof(OggVorbisContext), oggvorbis_encode_init, diff --git a/libavcodec/libx264.c b/libavcodec/libx264.c index a5f0a533d7..1ad270f84f 100644 --- a/libavcodec/libx264.c +++ b/libavcodec/libx264.c @@ -317,7 +317,7 @@ static av_cold int X264_init(AVCodecContext *avctx) AVCodec libx264_encoder = { .name = "libx264", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H264, .priv_data_size = sizeof(X264Context), .init = X264_init, diff --git a/libavcodec/libxvidff.c b/libavcodec/libxvidff.c index 855aba1ec5..3624770087 100644 --- a/libavcodec/libxvidff.c +++ b/libavcodec/libxvidff.c @@ -769,7 +769,7 @@ int xvid_ff_2pass(void *ref, int cmd, void *p1, void *p2) { */ AVCodec libxvid_encoder = { "libxvid", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4, sizeof(struct xvid_context), xvid_encode_init, diff --git a/libavcodec/ljpegenc.c b/libavcodec/ljpegenc.c index 566723dbc0..d529352b07 100644 --- a/libavcodec/ljpegenc.c +++ b/libavcodec/ljpegenc.c @@ -188,7 +188,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in AVCodec ljpeg_encoder = { //FIXME avoid MPV_* lossless JPEG should not need them "ljpeg", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_LJPEG, sizeof(MpegEncContext), MPV_encode_init, diff --git a/libavcodec/loco.c b/libavcodec/loco.c index 57fba82cf0..988cd0ec63 100644 --- a/libavcodec/loco.c +++ b/libavcodec/loco.c @@ -287,7 +287,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec loco_decoder = { "loco", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_LOCO, sizeof(LOCOContext), decode_init, diff --git a/libavcodec/mace.c b/libavcodec/mace.c index ae7b4dc833..95473345df 100644 --- a/libavcodec/mace.c +++ b/libavcodec/mace.c @@ -281,7 +281,7 @@ static int mace_decode_frame(AVCodecContext *avctx, AVCodec mace3_decoder = { "mace3", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MACE3, sizeof(MACEContext), mace_decode_init, @@ -293,7 +293,7 @@ AVCodec mace3_decoder = { AVCodec mace6_decoder = { "mace6", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MACE6, sizeof(MACEContext), mace_decode_init, diff --git a/libavcodec/mdec.c b/libavcodec/mdec.c index 8e737715c1..33408a6f00 100644 --- a/libavcodec/mdec.c +++ b/libavcodec/mdec.c @@ -250,7 +250,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec mdec_decoder = { "mdec", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MDEC, sizeof(MDECContext), decode_init, diff --git a/libavcodec/mimic.c b/libavcodec/mimic.c index 8cac02fe71..e5f7123e94 100644 --- a/libavcodec/mimic.c +++ b/libavcodec/mimic.c @@ -380,7 +380,7 @@ static av_cold int mimic_decode_end(AVCodecContext *avctx) AVCodec mimic_decoder = { "mimic", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MIMIC, sizeof(MimicContext), mimic_decode_init, diff --git a/libavcodec/mjpegbdec.c b/libavcodec/mjpegbdec.c index 185e7bb55c..3bea47e3c9 100644 --- a/libavcodec/mjpegbdec.c +++ b/libavcodec/mjpegbdec.c @@ -147,7 +147,7 @@ read_header: AVCodec mjpegb_decoder = { "mjpegb", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MJPEGB, sizeof(MJpegDecodeContext), ff_mjpeg_decode_init, diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index 14bd24e128..9b930e5bfd 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -1533,7 +1533,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) AVCodec mjpeg_decoder = { "mjpeg", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MJPEG, sizeof(MJpegDecodeContext), ff_mjpeg_decode_init, @@ -1547,7 +1547,7 @@ AVCodec mjpeg_decoder = { AVCodec thp_decoder = { "thp", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_THP, sizeof(MJpegDecodeContext), ff_mjpeg_decode_init, diff --git a/libavcodec/mjpegenc.c b/libavcodec/mjpegenc.c index 129a257d70..635fa1206f 100644 --- a/libavcodec/mjpegenc.c +++ b/libavcodec/mjpegenc.c @@ -445,7 +445,7 @@ void ff_mjpeg_encode_mb(MpegEncContext *s, DCTELEM block[6][64]) AVCodec mjpeg_encoder = { "mjpeg", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MJPEG, sizeof(MpegEncContext), MPV_encode_init, diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c index aa3b9cd2cd..88e6cdf5bd 100644 --- a/libavcodec/mlpdec.c +++ b/libavcodec/mlpdec.c @@ -1136,7 +1136,7 @@ error: AVCodec mlp_decoder = { "mlp", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MLP, sizeof(MLPDecodeContext), mlp_decode_init, @@ -1149,7 +1149,7 @@ AVCodec mlp_decoder = { #if CONFIG_TRUEHD_DECODER AVCodec truehd_decoder = { "truehd", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_TRUEHD, sizeof(MLPDecodeContext), mlp_decode_init, diff --git a/libavcodec/mmvideo.c b/libavcodec/mmvideo.c index fe1156159b..6d9aaacbe6 100644 --- a/libavcodec/mmvideo.c +++ b/libavcodec/mmvideo.c @@ -200,7 +200,7 @@ static av_cold int mm_decode_end(AVCodecContext *avctx) AVCodec mmvideo_decoder = { "mmvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MMVIDEO, sizeof(MmContext), mm_decode_init, diff --git a/libavcodec/motionpixels.c b/libavcodec/motionpixels.c index ac9c6ecf81..9bc5e2035d 100644 --- a/libavcodec/motionpixels.c +++ b/libavcodec/motionpixels.c @@ -304,7 +304,7 @@ static av_cold int mp_decode_end(AVCodecContext *avctx) AVCodec motionpixels_decoder = { "motionpixels", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MOTIONPIXELS, sizeof(MotionPixelsContext), mp_decode_init, diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index f6eb12cdb4..5eadbc6162 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -290,7 +290,7 @@ static void mpc7_decode_flush(AVCodecContext *avctx) AVCodec mpc7_decoder = { "mpc7", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MUSEPACK7, sizeof(MPCContext), mpc7_decode_init, diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 379528e9bd..780f0b7066 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -401,7 +401,7 @@ static int mpc8_decode_frame(AVCodecContext * avctx, AVCodec mpc8_decoder = { "mpc8", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MUSEPACK8, sizeof(MPCContext), mpc8_decode_init, diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index 1cd9acc771..bcc7fcfe78 100644 --- a/libavcodec/mpeg12.c +++ b/libavcodec/mpeg12.c @@ -2502,7 +2502,7 @@ static int mpeg_decode_end(AVCodecContext *avctx) AVCodec mpeg1video_decoder = { "mpeg1video", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, sizeof(Mpeg1Context), mpeg_decode_init, @@ -2516,7 +2516,7 @@ AVCodec mpeg1video_decoder = { AVCodec mpeg2video_decoder = { "mpeg2video", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, sizeof(Mpeg1Context), mpeg_decode_init, @@ -2531,7 +2531,7 @@ AVCodec mpeg2video_decoder = { //legacy decoder AVCodec mpegvideo_decoder = { "mpegvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, sizeof(Mpeg1Context), mpeg_decode_init, @@ -2562,7 +2562,7 @@ static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){ AVCodec mpeg_xvmc_decoder = { "mpegvideo_xvmc", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO_XVMC, sizeof(Mpeg1Context), mpeg_mc_decode_init, @@ -2579,7 +2579,7 @@ AVCodec mpeg_xvmc_decoder = { #if CONFIG_MPEG_VDPAU_DECODER AVCodec mpeg_vdpau_decoder = { "mpegvideo_vdpau", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, sizeof(Mpeg1Context), mpeg_decode_init, @@ -2595,7 +2595,7 @@ AVCodec mpeg_vdpau_decoder = { #if CONFIG_MPEG1_VDPAU_DECODER AVCodec mpeg1_vdpau_decoder = { "mpeg1video_vdpau", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, sizeof(Mpeg1Context), mpeg_decode_init, diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c index 350fa4016b..9cb4ef29d0 100644 --- a/libavcodec/mpeg12enc.c +++ b/libavcodec/mpeg12enc.c @@ -932,7 +932,7 @@ static void mpeg1_encode_block(MpegEncContext *s, AVCodec mpeg1video_encoder = { "mpeg1video", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, sizeof(MpegEncContext), encode_init, @@ -946,7 +946,7 @@ AVCodec mpeg1video_encoder = { AVCodec mpeg2video_encoder = { "mpeg2video", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, sizeof(MpegEncContext), encode_init, diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index baf7809d00..fa69c9ef87 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -2236,7 +2236,7 @@ static av_cold int decode_init(AVCodecContext *avctx) AVCodec mpeg4_decoder = { "mpeg4", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4, sizeof(MpegEncContext), decode_init, @@ -2253,7 +2253,7 @@ AVCodec mpeg4_decoder = { #if CONFIG_MPEG4_VDPAU_DECODER AVCodec mpeg4_vdpau_decoder = { "mpeg4_vdpau", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4, sizeof(MpegEncContext), decode_init, diff --git a/libavcodec/mpeg4videoenc.c b/libavcodec/mpeg4videoenc.c index 28d026b332..79190f0a6f 100644 --- a/libavcodec/mpeg4videoenc.c +++ b/libavcodec/mpeg4videoenc.c @@ -1340,7 +1340,7 @@ void ff_mpeg4_encode_video_packet_header(MpegEncContext *s) AVCodec mpeg4_encoder = { "mpeg4", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4, sizeof(MpegEncContext), encode_init, diff --git a/libavcodec/mpegaudiodec.c b/libavcodec/mpegaudiodec.c index f301ce9d88..af518aab9b 100644 --- a/libavcodec/mpegaudiodec.c +++ b/libavcodec/mpegaudiodec.c @@ -2485,7 +2485,7 @@ static int decode_frame_mp3on4(AVCodecContext * avctx, AVCodec mp1_decoder = { "mp1", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MP1, sizeof(MPADecodeContext), decode_init, @@ -2501,7 +2501,7 @@ AVCodec mp1_decoder = AVCodec mp2_decoder = { "mp2", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MP2, sizeof(MPADecodeContext), decode_init, @@ -2517,7 +2517,7 @@ AVCodec mp2_decoder = AVCodec mp3_decoder = { "mp3", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3, sizeof(MPADecodeContext), decode_init, @@ -2533,7 +2533,7 @@ AVCodec mp3_decoder = AVCodec mp3adu_decoder = { "mp3adu", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3ADU, sizeof(MPADecodeContext), decode_init, @@ -2549,7 +2549,7 @@ AVCodec mp3adu_decoder = AVCodec mp3on4_decoder = { "mp3on4", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3ON4, sizeof(MP3On4DecodeContext), decode_init_mp3on4, diff --git a/libavcodec/mpegaudioenc.c b/libavcodec/mpegaudioenc.c index a1e2023ba1..222db5357b 100644 --- a/libavcodec/mpegaudioenc.c +++ b/libavcodec/mpegaudioenc.c @@ -790,7 +790,7 @@ static av_cold int MPA_encode_close(AVCodecContext *avctx) AVCodec mp2_encoder = { "mp2", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_MP2, sizeof(MpegAudioContext), MPA_encode_init, diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c index 8b28062e9e..ec1cbc5db8 100644 --- a/libavcodec/mpegvideo_enc.c +++ b/libavcodec/mpegvideo_enc.c @@ -3771,7 +3771,7 @@ int dct_quantize_c(MpegEncContext *s, AVCodec h263_encoder = { "h263", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_H263, sizeof(MpegEncContext), MPV_encode_init, @@ -3783,7 +3783,7 @@ AVCodec h263_encoder = { AVCodec h263p_encoder = { "h263p", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_H263P, sizeof(MpegEncContext), MPV_encode_init, @@ -3795,7 +3795,7 @@ AVCodec h263p_encoder = { AVCodec msmpeg4v1_encoder = { "msmpeg4v1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSMPEG4V1, sizeof(MpegEncContext), MPV_encode_init, @@ -3807,7 +3807,7 @@ AVCodec msmpeg4v1_encoder = { AVCodec msmpeg4v2_encoder = { "msmpeg4v2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSMPEG4V2, sizeof(MpegEncContext), MPV_encode_init, @@ -3819,7 +3819,7 @@ AVCodec msmpeg4v2_encoder = { AVCodec msmpeg4v3_encoder = { "msmpeg4", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSMPEG4V3, sizeof(MpegEncContext), MPV_encode_init, @@ -3831,7 +3831,7 @@ AVCodec msmpeg4v3_encoder = { AVCodec wmv1_encoder = { "wmv1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_WMV1, sizeof(MpegEncContext), MPV_encode_init, diff --git a/libavcodec/msmpeg4.c b/libavcodec/msmpeg4.c index 60d104bdef..94127cf7b6 100644 --- a/libavcodec/msmpeg4.c +++ b/libavcodec/msmpeg4.c @@ -1921,7 +1921,7 @@ int ff_msmpeg4_decode_motion(MpegEncContext * s, AVCodec msmpeg4v1_decoder = { "msmpeg4v1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSMPEG4V1, sizeof(MpegEncContext), ff_msmpeg4_decode_init, @@ -1935,7 +1935,7 @@ AVCodec msmpeg4v1_decoder = { AVCodec msmpeg4v2_decoder = { "msmpeg4v2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSMPEG4V2, sizeof(MpegEncContext), ff_msmpeg4_decode_init, @@ -1949,7 +1949,7 @@ AVCodec msmpeg4v2_decoder = { AVCodec msmpeg4v3_decoder = { "msmpeg4", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSMPEG4V3, sizeof(MpegEncContext), ff_msmpeg4_decode_init, @@ -1963,7 +1963,7 @@ AVCodec msmpeg4v3_decoder = { AVCodec wmv1_decoder = { "wmv1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_WMV1, sizeof(MpegEncContext), ff_msmpeg4_decode_init, diff --git a/libavcodec/msrle.c b/libavcodec/msrle.c index 3ab73a3957..0fa2c67a87 100644 --- a/libavcodec/msrle.c +++ b/libavcodec/msrle.c @@ -145,7 +145,7 @@ static av_cold int msrle_decode_end(AVCodecContext *avctx) AVCodec msrle_decoder = { "msrle", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSRLE, sizeof(MsrleContext), msrle_decode_init, diff --git a/libavcodec/msvideo1.c b/libavcodec/msvideo1.c index a9d94f8f57..b2e98a015b 100644 --- a/libavcodec/msvideo1.c +++ b/libavcodec/msvideo1.c @@ -333,7 +333,7 @@ static av_cold int msvideo1_decode_end(AVCodecContext *avctx) AVCodec msvideo1_decoder = { "msvideo1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_MSVIDEO1, sizeof(Msvideo1Context), msvideo1_decode_init, diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index a2c67f65e0..95e8ed5878 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -200,7 +200,7 @@ static av_cold int decode_end(AVCodecContext * avctx) { AVCodec nellymoser_decoder = { "nellymoser", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_NELLYMOSER, sizeof(NellyMoserDecodeContext), decode_init, diff --git a/libavcodec/nellymoserenc.c b/libavcodec/nellymoserenc.c index 95ab22fa3e..3ea2763b78 100644 --- a/libavcodec/nellymoserenc.c +++ b/libavcodec/nellymoserenc.c @@ -384,7 +384,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, voi AVCodec nellymoser_encoder = { .name = "nellymoser", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_NELLYMOSER, .priv_data_size = sizeof(NellyMoserEncodeContext), .init = encode_init, diff --git a/libavcodec/nuv.c b/libavcodec/nuv.c index dfc26e4ebc..791f450913 100644 --- a/libavcodec/nuv.c +++ b/libavcodec/nuv.c @@ -274,7 +274,7 @@ static av_cold int decode_end(AVCodecContext *avctx) { AVCodec nuv_decoder = { "nuv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_NUV, sizeof(NuvContext), decode_init, diff --git a/libavcodec/options.c b/libavcodec/options.c index eae0205640..89b25483c2 100644 --- a/libavcodec/options.c +++ b/libavcodec/options.c @@ -423,18 +423,18 @@ static const AVOption options[]={ static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options }; -void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type){ +void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){ int flags=0; memset(s, 0, sizeof(AVCodecContext)); s->av_class= &av_codec_context_class; s->codec_type = codec_type; - if(codec_type == CODEC_TYPE_AUDIO) + if(codec_type == AVMEDIA_TYPE_AUDIO) flags= AV_OPT_FLAG_AUDIO_PARAM; - else if(codec_type == CODEC_TYPE_VIDEO) + else if(codec_type == AVMEDIA_TYPE_VIDEO) flags= AV_OPT_FLAG_VIDEO_PARAM; - else if(codec_type == CODEC_TYPE_SUBTITLE) + else if(codec_type == AVMEDIA_TYPE_SUBTITLE) flags= AV_OPT_FLAG_SUBTITLE_PARAM; av_opt_set_defaults2(s, flags, flags); @@ -453,7 +453,7 @@ void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type) s->reordered_opaque= AV_NOPTS_VALUE; } -AVCodecContext *avcodec_alloc_context2(enum CodecType codec_type){ +AVCodecContext *avcodec_alloc_context2(enum AVMediaType codec_type){ AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); if(avctx==NULL) return NULL; @@ -464,10 +464,10 @@ AVCodecContext *avcodec_alloc_context2(enum CodecType codec_type){ } void avcodec_get_context_defaults(AVCodecContext *s){ - avcodec_get_context_defaults2(s, CODEC_TYPE_UNKNOWN); + avcodec_get_context_defaults2(s, AVMEDIA_TYPE_UNKNOWN); } AVCodecContext *avcodec_alloc_context(void){ - return avcodec_alloc_context2(CODEC_TYPE_UNKNOWN); + return avcodec_alloc_context2(AVMEDIA_TYPE_UNKNOWN); } diff --git a/libavcodec/pamenc.c b/libavcodec/pamenc.c index 1239521a7a..ae0ea3a102 100644 --- a/libavcodec/pamenc.c +++ b/libavcodec/pamenc.c @@ -110,7 +110,7 @@ static int pam_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, AVCodec pam_encoder = { "pam", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PAM, sizeof(PNMContext), ff_pnm_init, diff --git a/libavcodec/pcm-mpeg.c b/libavcodec/pcm-mpeg.c index ec5f19bef4..20c1db92f1 100644 --- a/libavcodec/pcm-mpeg.c +++ b/libavcodec/pcm-mpeg.c @@ -297,7 +297,7 @@ static int pcm_bluray_decode_frame(AVCodecContext *avctx, AVCodec pcm_bluray_decoder = { "pcm_bluray", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_BLURAY, 0, NULL, diff --git a/libavcodec/pcm.c b/libavcodec/pcm.c index 572ee947e5..1298121fac 100644 --- a/libavcodec/pcm.c +++ b/libavcodec/pcm.c @@ -516,7 +516,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, #define PCM_ENCODER(id,sample_fmt_,name,long_name_) \ AVCodec name ## _encoder = { \ #name, \ - CODEC_TYPE_AUDIO, \ + AVMEDIA_TYPE_AUDIO, \ id, \ 0, \ pcm_encode_init, \ @@ -534,7 +534,7 @@ AVCodec name ## _encoder = { \ #define PCM_DECODER(id,sample_fmt_,name,long_name_) \ AVCodec name ## _decoder = { \ #name, \ - CODEC_TYPE_AUDIO, \ + AVMEDIA_TYPE_AUDIO, \ id, \ sizeof(PCMDecode), \ pcm_decode_init, \ diff --git a/libavcodec/pcx.c b/libavcodec/pcx.c index bbca8bce7a..2174184bce 100644 --- a/libavcodec/pcx.c +++ b/libavcodec/pcx.c @@ -244,7 +244,7 @@ static av_cold int pcx_end(AVCodecContext *avctx) { AVCodec pcx_decoder = { "pcx", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PCX, sizeof(PCXContext), pcx_init, diff --git a/libavcodec/pcxenc.c b/libavcodec/pcxenc.c index 17fa3c2f47..43ebc8720a 100644 --- a/libavcodec/pcxenc.c +++ b/libavcodec/pcxenc.c @@ -191,7 +191,7 @@ static int pcx_encode_frame(AVCodecContext *avctx, AVCodec pcx_encoder = { "pcx", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PCX, sizeof(PCXContext), pcx_encode_init, diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c index 5041d3a3d9..85db88ebac 100644 --- a/libavcodec/pgssubdec.c +++ b/libavcodec/pgssubdec.c @@ -454,7 +454,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVCodec pgssub_decoder = { "pgssub", - CODEC_TYPE_SUBTITLE, + AVMEDIA_TYPE_SUBTITLE, CODEC_ID_HDMV_PGS_SUBTITLE, sizeof(PGSSubContext), init_decoder, diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c index 6cce626fd3..382ba524cc 100644 --- a/libavcodec/pngdec.c +++ b/libavcodec/pngdec.c @@ -656,7 +656,7 @@ static av_cold int png_dec_end(AVCodecContext *avctx) AVCodec png_decoder = { "png", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PNG, sizeof(PNGDecContext), png_dec_init, diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c index 4638095e11..615bcc44cc 100644 --- a/libavcodec/pngenc.c +++ b/libavcodec/pngenc.c @@ -438,7 +438,7 @@ static av_cold int png_enc_init(AVCodecContext *avctx){ AVCodec png_encoder = { "png", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PNG, sizeof(PNGEncContext), png_enc_init, diff --git a/libavcodec/pnmdec.c b/libavcodec/pnmdec.c index 5630e7689c..66033c1f4e 100644 --- a/libavcodec/pnmdec.c +++ b/libavcodec/pnmdec.c @@ -190,7 +190,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, #if CONFIG_PGM_DECODER AVCodec pgm_decoder = { "pgm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PGM, sizeof(PNMContext), ff_pnm_init, @@ -206,7 +206,7 @@ AVCodec pgm_decoder = { #if CONFIG_PGMYUV_DECODER AVCodec pgmyuv_decoder = { "pgmyuv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PGMYUV, sizeof(PNMContext), ff_pnm_init, @@ -222,7 +222,7 @@ AVCodec pgmyuv_decoder = { #if CONFIG_PPM_DECODER AVCodec ppm_decoder = { "ppm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PPM, sizeof(PNMContext), ff_pnm_init, @@ -238,7 +238,7 @@ AVCodec ppm_decoder = { #if CONFIG_PBM_DECODER AVCodec pbm_decoder = { "pbm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PBM, sizeof(PNMContext), ff_pnm_init, @@ -254,7 +254,7 @@ AVCodec pbm_decoder = { #if CONFIG_PAM_DECODER AVCodec pam_decoder = { "pam", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PAM, sizeof(PNMContext), ff_pnm_init, diff --git a/libavcodec/pnmenc.c b/libavcodec/pnmenc.c index b14a151937..1fbf665883 100644 --- a/libavcodec/pnmenc.c +++ b/libavcodec/pnmenc.c @@ -115,7 +115,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, #if CONFIG_PGM_ENCODER AVCodec pgm_encoder = { "pgm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PGM, sizeof(PNMContext), ff_pnm_init, @@ -128,7 +128,7 @@ AVCodec pgm_encoder = { #if CONFIG_PGMYUV_ENCODER AVCodec pgmyuv_encoder = { "pgmyuv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PGMYUV, sizeof(PNMContext), ff_pnm_init, @@ -141,7 +141,7 @@ AVCodec pgmyuv_encoder = { #if CONFIG_PPM_ENCODER AVCodec ppm_encoder = { "ppm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PPM, sizeof(PNMContext), ff_pnm_init, @@ -154,7 +154,7 @@ AVCodec ppm_encoder = { #if CONFIG_PBM_ENCODER AVCodec pbm_encoder = { "pbm", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PBM, sizeof(PNMContext), ff_pnm_init, diff --git a/libavcodec/ptx.c b/libavcodec/ptx.c index f5aa601cde..d8798f2e9c 100644 --- a/libavcodec/ptx.c +++ b/libavcodec/ptx.c @@ -107,7 +107,7 @@ static av_cold int ptx_end(AVCodecContext *avctx) { AVCodec ptx_decoder = { "ptx", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_PTX, sizeof(PTXContext), ptx_init, diff --git a/libavcodec/qcelpdec.c b/libavcodec/qcelpdec.c index 285de1baa5..15481e0a91 100644 --- a/libavcodec/qcelpdec.c +++ b/libavcodec/qcelpdec.c @@ -813,7 +813,7 @@ erasure: AVCodec qcelp_decoder = { .name = "qcelp", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_QCELP, .init = qcelp_decode_init, .decode = qcelp_decode_frame, diff --git a/libavcodec/qdm2.c b/libavcodec/qdm2.c index 031bf2f3a4..33d4824e7b 100644 --- a/libavcodec/qdm2.c +++ b/libavcodec/qdm2.c @@ -1974,7 +1974,7 @@ static int qdm2_decode_frame(AVCodecContext *avctx, AVCodec qdm2_decoder = { .name = "qdm2", - .type = CODEC_TYPE_AUDIO, + .type = AVMEDIA_TYPE_AUDIO, .id = CODEC_ID_QDM2, .priv_data_size = sizeof(QDM2Context), .init = qdm2_decode_init, diff --git a/libavcodec/qdrw.c b/libavcodec/qdrw.c index f0c0350c23..594ef8c768 100644 --- a/libavcodec/qdrw.c +++ b/libavcodec/qdrw.c @@ -152,7 +152,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec qdraw_decoder = { "qdraw", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_QDRAW, sizeof(QdrawContext), decode_init, diff --git a/libavcodec/qpeg.c b/libavcodec/qpeg.c index 6b5d8732d9..e72afd1dd9 100644 --- a/libavcodec/qpeg.c +++ b/libavcodec/qpeg.c @@ -313,7 +313,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec qpeg_decoder = { "qpeg", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_QPEG, sizeof(QpegContext), decode_init, diff --git a/libavcodec/qtrle.c b/libavcodec/qtrle.c index dcb76ecfe5..dc300f00ac 100644 --- a/libavcodec/qtrle.c +++ b/libavcodec/qtrle.c @@ -539,7 +539,7 @@ static av_cold int qtrle_decode_end(AVCodecContext *avctx) AVCodec qtrle_decoder = { "qtrle", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_QTRLE, sizeof(QtrleContext), qtrle_decode_init, diff --git a/libavcodec/qtrleenc.c b/libavcodec/qtrleenc.c index 259a377ef0..7f95c7f5a4 100644 --- a/libavcodec/qtrleenc.c +++ b/libavcodec/qtrleenc.c @@ -322,7 +322,7 @@ static av_cold int qtrle_encode_end(AVCodecContext *avctx) AVCodec qtrle_encoder = { "qtrle", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_QTRLE, sizeof(QtrleEncContext), qtrle_encode_init, diff --git a/libavcodec/r210dec.c b/libavcodec/r210dec.c index 0b100e5f7d..416f76498c 100644 --- a/libavcodec/r210dec.c +++ b/libavcodec/r210dec.c @@ -92,7 +92,7 @@ static av_cold int decode_close(AVCodecContext *avctx) AVCodec r210_decoder = { "r210", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_R210, 0, decode_init, diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index deda412b2a..efa62c4913 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -353,7 +353,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, void *vdata, AVCodec ra_144_decoder = { "real_144", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_RA_144, sizeof(RA144Context), ra144_decode_init, diff --git a/libavcodec/ra288.c b/libavcodec/ra288.c index abc7df51bd..c74b5f78df 100644 --- a/libavcodec/ra288.c +++ b/libavcodec/ra288.c @@ -206,7 +206,7 @@ static int ra288_decode_frame(AVCodecContext * avctx, void *data, AVCodec ra_288_decoder = { "real_288", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_RA_288, sizeof(RA288Context), ra288_decode_init, diff --git a/libavcodec/rawdec.c b/libavcodec/rawdec.c index b4c7b3c6d8..b2a3c99e87 100644 --- a/libavcodec/rawdec.c +++ b/libavcodec/rawdec.c @@ -185,7 +185,7 @@ static av_cold int raw_close_decoder(AVCodecContext *avctx) AVCodec rawvideo_decoder = { "rawvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RAWVIDEO, sizeof(RawVideoContext), raw_init_decoder, diff --git a/libavcodec/rawenc.c b/libavcodec/rawenc.c index b7924a97ac..8a9bb311b6 100644 --- a/libavcodec/rawenc.c +++ b/libavcodec/rawenc.c @@ -57,7 +57,7 @@ static int raw_encode(AVCodecContext *avctx, AVCodec rawvideo_encoder = { "rawvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RAWVIDEO, sizeof(AVFrame), raw_init_encoder, diff --git a/libavcodec/rl2.c b/libavcodec/rl2.c index 721e5706ac..0e582754b6 100644 --- a/libavcodec/rl2.c +++ b/libavcodec/rl2.c @@ -230,7 +230,7 @@ static av_cold int rl2_decode_end(AVCodecContext *avctx) AVCodec rl2_decoder = { "rl2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RL2, sizeof(Rl2Context), rl2_decode_init, diff --git a/libavcodec/roqaudioenc.c b/libavcodec/roqaudioenc.c index b44d5d382a..11fd6f06cb 100644 --- a/libavcodec/roqaudioenc.c +++ b/libavcodec/roqaudioenc.c @@ -155,7 +155,7 @@ static av_cold int roq_dpcm_encode_close(AVCodecContext *avctx) AVCodec roq_dpcm_encoder = { "roq_dpcm", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_ROQ_DPCM, sizeof(ROQDPCMContext), roq_dpcm_encode_init, diff --git a/libavcodec/roqvideodec.c b/libavcodec/roqvideodec.c index 8e3bdb0dc3..a762adbc88 100644 --- a/libavcodec/roqvideodec.c +++ b/libavcodec/roqvideodec.c @@ -212,7 +212,7 @@ static av_cold int roq_decode_end(AVCodecContext *avctx) AVCodec roq_decoder = { "roqvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ROQ, sizeof(RoqContext), roq_decode_init, diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index 8dc77bd414..0326dee368 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -1057,7 +1057,7 @@ static int roq_encode_end(AVCodecContext *avctx) AVCodec roq_encoder = { "roqvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ROQ, sizeof(RoqContext), roq_encode_init, diff --git a/libavcodec/rpza.c b/libavcodec/rpza.c index e24508df49..1ddb5aad62 100644 --- a/libavcodec/rpza.c +++ b/libavcodec/rpza.c @@ -277,7 +277,7 @@ static av_cold int rpza_decode_end(AVCodecContext *avctx) AVCodec rpza_decoder = { "rpza", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RPZA, sizeof(RpzaContext), rpza_decode_init, diff --git a/libavcodec/rv10.c b/libavcodec/rv10.c index 4739916475..7fb1af91d6 100644 --- a/libavcodec/rv10.c +++ b/libavcodec/rv10.c @@ -708,7 +708,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, AVCodec rv10_decoder = { "rv10", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RV10, sizeof(MpegEncContext), rv10_decode_init, @@ -722,7 +722,7 @@ AVCodec rv10_decoder = { AVCodec rv20_decoder = { "rv20", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RV20, sizeof(MpegEncContext), rv10_decode_init, diff --git a/libavcodec/rv10enc.c b/libavcodec/rv10enc.c index db0e6edec4..333a108c48 100644 --- a/libavcodec/rv10enc.c +++ b/libavcodec/rv10enc.c @@ -58,7 +58,7 @@ void rv10_encode_picture_header(MpegEncContext *s, int picture_number) AVCodec rv10_encoder = { "rv10", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RV10, sizeof(MpegEncContext), MPV_encode_init, diff --git a/libavcodec/rv20enc.c b/libavcodec/rv20enc.c index e25a1bc452..ac43891c39 100644 --- a/libavcodec/rv20enc.c +++ b/libavcodec/rv20enc.c @@ -59,7 +59,7 @@ void rv20_encode_picture_header(MpegEncContext *s, int picture_number){ AVCodec rv20_encoder = { "rv20", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RV20, sizeof(MpegEncContext), MPV_encode_init, diff --git a/libavcodec/rv30.c b/libavcodec/rv30.c index 4cb2c3d900..8bab0bba09 100644 --- a/libavcodec/rv30.c +++ b/libavcodec/rv30.c @@ -268,7 +268,7 @@ static av_cold int rv30_decode_init(AVCodecContext *avctx) AVCodec rv30_decoder = { "rv30", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RV30, sizeof(RV34DecContext), rv30_decode_init, diff --git a/libavcodec/rv40.c b/libavcodec/rv40.c index baf2d6a34d..2eb030d833 100644 --- a/libavcodec/rv40.c +++ b/libavcodec/rv40.c @@ -668,7 +668,7 @@ static av_cold int rv40_decode_init(AVCodecContext *avctx) AVCodec rv40_decoder = { "rv40", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_RV40, sizeof(RV34DecContext), rv40_decode_init, diff --git a/libavcodec/sgidec.c b/libavcodec/sgidec.c index 2670140b28..bbfd94bdf0 100644 --- a/libavcodec/sgidec.c +++ b/libavcodec/sgidec.c @@ -260,7 +260,7 @@ static av_cold int sgi_end(AVCodecContext *avctx) AVCodec sgi_decoder = { "sgi", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SGI, sizeof(SgiState), sgi_init, diff --git a/libavcodec/sgienc.c b/libavcodec/sgienc.c index 7c2bcae528..f9f3709788 100644 --- a/libavcodec/sgienc.c +++ b/libavcodec/sgienc.c @@ -161,7 +161,7 @@ static int encode_frame(AVCodecContext *avctx, unsigned char *buf, AVCodec sgi_encoder = { "sgi", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SGI, sizeof(SgiContext), encode_init, diff --git a/libavcodec/shorten.c b/libavcodec/shorten.c index 328aaccd29..0dd07dd83c 100644 --- a/libavcodec/shorten.c +++ b/libavcodec/shorten.c @@ -527,7 +527,7 @@ static void shorten_flush(AVCodecContext *avctx){ AVCodec shorten_decoder = { "shorten", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_SHORTEN, sizeof(ShortenContext), shorten_decode_init, diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c index d2ce9c7897..fc19ecd710 100644 --- a/libavcodec/sipr.c +++ b/libavcodec/sipr.c @@ -579,7 +579,7 @@ static int sipr_decode_frame(AVCodecContext *avctx, void *datap, AVCodec sipr_decoder = { "sipr", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_SIPR, sizeof(SiprContext), sipr_decoder_init, diff --git a/libavcodec/smacker.c b/libavcodec/smacker.c index 19f0b289e5..a7134f227d 100644 --- a/libavcodec/smacker.c +++ b/libavcodec/smacker.c @@ -691,7 +691,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVCodec smacker_decoder = { "smackvid", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SMACKVIDEO, sizeof(SmackVContext), decode_init, @@ -704,7 +704,7 @@ AVCodec smacker_decoder = { AVCodec smackaud_decoder = { "smackaud", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_SMACKAUDIO, 0, smka_decode_init, diff --git a/libavcodec/smc.c b/libavcodec/smc.c index f63dc1e6ac..7891220c35 100644 --- a/libavcodec/smc.c +++ b/libavcodec/smc.c @@ -473,7 +473,7 @@ static av_cold int smc_decode_end(AVCodecContext *avctx) AVCodec smc_decoder = { "smc", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SMC, sizeof(SmcContext), smc_decode_init, diff --git a/libavcodec/snow.c b/libavcodec/snow.c index ad28d6484d..5ef9e5e811 100644 --- a/libavcodec/snow.c +++ b/libavcodec/snow.c @@ -2237,7 +2237,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec snow_decoder = { "snow", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SNOW, sizeof(SnowContext), decode_init, @@ -3988,7 +3988,7 @@ static av_cold int encode_end(AVCodecContext *avctx) AVCodec snow_encoder = { "snow", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SNOW, sizeof(SnowContext), encode_init, diff --git a/libavcodec/sonic.c b/libavcodec/sonic.c index 178ae01528..570dd245d0 100644 --- a/libavcodec/sonic.c +++ b/libavcodec/sonic.c @@ -937,7 +937,7 @@ static int sonic_decode_frame(AVCodecContext *avctx, AVCodec sonic_decoder = { "sonic", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_SONIC, sizeof(SonicContext), sonic_decode_init, @@ -951,7 +951,7 @@ AVCodec sonic_decoder = { #if CONFIG_SONIC_ENCODER AVCodec sonic_encoder = { "sonic", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_SONIC, sizeof(SonicContext), sonic_encode_init, @@ -965,7 +965,7 @@ AVCodec sonic_encoder = { #if CONFIG_SONIC_LS_ENCODER AVCodec sonic_ls_encoder = { "sonicls", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_SONIC_LS, sizeof(SonicContext), sonic_encode_init, diff --git a/libavcodec/sp5xdec.c b/libavcodec/sp5xdec.c index 13cce225a2..d0b4b8cc56 100644 --- a/libavcodec/sp5xdec.c +++ b/libavcodec/sp5xdec.c @@ -195,7 +195,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx, AVCodec sp5x_decoder = { "sp5x", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SP5X, sizeof(MJpegDecodeContext), ff_mjpeg_decode_init, @@ -209,7 +209,7 @@ AVCodec sp5x_decoder = { AVCodec amv_decoder = { "amv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_AMV, sizeof(MJpegDecodeContext), ff_mjpeg_decode_init, diff --git a/libavcodec/sunrast.c b/libavcodec/sunrast.c index e5e0f73cb8..456ab85a88 100644 --- a/libavcodec/sunrast.c +++ b/libavcodec/sunrast.c @@ -185,7 +185,7 @@ static av_cold int sunrast_end(AVCodecContext *avctx) { AVCodec sunrast_decoder = { "sunrast", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SUNRAST, sizeof(SUNRASTContext), sunrast_init, diff --git a/libavcodec/svq1dec.c b/libavcodec/svq1dec.c index 7bc18f604e..3834afb14a 100644 --- a/libavcodec/svq1dec.c +++ b/libavcodec/svq1dec.c @@ -828,7 +828,7 @@ static av_cold int svq1_decode_end(AVCodecContext *avctx) AVCodec svq1_decoder = { "svq1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SVQ1, sizeof(MpegEncContext), svq1_decode_init, diff --git a/libavcodec/svq1enc.c b/libavcodec/svq1enc.c index 3432bb9c5f..03c77ffcd6 100644 --- a/libavcodec/svq1enc.c +++ b/libavcodec/svq1enc.c @@ -574,7 +574,7 @@ static av_cold int svq1_encode_end(AVCodecContext *avctx) AVCodec svq1_encoder = { "svq1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SVQ1, sizeof(SVQ1Context), svq1_encode_init, diff --git a/libavcodec/svq3.c b/libavcodec/svq3.c index 8ece9a9b52..50de623cba 100644 --- a/libavcodec/svq3.c +++ b/libavcodec/svq3.c @@ -1071,7 +1071,7 @@ static int svq3_decode_frame(AVCodecContext *avctx, AVCodec svq3_decoder = { "svq3", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_SVQ3, sizeof(H264Context), svq3_decode_init, diff --git a/libavcodec/targa.c b/libavcodec/targa.c index b6fe5dfed5..50fe107ea9 100644 --- a/libavcodec/targa.c +++ b/libavcodec/targa.c @@ -243,7 +243,7 @@ static av_cold int targa_end(AVCodecContext *avctx){ AVCodec targa_decoder = { "targa", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TARGA, sizeof(TargaContext), targa_init, diff --git a/libavcodec/targaenc.c b/libavcodec/targaenc.c index fa886755c1..e5d0042ecb 100644 --- a/libavcodec/targaenc.c +++ b/libavcodec/targaenc.c @@ -153,7 +153,7 @@ static av_cold int targa_encode_init(AVCodecContext *avctx) AVCodec targa_encoder = { .name = "targa", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_TARGA, .priv_data_size = sizeof(TargaContext), .init = targa_encode_init, diff --git a/libavcodec/tiertexseqv.c b/libavcodec/tiertexseqv.c index 66055937fe..3e29c46fe2 100644 --- a/libavcodec/tiertexseqv.c +++ b/libavcodec/tiertexseqv.c @@ -221,7 +221,7 @@ static av_cold int seqvideo_decode_end(AVCodecContext *avctx) AVCodec tiertexseqvideo_decoder = { "tiertexseqvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TIERTEXSEQVIDEO, sizeof(SeqVideoContext), seqvideo_decode_init, diff --git a/libavcodec/tiff.c b/libavcodec/tiff.c index f8f3cbde95..e02767caad 100644 --- a/libavcodec/tiff.c +++ b/libavcodec/tiff.c @@ -592,7 +592,7 @@ static av_cold int tiff_end(AVCodecContext *avctx) AVCodec tiff_decoder = { "tiff", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TIFF, sizeof(TiffContext), tiff_init, diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 1d6b5b01f7..0cc8655b6d 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -444,7 +444,7 @@ fail: AVCodec tiff_encoder = { "tiff", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TIFF, sizeof(TiffEncoderContext), NULL, diff --git a/libavcodec/tmv.c b/libavcodec/tmv.c index 29aaae1fe7..827d8a6183 100644 --- a/libavcodec/tmv.c +++ b/libavcodec/tmv.c @@ -100,7 +100,7 @@ static av_cold int tmv_decode_close(AVCodecContext *avctx) AVCodec tmv_decoder = { .name = "tmv", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_TMV, .priv_data_size = sizeof(TMVContext), .close = tmv_decode_close, diff --git a/libavcodec/truemotion1.c b/libavcodec/truemotion1.c index ae08bfe0b2..2e8b72080a 100644 --- a/libavcodec/truemotion1.c +++ b/libavcodec/truemotion1.c @@ -892,7 +892,7 @@ static av_cold int truemotion1_decode_end(AVCodecContext *avctx) AVCodec truemotion1_decoder = { "truemotion1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TRUEMOTION1, sizeof(TrueMotion1Context), truemotion1_decode_init, diff --git a/libavcodec/truemotion2.c b/libavcodec/truemotion2.c index 44b89e70d1..4a5a2edf40 100644 --- a/libavcodec/truemotion2.c +++ b/libavcodec/truemotion2.c @@ -872,7 +872,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec truemotion2_decoder = { "truemotion2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TRUEMOTION2, sizeof(TM2Context), decode_init, diff --git a/libavcodec/truespeech.c b/libavcodec/truespeech.c index 598d414832..da5f2636d7 100644 --- a/libavcodec/truespeech.c +++ b/libavcodec/truespeech.c @@ -378,7 +378,7 @@ static int truespeech_decode_frame(AVCodecContext *avctx, AVCodec truespeech_decoder = { "truespeech", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_TRUESPEECH, sizeof(TSContext), truespeech_decode_init, diff --git a/libavcodec/tscc.c b/libavcodec/tscc.c index bf82c6302b..d200c8aabd 100644 --- a/libavcodec/tscc.c +++ b/libavcodec/tscc.c @@ -199,7 +199,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec tscc_decoder = { "camtasia", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TSCC, sizeof(CamtasiaContext), decode_init, diff --git a/libavcodec/tta.c b/libavcodec/tta.c index 77f9978c09..68c9840465 100644 --- a/libavcodec/tta.c +++ b/libavcodec/tta.c @@ -449,7 +449,7 @@ static av_cold int tta_decode_close(AVCodecContext *avctx) { AVCodec tta_decoder = { "tta", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_TTA, sizeof(TTAContext), tta_decode_init, diff --git a/libavcodec/twinvq.c b/libavcodec/twinvq.c index e460ea9623..1aa66661d6 100644 --- a/libavcodec/twinvq.c +++ b/libavcodec/twinvq.c @@ -1119,7 +1119,7 @@ static av_cold int twin_decode_close(AVCodecContext *avctx) AVCodec twinvq_decoder = { "twinvq", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_TWINVQ, sizeof(TwinContext), twin_decode_init, diff --git a/libavcodec/txd.c b/libavcodec/txd.c index 5065d08f19..ac8229f9e4 100644 --- a/libavcodec/txd.c +++ b/libavcodec/txd.c @@ -156,7 +156,7 @@ static av_cold int txd_end(AVCodecContext *avctx) { AVCodec txd_decoder = { "txd", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_TXD, sizeof(TXDContext), txd_init, diff --git a/libavcodec/ulti.c b/libavcodec/ulti.c index 12dc6ac14f..f53690f4d0 100644 --- a/libavcodec/ulti.c +++ b/libavcodec/ulti.c @@ -406,7 +406,7 @@ static int ulti_decode_frame(AVCodecContext *avctx, AVCodec ulti_decoder = { "ultimotion", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ULTI, sizeof(UltimotionDecodeContext), ulti_decode_init, diff --git a/libavcodec/utils.c b/libavcodec/utils.c index e48cf6e4c8..0abf07ce62 100644 --- a/libavcodec/utils.c +++ b/libavcodec/utils.c @@ -497,7 +497,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) } avctx->codec = codec; - if ((avctx->codec_type == CODEC_TYPE_UNKNOWN || avctx->codec_type == codec->type) && + if ((avctx->codec_type == AVMEDIA_TYPE_UNKNOWN || avctx->codec_type == codec->type) && avctx->codec_id == CODEC_ID_NONE) { avctx->codec_type = codec->type; avctx->codec_id = codec->id; @@ -775,20 +775,20 @@ static int get_bit_rate(AVCodecContext *ctx) int bits_per_sample; switch(ctx->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: bit_rate = ctx->bit_rate; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: bits_per_sample = av_get_bits_per_sample(ctx->codec_id); bit_rate = bits_per_sample ? ctx->sample_rate * ctx->channels * bits_per_sample : ctx->bit_rate; break; - case CODEC_TYPE_DATA: + case AVMEDIA_TYPE_DATA: bit_rate = ctx->bit_rate; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: bit_rate = ctx->bit_rate; break; - case CODEC_TYPE_ATTACHMENT: + case AVMEDIA_TYPE_ATTACHMENT: bit_rate = ctx->bit_rate; break; default: @@ -836,7 +836,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) } switch(enc->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: snprintf(buf, buf_size, "Video: %s%s", codec_name, enc->mb_decision ? " (hq)" : ""); @@ -871,7 +871,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) ", q=%d-%d", enc->qmin, enc->qmax); } break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: snprintf(buf, buf_size, "Audio: %s", codec_name); @@ -886,13 +886,13 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) ", %s", avcodec_get_sample_fmt_name(enc->sample_fmt)); } break; - case CODEC_TYPE_DATA: + case AVMEDIA_TYPE_DATA: snprintf(buf, buf_size, "Data: %s", codec_name); break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: snprintf(buf, buf_size, "Subtitle: %s", codec_name); break; - case CODEC_TYPE_ATTACHMENT: + case AVMEDIA_TYPE_ATTACHMENT: snprintf(buf, buf_size, "Attachment: %s", codec_name); break; default: diff --git a/libavcodec/v210dec.c b/libavcodec/v210dec.c index ceeccb6346..a1a0827bed 100644 --- a/libavcodec/v210dec.c +++ b/libavcodec/v210dec.c @@ -122,7 +122,7 @@ static av_cold int decode_close(AVCodecContext *avctx) AVCodec v210_decoder = { "v210", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_V210, 0, decode_init, diff --git a/libavcodec/v210enc.c b/libavcodec/v210enc.c index 8f20f73d45..11e0e0eb7a 100644 --- a/libavcodec/v210enc.c +++ b/libavcodec/v210enc.c @@ -119,7 +119,7 @@ static av_cold int encode_close(AVCodecContext *avctx) AVCodec v210_encoder = { "v210", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_V210, 0, encode_init, diff --git a/libavcodec/v210x.c b/libavcodec/v210x.c index 089aa2c127..d869d64725 100644 --- a/libavcodec/v210x.c +++ b/libavcodec/v210x.c @@ -134,7 +134,7 @@ static av_cold int decode_close(AVCodecContext *avctx) AVCodec v210x_decoder = { "v210x", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_V210X, 0, decode_init, diff --git a/libavcodec/vaapi_h264.c b/libavcodec/vaapi_h264.c index f49a54d1e2..52f836330d 100644 --- a/libavcodec/vaapi_h264.c +++ b/libavcodec/vaapi_h264.c @@ -336,7 +336,7 @@ static int decode_slice(AVCodecContext *avctx, AVHWAccel h264_vaapi_hwaccel = { .name = "h264_vaapi", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H264, .pix_fmt = PIX_FMT_VAAPI_VLD, .capabilities = 0, diff --git a/libavcodec/vaapi_mpeg2.c b/libavcodec/vaapi_mpeg2.c index 21bc77863f..2e870dcfa0 100644 --- a/libavcodec/vaapi_mpeg2.c +++ b/libavcodec/vaapi_mpeg2.c @@ -140,7 +140,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer AVHWAccel mpeg2_vaapi_hwaccel = { .name = "mpeg2_vaapi", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_MPEG2VIDEO, .pix_fmt = PIX_FMT_VAAPI_VLD, .capabilities = 0, diff --git a/libavcodec/vaapi_mpeg4.c b/libavcodec/vaapi_mpeg4.c index 4e606f0f1d..466ce2fd91 100644 --- a/libavcodec/vaapi_mpeg4.c +++ b/libavcodec/vaapi_mpeg4.c @@ -151,7 +151,7 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer #if CONFIG_MPEG4_VAAPI_HWACCEL AVHWAccel mpeg4_vaapi_hwaccel = { .name = "mpeg4_vaapi", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_MPEG4, .pix_fmt = PIX_FMT_VAAPI_VLD, .capabilities = 0, @@ -165,7 +165,7 @@ AVHWAccel mpeg4_vaapi_hwaccel = { #if CONFIG_H263_VAAPI_HWACCEL AVHWAccel h263_vaapi_hwaccel = { .name = "h263_vaapi", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_H263, .pix_fmt = PIX_FMT_VAAPI_VLD, .capabilities = 0, diff --git a/libavcodec/vaapi_vc1.c b/libavcodec/vaapi_vc1.c index 50a4ba266b..992e1da4b1 100644 --- a/libavcodec/vaapi_vc1.c +++ b/libavcodec/vaapi_vc1.c @@ -328,7 +328,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, #if CONFIG_WMV3_VAAPI_HWACCEL AVHWAccel wmv3_vaapi_hwaccel = { .name = "wmv3_vaapi", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_WMV3, .pix_fmt = PIX_FMT_VAAPI_VLD, .capabilities = 0, @@ -341,7 +341,7 @@ AVHWAccel wmv3_vaapi_hwaccel = { AVHWAccel vc1_vaapi_hwaccel = { .name = "vc1_vaapi", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .id = CODEC_ID_VC1, .pix_fmt = PIX_FMT_VAAPI_VLD, .capabilities = 0, diff --git a/libavcodec/vb.c b/libavcodec/vb.c index 4dfac435ac..2d4d4e286d 100644 --- a/libavcodec/vb.c +++ b/libavcodec/vb.c @@ -289,7 +289,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec vb_decoder = { "vb", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VB, sizeof(VBDecContext), decode_init, diff --git a/libavcodec/vc1dec.c b/libavcodec/vc1dec.c index ebd14cb1cb..333afbd6b6 100644 --- a/libavcodec/vc1dec.c +++ b/libavcodec/vc1dec.c @@ -3319,7 +3319,7 @@ static av_cold int vc1_decode_end(AVCodecContext *avctx) AVCodec vc1_decoder = { "vc1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VC1, sizeof(VC1Context), vc1_decode_init, @@ -3335,7 +3335,7 @@ AVCodec vc1_decoder = { #if CONFIG_WMV3_DECODER AVCodec wmv3_decoder = { "wmv3", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_WMV3, sizeof(VC1Context), vc1_decode_init, @@ -3352,7 +3352,7 @@ AVCodec wmv3_decoder = { #if CONFIG_WMV3_VDPAU_DECODER AVCodec wmv3_vdpau_decoder = { "wmv3_vdpau", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_WMV3, sizeof(VC1Context), vc1_decode_init, @@ -3369,7 +3369,7 @@ AVCodec wmv3_vdpau_decoder = { #if CONFIG_VC1_VDPAU_DECODER AVCodec vc1_vdpau_decoder = { "vc1_vdpau", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VC1, sizeof(VC1Context), vc1_decode_init, diff --git a/libavcodec/vcr1.c b/libavcodec/vcr1.c index ea2d5553a6..7800859760 100644 --- a/libavcodec/vcr1.c +++ b/libavcodec/vcr1.c @@ -178,7 +178,7 @@ static av_cold int encode_init(AVCodecContext *avctx){ AVCodec vcr1_decoder = { "vcr1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VCR1, sizeof(VCR1Context), decode_init, @@ -192,7 +192,7 @@ AVCodec vcr1_decoder = { #if CONFIG_VCR1_ENCODER AVCodec vcr1_encoder = { "vcr1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VCR1, sizeof(VCR1Context), encode_init, diff --git a/libavcodec/vmdav.c b/libavcodec/vmdav.c index 79318b0277..9e2d1a13c8 100644 --- a/libavcodec/vmdav.c +++ b/libavcodec/vmdav.c @@ -567,7 +567,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, AVCodec vmdvideo_decoder = { "vmdvideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VMDVIDEO, sizeof(VmdVideoContext), vmdvideo_decode_init, @@ -580,7 +580,7 @@ AVCodec vmdvideo_decoder = { AVCodec vmdaudio_decoder = { "vmdaudio", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_VMDAUDIO, sizeof(VmdAudioContext), vmdaudio_decode_init, diff --git a/libavcodec/vmnc.c b/libavcodec/vmnc.c index b4c07f76e4..1b30f0af10 100644 --- a/libavcodec/vmnc.c +++ b/libavcodec/vmnc.c @@ -510,7 +510,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec vmnc_decoder = { "vmnc", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VMNC, sizeof(VmncContext), decode_init, diff --git a/libavcodec/vorbis_dec.c b/libavcodec/vorbis_dec.c index ae45c1f746..0676e87efe 100644 --- a/libavcodec/vorbis_dec.c +++ b/libavcodec/vorbis_dec.c @@ -1645,7 +1645,7 @@ static av_cold int vorbis_decode_close(AVCodecContext *avccontext) AVCodec vorbis_decoder = { "vorbis", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_VORBIS, sizeof(vorbis_context), vorbis_decode_init, diff --git a/libavcodec/vorbis_enc.c b/libavcodec/vorbis_enc.c index f33f431655..862d16c878 100644 --- a/libavcodec/vorbis_enc.c +++ b/libavcodec/vorbis_enc.c @@ -1093,7 +1093,7 @@ static av_cold int vorbis_encode_close(AVCodecContext *avccontext) AVCodec vorbis_encoder = { "vorbis", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_VORBIS, sizeof(vorbis_enc_context), vorbis_encode_init, diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index cab3f2bd5e..2dccbcdea4 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2191,7 +2191,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) AVCodec theora_decoder = { "theora", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_THEORA, sizeof(Vp3DecodeContext), theora_decode_init, @@ -2206,7 +2206,7 @@ AVCodec theora_decoder = { AVCodec vp3_decoder = { "vp3", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VP3, sizeof(Vp3DecodeContext), vp3_decode_init, diff --git a/libavcodec/vp5.c b/libavcodec/vp5.c index 1f8434c731..41e6497202 100644 --- a/libavcodec/vp5.c +++ b/libavcodec/vp5.c @@ -286,7 +286,7 @@ static av_cold int vp5_decode_init(AVCodecContext *avctx) AVCodec vp5_decoder = { "vp5", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VP5, sizeof(VP56Context), vp5_decode_init, diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c index b3dd80ffbf..53e2ca25ed 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -621,7 +621,7 @@ static av_cold int vp6_decode_free(AVCodecContext *avctx) AVCodec vp6_decoder = { "vp6", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VP6, sizeof(VP56Context), vp6_decode_init, @@ -635,7 +635,7 @@ AVCodec vp6_decoder = { /* flash version, not flipped upside-down */ AVCodec vp6f_decoder = { "vp6f", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VP6F, sizeof(VP56Context), vp6_decode_init, @@ -649,7 +649,7 @@ AVCodec vp6f_decoder = { /* flash version, not flipped upside-down, with alpha channel */ AVCodec vp6a_decoder = { "vp6a", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VP6A, sizeof(VP56Context), vp6_decode_init, diff --git a/libavcodec/vqavideo.c b/libavcodec/vqavideo.c index aba886489e..a40e4e0102 100644 --- a/libavcodec/vqavideo.c +++ b/libavcodec/vqavideo.c @@ -610,7 +610,7 @@ static av_cold int vqa_decode_end(AVCodecContext *avctx) AVCodec vqa_decoder = { "vqavideo", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_WS_VQA, sizeof(VqaContext), vqa_decode_init, diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 2c1df38b3e..d460893937 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -1020,7 +1020,7 @@ static int wavpack_decode_frame(AVCodecContext *avctx, AVCodec wavpack_decoder = { "wavpack", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_WAVPACK, sizeof(WavpackContext), wavpack_decode_init, diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 74583abe58..e7705470f2 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -942,7 +942,7 @@ static av_cold void flush(AVCodecContext *avctx) AVCodec wmav1_decoder = { "wmav1", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_WMAV1, sizeof(WMACodecContext), wma_decode_init, @@ -956,7 +956,7 @@ AVCodec wmav1_decoder = AVCodec wmav2_decoder = { "wmav2", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_WMAV2, sizeof(WMACodecContext), wma_decode_init, diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index b1d4cb160d..7aaeb70baa 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -386,7 +386,7 @@ static int encode_superframe(AVCodecContext *avctx, AVCodec wmav1_encoder = { "wmav1", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_WMAV1, sizeof(WMACodecContext), encode_init, @@ -399,7 +399,7 @@ AVCodec wmav1_encoder = AVCodec wmav2_encoder = { "wmav2", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_WMAV2, sizeof(WMACodecContext), encode_init, diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c index a323a19fba..82f1b3623b 100644 --- a/libavcodec/wmaprodec.c +++ b/libavcodec/wmaprodec.c @@ -1565,7 +1565,7 @@ static void flush(AVCodecContext *avctx) */ AVCodec wmapro_decoder = { "wmapro", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_WMAPRO, sizeof(WMAProDecodeCtx), decode_init, diff --git a/libavcodec/wmavoice.c b/libavcodec/wmavoice.c index 9b9609f1a2..259755343d 100644 --- a/libavcodec/wmavoice.c +++ b/libavcodec/wmavoice.c @@ -1555,7 +1555,7 @@ static av_cold void wmavoice_flush(AVCodecContext *ctx) AVCodec wmavoice_decoder = { "wmavoice", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_WMAVOICE, sizeof(WMAVoiceContext), wmavoice_decode_init, diff --git a/libavcodec/wmv2dec.c b/libavcodec/wmv2dec.c index a2eb4292a2..a9bb80cae4 100644 --- a/libavcodec/wmv2dec.c +++ b/libavcodec/wmv2dec.c @@ -486,7 +486,7 @@ static av_cold int wmv2_decode_end(AVCodecContext *avctx) AVCodec wmv2_decoder = { "wmv2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_WMV2, sizeof(Wmv2Context), wmv2_decode_init, diff --git a/libavcodec/wmv2enc.c b/libavcodec/wmv2enc.c index 84eedf3e43..7416f85233 100644 --- a/libavcodec/wmv2enc.c +++ b/libavcodec/wmv2enc.c @@ -213,7 +213,7 @@ void ff_wmv2_encode_mb(MpegEncContext * s, AVCodec wmv2_encoder = { "wmv2", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_WMV2, sizeof(Wmv2Context), wmv2_encode_init, diff --git a/libavcodec/wnv1.c b/libavcodec/wnv1.c index f537aee3af..7d325578af 100644 --- a/libavcodec/wnv1.c +++ b/libavcodec/wnv1.c @@ -156,7 +156,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec wnv1_decoder = { "wnv1", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_WNV1, sizeof(WNV1Context), decode_init, diff --git a/libavcodec/ws-snd1.c b/libavcodec/ws-snd1.c index 85e04f55d4..0e75654c1e 100644 --- a/libavcodec/ws-snd1.c +++ b/libavcodec/ws-snd1.c @@ -147,7 +147,7 @@ static int ws_snd_decode_frame(AVCodecContext *avctx, AVCodec ws_snd1_decoder = { "ws_snd1", - CODEC_TYPE_AUDIO, + AVMEDIA_TYPE_AUDIO, CODEC_ID_WESTWOOD_SND1, 0, ws_snd_decode_init, diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 2638172d3f..d75d4692a2 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -417,7 +417,7 @@ static av_cold int xan_decode_end(AVCodecContext *avctx) AVCodec xan_wc3_decoder = { "xan_wc3", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_XAN_WC3, sizeof(XanContext), xan_decode_init, @@ -431,7 +431,7 @@ AVCodec xan_wc3_decoder = { /* AVCodec xan_wc4_decoder = { "xan_wc4", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_XAN_WC4, sizeof(XanContext), xan_decode_init, diff --git a/libavcodec/xl.c b/libavcodec/xl.c index 2a5110cb98..bf88938bf5 100644 --- a/libavcodec/xl.c +++ b/libavcodec/xl.c @@ -140,7 +140,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ AVCodec xl_decoder = { "xl", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_VIXL, sizeof(VideoXLContext), decode_init, diff --git a/libavcodec/xsubdec.c b/libavcodec/xsubdec.c index 368caf4a6d..0055ebb20b 100644 --- a/libavcodec/xsubdec.c +++ b/libavcodec/xsubdec.c @@ -132,7 +132,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVCodec xsub_decoder = { "xsub", - CODEC_TYPE_SUBTITLE, + AVMEDIA_TYPE_SUBTITLE, CODEC_ID_XSUB, 0, decode_init, diff --git a/libavcodec/xsubenc.c b/libavcodec/xsubenc.c index dbf2a2f3ab..903cbd2098 100644 --- a/libavcodec/xsubenc.c +++ b/libavcodec/xsubenc.c @@ -212,7 +212,7 @@ static av_cold int xsub_encoder_init(AVCodecContext *avctx) AVCodec xsub_encoder = { "xsub", - CODEC_TYPE_SUBTITLE, + AVMEDIA_TYPE_SUBTITLE, CODEC_ID_XSUB, 0, xsub_encoder_init, diff --git a/libavcodec/yop.c b/libavcodec/yop.c index 235e5c9658..0c771fe05e 100644 --- a/libavcodec/yop.c +++ b/libavcodec/yop.c @@ -249,7 +249,7 @@ static int yop_decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVCodec yop_decoder = { "yop", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_YOP, sizeof(YopDecContext), yop_decode_init, diff --git a/libavcodec/zmbv.c b/libavcodec/zmbv.c index 35a31c0924..e8e5135731 100644 --- a/libavcodec/zmbv.c +++ b/libavcodec/zmbv.c @@ -654,7 +654,7 @@ static av_cold int decode_end(AVCodecContext *avctx) AVCodec zmbv_decoder = { "zmbv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ZMBV, sizeof(ZmbvContext), decode_init, diff --git a/libavcodec/zmbvenc.c b/libavcodec/zmbvenc.c index a04c0597ee..162b8485cb 100644 --- a/libavcodec/zmbvenc.c +++ b/libavcodec/zmbvenc.c @@ -325,7 +325,7 @@ static av_cold int encode_end(AVCodecContext *avctx) AVCodec zmbv_encoder = { "zmbv", - CODEC_TYPE_VIDEO, + AVMEDIA_TYPE_VIDEO, CODEC_ID_ZMBV, sizeof(ZmbvEncContext), encode_init, diff --git a/libavdevice/alsa-audio-dec.c b/libavdevice/alsa-audio-dec.c index 833bca3b06..1fb0bf5c68 100644 --- a/libavdevice/alsa-audio-dec.c +++ b/libavdevice/alsa-audio-dec.c @@ -111,7 +111,7 @@ static av_cold int audio_read_header(AVFormatContext *s1, } /* take real parameters */ - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = codec_id; st->codec->sample_rate = sample_rate; st->codec->channels = ap->channels; diff --git a/libavdevice/bktr.c b/libavdevice/bktr.c index c63d79ea28..afb94b6c5d 100644 --- a/libavdevice/bktr.c +++ b/libavdevice/bktr.c @@ -269,7 +269,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) s->frame_rate_base = frame_rate_base; s->per_frame = ((uint64_t)1000000 * s->frame_rate_base) / s->frame_rate; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->pix_fmt = PIX_FMT_YUV420P; st->codec->codec_id = CODEC_ID_RAWVIDEO; st->codec->width = width; diff --git a/libavdevice/jack_audio.c b/libavdevice/jack_audio.c index fa1fba13ca..b41bbdf902 100644 --- a/libavdevice/jack_audio.c +++ b/libavdevice/jack_audio.c @@ -237,7 +237,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param return AVERROR(ENOMEM); } - stream->codec->codec_type = CODEC_TYPE_AUDIO; + stream->codec->codec_type = AVMEDIA_TYPE_AUDIO; #if HAVE_BIGENDIAN stream->codec->codec_id = CODEC_ID_PCM_F32BE; #else diff --git a/libavdevice/libdc1394.c b/libavdevice/libdc1394.c index 0d8e36ad63..8ffbc58974 100644 --- a/libavdevice/libdc1394.c +++ b/libavdevice/libdc1394.c @@ -117,7 +117,7 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap, if (!vst) goto out; av_set_pts_info(vst, 64, 1, 1000); - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_RAWVIDEO; vst->codec->time_base.den = fps->frame_rate; vst->codec->time_base.num = 1000; diff --git a/libavdevice/oss_audio.c b/libavdevice/oss_audio.c index 8e4dbf2fc4..d382c0376e 100644 --- a/libavdevice/oss_audio.c +++ b/libavdevice/oss_audio.c @@ -232,7 +232,7 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap) } /* take real parameters */ - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = s->codec_id; st->codec->sample_rate = s->sample_rate; st->codec->channels = s->channels; diff --git a/libavdevice/v4l.c b/libavdevice/v4l.c index 3382cdb0ae..d0ef7d5e04 100644 --- a/libavdevice/v4l.c +++ b/libavdevice/v4l.c @@ -242,7 +242,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) s->fd = video_fd; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_RAWVIDEO; st->codec->width = s->video_win.width; st->codec->height = s->video_win.height; diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c index 36c8d66c6b..9cc6806256 100644 --- a/libavdevice/v4l2.c +++ b/libavdevice/v4l2.c @@ -646,7 +646,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) } s->top_field_first = first_field(s->fd); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = codec_id; st->codec->width = width; st->codec->height = height; diff --git a/libavdevice/vfwcap.c b/libavdevice/vfwcap.c index 9f242f80f9..9f54494c83 100644 --- a/libavdevice/vfwcap.c +++ b/libavdevice/vfwcap.c @@ -353,7 +353,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) codec = st->codec; codec->time_base = ap->time_base; - codec->codec_type = CODEC_TYPE_VIDEO; + codec->codec_type = AVMEDIA_TYPE_VIDEO; codec->width = width; codec->height = height; codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount); diff --git a/libavdevice/x11grab.c b/libavdevice/x11grab.c index 045b82306e..865206dfcf 100644 --- a/libavdevice/x11grab.c +++ b/libavdevice/x11grab.c @@ -226,7 +226,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) x11grab->image = image; x11grab->use_shm = use_shm; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_RAWVIDEO; st->codec->width = ap->width; st->codec->height = ap->height; diff --git a/libavfilter/avfilter.h b/libavfilter/avfilter.h index 7867cd09fd..fabc1beb82 100644 --- a/libavfilter/avfilter.h +++ b/libavfilter/avfilter.h @@ -280,7 +280,7 @@ struct AVFilterPad * AVFilterPad type. Only video supported now, hopefully someone will * add audio in the future. */ - enum CodecType type; + enum AVMediaType type; /** * Minimum required permissions on incoming buffers. Any buffer with diff --git a/libavfilter/vf_aspect.c b/libavfilter/vf_aspect.c index 801f927ba3..79e26998e9 100644 --- a/libavfilter/vf_aspect.c +++ b/libavfilter/vf_aspect.c @@ -86,7 +86,7 @@ AVFilter avfilter_vf_aspect = { .priv_size = sizeof(AspectContext), .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .config_props = frameaspect_config_props, .get_video_buffer = avfilter_null_get_video_buffer, .start_frame = start_frame, @@ -94,7 +94,7 @@ AVFilter avfilter_vf_aspect = { { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, }, + .type = AVMEDIA_TYPE_VIDEO, }, { .name = NULL}}, }; #endif /* CONFIG_ASPECT_FILTER */ @@ -109,14 +109,14 @@ AVFilter avfilter_vf_pixelaspect = { .priv_size = sizeof(AspectContext), .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer = avfilter_null_get_video_buffer, .start_frame = start_frame, .end_frame = avfilter_null_end_frame }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, }, + .type = AVMEDIA_TYPE_VIDEO, }, { .name = NULL}}, }; #endif /* CONFIG_PIXELASPECT_FILTER */ diff --git a/libavfilter/vf_crop.c b/libavfilter/vf_crop.c index 69dfdea2e7..85e99c28b9 100644 --- a/libavfilter/vf_crop.c +++ b/libavfilter/vf_crop.c @@ -214,14 +214,14 @@ AVFilter avfilter_vf_crop = { .init = init, .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .start_frame = start_frame, .draw_slice = draw_slice, .get_video_buffer = avfilter_null_get_video_buffer, .config_props = config_input, }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .config_props = config_output, }, { .name = NULL}}, }; diff --git a/libavfilter/vf_format.c b/libavfilter/vf_format.c index 2c84b0ab1a..36d5f4009a 100644 --- a/libavfilter/vf_format.c +++ b/libavfilter/vf_format.c @@ -103,14 +103,14 @@ AVFilter avfilter_vf_format = { .priv_size = sizeof(FormatContext), .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer= avfilter_null_get_video_buffer, .start_frame = avfilter_null_start_frame, .draw_slice = avfilter_null_draw_slice, .end_frame = avfilter_null_end_frame, }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO }, + .type = AVMEDIA_TYPE_VIDEO }, { .name = NULL}}, }; #endif /* CONFIG_FORMAT_FILTER */ @@ -133,14 +133,14 @@ AVFilter avfilter_vf_noformat = { .priv_size = sizeof(FormatContext), .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer= avfilter_null_get_video_buffer, .start_frame = avfilter_null_start_frame, .draw_slice = avfilter_null_draw_slice, .end_frame = avfilter_null_end_frame, }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO }, + .type = AVMEDIA_TYPE_VIDEO }, { .name = NULL}}, }; #endif /* CONFIG_NOFORMAT_FILTER */ diff --git a/libavfilter/vf_null.c b/libavfilter/vf_null.c index 75eba6783f..e3987ff693 100644 --- a/libavfilter/vf_null.c +++ b/libavfilter/vf_null.c @@ -30,13 +30,13 @@ AVFilter avfilter_vf_null = { .priv_size = 0, .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer = avfilter_null_get_video_buffer, .start_frame = avfilter_null_start_frame, .end_frame = avfilter_null_end_frame }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, }, + .type = AVMEDIA_TYPE_VIDEO, }, { .name = NULL}}, }; diff --git a/libavfilter/vf_scale.c b/libavfilter/vf_scale.c index 8b70d0319f..4898dc554d 100644 --- a/libavfilter/vf_scale.c +++ b/libavfilter/vf_scale.c @@ -197,13 +197,13 @@ AVFilter avfilter_vf_scale = { .priv_size = sizeof(ScaleContext), .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .start_frame = start_frame, .draw_slice = draw_slice, .min_perms = AV_PERM_READ, }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .config_props = config_props, }, { .name = NULL}}, }; diff --git a/libavfilter/vf_slicify.c b/libavfilter/vf_slicify.c index ec96db499d..e405e70e2a 100644 --- a/libavfilter/vf_slicify.c +++ b/libavfilter/vf_slicify.c @@ -104,7 +104,7 @@ AVFilter avfilter_vf_slicify = { .priv_size = sizeof(SliceContext), .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer = avfilter_null_get_video_buffer, .start_frame = start_frame, .draw_slice = draw_slice, @@ -112,6 +112,6 @@ AVFilter avfilter_vf_slicify = { .end_frame = avfilter_null_end_frame, }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, }, + .type = AVMEDIA_TYPE_VIDEO, }, { .name = NULL}}, }; diff --git a/libavfilter/vf_vflip.c b/libavfilter/vf_vflip.c index 7f5299297f..3ab56b9939 100644 --- a/libavfilter/vf_vflip.c +++ b/libavfilter/vf_vflip.c @@ -91,7 +91,7 @@ AVFilter avfilter_vf_vflip = { .priv_size = sizeof(FlipContext), .inputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .get_video_buffer = get_video_buffer, .start_frame = start_frame, .draw_slice = draw_slice, @@ -99,6 +99,6 @@ AVFilter avfilter_vf_vflip = { .config_props = config_input, }, { .name = NULL}}, .outputs = (AVFilterPad[]) {{ .name = "default", - .type = CODEC_TYPE_VIDEO, }, + .type = AVMEDIA_TYPE_VIDEO, }, { .name = NULL}}, }; diff --git a/libavfilter/vsink_nullsink.c b/libavfilter/vsink_nullsink.c index d87f20400b..d11912f7dd 100644 --- a/libavfilter/vsink_nullsink.c +++ b/libavfilter/vsink_nullsink.c @@ -35,7 +35,7 @@ AVFilter avfilter_vsink_nullsink = { .inputs = (AVFilterPad[]) { { .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .start_frame = start_frame, .end_frame = end_frame, }, diff --git a/libavfilter/vsrc_nullsrc.c b/libavfilter/vsrc_nullsrc.c index ff14ea68b2..892ee1205e 100644 --- a/libavfilter/vsrc_nullsrc.c +++ b/libavfilter/vsrc_nullsrc.c @@ -74,7 +74,7 @@ AVFilter avfilter_vsrc_nullsrc = { .outputs = (AVFilterPad[]) { { .name = "default", - .type = CODEC_TYPE_VIDEO, + .type = AVMEDIA_TYPE_VIDEO, .config_props = config_props, .request_frame = request_frame, }, diff --git a/libavformat/4xm.c b/libavformat/4xm.c index 631f8216a5..661d6718b6 100644 --- a/libavformat/4xm.c +++ b/libavformat/4xm.c @@ -149,7 +149,7 @@ static int fourxm_read_header(AVFormatContext *s, fourxm->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_4XM; st->codec->extradata_size = 4; st->codec->extradata = av_malloc(4); @@ -198,7 +198,7 @@ static int fourxm_read_header(AVFormatContext *s, fourxm->tracks[current_track].stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = 0; st->codec->channels = fourxm->tracks[current_track].channels; st->codec->sample_rate = fourxm->tracks[current_track].sample_rate; diff --git a/libavformat/aea.c b/libavformat/aea.c index 7c44d78663..ec95a0f92c 100644 --- a/libavformat/aea.c +++ b/libavformat/aea.c @@ -71,7 +71,7 @@ static int aea_read_header(AVFormatContext *s, url_fskip(s->pb, 1783); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ATRAC1; st->codec->sample_rate = 44100; st->codec->bit_rate = 292000; diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c index a56bb0911d..f72af00f4c 100644 --- a/libavformat/aiffdec.c +++ b/libavformat/aiffdec.c @@ -92,7 +92,7 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, if (size & 1) size++; - codec->codec_type = CODEC_TYPE_AUDIO; + codec->codec_type = AVMEDIA_TYPE_AUDIO; codec->channels = get_be16(pb); num_frames = get_be32(pb); codec->bits_per_coded_sample = get_be16(pb); diff --git a/libavformat/amr.c b/libavformat/amr.c index cbc4ec50d4..d16b4c03cd 100644 --- a/libavformat/amr.c +++ b/libavformat/amr.c @@ -108,7 +108,7 @@ static int amr_read_header(AVFormatContext *s, st->codec->sample_rate = 8000; } st->codec->channels = 1; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; av_set_pts_info(st, 64, 1, st->codec->sample_rate); return 0; diff --git a/libavformat/anm.c b/libavformat/anm.c index 2099dc96e8..0d28ff4e8f 100644 --- a/libavformat/anm.c +++ b/libavformat/anm.c @@ -100,7 +100,7 @@ static int read_header(AVFormatContext *s, st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_ANM; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = get_le16(pb); diff --git a/libavformat/apc.c b/libavformat/apc.c index 14701d9229..9b4a8adc1d 100644 --- a/libavformat/apc.c +++ b/libavformat/apc.c @@ -43,7 +43,7 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_IMA_WS; get_le32(pb); /* number of samples */ diff --git a/libavformat/ape.c b/libavformat/ape.c index b5f93cf134..102e191a3f 100644 --- a/libavformat/ape.c +++ b/libavformat/ape.c @@ -301,7 +301,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_APE; st->codec->codec_tag = MKTAG('A', 'P', 'E', ' '); st->codec->channels = ape->channels; diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c index 882614be3d..ab96cc4339 100644 --- a/libavformat/asfdec.c +++ b/libavformat/asfdec.c @@ -236,7 +236,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) asf->hdr.max_bitrate = get_le32(pb); s->packet_size = asf->hdr.max_pktsize; } else if (!guidcmp(&g, &ff_asf_stream_header)) { - enum CodecType type; + enum AVMediaType type; int type_specific_size, sizeX; uint64_t total_size; unsigned int tag1; @@ -265,14 +265,14 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) test_for_ext_stream_audio = 0; if (!guidcmp(&g, &ff_asf_audio_stream)) { - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; } else if (!guidcmp(&g, &ff_asf_video_stream)) { - type = CODEC_TYPE_VIDEO; + type = AVMEDIA_TYPE_VIDEO; } else if (!guidcmp(&g, &ff_asf_command_stream)) { - type = CODEC_TYPE_DATA; + type = AVMEDIA_TYPE_DATA; } else if (!guidcmp(&g, &ff_asf_ext_stream_embed_stream_header)) { test_for_ext_stream_audio = 1; - type = CODEC_TYPE_UNKNOWN; + type = AVMEDIA_TYPE_UNKNOWN; } else { return -1; } @@ -289,7 +289,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) if (test_for_ext_stream_audio) { get_guid(pb, &g); if (!guidcmp(&g, &ff_asf_ext_stream_audio_stream)) { - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; is_dvr_ms_audio=1; get_guid(pb, &g); get_le32(pb); @@ -301,7 +301,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) } st->codec->codec_type = type; - if (type == CODEC_TYPE_AUDIO) { + if (type == AVMEDIA_TYPE_AUDIO) { ff_get_wav_header(pb, st->codec, type_specific_size); if (is_dvr_ms_audio) { // codec_id and codec_tag are unreliable in dvr_ms @@ -351,7 +351,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->frame_size = 1; break; } - } else if (type == CODEC_TYPE_VIDEO) { + } else if (type == AVMEDIA_TYPE_VIDEO) { get_le32(pb); get_le32(pb); get_byte(pb); @@ -889,8 +889,8 @@ static int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket * asf_st->packet_pos= asf->packet_pos; //printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n", //asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & PKT_FLAG_KEY, -//s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO, asf->packet_obj_size); - if (s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO) +//s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO, asf->packet_obj_size); + if (s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO) asf->packet_key_frame = 1; if (asf->packet_key_frame) asf_st->pkt.flags |= PKT_FLAG_KEY; diff --git a/libavformat/asfenc.c b/libavformat/asfenc.c index 03b7256397..f3a368ae3b 100644 --- a/libavformat/asfenc.c +++ b/libavformat/asfenc.c @@ -375,13 +375,13 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data switch(enc->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: wav_extra_size = 0; extra_size = 18 + wav_extra_size; extra_size2 = 8; break; default: - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: wav_extra_size = enc->extradata_size; extra_size = 0x33 + wav_extra_size; extra_size2 = 0; @@ -389,7 +389,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data } hpos = put_header(pb, &ff_asf_stream_header); - if (enc->codec_type == CODEC_TYPE_AUDIO) { + if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { put_guid(pb, &ff_asf_audio_stream); put_guid(pb, &ff_asf_audio_conceal_spread); } else { @@ -403,7 +403,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data put_le16(pb, n + 1); /* stream number */ put_le32(pb, 0); /* ??? */ - if (enc->codec_type == CODEC_TYPE_AUDIO) { + if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { /* WAVEFORMATEX header */ int wavsize = ff_put_wav_header(pb, enc); if ((enc->codec_id != CODEC_ID_MP3) && (enc->codec_id != CODEC_ID_MP2) && (enc->codec_id != CODEC_ID_ADPCM_IMA_WAV) && (enc->extradata_size==0)) { @@ -457,9 +457,9 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data enc = s->streams[n]->codec; p = avcodec_find_encoder(enc->codec_id); - if(enc->codec_type == CODEC_TYPE_AUDIO) + if(enc->codec_type == AVMEDIA_TYPE_AUDIO) put_le16(pb, 2); - else if(enc->codec_type == CODEC_TYPE_VIDEO) + else if(enc->codec_type == AVMEDIA_TYPE_VIDEO) put_le16(pb, 1); else put_le16(pb, -1); @@ -483,7 +483,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data /* id */ - if (enc->codec_type == CODEC_TYPE_AUDIO) { + if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { put_le16(pb, 2); put_le16(pb, enc->codec_tag); } else { @@ -722,7 +722,7 @@ static void put_frame( // multi payloads frag_len1 = asf->packet_size_left - PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS - PACKET_HEADER_MIN_SIZE - 1; - if(frag_len1 < payload_len && avst->codec->codec_type == CODEC_TYPE_AUDIO){ + if(frag_len1 < payload_len && avst->codec->codec_type == AVMEDIA_TYPE_AUDIO){ flush_packet(s); continue; } @@ -770,7 +770,7 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) codec = s->streams[pkt->stream_index]->codec; stream = &asf->streams[pkt->stream_index]; - if(codec->codec_type == CODEC_TYPE_AUDIO) + if(codec->codec_type == AVMEDIA_TYPE_AUDIO) flags &= ~PKT_FLAG_KEY; pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; diff --git a/libavformat/assdec.c b/libavformat/assdec.c index 32fb09d22d..173dc0c632 100644 --- a/libavformat/assdec.c +++ b/libavformat/assdec.c @@ -99,7 +99,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) if (!st) return -1; av_set_pts_info(st, 64, 1, 100); - st->codec->codec_type = CODEC_TYPE_SUBTITLE; + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codec->codec_id= CODEC_ID_SSA; header_remaining= INT_MAX; diff --git a/libavformat/au.c b/libavformat/au.c index 0ea0ea8c98..f8f718d4ff 100644 --- a/libavformat/au.c +++ b/libavformat/au.c @@ -148,7 +148,7 @@ static int au_read_header(AVFormatContext *s, st = av_new_stream(s, 0); if (!st) return -1; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = id; st->codec->codec_id = codec; st->codec->channels = channels; diff --git a/libavformat/audiointerleave.c b/libavformat/audiointerleave.c index a3a6531348..3c235c069e 100644 --- a/libavformat/audiointerleave.c +++ b/libavformat/audiointerleave.c @@ -32,7 +32,7 @@ void ff_audio_interleave_close(AVFormatContext *s) AVStream *st = s->streams[i]; AudioInterleaveContext *aic = st->priv_data; - if (st->codec->codec_type == CODEC_TYPE_AUDIO) + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) av_fifo_free(aic->fifo); } } @@ -50,7 +50,7 @@ int ff_audio_interleave_init(AVFormatContext *s, AVStream *st = s->streams[i]; AudioInterleaveContext *aic = st->priv_data; - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { aic->sample_size = (st->codec->channels * av_get_bits_per_sample(st->codec->codec_id)) / 8; if (!aic->sample_size) { @@ -103,7 +103,7 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt if (pkt) { AVStream *st = s->streams[pkt->stream_index]; AudioInterleaveContext *aic = st->priv_data; - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { unsigned new_size = av_fifo_size(aic->fifo) + pkt->size; if (new_size > aic->fifo_size) { if (av_fifo_realloc2(aic->fifo, new_size) < 0) @@ -122,7 +122,7 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { AVPacket new_pkt; while (ff_interleave_new_audio_packet(s, &new_pkt, i, flush)) ff_interleave_add_packet(s, &new_pkt, compare_ts); diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 92fd85c703..65e32bb043 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -804,7 +804,7 @@ AVOutputFormat *av_guess_format(const char *short_name, */ enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, const char *filename, const char *mime_type, - enum CodecType type); + enum AVMediaType type); /** * Sends a nice hexadecimal dump of a buffer to the specified file stream. diff --git a/libavformat/avidec.c b/libavformat/avidec.c index cba34f8d3d..a74400f860 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -442,19 +442,19 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) switch(tag1) { case MKTAG('v', 'i', 'd', 's'): - codec_type = CODEC_TYPE_VIDEO; + codec_type = AVMEDIA_TYPE_VIDEO; ast->sample_size = 0; break; case MKTAG('a', 'u', 'd', 's'): - codec_type = CODEC_TYPE_AUDIO; + codec_type = AVMEDIA_TYPE_AUDIO; break; case MKTAG('t', 'x', 't', 's'): //FIXME - codec_type = CODEC_TYPE_DATA; //CODEC_TYPE_SUB ? FIXME + codec_type = AVMEDIA_TYPE_DATA; //AVMEDIA_TYPE_SUB ? FIXME break; case MKTAG('d', 'a', 't', 's'): - codec_type = CODEC_TYPE_DATA; + codec_type = AVMEDIA_TYPE_DATA; break; default: av_log(s, AV_LOG_ERROR, "unknown stream type %X\n", tag1); @@ -475,11 +475,11 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) size = FFMIN(size, list_end - cur_pos); st = s->streams[stream_index]; switch(codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if(amv_file_format){ st->codec->width=avih_width; st->codec->height=avih_height; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_AMV; url_fskip(pb, size); break; @@ -497,7 +497,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) get_le32(pb); /* ClrImportant */ if (tag1 == MKTAG('D', 'X', 'S', 'B') || tag1 == MKTAG('D','X','S','A')) { - st->codec->codec_type = CODEC_TYPE_SUBTITLE; + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codec->codec_tag = tag1; st->codec->codec_id = CODEC_ID_XSUB; break; @@ -534,7 +534,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) #ifdef DEBUG print_tag("video", tag1, 0); #endif - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_tag = tag1; st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag1); st->need_parsing = AVSTREAM_PARSE_HEADERS; // This is needed to get the pict type which is necessary for generating correct pts. @@ -554,7 +554,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) // url_fskip(pb, size - 5 * 4); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: ff_get_wav_header(pb, st->codec, size); if(ast->sample_size && st->codec->block_align && ast->sample_size != st->codec->block_align){ av_log(s, AV_LOG_WARNING, "sample size (%d) != block align (%d)\n", ast->sample_size, st->codec->block_align); @@ -580,7 +580,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->codec_id = CODEC_ID_ADPCM_IMA_AMV; break; default: - st->codec->codec_type = CODEC_TYPE_DATA; + st->codec->codec_type = AVMEDIA_TYPE_DATA; st->codec->codec_id= CODEC_ID_NONE; st->codec->codec_tag= 0; url_fskip(pb, size); @@ -787,7 +787,7 @@ resync: //av_log(s, AV_LOG_DEBUG, "dts:%"PRId64" offset:%"PRId64" %d/%d smpl_siz:%d base:%d st:%d size:%d\n", pkt->dts, ast->frame_offset, ast->scale, ast->rate, ast->sample_size, AV_TIME_BASE, avi->stream_index, size); pkt->stream_index = avi->stream_index; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { AVIndexEntry *e; int index; assert(st->index_entries); @@ -871,8 +871,8 @@ resync: //workaround for broken small-file-bug402.avi if( d[2] == 'w' && d[3] == 'b' && n==0 - && st ->codec->codec_type == CODEC_TYPE_VIDEO - && st1->codec->codec_type == CODEC_TYPE_AUDIO + && st ->codec->codec_type == AVMEDIA_TYPE_VIDEO + && st1->codec->codec_type == AVMEDIA_TYPE_AUDIO && ast->prefix == 'd'*256+'c' && (d[2]*256+d[3] == ast1->prefix || !ast1->prefix_count) ){ diff --git a/libavformat/avienc.c b/libavformat/avienc.c index 50419960a3..51daf500fe 100644 --- a/libavformat/avienc.c +++ b/libavformat/avienc.c @@ -83,14 +83,14 @@ static int64_t avi_start_new_riff(AVFormatContext *s, ByteIOContext *pb, return loff; } -static char* avi_stream2fourcc(char* tag, int index, enum CodecType type) +static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type) { tag[0] = '0'; tag[1] = '0' + index; - if (type == CODEC_TYPE_VIDEO) { + if (type == AVMEDIA_TYPE_VIDEO) { tag[2] = 'd'; tag[3] = 'c'; - } else if (type == CODEC_TYPE_SUBTITLE) { + } else if (type == AVMEDIA_TYPE_SUBTITLE) { // note: this is not an official code tag[2] = 's'; tag[3] = 'b'; @@ -136,7 +136,7 @@ static int avi_write_counters(AVFormatContext* s, int riff_id) } else { put_le32(pb, avist->audio_strm_length / au_ssize); } - if(stream->codec_type == CODEC_TYPE_VIDEO) + if(stream->codec_type == AVMEDIA_TYPE_VIDEO) nb_frames = FFMAX(nb_frames, avist->packet_count); } if(riff_id == 1) { @@ -177,7 +177,7 @@ static int avi_write_header(AVFormatContext *s) for(n=0;nnb_streams;n++) { stream = s->streams[n]->codec; bitrate += stream->bit_rate; - if (stream->codec_type == CODEC_TYPE_VIDEO) + if (stream->codec_type == AVMEDIA_TYPE_VIDEO) video_enc = stream; } @@ -222,16 +222,16 @@ static int avi_write_header(AVFormatContext *s) /* stream generic header */ strh = ff_start_tag(pb, "strh"); switch(stream->codec_type) { - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: // XSUB subtitles behave like video tracks, other subtitles // are not (yet) supported. if (stream->codec_id != CODEC_ID_XSUB) break; - case CODEC_TYPE_VIDEO: put_tag(pb, "vids"); break; - case CODEC_TYPE_AUDIO: put_tag(pb, "auds"); break; -// case CODEC_TYPE_TEXT : put_tag(pb, "txts"); break; - case CODEC_TYPE_DATA : put_tag(pb, "dats"); break; + case AVMEDIA_TYPE_VIDEO: put_tag(pb, "vids"); break; + case AVMEDIA_TYPE_AUDIO: put_tag(pb, "auds"); break; +// case AVMEDIA_TYPE_TEXT : put_tag(pb, "txts"); break; + case AVMEDIA_TYPE_DATA : put_tag(pb, "dats"); break; } - if(stream->codec_type == CODEC_TYPE_VIDEO || + if(stream->codec_type == AVMEDIA_TYPE_VIDEO || stream->codec_id == CODEC_ID_XSUB) put_le32(pb, stream->codec_tag); else @@ -255,9 +255,9 @@ static int avi_write_header(AVFormatContext *s) put_le32(pb, 0); /* length, XXX: filled later */ /* suggested buffer size */ //FIXME set at the end to largest chunk - if(stream->codec_type == CODEC_TYPE_VIDEO) + if(stream->codec_type == AVMEDIA_TYPE_VIDEO) put_le32(pb, 1024 * 1024); - else if(stream->codec_type == CODEC_TYPE_AUDIO) + else if(stream->codec_type == AVMEDIA_TYPE_AUDIO) put_le32(pb, 12 * 1024); else put_le32(pb, 0); @@ -268,17 +268,17 @@ static int avi_write_header(AVFormatContext *s) put_le16(pb, stream->height); ff_end_tag(pb, strh); - if(stream->codec_type != CODEC_TYPE_DATA){ + if(stream->codec_type != AVMEDIA_TYPE_DATA){ strf = ff_start_tag(pb, "strf"); switch(stream->codec_type) { - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: // XSUB subtitles behave like video tracks, other subtitles // are not (yet) supported. if (stream->codec_id != CODEC_ID_XSUB) break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: ff_put_bmp_header(pb, stream, ff_codec_bmp_tags, 0); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (ff_put_wav_header(pb, stream) < 0) { return -1; } @@ -322,7 +322,7 @@ static int avi_write_header(AVFormatContext *s) ff_end_tag(pb, avist->indexes.indx_start); } - if( stream->codec_type == CODEC_TYPE_VIDEO + if( stream->codec_type == AVMEDIA_TYPE_VIDEO && s->streams[i]->sample_aspect_ratio.num>0 && s->streams[i]->sample_aspect_ratio.den>0){ int vprp= ff_start_tag(pb, "vprp"); @@ -542,7 +542,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) avi_stream2fourcc(&tag[0], stream_index, enc->codec_type); if(pkt->flags&PKT_FLAG_KEY) flags = 0x10; - if (enc->codec_type == CODEC_TYPE_AUDIO) { + if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { avist->audio_strm_length += size; } @@ -603,7 +603,7 @@ static int avi_write_trailer(AVFormatContext *s) AVCodecContext *stream = s->streams[n]->codec; AVIStream *avist= s->streams[n]->priv_data; - if (stream->codec_type == CODEC_TYPE_VIDEO) { + if (stream->codec_type == AVMEDIA_TYPE_VIDEO) { if (nb_frames < avist->packet_count) nb_frames = avist->packet_count; } else { diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c index 7ca52d9892..e2a8a3cf5a 100644 --- a/libavformat/avisynth.c +++ b/libavformat/avisynth.c @@ -85,7 +85,7 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) continue; st = av_new_stream(s, id); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->block_align = wvfmt.nBlockAlign; st->codec->channels = wvfmt.nChannels; @@ -111,7 +111,7 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) continue; st = av_new_stream(s, id); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->r_frame_rate.num = stream->info.dwRate; st->r_frame_rate.den = stream->info.dwScale; diff --git a/libavformat/avs.c b/libavformat/avs.c index 1fcb19fdde..9cdd336c05 100644 --- a/libavformat/avs.c +++ b/libavformat/avs.c @@ -178,7 +178,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) avs->st_video = av_new_stream(s, AVS_VIDEO); if (avs->st_video == NULL) return AVERROR(ENOMEM); - avs->st_video->codec->codec_type = CODEC_TYPE_VIDEO; + avs->st_video->codec->codec_type = AVMEDIA_TYPE_VIDEO; avs->st_video->codec->codec_id = CODEC_ID_AVS; avs->st_video->codec->width = avs->width; avs->st_video->codec->height = avs->height; @@ -195,7 +195,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) avs->st_audio = av_new_stream(s, AVS_AUDIO); if (avs->st_audio == NULL) return AVERROR(ENOMEM); - avs->st_audio->codec->codec_type = CODEC_TYPE_AUDIO; + avs->st_audio->codec->codec_type = AVMEDIA_TYPE_AUDIO; } avs->remaining_audio_size = size - 4; size = avs_read_audio_packet(s, pkt); diff --git a/libavformat/bethsoftvid.c b/libavformat/bethsoftvid.c index e599255f16..43275c9859 100644 --- a/libavformat/bethsoftvid.c +++ b/libavformat/bethsoftvid.c @@ -74,7 +74,7 @@ static int vid_read_header(AVFormatContext *s, if (!stream) return AVERROR(ENOMEM); av_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps - stream->codec->codec_type = CODEC_TYPE_VIDEO; + stream->codec->codec_type = AVMEDIA_TYPE_VIDEO; stream->codec->codec_id = CODEC_ID_BETHSOFTVID; stream->codec->width = get_le16(pb); stream->codec->height = get_le16(pb); @@ -86,7 +86,7 @@ static int vid_read_header(AVFormatContext *s, stream = av_new_stream(s, 0); if (!stream) return AVERROR(ENOMEM); - stream->codec->codec_type = CODEC_TYPE_AUDIO; + stream->codec->codec_type = AVMEDIA_TYPE_AUDIO; stream->codec->codec_id = CODEC_ID_PCM_U8; stream->codec->channels = 1; stream->codec->sample_rate = 11025; diff --git a/libavformat/bfi.c b/libavformat/bfi.c index cecbfbabd0..f9e427ccd1 100644 --- a/libavformat/bfi.c +++ b/libavformat/bfi.c @@ -87,12 +87,12 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap) /* Set up the video codec... */ av_set_pts_info(vstream, 32, 1, fps); - vstream->codec->codec_type = CODEC_TYPE_VIDEO; + vstream->codec->codec_type = AVMEDIA_TYPE_VIDEO; vstream->codec->codec_id = CODEC_ID_BFI; vstream->codec->pix_fmt = PIX_FMT_PAL8; /* Set up the audio codec now... */ - astream->codec->codec_type = CODEC_TYPE_AUDIO; + astream->codec->codec_type = AVMEDIA_TYPE_AUDIO; astream->codec->codec_id = CODEC_ID_PCM_U8; astream->codec->channels = 1; astream->codec->bits_per_coded_sample = 8; diff --git a/libavformat/bink.c b/libavformat/bink.c index ac04e762e8..3bb73610ad 100644 --- a/libavformat/bink.c +++ b/libavformat/bink.c @@ -111,7 +111,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) } av_set_pts_info(vst, 64, fps_den, fps_num); - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_BINKVIDEO; vst->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); vst->codec->extradata_size = 4; @@ -133,7 +133,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) ast = av_new_stream(s, 1); if (!ast) return AVERROR(ENOMEM); - ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_tag = 0; ast->codec->sample_rate = get_le16(pb); av_set_pts_info(ast, 64, 1, ast->codec->sample_rate); diff --git a/libavformat/c93.c b/libavformat/c93.c index e829e395cc..cd3d36a160 100644 --- a/libavformat/c93.c +++ b/libavformat/c93.c @@ -83,7 +83,7 @@ static int read_header(AVFormatContext *s, if (!video) return AVERROR(ENOMEM); - video->codec->codec_type = CODEC_TYPE_VIDEO; + video->codec->codec_type = AVMEDIA_TYPE_VIDEO; video->codec->codec_id = CODEC_ID_C93; video->codec->width = 320; video->codec->height = 192; @@ -120,7 +120,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) c93->audio = av_new_stream(s, 1); if (!c93->audio) return AVERROR(ENOMEM); - c93->audio->codec->codec_type = CODEC_TYPE_AUDIO; + c93->audio->codec->codec_type = AVMEDIA_TYPE_AUDIO; } url_fskip(pb, 26); /* VOC header */ ret = voc_get_packet(s, pkt, c93->audio, datasize - 26); diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c index df297164ba..720a49a899 100644 --- a/libavformat/cafdec.c +++ b/libavformat/cafdec.c @@ -64,7 +64,7 @@ static int read_desc_chunk(AVFormatContext *s) return AVERROR_NOMEM; /* parse format description */ - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->sample_rate = av_int2dbl(get_be64(pb)); st->codec->codec_tag = get_be32(pb); flags = get_be32(pb); diff --git a/libavformat/cdg.c b/libavformat/cdg.c index f40028d2f9..2f4fb2771d 100644 --- a/libavformat/cdg.c +++ b/libavformat/cdg.c @@ -32,7 +32,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) if (!vst) return AVERROR(ENOMEM); - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_CDGRAPHICS; /// 75 sectors/sec * 4 packets/sector = 300 packets/sec diff --git a/libavformat/daud.c b/libavformat/daud.c index cdd831ba4b..9b0e008347 100644 --- a/libavformat/daud.c +++ b/libavformat/daud.c @@ -24,7 +24,7 @@ static int daud_header(AVFormatContext *s, AVFormatParameters *ap) { AVStream *st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_PCM_S24DAUD; st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd'); st->codec->channels = 6; diff --git a/libavformat/dsicin.c b/libavformat/dsicin.c index 113f8ffca2..72ce17c57e 100644 --- a/libavformat/dsicin.c +++ b/libavformat/dsicin.c @@ -113,7 +113,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) av_set_pts_info(st, 32, 1, 12); cin->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_DSICINVIDEO; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = hdr->video_frame_width; @@ -126,7 +126,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) av_set_pts_info(st, 32, 1, 22050); cin->audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_DSICINAUDIO; st->codec->codec_tag = 0; /* no tag */ st->codec->channels = 1; diff --git a/libavformat/dv.c b/libavformat/dv.c index af8bb921cb..f30f2ae1b9 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -214,7 +214,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame) if (!c->ast[i]) break; av_set_pts_info(c->ast[i], 64, 1, 30000); - c->ast[i]->codec->codec_type = CODEC_TYPE_AUDIO; + c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO; c->ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE; av_init_packet(&c->audio_pkt[i]); @@ -290,7 +290,7 @@ DVDemuxContext* dv_init_demux(AVFormatContext *s) c->frames = 0; c->abytes = 0; - c->vst->codec->codec_type = CODEC_TYPE_VIDEO; + c->vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; c->vst->codec->codec_id = CODEC_ID_DVVIDEO; c->vst->codec->bit_rate = 25000000; c->vst->start_time = 0; diff --git a/libavformat/dvenc.c b/libavformat/dvenc.c index 351062b76a..617980903e 100644 --- a/libavformat/dvenc.c +++ b/libavformat/dvenc.c @@ -239,7 +239,7 @@ int dv_assemble_frame(DVMuxContext *c, AVStream* st, reqasize = 4 * dv_audio_frame_size(c->sys, c->frames); switch (st->codec->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: /* FIXME: we have to have more sensible approach than this one */ if (c->has_video) av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames); @@ -247,7 +247,7 @@ int dv_assemble_frame(DVMuxContext *c, AVStream* st, memcpy(*frame, data, c->sys->frame_size); c->has_video = 1; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: for (i = 0; i < c->n_ast && st != c->ast[i]; i++); /* FIXME: we have to have more sensible approach than this one */ @@ -299,11 +299,11 @@ DVMuxContext* dv_init_mux(AVFormatContext* s) /* We have to sort out where audio and where video stream is */ for (i=0; inb_streams; i++) { switch (s->streams[i]->codec->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (vst) return NULL; vst = s->streams[i]; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (c->n_ast > 1) return NULL; c->ast[c->n_ast++] = s->streams[i]; break; diff --git a/libavformat/dxa.c b/libavformat/dxa.c index a68d4c4efb..c00c917d0b 100644 --- a/libavformat/dxa.c +++ b/libavformat/dxa.c @@ -119,7 +119,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) } /* now we are ready: build format streams */ - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_DXA; st->codec->width = w; st->codec->height = h; diff --git a/libavformat/eacdata.c b/libavformat/eacdata.c index 5fa22863b8..ac5dbe3947 100644 --- a/libavformat/eacdata.c +++ b/libavformat/eacdata.c @@ -67,7 +67,7 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap) st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = 0; /* no fourcc */ st->codec->codec_id = CODEC_ID_ADPCM_EA_XAS; st->codec->channels = cdata->channels; diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c index df9aded9d3..fd05870f0d 100644 --- a/libavformat/electronicarts.c +++ b/libavformat/electronicarts.c @@ -414,7 +414,7 @@ static int ea_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); ea->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = ea->video_codec; st->codec->codec_tag = 0; /* no fourcc */ st->codec->time_base = ea->time_base; @@ -428,7 +428,7 @@ static int ea_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, ea->sample_rate); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = ea->audio_codec; st->codec->codec_tag = 0; /* no tag */ st->codec->channels = ea->num_channels; diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index b39836adb4..3f0911fa1e 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -301,7 +301,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) codec->debug = get_be32(pb); /* specific info */ switch(codec->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: codec->time_base.num = get_be32(pb); codec->time_base.den = get_be32(pb); codec->width = get_be16(pb); @@ -350,7 +350,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) codec->refs = get_be32(pb); codec->directpred = get_be32(pb); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: codec->sample_rate = get_be32(pb); codec->channels = get_le16(pb); codec->frame_size = get_le16(pb); diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c index 52d55d6936..b9e62aa197 100644 --- a/libavformat/ffmenc.c +++ b/libavformat/ffmenc.c @@ -119,7 +119,7 @@ static int ffm_write_header(AVFormatContext *s) put_be32(pb, codec->debug); /* specific info */ switch(codec->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: put_be32(pb, codec->time_base.num); put_be32(pb, codec->time_base.den); put_be16(pb, codec->width); @@ -168,7 +168,7 @@ static int ffm_write_header(AVFormatContext *s) put_be32(pb, codec->refs); put_be32(pb, codec->directpred); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: put_be32(pb, codec->sample_rate); put_le16(pb, codec->channels); put_le16(pb, codec->frame_size); diff --git a/libavformat/filmstripdec.c b/libavformat/filmstripdec.c index 80c4157d8e..2fa658b4f0 100644 --- a/libavformat/filmstripdec.c +++ b/libavformat/filmstripdec.c @@ -60,7 +60,7 @@ static int read_header(AVFormatContext *s, } url_fskip(pb, 2); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_RAWVIDEO; st->codec->pix_fmt = PIX_FMT_RGBA; st->codec->codec_tag = 0; /* no fourcc */ diff --git a/libavformat/flacdec.c b/libavformat/flacdec.c index a1bb51b074..02ae8ae628 100644 --- a/libavformat/flacdec.c +++ b/libavformat/flacdec.c @@ -36,7 +36,7 @@ static int flac_read_header(AVFormatContext *s, AVStream *st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_FLAC; st->need_parsing = AVSTREAM_PARSE_FULL; /* the parameters will be extracted from the compressed bitstream */ diff --git a/libavformat/flic.c b/libavformat/flic.c index b382a25f96..55f07587be 100644 --- a/libavformat/flic.c +++ b/libavformat/flic.c @@ -103,7 +103,7 @@ static int flic_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); flic->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_FLIC; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = AV_RL16(&header[0x08]); diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index f84ad31c31..fc51594f6f 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -221,8 +221,8 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos) { //find the streams now so that amf_parse_object doesn't need to do the lookup every time it is called. for(i = 0; i < s->nb_streams; i++) { stream = s->streams[i]; - if (stream->codec->codec_type == CODEC_TYPE_AUDIO) astream = stream; - else if(stream->codec->codec_type == CODEC_TYPE_VIDEO) vstream = stream; + if (stream->codec->codec_type == AVMEDIA_TYPE_AUDIO) astream = stream; + else if(stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) vstream = stream; } //parse the second object (we want a mixed array) @@ -236,7 +236,7 @@ static AVStream *create_stream(AVFormatContext *s, int is_audio){ AVStream *st = av_new_stream(s, is_audio); if (!st) return NULL; - st->codec->codec_type = is_audio ? CODEC_TYPE_AUDIO : CODEC_TYPE_VIDEO; + st->codec->codec_type = is_audio ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO; av_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */ return st; } diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c index cf6b1c566f..9b68737530 100644 --- a/libavformat/flvenc.c +++ b/libavformat/flvenc.c @@ -166,7 +166,7 @@ static int flv_write_header(AVFormatContext *s) for(i=0; inb_streams; i++){ AVCodecContext *enc = s->streams[i]->codec; - if (enc->codec_type == CODEC_TYPE_VIDEO) { + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) { framerate = av_q2d(s->streams[i]->r_frame_rate); } else { @@ -275,7 +275,7 @@ static int flv_write_header(AVFormatContext *s) AVCodecContext *enc = s->streams[i]->codec; if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) { int64_t pos; - put_byte(pb, enc->codec_type == CODEC_TYPE_VIDEO ? + put_byte(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO ? FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO); put_be24(pb, 0); // size patched later put_be24(pb, 0); // ts @@ -342,7 +342,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) else flags_size= 1; - if (enc->codec_type == CODEC_TYPE_VIDEO) { + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { put_byte(pb, FLV_TAG_TYPE_VIDEO); flags = enc->codec_tag; @@ -353,7 +353,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) flags |= pkt->flags & PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER; } else { - assert(enc->codec_type == CODEC_TYPE_AUDIO); + assert(enc->codec_type == AVMEDIA_TYPE_AUDIO); flags = get_audio_flags(enc); assert(size); diff --git a/libavformat/gif.c b/libavformat/gif.c index 2b802a9dca..4741915bac 100644 --- a/libavformat/gif.c +++ b/libavformat/gif.c @@ -266,7 +266,7 @@ static int gif_write_header(AVFormatContext *s) video_enc = NULL; for(i=0;inb_streams;i++) { enc = s->streams[i]->codec; - if (enc->codec_type != CODEC_TYPE_AUDIO) + if (enc->codec_type != AVMEDIA_TYPE_AUDIO) video_enc = enc; } @@ -329,7 +329,7 @@ static int gif_write_video(AVFormatContext *s, static int gif_write_packet(AVFormatContext *s, AVPacket *pkt) { AVCodecContext *codec = s->streams[pkt->stream_index]->codec; - if (codec->codec_type == CODEC_TYPE_AUDIO) + if (codec->codec_type == AVMEDIA_TYPE_AUDIO) return 0; /* just ignore audio */ else return gif_write_video(s, codec, pkt->data, pkt->size); diff --git a/libavformat/gxf.c b/libavformat/gxf.c index 774f61aedc..ea8a2fff7f 100644 --- a/libavformat/gxf.c +++ b/libavformat/gxf.c @@ -87,34 +87,34 @@ static int get_sindex(AVFormatContext *s, int id, int format) { switch (format) { case 3: case 4: - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MJPEG; break; case 13: case 15: - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_DVVIDEO; break; case 14: case 16: - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_DVVIDEO; break; case 11: case 12: case 20: - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MPEG2VIDEO; st->need_parsing = AVSTREAM_PARSE_HEADERS; //get keyframe flag etc. break; case 22: case 23: - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MPEG1VIDEO; st->need_parsing = AVSTREAM_PARSE_HEADERS; //get keyframe flag etc. break; case 9: - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_PCM_S24LE; st->codec->channels = 1; st->codec->sample_rate = 48000; @@ -123,7 +123,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { st->codec->bits_per_coded_sample = 24; break; case 10: - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_PCM_S16LE; st->codec->channels = 1; st->codec->sample_rate = 48000; @@ -132,7 +132,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { st->codec->bits_per_coded_sample = 16; break; case 17: - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_AC3; st->codec->channels = 2; st->codec->sample_rate = 48000; @@ -141,11 +141,11 @@ static int get_sindex(AVFormatContext *s, int id, int format) { case 7: case 8: case 24: - st->codec->codec_type = CODEC_TYPE_DATA; + st->codec->codec_type = AVMEDIA_TYPE_DATA; st->codec->codec_id = CODEC_ID_NONE; break; default: - st->codec->codec_type = CODEC_TYPE_UNKNOWN; + st->codec->codec_type = AVMEDIA_TYPE_UNKNOWN; st->codec->codec_id = CODEC_ID_NONE; break; } diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c index 603f595b32..a6f4b7260e 100644 --- a/libavformat/gxfenc.c +++ b/libavformat/gxfenc.c @@ -644,7 +644,7 @@ static int gxf_write_header(AVFormatContext *s) st->priv_data = sc; sc->media_type = ff_codec_get_tag(gxf_media_types, st->codec->codec_id); - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (st->codec->codec_id != CODEC_ID_PCM_S16LE) { av_log(s, AV_LOG_ERROR, "only 16 BIT PCM LE allowed for now\n"); return -1; @@ -667,7 +667,7 @@ static int gxf_write_header(AVFormatContext *s) gxf->audio_tracks++; gxf->flags |= 0x04000000; /* audio is 16 bit pcm */ media_info = 'A'; - } else if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (i != 0) { av_log(s, AV_LOG_ERROR, "video stream must be the first track\n"); return -1; @@ -811,7 +811,7 @@ static int gxf_write_media_preamble(AVFormatContext *s, AVPacket *pkt, int size) /* If the video is frame-encoded, the frame numbers shall be represented by * even field numbers. * see SMPTE360M-2004 6.4.2.1.3 Media field number */ - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { field_nb = gxf->nb_fields; } else { field_nb = av_rescale_rnd(pkt->dts, gxf->time_base.den, @@ -821,7 +821,7 @@ static int gxf_write_media_preamble(AVFormatContext *s, AVPacket *pkt, int size) put_byte(pb, sc->media_type); put_byte(pb, st->index); put_be32(pb, field_nb); - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { put_be16(pb, 0); put_be16(pb, size / 2); } else if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO) { @@ -859,13 +859,13 @@ static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt) gxf_write_packet_header(pb, PKT_MEDIA); if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO && pkt->size % 4) /* MPEG-2 frames must be padded */ padding = 4 - pkt->size % 4; - else if (st->codec->codec_type == CODEC_TYPE_AUDIO) + else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) padding = GXF_AUDIO_PACKET_SIZE - pkt->size; gxf_write_media_preamble(s, pkt, pkt->size + padding); put_buffer(pb, pkt->data, pkt->size); gxf_write_padding(pb, padding); - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (!(gxf->flt_entries_nb % 500)) { gxf->flt_entries = av_realloc(gxf->flt_entries, (gxf->flt_entries_nb+500)*sizeof(*gxf->flt_entries)); @@ -901,7 +901,7 @@ static int gxf_compare_field_nb(AVFormatContext *s, AVPacket *next, AVPacket *cu for (i = 0; i < 2; i++) { AVStream *st = s->streams[pkt[i]->stream_index]; sc[i] = st->priv_data; - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { field_nb[i] = av_rescale_rnd(pkt[i]->dts, gxf->time_base.den, (int64_t)48000*gxf->time_base.num, AV_ROUND_UP); field_nb[i] &= ~1; // compare against even field number because audio must be before video @@ -915,7 +915,7 @@ static int gxf_compare_field_nb(AVFormatContext *s, AVPacket *next, AVPacket *cu static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush) { - if (pkt && s->streams[pkt->stream_index]->codec->codec_type == CODEC_TYPE_VIDEO) + if (pkt && s->streams[pkt->stream_index]->codec->codec_type == AVMEDIA_TYPE_VIDEO) pkt->duration = 2; // enforce 2 fields return ff_audio_rechunk_interleave(s, out, pkt, flush, av_interleave_packet_per_dts, gxf_compare_field_nb); diff --git a/libavformat/idcin.c b/libavformat/idcin.c index 9fd146f9ba..9014a6e502 100644 --- a/libavformat/idcin.c +++ b/libavformat/idcin.c @@ -160,7 +160,7 @@ static int idcin_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, IDCIN_FPS); idcin->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_IDCIN; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = width; @@ -183,7 +183,7 @@ static int idcin_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, IDCIN_FPS); idcin->audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = 1; st->codec->channels = channels; st->codec->sample_rate = sample_rate; diff --git a/libavformat/idroq.c b/libavformat/idroq.c index c570eecf0d..4df7fd4a67 100644 --- a/libavformat/idroq.c +++ b/libavformat/idroq.c @@ -89,7 +89,7 @@ static int roq_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 63, 1, framerate); roq->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_ROQ; st->codec->codec_tag = 0; /* no fourcc */ @@ -171,7 +171,7 @@ static int roq_read_packet(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 32, 1, RoQ_AUDIO_SAMPLE_RATE); roq->audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ROQ_DPCM; st->codec->codec_tag = 0; /* no tag */ st->codec->channels = roq->audio_channels = chunk_type == RoQ_SOUND_STEREO ? 2 : 1; diff --git a/libavformat/iff.c b/libavformat/iff.c index 62ee16d7a0..6dcd686b80 100644 --- a/libavformat/iff.c +++ b/libavformat/iff.c @@ -119,7 +119,7 @@ static int iff_read_header(AVFormatContext *s, switch(chunk_id) { case ID_VHDR: - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; url_fskip(pb, 12); st->codec->sample_rate = get_be16(pb); url_fskip(pb, 1); @@ -146,7 +146,7 @@ static int iff_read_header(AVFormatContext *s, break; case ID_BMHD: - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->width = get_be16(pb); st->codec->height = get_be16(pb); url_fskip(pb, 4); // x, y offset @@ -175,7 +175,7 @@ static int iff_read_header(AVFormatContext *s, } switch(st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: av_set_pts_info(st, 32, 1, st->codec->sample_rate); switch(compression) { @@ -198,7 +198,7 @@ static int iff_read_header(AVFormatContext *s, st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: switch (compression) { case BITMAP_RAW: if (st->codec->codec_tag == ID_ILBM) { @@ -256,7 +256,7 @@ static int iff_read_packet(AVFormatContext *s, st->codec->extradata_size = 0; ret = get_buffer(pb, pkt->data, iff->body_size); - } else if (s->streams[0]->codec->codec_type == CODEC_TYPE_VIDEO) { + } else if (s->streams[0]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { ret = av_get_packet(pb, pkt, iff->body_size); } else { ret = av_get_packet(pb, pkt, PACKET_SIZE); @@ -265,13 +265,13 @@ static int iff_read_packet(AVFormatContext *s, if(iff->sent_bytes == 0) pkt->flags |= PKT_FLAG_KEY; - if(s->streams[0]->codec->codec_type == CODEC_TYPE_AUDIO) { + if(s->streams[0]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { iff->sent_bytes += PACKET_SIZE; } else { iff->sent_bytes = iff->body_size; } pkt->stream_index = 0; - if(s->streams[0]->codec->codec_type == CODEC_TYPE_AUDIO) { + if(s->streams[0]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { pkt->pts = iff->audio_frame_count; iff->audio_frame_count += ret / s->streams[0]->codec->channels; } diff --git a/libavformat/img2.c b/libavformat/img2.c index 783167317c..a531967d81 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -233,16 +233,16 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap) } if(s1->video_codec_id){ - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = s1->video_codec_id; }else if(s1->audio_codec_id){ - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = s1->audio_codec_id; }else{ - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = av_str2id(img_tags, s->path); } - if(st->codec->codec_type == CODEC_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE) + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE) st->codec->pix_fmt = ap->pix_fmt; return 0; diff --git a/libavformat/ipmovie.c b/libavformat/ipmovie.c index bf62ee64ce..7e94acef0b 100644 --- a/libavformat/ipmovie.c +++ b/libavformat/ipmovie.c @@ -566,7 +566,7 @@ static int ipmovie_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 63, 1, 1000000); ipmovie->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_INTERPLAY_VIDEO; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = ipmovie->video_width; @@ -582,7 +582,7 @@ static int ipmovie_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate); ipmovie->audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = ipmovie->audio_type; st->codec->codec_tag = 0; /* no tag */ st->codec->channels = ipmovie->audio_channels; diff --git a/libavformat/iss.c b/libavformat/iss.c index 891729a2b5..b417eb364c 100644 --- a/libavformat/iss.c +++ b/libavformat/iss.c @@ -92,7 +92,7 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap) st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_IMA_ISS; st->codec->channels = stereo ? 2 : 1; st->codec->sample_rate = 44100; diff --git a/libavformat/iv8.c b/libavformat/iv8.c index 299de45ba8..00ddcd4f7a 100644 --- a/libavformat/iv8.c +++ b/libavformat/iv8.c @@ -44,7 +44,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MPEG4; st->need_parsing = AVSTREAM_PARSE_FULL; av_set_pts_info(st, 64, 1, 90000); diff --git a/libavformat/libnut.c b/libavformat/libnut.c index f23e70dc08..365a545234 100644 --- a/libavformat/libnut.c +++ b/libavformat/libnut.c @@ -77,14 +77,14 @@ static int nut_write_header(AVFormatContext * avf) { int fourcc = 0; int num, denom, ssize; - s[i].type = codec->codec_type == CODEC_TYPE_VIDEO ? NUT_VIDEO_CLASS : NUT_AUDIO_CLASS; + s[i].type = codec->codec_type == AVMEDIA_TYPE_VIDEO ? NUT_VIDEO_CLASS : NUT_AUDIO_CLASS; if (codec->codec_tag) fourcc = codec->codec_tag; else fourcc = ff_codec_get_tag(nut_tags, codec->codec_id); if (!fourcc) { - if (codec->codec_type == CODEC_TYPE_VIDEO) fourcc = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id); - if (codec->codec_type == CODEC_TYPE_AUDIO) fourcc = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id); + if (codec->codec_type == AVMEDIA_TYPE_VIDEO) fourcc = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id); + if (codec->codec_type == AVMEDIA_TYPE_AUDIO) fourcc = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id); } s[i].fourcc_len = 4; @@ -102,7 +102,7 @@ static int nut_write_header(AVFormatContext * avf) { s[i].codec_specific_len = codec->extradata_size; s[i].codec_specific = codec->extradata; - if (codec->codec_type == CODEC_TYPE_VIDEO) { + if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { s[i].width = codec->width; s[i].height = codec->height; s[i].sample_width = 0; @@ -234,14 +234,14 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) { switch(s[i].type) { case NUT_AUDIO_CLASS: - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, st->codec->codec_tag); st->codec->channels = s[i].channel_count; st->codec->sample_rate = s[i].samplerate_num / s[i].samplerate_denom; break; case NUT_VIDEO_CLASS: - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, st->codec->codec_tag); st->codec->width = s[i].width; diff --git a/libavformat/lmlm4.c b/libavformat/lmlm4.c index dc0a90125a..be606e827e 100644 --- a/libavformat/lmlm4.c +++ b/libavformat/lmlm4.c @@ -62,14 +62,14 @@ static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) { if (!(st = av_new_stream(s, 0))) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MPEG4; st->need_parsing = AVSTREAM_PARSE_HEADERS; av_set_pts_info(st, 64, 1001, 30000); if (!(st = av_new_stream(s, 1))) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MP2; st->need_parsing = AVSTREAM_PARSE_HEADERS; diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c index 1e646fc559..01c2c7cabe 100644 --- a/libavformat/matroskadec.c +++ b/libavformat/matroskadec.c @@ -1378,7 +1378,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) } if (track->type == MATROSKA_TRACK_TYPE_VIDEO) { - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_tag = track->video.fourcc; st->codec->width = track->video.pixel_width; st->codec->height = track->video.pixel_height; @@ -1390,11 +1390,11 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) if (st->codec->codec_id != CODEC_ID_H264) st->need_parsing = AVSTREAM_PARSE_HEADERS; } else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) { - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->sample_rate = track->audio.out_samplerate; st->codec->channels = track->audio.channels; } else if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE) { - st->codec->codec_type = CODEC_TYPE_SUBTITLE; + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; } } @@ -1409,7 +1409,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) break; av_metadata_set(&st->metadata, "filename",attachements[j].filename); st->codec->codec_id = CODEC_ID_NONE; - st->codec->codec_type = CODEC_TYPE_ATTACHMENT; + st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT; st->codec->extradata = av_malloc(attachements[j].bin.size); if(st->codec->extradata == NULL) break; diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c index 0a17c73d46..32fc4bc82f 100644 --- a/libavformat/matroskaenc.c +++ b/libavformat/matroskaenc.c @@ -475,7 +475,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, ByteIOContext *pb, AVCodec ret = ff_isom_write_avcc(dyn_cp, codec->extradata, codec->extradata_size); else if (codec->extradata_size) put_buffer(dyn_cp, codec->extradata, codec->extradata_size); - } else if (codec->codec_type == CODEC_TYPE_VIDEO) { + } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (qt_id) { if (!codec->codec_tag) codec->codec_tag = ff_codec_get_tag(codec_movvideo_tags, codec->codec_id); @@ -492,7 +492,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, ByteIOContext *pb, AVCodec ff_put_bmp_header(dyn_cp, codec, ff_codec_bmp_tags, 0); } - } else if (codec->codec_type == CODEC_TYPE_AUDIO) { + } else if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { unsigned int tag; tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id); if (!tag) { @@ -565,7 +565,7 @@ static int mkv_write_tracks(AVFormatContext *s) } switch (codec->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO); if (!native_id && @@ -596,7 +596,7 @@ static int mkv_write_tracks(AVFormatContext *s) end_ebml_master(pb, subinfo); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_AUDIO); if (!native_id) @@ -613,7 +613,7 @@ static int mkv_write_tracks(AVFormatContext *s) end_ebml_master(pb, subinfo); break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_SUBTITLE); break; default: @@ -893,7 +893,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) av_md5_update(mkv->md5_ctx, pkt->data, FFMIN(200, pkt->size)); } - if (codec->codec_type != CODEC_TYPE_SUBTITLE) { + if (codec->codec_type != AVMEDIA_TYPE_SUBTITLE) { mkv_write_block(s, pb, MATROSKA_ID_SIMPLEBLOCK, pkt, keyframe << 7); } else if (codec->codec_id == CODEC_ID_SSA) { duration = mkv_write_ass_blocks(s, pb, pkt); @@ -905,7 +905,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) end_ebml_master(pb, blockgroup); } - if (codec->codec_type == CODEC_TYPE_VIDEO && keyframe) { + if (codec->codec_type == AVMEDIA_TYPE_VIDEO && keyframe) { ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, ts, mkv->cluster_pos); if (ret < 0) return ret; } diff --git a/libavformat/mm.c b/libavformat/mm.c index 8ed315428a..d6c9c303c9 100644 --- a/libavformat/mm.c +++ b/libavformat/mm.c @@ -108,7 +108,7 @@ static int read_header(AVFormatContext *s, st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MMVIDEO; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = width; @@ -120,7 +120,7 @@ static int read_header(AVFormatContext *s, st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = 0; /* no fourcc */ st->codec->codec_id = CODEC_ID_PCM_U8; st->codec->channels = 1; diff --git a/libavformat/mmf.c b/libavformat/mmf.c index 75afa0e31c..540407f659 100644 --- a/libavformat/mmf.c +++ b/libavformat/mmf.c @@ -244,7 +244,7 @@ static int mmf_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_YAMAHA; st->codec->sample_rate = rate; st->codec->channels = 1; diff --git a/libavformat/mov.c b/libavformat/mov.c index f8b2d8d0cb..59baa0d6c3 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -411,13 +411,13 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom) dprintf(c->fc, "stype= %.4s\n", (char*)&type); if (type == MKTAG('v','i','d','e')) - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; else if(type == MKTAG('s','o','u','n')) - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; else if(type == MKTAG('m','1','a',' ')) st->codec->codec_id = CODEC_ID_MP2; else if(type == MKTAG('s','u','b','p')) - st->codec->codec_type = CODEC_TYPE_SUBTITLE; + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; get_be32(pb); /* component manufacture */ get_be32(pb); /* component flags */ @@ -933,19 +933,19 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) if (id<=0 && ((format&0xFFFF) == 'm'+('s'<<8) || (format&0xFFFF) == 'T'+('S'<<8))) id = ff_codec_get_id(ff_codec_wav_tags, bswap_32(format)&0xFFFF); - if (st->codec->codec_type != CODEC_TYPE_VIDEO && id > 0) { - st->codec->codec_type = CODEC_TYPE_AUDIO; - } else if (st->codec->codec_type != CODEC_TYPE_AUDIO && /* do not overwrite codec type */ + if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO && id > 0) { + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; + } else if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO && /* do not overwrite codec type */ format && format != MKTAG('m','p','4','s')) { /* skip old asf mpeg4 tag */ id = ff_codec_get_id(codec_movvideo_tags, format); if (id <= 0) id = ff_codec_get_id(ff_codec_bmp_tags, format); if (id > 0) - st->codec->codec_type = CODEC_TYPE_VIDEO; - else if(st->codec->codec_type == CODEC_TYPE_DATA){ + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; + else if(st->codec->codec_type == AVMEDIA_TYPE_DATA){ id = ff_codec_get_id(ff_codec_movsubtitle_tags, format); if(id > 0) - st->codec->codec_type = CODEC_TYPE_SUBTITLE; + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; } } @@ -953,7 +953,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) (format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff, (format >> 24) & 0xff, st->codec->codec_type); - if(st->codec->codec_type==CODEC_TYPE_VIDEO) { + if(st->codec->codec_type==AVMEDIA_TYPE_VIDEO) { unsigned int color_depth, len; int color_greyscale; @@ -1057,7 +1057,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) } st->codec->palctrl->palette_changed = 1; } - } else if(st->codec->codec_type==CODEC_TYPE_AUDIO) { + } else if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO) { int bits_per_sample, flags; uint16_t version = get_be16(pb); @@ -1137,7 +1137,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) st->codec->bits_per_coded_sample = bits_per_sample; sc->sample_size = (bits_per_sample >> 3) * st->codec->channels; } - } else if(st->codec->codec_type==CODEC_TYPE_SUBTITLE){ + } else if(st->codec->codec_type==AVMEDIA_TYPE_SUBTITLE){ // ttxt stsd contains display flags, justification, background // color, fonts, and default styles, so fake an atom to read it MOVAtom fake_atom = { .size = size - (url_ftell(pb) - start_pos) }; @@ -1159,7 +1159,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) url_fskip(pb, a.size); } - if(st->codec->codec_type==CODEC_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) + if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) st->codec->sample_rate= sc->time_scale; /* special codec parameters handling */ @@ -1196,7 +1196,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) break; case CODEC_ID_MP2: case CODEC_ID_MP3: - st->codec->codec_type = CODEC_TYPE_AUDIO; /* force type after stsd for m1a hdlr */ + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; /* force type after stsd for m1a hdlr */ st->need_parsing = AVSTREAM_PARSE_FULL; break; case CODEC_ID_GSM: @@ -1490,7 +1490,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) } /* only use old uncompressed audio chunk demuxing when stts specifies it */ - if (!(st->codec->codec_type == CODEC_TYPE_AUDIO && + if (!(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && sc->stts_count == 1 && sc->stts_data[0].duration == 1)) { unsigned int current_sample = 0; unsigned int stts_sample = 0; @@ -1698,7 +1698,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom) if (!sc) return AVERROR(ENOMEM); st->priv_data = sc; - st->codec->codec_type = CODEC_TYPE_DATA; + st->codec->codec_type = AVMEDIA_TYPE_DATA; sc->ffindex = st->index; if ((ret = mov_read_default(c, pb, atom)) < 0) @@ -1721,7 +1721,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom) av_set_pts_info(st, 64, 1, sc->time_scale); - if (st->codec->codec_type == CODEC_TYPE_AUDIO && + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && !st->codec->frame_size && sc->stts_count == 1) { st->codec->frame_size = av_rescale(sc->stts_data[0].duration, st->codec->sample_rate, sc->time_scale); @@ -1741,7 +1741,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom) } else sc->pb = c->fc->pb; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (st->codec->width != sc->width || st->codec->height != sc->height) { AVRational r = av_d2q(((double)st->codec->height * sc->width) / ((double)st->codec->width * sc->height), INT_MAX); @@ -2004,7 +2004,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom) sc->ctts_data[sc->ctts_count].duration = get_be32(pb); sc->ctts_count++; } - if ((keyframe = st->codec->codec_type == CODEC_TYPE_AUDIO || + if ((keyframe = st->codec->codec_type == AVMEDIA_TYPE_AUDIO || (flags & 0x004 && !i && !sample_flags) || sample_flags & 0x2000000)) distance = 0; av_add_index_entry(st, offset, dts, sample_size, distance, diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 671a9dde2d..f5c344f7ab 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -333,7 +333,7 @@ static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack *track) // Basic // the following fields is made of 6 bits to identify the streamtype (4 for video, 5 for audio) // plus 1 bit to indicate upstream and 1 bit set to 1 (reserved) - if(track->enc->codec_type == CODEC_TYPE_AUDIO) + if(track->enc->codec_type == AVMEDIA_TYPE_AUDIO) put_byte(pb, 0x15); // flags (= Audiostream) else put_byte(pb, 0x11); // flags (= Visualstream) @@ -620,8 +620,8 @@ static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track) else if (track->enc->codec_id == CODEC_ID_AC3) tag = MKTAG('a','c','-','3'); else if (track->enc->codec_id == CODEC_ID_DIRAC) tag = MKTAG('d','r','a','c'); else if (track->enc->codec_id == CODEC_ID_MOV_TEXT) tag = MKTAG('t','x','3','g'); - else if (track->enc->codec_type == CODEC_TYPE_VIDEO) tag = MKTAG('m','p','4','v'); - else if (track->enc->codec_type == CODEC_TYPE_AUDIO) tag = MKTAG('m','p','4','a'); + else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) tag = MKTAG('m','p','4','v'); + else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) tag = MKTAG('m','p','4','a'); return tag; } @@ -642,7 +642,7 @@ static int ipod_get_codec_tag(AVFormatContext *s, MOVTrack *track) int tag = track->enc->codec_tag; // keep original tag for subs, ipod supports both formats - if (!(track->enc->codec_type == CODEC_TYPE_SUBTITLE && + if (!(track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE && (tag == MKTAG('t','x','3','g') || tag == MKTAG('t','e','x','t')))) tag = ff_codec_get_tag(codec_ipod_tags, track->enc->codec_id); @@ -714,7 +714,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track) tag = mov_get_dv_codec_tag(s, track); else if (track->enc->codec_id == CODEC_ID_RAWVIDEO) tag = mov_get_rawvideo_codec_tag(s, track); - else if (track->enc->codec_type == CODEC_TYPE_VIDEO) { + else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { tag = ff_codec_get_tag(codec_movvideo_tags, track->enc->codec_id); if (!tag) { // if no mac fcc found, try with Microsoft tags tag = ff_codec_get_tag(ff_codec_bmp_tags, track->enc->codec_id); @@ -722,7 +722,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track) av_log(s, AV_LOG_INFO, "Warning, using MS style video codec tag, " "the file may be unplayable!\n"); } - } else if (track->enc->codec_type == CODEC_TYPE_AUDIO) { + } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) { tag = ff_codec_get_tag(codec_movaudio_tags, track->enc->codec_id); if (!tag) { // if no mac fcc found, try with Microsoft tags int ms_tag = ff_codec_get_tag(ff_codec_wav_tags, track->enc->codec_id); @@ -732,7 +732,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track) "the file may be unplayable!\n"); } } - } else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) + } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) tag = ff_codec_get_tag(ff_codec_movsubtitle_tags, track->enc->codec_id); } @@ -868,11 +868,11 @@ static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack *track) put_tag(pb, "stsd"); put_be32(pb, 0); /* version & flags */ put_be32(pb, 1); /* entry count */ - if (track->enc->codec_type == CODEC_TYPE_VIDEO) + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) mov_write_video_tag(pb, track); - else if (track->enc->codec_type == CODEC_TYPE_AUDIO) + else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) mov_write_audio_tag(pb, track); - else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) + else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) mov_write_subtitle_tag(pb, track); return updateSize(pb, pos); } @@ -918,7 +918,7 @@ static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack *track) uint32_t atom_size; int i; - if (track->enc->codec_type == CODEC_TYPE_AUDIO && !track->audio_vbr) { + if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO && !track->audio_vbr) { stts_entries = av_malloc(sizeof(*stts_entries)); /* one entry */ stts_entries[0].count = track->sampleCount; stts_entries[0].duration = 1; @@ -973,12 +973,12 @@ static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack *track) put_tag(pb, "stbl"); mov_write_stsd_tag(pb, track); mov_write_stts_tag(pb, track); - if (track->enc->codec_type == CODEC_TYPE_VIDEO && + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && track->hasKeyframes && track->hasKeyframes < track->entry) mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE); if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS) mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE); - if (track->enc->codec_type == CODEC_TYPE_VIDEO && + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && track->flags & MOV_TRACK_CTTS) mov_write_ctts_tag(pb, track); mov_write_stsc_tag(pb, track); @@ -1050,13 +1050,13 @@ static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track) descr = "DataHandler"; } else { hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0"; - if (track->enc->codec_type == CODEC_TYPE_VIDEO) { + if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { hdlr_type = "vide"; descr = "VideoHandler"; - } else if (track->enc->codec_type == CODEC_TYPE_AUDIO) { + } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) { hdlr_type = "soun"; descr = "SoundHandler"; - } else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) { + } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { if (track->tag == MKTAG('t','x','3','g')) hdlr_type = "sbtl"; else hdlr_type = "text"; descr = "SubtitleHandler"; @@ -1084,11 +1084,11 @@ static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack *track) int64_t pos = url_ftell(pb); put_be32(pb, 0); /* size */ put_tag(pb, "minf"); - if(track->enc->codec_type == CODEC_TYPE_VIDEO) + if(track->enc->codec_type == AVMEDIA_TYPE_VIDEO) mov_write_vmhd_tag(pb); - else if (track->enc->codec_type == CODEC_TYPE_AUDIO) + else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) mov_write_smhd_tag(pb); - else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) { + else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { if (track->tag == MKTAG('t','e','x','t')) mov_write_gmhd_tag(pb); else mov_write_nmhd_tag(pb); } @@ -1165,7 +1165,7 @@ static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st) put_be32(pb, 0); /* reserved */ put_be32(pb, 0x0); /* reserved (Layer & Alternate group) */ /* Volume, only for audio */ - if(track->enc->codec_type == CODEC_TYPE_AUDIO) + if(track->enc->codec_type == AVMEDIA_TYPE_AUDIO) put_be16(pb, 0x0100); else put_be16(pb, 0); @@ -1183,8 +1183,8 @@ static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st) put_be32(pb, 0x40000000); /* reserved */ /* Track width and height, for visual only */ - if(track->enc->codec_type == CODEC_TYPE_VIDEO || - track->enc->codec_type == CODEC_TYPE_SUBTITLE) { + if(track->enc->codec_type == AVMEDIA_TYPE_VIDEO || + track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio); if(!sample_aspect_ratio || track->height != track->enc->height) sample_aspect_ratio = 1; @@ -1671,7 +1671,7 @@ static int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s) for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) has_video = 1; if (st->codec->codec_id == CODEC_ID_H264) has_h264 = 1; @@ -1829,7 +1829,7 @@ static int mov_write_header(AVFormatContext *s) "codec not currently supported in container\n", i); goto error; } - if(st->codec->codec_type == CODEC_TYPE_VIDEO){ + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ if (track->tag == MKTAG('m','x','3','p') || track->tag == MKTAG('m','x','3','n') || track->tag == MKTAG('m','x','4','p') || track->tag == MKTAG('m','x','4','n') || track->tag == MKTAG('m','x','5','p') || track->tag == MKTAG('m','x','5','n')) { @@ -1845,7 +1845,7 @@ static int mov_write_header(AVFormatContext *s) "WARNING codec timebase is very high. If duration is too long,\n" "file may not be playable by quicktime. Specify a shorter timebase\n" "or choose different container.\n"); - }else if(st->codec->codec_type == CODEC_TYPE_AUDIO){ + }else if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO){ track->timescale = st->codec->sample_rate; if(!st->codec->frame_size && !av_get_bits_per_sample(st->codec->codec_id)) { av_log(s, AV_LOG_ERROR, "track %d: codec frame size is not set\n", i); @@ -1868,7 +1868,7 @@ static int mov_write_header(AVFormatContext *s) goto error; } } - }else if(st->codec->codec_type == CODEC_TYPE_SUBTITLE){ + }else if(st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE){ track->timescale = st->codec->time_base.den; } if (!track->height) diff --git a/libavformat/mp3.c b/libavformat/mp3.c index a111b19272..3ee3cb2a8a 100644 --- a/libavformat/mp3.c +++ b/libavformat/mp3.c @@ -140,7 +140,7 @@ static int mp3_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MP3; st->need_parsing = AVSTREAM_PARSE_FULL; st->start_time = 0; diff --git a/libavformat/mpc.c b/libavformat/mpc.c index a164783002..4dda65dbca 100644 --- a/libavformat/mpc.c +++ b/libavformat/mpc.c @@ -104,7 +104,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap) st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MUSEPACK7; st->codec->channels = 2; st->codec->bits_per_coded_sample = 16; diff --git a/libavformat/mpc8.c b/libavformat/mpc8.c index 85cbb41f83..92e996c29c 100644 --- a/libavformat/mpc8.c +++ b/libavformat/mpc8.c @@ -224,7 +224,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap) st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MUSEPACK8; st->codec->bits_per_coded_sample = 16; diff --git a/libavformat/mpeg.c b/libavformat/mpeg.c index 2b1cc34349..4224a04b37 100644 --- a/libavformat/mpeg.c +++ b/libavformat/mpeg.c @@ -417,7 +417,7 @@ static int mpegps_read_packet(AVFormatContext *s, AVStream *st; int len, startcode, i, es_type; enum CodecID codec_id = CODEC_ID_NONE; - enum CodecType type; + enum AVMediaType type; int64_t pts, dts, dummy_pos; //dummy_pos is needed for the index building to work uint8_t av_uninit(dvdaudio_substream_type); @@ -443,26 +443,26 @@ static int mpegps_read_packet(AVFormatContext *s, if(es_type > 0 && es_type != STREAM_TYPE_PRIVATE_DATA){ if(es_type == STREAM_TYPE_VIDEO_MPEG1){ codec_id = CODEC_ID_MPEG2VIDEO; - type = CODEC_TYPE_VIDEO; + type = AVMEDIA_TYPE_VIDEO; } else if(es_type == STREAM_TYPE_VIDEO_MPEG2){ codec_id = CODEC_ID_MPEG2VIDEO; - type = CODEC_TYPE_VIDEO; + type = AVMEDIA_TYPE_VIDEO; } else if(es_type == STREAM_TYPE_AUDIO_MPEG1 || es_type == STREAM_TYPE_AUDIO_MPEG2){ codec_id = CODEC_ID_MP3; - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; } else if(es_type == STREAM_TYPE_AUDIO_AAC){ codec_id = CODEC_ID_AAC; - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; } else if(es_type == STREAM_TYPE_VIDEO_MPEG4){ codec_id = CODEC_ID_MPEG4; - type = CODEC_TYPE_VIDEO; + type = AVMEDIA_TYPE_VIDEO; } else if(es_type == STREAM_TYPE_VIDEO_H264){ codec_id = CODEC_ID_H264; - type = CODEC_TYPE_VIDEO; + type = AVMEDIA_TYPE_VIDEO; } else if(es_type == STREAM_TYPE_AUDIO_AC3){ codec_id = CODEC_ID_AC3; - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; } else { goto skip; } @@ -475,38 +475,38 @@ static int mpegps_read_packet(AVFormatContext *s, codec_id = CODEC_ID_CAVS; else codec_id = CODEC_ID_PROBE; - type = CODEC_TYPE_VIDEO; + type = AVMEDIA_TYPE_VIDEO; } else if (startcode >= 0x1c0 && startcode <= 0x1df) { - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; codec_id = m->sofdec > 0 ? CODEC_ID_ADPCM_ADX : CODEC_ID_MP2; } else if (startcode >= 0x80 && startcode <= 0x87) { - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; codec_id = CODEC_ID_AC3; } else if ( ( startcode >= 0x88 && startcode <= 0x8f) ||( startcode >= 0x98 && startcode <= 0x9f)) { /* 0x90 - 0x97 is reserved for SDDS in DVD specs */ - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; codec_id = CODEC_ID_DTS; } else if (startcode >= 0xa0 && startcode <= 0xaf) { - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; /* 16 bit form will be handled as CODEC_ID_PCM_S16BE */ codec_id = CODEC_ID_PCM_DVD; } else if (startcode >= 0xb0 && startcode <= 0xbf) { - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; codec_id = CODEC_ID_TRUEHD; } else if (startcode >= 0xc0 && startcode <= 0xcf) { /* Used for both AC-3 and E-AC-3 in EVOB files */ - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; codec_id = CODEC_ID_AC3; } else if (startcode >= 0x20 && startcode <= 0x3f) { - type = CODEC_TYPE_SUBTITLE; + type = AVMEDIA_TYPE_SUBTITLE; codec_id = CODEC_ID_DVD_SUBTITLE; } else if (startcode >= 0xfd55 && startcode <= 0xfd5f) { - type = CODEC_TYPE_VIDEO; + type = AVMEDIA_TYPE_VIDEO; codec_id = CODEC_ID_VC1; } else if (startcode == 0x1bd) { // check dvd audio substream type - type = CODEC_TYPE_AUDIO; + type = AVMEDIA_TYPE_AUDIO; switch(dvdaudio_substream_type & 0xe0) { case 0xa0: codec_id = CODEC_ID_PCM_DVD; break; diff --git a/libavformat/mpegenc.c b/libavformat/mpegenc.c index a471b38bb9..32a3858f56 100644 --- a/libavformat/mpegenc.c +++ b/libavformat/mpegenc.c @@ -335,7 +335,7 @@ static int mpeg_mux_init(AVFormatContext *ctx) av_set_pts_info(st, 64, 1, 90000); switch(st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (st->codec->codec_id == CODEC_ID_AC3) { stream->id = ac3_id++; } else if (st->codec->codec_id == CODEC_ID_DTS) { @@ -363,7 +363,7 @@ static int mpeg_mux_init(AVFormatContext *ctx) stream->max_buffer_size = 4 * 1024; s->audio_bound++; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: stream->id = mpv_id++; if (st->codec->rc_buffer_size) stream->max_buffer_size = 6*1024 + st->codec->rc_buffer_size/8; @@ -379,7 +379,7 @@ static int mpeg_mux_init(AVFormatContext *ctx) #endif s->video_bound++; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: stream->id = mps_id++; stream->max_buffer_size = 16 * 1024; break; @@ -1046,7 +1046,7 @@ retry: /* for subtitle, a single PES packet must be generated, so we flush after every single subtitle packet */ if(s->packet_size > avail_data && !flush - && st->codec->codec_type != CODEC_TYPE_SUBTITLE) + && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) return 0; if(avail_data==0) continue; @@ -1156,7 +1156,7 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) int64_t pts, dts; PacketDesc *pkt_desc; const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE); - const int is_iframe = st->codec->codec_type == CODEC_TYPE_VIDEO && (pkt->flags & PKT_FLAG_KEY); + const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & PKT_FLAG_KEY); pts= pkt->pts; dts= pkt->dts; diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 0a49ed9d68..ac1e911e35 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -486,54 +486,54 @@ static int parse_section_header(SectionHeader *h, typedef struct { uint32_t stream_type; - enum CodecType codec_type; + enum AVMediaType codec_type; enum CodecID codec_id; } StreamType; static const StreamType ISO_types[] = { - { 0x01, CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO }, - { 0x02, CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO }, - { 0x03, CODEC_TYPE_AUDIO, CODEC_ID_MP3 }, - { 0x04, CODEC_TYPE_AUDIO, CODEC_ID_MP3 }, - { 0x0f, CODEC_TYPE_AUDIO, CODEC_ID_AAC }, - { 0x10, CODEC_TYPE_VIDEO, CODEC_ID_MPEG4 }, - { 0x11, CODEC_TYPE_AUDIO, CODEC_ID_AAC }, /* LATM syntax */ - { 0x1b, CODEC_TYPE_VIDEO, CODEC_ID_H264 }, - { 0xd1, CODEC_TYPE_VIDEO, CODEC_ID_DIRAC }, - { 0xea, CODEC_TYPE_VIDEO, CODEC_ID_VC1 }, + { 0x01, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO }, + { 0x02, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO }, + { 0x03, AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3 }, + { 0x04, AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3 }, + { 0x0f, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC }, + { 0x10, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4 }, + { 0x11, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC }, /* LATM syntax */ + { 0x1b, AVMEDIA_TYPE_VIDEO, CODEC_ID_H264 }, + { 0xd1, AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC }, + { 0xea, AVMEDIA_TYPE_VIDEO, CODEC_ID_VC1 }, { 0 }, }; static const StreamType HDMV_types[] = { - { 0x80, CODEC_TYPE_AUDIO, CODEC_ID_PCM_BLURAY }, - { 0x81, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, - { 0x82, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, - { 0x83, CODEC_TYPE_AUDIO, CODEC_ID_TRUEHD }, - { 0x84, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 }, - { 0x90, CODEC_TYPE_SUBTITLE, CODEC_ID_HDMV_PGS_SUBTITLE }, + { 0x80, AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_BLURAY }, + { 0x81, AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, + { 0x82, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, + { 0x83, AVMEDIA_TYPE_AUDIO, CODEC_ID_TRUEHD }, + { 0x84, AVMEDIA_TYPE_AUDIO, CODEC_ID_EAC3 }, + { 0x90, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_HDMV_PGS_SUBTITLE }, { 0 }, }; /* ATSC ? */ static const StreamType MISC_types[] = { - { 0x81, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, - { 0x8a, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, + { 0x81, AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, + { 0x8a, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, { 0 }, }; static const StreamType REGD_types[] = { - { MKTAG('d','r','a','c'), CODEC_TYPE_VIDEO, CODEC_ID_DIRAC }, - { MKTAG('A','C','-','3'), CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, + { MKTAG('d','r','a','c'), AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC }, + { MKTAG('A','C','-','3'), AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, { 0 }, }; /* descriptor present */ static const StreamType DESC_types[] = { - { 0x6a, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, /* AC-3 descriptor */ - { 0x7a, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 }, /* E-AC-3 descriptor */ - { 0x7b, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, - { 0x56, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_TELETEXT }, - { 0x59, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */ + { 0x6a, AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, /* AC-3 descriptor */ + { 0x7a, AVMEDIA_TYPE_AUDIO, CODEC_ID_EAC3 }, /* E-AC-3 descriptor */ + { 0x7b, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, + { 0x56, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_TELETEXT }, + { 0x59, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */ { 0 }, }; @@ -554,7 +554,7 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, { av_set_pts_info(st, 33, 1, 90000); st->priv_data = pes; - st->codec->codec_type = CODEC_TYPE_DATA; + st->codec->codec_type = AVMEDIA_TYPE_DATA; st->codec->codec_id = CODEC_ID_NONE; st->need_parsing = AVSTREAM_PARSE_FULL; pes->st = st; @@ -588,7 +588,7 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, av_set_pts_info(sub_st, 33, 1, 90000); sub_st->priv_data = sub_pes; - sub_st->codec->codec_type = CODEC_TYPE_AUDIO; + sub_st->codec->codec_type = AVMEDIA_TYPE_AUDIO; sub_st->codec->codec_id = CODEC_ID_AC3; sub_st->need_parsing = AVSTREAM_PARSE_FULL; sub_pes->sub_st = pes->sub_st = sub_st; @@ -1394,7 +1394,7 @@ static int mpegts_read_header(AVFormatContext *s, if (!st) goto fail; av_set_pts_info(st, 60, 1, 27000000); - st->codec->codec_type = CODEC_TYPE_DATA; + st->codec->codec_type = AVMEDIA_TYPE_DATA; st->codec->codec_id = CODEC_ID_MPEG2TS; /* we iterate until we find two PCRs to estimate the bitrate */ diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c index 487a0c2fdf..adb94af956 100644 --- a/libavformat/mpegtsenc.c +++ b/libavformat/mpegtsenc.c @@ -255,7 +255,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) /* write optional descriptors here */ switch(st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (lang && strlen(lang->value) == 3) { *q++ = 0x0a; /* ISO 639 language descriptor */ *q++ = 4; @@ -265,7 +265,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) *q++ = 0; /* undefined type */ } break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: { const char *language; language = lang && strlen(lang->value)==3 ? lang->value : "eng"; @@ -279,7 +279,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) put16(&q, 1); /* ancillary page id */ } break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (stream_type == STREAM_TYPE_VIDEO_DIRAC) { *q++ = 0x05; /*MPEG-2 registration descriptor*/ *q++ = 4; @@ -424,7 +424,7 @@ static int mpegts_write_header(AVFormatContext *s) ts_st->first_pts_check = 1; ts_st->cc = 15; /* update PCR pid by using the first video stream */ - if (st->codec->codec_type == CODEC_TYPE_VIDEO && + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && service->pcr_pid == 0x1fff) { service->pcr_pid = ts_st->pid; pcr_st = st; @@ -462,7 +462,7 @@ static int mpegts_write_header(AVFormatContext *s) /* Arbitrary values, PAT/PMT could be written on key frames */ ts->sdt_packet_period = 200; ts->pat_packet_period = 40; - if (pcr_st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (pcr_st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (!pcr_st->codec->frame_size) { av_log(s, AV_LOG_WARNING, "frame size not set\n"); service->pcr_packet_period = @@ -661,18 +661,18 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, *q++ = 0x00; *q++ = 0x01; private_code = 0; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (st->codec->codec_id == CODEC_ID_DIRAC) { *q++ = 0xfd; } else *q++ = 0xe0; - } else if (st->codec->codec_type == CODEC_TYPE_AUDIO && + } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && (st->codec->codec_id == CODEC_ID_MP2 || st->codec->codec_id == CODEC_ID_MP3)) { *q++ = 0xc0; } else { *q++ = 0xbd; - if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) { + if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) { private_code = 0x20; } } @@ -686,7 +686,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, header_len += 5; flags |= 0x40; } - if (st->codec->codec_type == CODEC_TYPE_VIDEO && + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->codec->codec_id == CODEC_ID_DIRAC) { /* set PES_extension_flag */ pes_extension = 1; @@ -708,7 +708,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, *q++ = len; val = 0x80; /* data alignment indicator is required for subtitle data */ - if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) + if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) val |= 0x04; *q++ = val; *q++ = flags; @@ -848,7 +848,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) } } - if (st->codec->codec_type != CODEC_TYPE_AUDIO) { + if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO) { // for video and subtitle, write a single pes packet mpegts_write_pes(s, st, buf, size, pts, dts); av_free(data); diff --git a/libavformat/msnwc_tcp.c b/libavformat/msnwc_tcp.c index 34ab9d94bb..49b8297a4f 100644 --- a/libavformat/msnwc_tcp.c +++ b/libavformat/msnwc_tcp.c @@ -80,7 +80,7 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap) return AVERROR_NOMEM; codec = st->codec; - codec->codec_type = CODEC_TYPE_VIDEO; + codec->codec_type = AVMEDIA_TYPE_VIDEO; codec->codec_id = CODEC_ID_MIMIC; codec->codec_tag = MKTAG('M', 'L', '2', '0'); diff --git a/libavformat/mtv.c b/libavformat/mtv.c index e7e3a1c4bc..fd26c14869 100644 --- a/libavformat/mtv.c +++ b/libavformat/mtv.c @@ -123,7 +123,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) return AVERROR(ENOMEM); av_set_pts_info(st, 64, 1, mtv->video_fps); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_RAWVIDEO; st->codec->codec_tag = MKTAG('R', 'G', 'B', mtv->img_bpp); st->codec->width = mtv->img_width; @@ -140,7 +140,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) return AVERROR(ENOMEM); av_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MP3; st->codec->bit_rate = mtv->audio_br; st->need_parsing = AVSTREAM_PARSE_FULL; diff --git a/libavformat/mvi.c b/libavformat/mvi.c index 89c47da473..506976df43 100644 --- a/libavformat/mvi.c +++ b/libavformat/mvi.c @@ -77,14 +77,14 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) } av_set_pts_info(ast, 64, 1, ast->codec->sample_rate); - ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_id = CODEC_ID_PCM_U8; ast->codec->channels = 1; ast->codec->bits_per_coded_sample = 8; ast->codec->bit_rate = ast->codec->sample_rate * 8; av_set_pts_info(vst, 64, msecs_per_frame, 1000000); - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_MOTIONPIXELS; mvi->get_int = (vst->codec->width * vst->codec->height < (1 << 16)) ? get_le16 : get_le24; diff --git a/libavformat/mxf.c b/libavformat/mxf.c index 05cb173ac3..452ee6ddfe 100644 --- a/libavformat/mxf.c +++ b/libavformat/mxf.c @@ -25,9 +25,9 @@ * SMPTE RP224 http://www.smpte-ra.org/mdd/index.html */ const MXFCodecUL ff_mxf_data_definition_uls[] = { - { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x01,0x00,0x00,0x00 }, 13, CODEC_TYPE_VIDEO }, - { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x02,0x00,0x00,0x00 }, 13, CODEC_TYPE_AUDIO }, - { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, CODEC_TYPE_DATA }, + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x01,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_VIDEO }, + { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x02,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_AUDIO }, + { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AVMEDIA_TYPE_DATA }, }; const MXFCodecUL ff_mxf_codec_uls[] = { diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c index 2f6d2eaa2f..168fd8d69f 100644 --- a/libavformat/mxfdec.c +++ b/libavformat/mxfdec.c @@ -795,7 +795,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->codec->extradata = descriptor->extradata; st->codec->extradata_size = descriptor->extradata_size; } - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = container_ul->id; @@ -803,7 +803,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->codec->height = descriptor->height; st->codec->bits_per_coded_sample = descriptor->bits_per_sample; /* Uncompressed */ st->need_parsing = AVSTREAM_PARSE_HEADERS; - } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = container_ul->id; @@ -825,7 +825,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) st->need_parsing = AVSTREAM_PARSE_FULL; } } - if (st->codec->codec_type != CODEC_TYPE_DATA && (*essence_container_ul)[15] > 0x01) { + if (st->codec->codec_type != AVMEDIA_TYPE_DATA && (*essence_container_ul)[15] > 0x01) { av_log(mxf->fc, AV_LOG_WARNING, "only frame wrapped mappings are correctly supported\n"); st->need_parsing = AVSTREAM_PARSE_FULL; } diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 766327ded3..ab381189c9 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -1415,7 +1415,7 @@ static int mxf_write_header(AVFormatContext *s) return AVERROR(ENOMEM); st->priv_data = sc; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if (i != 0) { av_log(s, AV_LOG_ERROR, "video stream must be first track\n"); return -1; @@ -1455,7 +1455,7 @@ static int mxf_write_header(AVFormatContext *s) mxf->edit_unit_byte_count += 16 + 4 + 4 + samples_per_frame[0]*8*4; mxf->edit_unit_byte_count += klv_fill_size(mxf->edit_unit_byte_count); } - } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (st->codec->sample_rate != 48000) { av_log(s, AV_LOG_ERROR, "only 48khz is implemented\n"); return -1; @@ -1717,7 +1717,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt) mxf_write_klv_fill(s); put_buffer(pb, sc->track_essence_element_key, 16); // write key if (s->oformat == &mxf_d10_muxer) { - if (st->codec->codec_type == CODEC_TYPE_VIDEO) + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) mxf_write_d10_video_packet(s, st, pkt); else mxf_write_d10_audio_packet(s, st, pkt); diff --git a/libavformat/ncdec.c b/libavformat/ncdec.c index 8e51f840d2..6d99a049e6 100644 --- a/libavformat/ncdec.c +++ b/libavformat/ncdec.c @@ -50,7 +50,7 @@ static int nc_read_header(AVFormatContext *s, AVFormatParameters *ap) if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MPEG4; st->need_parsing = AVSTREAM_PARSE_FULL; diff --git a/libavformat/nsvdec.c b/libavformat/nsvdec.c index 6149d83f3a..1c58cd6c3b 100644 --- a/libavformat/nsvdec.c +++ b/libavformat/nsvdec.c @@ -456,7 +456,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) if (!nst) goto fail; st->priv_data = nst; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_tag = vtag; st->codec->codec_id = ff_codec_get_id(nsv_codec_video_tags, vtag); st->codec->width = vwidth; @@ -487,7 +487,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) if (!nst) goto fail; st->priv_data = nst; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = atag; st->codec->codec_id = ff_codec_get_id(nsv_codec_audio_tags, atag); diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index 3dbca9eeb3..7b934c50c6 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -315,19 +315,19 @@ static int decode_stream_header(NUTContext *nut){ switch(class) { case 0: - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tmp); break; case 1: - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp); break; case 2: - st->codec->codec_type = CODEC_TYPE_SUBTITLE; + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codec->codec_id = ff_codec_get_id(ff_nut_subtitle_tags, tmp); break; case 3: - st->codec->codec_type = CODEC_TYPE_DATA; + st->codec->codec_type = AVMEDIA_TYPE_DATA; break; default: av_log(s, AV_LOG_ERROR, "unknown stream class (%d)\n", class); @@ -349,7 +349,7 @@ static int decode_stream_header(NUTContext *nut){ get_buffer(bc, st->codec->extradata, st->codec->extradata_size); } - if (st->codec->codec_type == CODEC_TYPE_VIDEO){ + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ GET_V(st->codec->width , tmp > 0) GET_V(st->codec->height, tmp > 0) st->sample_aspect_ratio.num= ff_get_v(bc); @@ -359,7 +359,7 @@ static int decode_stream_header(NUTContext *nut){ return -1; } ff_get_v(bc); /* csp type */ - }else if (st->codec->codec_type == CODEC_TYPE_AUDIO){ + }else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO){ GET_V(st->codec->sample_rate , tmp > 0) ff_get_v(bc); // samplerate_den GET_V(st->codec->channels, tmp > 0) diff --git a/libavformat/nutenc.c b/libavformat/nutenc.c index 84ea29024e..28eac127ec 100644 --- a/libavformat/nutenc.c +++ b/libavformat/nutenc.c @@ -152,7 +152,7 @@ static void build_frame_code(AVFormatContext *s){ int start2= start + (end-start)*stream_id / s->nb_streams; int end2 = start + (end-start)*(stream_id+1) / s->nb_streams; AVCodecContext *codec = s->streams[stream_id]->codec; - int is_audio= codec->codec_type == CODEC_TYPE_AUDIO; + int is_audio= codec->codec_type == AVMEDIA_TYPE_AUDIO; int intra_only= /*codec->intra_only || */is_audio; int pred_count; @@ -394,9 +394,9 @@ static int write_streamheader(NUTContext *nut, ByteIOContext *bc, AVStream *st, AVCodecContext *codec = st->codec; put_v(bc, i); switch(codec->codec_type){ - case CODEC_TYPE_VIDEO: put_v(bc, 0); break; - case CODEC_TYPE_AUDIO: put_v(bc, 1); break; - case CODEC_TYPE_SUBTITLE: put_v(bc, 2); break; + case AVMEDIA_TYPE_VIDEO: put_v(bc, 0); break; + case AVMEDIA_TYPE_AUDIO: put_v(bc, 1); break; + case AVMEDIA_TYPE_SUBTITLE: put_v(bc, 2); break; default : put_v(bc, 3); break; } put_v(bc, 4); @@ -415,12 +415,12 @@ static int write_streamheader(NUTContext *nut, ByteIOContext *bc, AVStream *st, put_buffer(bc, codec->extradata, codec->extradata_size); switch(codec->codec_type){ - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: put_v(bc, codec->sample_rate); put_v(bc, 1); put_v(bc, codec->channels); break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: put_v(bc, codec->width); put_v(bc, codec->height); diff --git a/libavformat/nuv.c b/libavformat/nuv.c index 4abe54fd6e..940bb03df2 100644 --- a/libavformat/nuv.c +++ b/libavformat/nuv.c @@ -155,7 +155,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { vst = av_new_stream(s, ctx->v_id); if (!vst) return AVERROR(ENOMEM); - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_NUV; vst->codec->width = width; vst->codec->height = height; @@ -171,7 +171,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { ast = av_new_stream(s, ctx->a_id); if (!ast) return AVERROR(ENOMEM); - ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_id = CODEC_ID_PCM_S16LE; ast->codec->channels = 2; ast->codec->sample_rate = 44100; diff --git a/libavformat/oggdec.c b/libavformat/oggdec.c index 435044fcb3..ed90832c14 100644 --- a/libavformat/oggdec.c +++ b/libavformat/oggdec.c @@ -612,7 +612,7 @@ static int ogg_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp // Try seeking to a keyframe first. If this fails (very possible), // av_seek_frame will fall back to ignoring keyframes - if (s->streams[stream_index]->codec->codec_type == CODEC_TYPE_VIDEO + if (s->streams[stream_index]->codec->codec_type == AVMEDIA_TYPE_VIDEO && !(flags & AVSEEK_FLAG_ANY)) os->keyframe_seek = 1; diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c index 35080f3a4e..6944b3c069 100644 --- a/libavformat/oggenc.c +++ b/libavformat/oggenc.c @@ -178,9 +178,9 @@ static int ogg_write_header(AVFormatContext *s) int i, j; for (i = 0; i < s->nb_streams; i++) { AVStream *st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_AUDIO) + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) av_set_pts_info(st, 64, 1, st->codec->sample_rate); - else if (st->codec->codec_type == CODEC_TYPE_VIDEO) + else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) av_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den); if (st->codec->codec_id != CODEC_ID_VORBIS && st->codec->codec_id != CODEC_ID_THEORA && diff --git a/libavformat/oggparsedirac.c b/libavformat/oggparsedirac.c index 59a6deec49..1320877900 100644 --- a/libavformat/oggparsedirac.c +++ b/libavformat/oggparsedirac.c @@ -39,7 +39,7 @@ static int dirac_header(AVFormatContext *s, int idx) if (ff_dirac_parse_sequence_header(st->codec, &gb, &source) < 0) return -1; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_DIRAC; // dirac in ogg always stores timestamps as though the video were interlaced st->time_base = (AVRational){st->codec->time_base.num, 2*st->codec->time_base.den}; @@ -77,7 +77,7 @@ static int old_dirac_header(AVFormatContext *s, int idx) if (buf[0] != 'K') return 0; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_DIRAC; st->time_base.den = AV_RB32(buf+8); st->time_base.num = AV_RB32(buf+12); diff --git a/libavformat/oggparseflac.c b/libavformat/oggparseflac.c index 9a9ca7ead7..e5034af3a0 100644 --- a/libavformat/oggparseflac.c +++ b/libavformat/oggparseflac.c @@ -57,7 +57,7 @@ flac_header (AVFormatContext * s, int idx) ff_flac_parse_streaminfo(st->codec, &si, streaminfo_start); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_FLAC; st->codec->extradata = @@ -78,7 +78,7 @@ static int old_flac_header (AVFormatContext * s, int idx) { AVStream *st = s->streams[idx]; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_FLAC; return 0; diff --git a/libavformat/oggparseogm.c b/libavformat/oggparseogm.c index 01464839c4..25722f3b0e 100644 --- a/libavformat/oggparseogm.c +++ b/libavformat/oggparseogm.c @@ -49,19 +49,19 @@ ogm_header(AVFormatContext *s, int idx) if(*p == 'v'){ int tag; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; p += 8; tag = bytestream_get_le32(&p); st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); st->codec->codec_tag = tag; } else if (*p == 't') { - st->codec->codec_type = CODEC_TYPE_SUBTITLE; + st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; st->codec->codec_id = CODEC_ID_TEXT; p += 12; } else { uint8_t acid[5]; int cid; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; p += 8; bytestream_get_buffer(&p, acid, 4); acid[4] = 0; @@ -78,7 +78,7 @@ ogm_header(AVFormatContext *s, int idx) p += 8; /* buffersize + bits_per_sample */ - if(st->codec->codec_type == CODEC_TYPE_VIDEO){ + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ st->codec->width = bytestream_get_le32(&p); st->codec->height = bytestream_get_le32(&p); st->codec->time_base.den = spu * 10000000; @@ -117,14 +117,14 @@ ogm_dshow_header(AVFormatContext *s, int idx) t = AV_RL32(p + 96); if(t == 0x05589f80){ - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(p + 68)); st->codec->time_base.den = 10000000; st->codec->time_base.num = AV_RL64(p + 164); st->codec->width = AV_RL32(p + 176); st->codec->height = AV_RL32(p + 180); } else if(t == 0x05589f81){ - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, AV_RL16(p + 124)); st->codec->channels = AV_RL16(p + 126); st->codec->sample_rate = AV_RL32(p + 128); diff --git a/libavformat/oggparseskeleton.c b/libavformat/oggparseskeleton.c index 82d249246e..ad0dded0d7 100644 --- a/libavformat/oggparseskeleton.c +++ b/libavformat/oggparseskeleton.c @@ -33,7 +33,7 @@ static int skeleton_header(AVFormatContext *s, int idx) int target_idx, start_time; strcpy(st->codec->codec_name, "skeleton"); - st->codec->codec_type = CODEC_TYPE_DATA; + st->codec->codec_type = AVMEDIA_TYPE_DATA; if (os->psize < 8) return -1; diff --git a/libavformat/oggparsespeex.c b/libavformat/oggparsespeex.c index 9ad5397af4..936b37e952 100644 --- a/libavformat/oggparsespeex.c +++ b/libavformat/oggparsespeex.c @@ -52,7 +52,7 @@ static int speex_header(AVFormatContext *s, int idx) { if (spxp->seq == 0) { int frames_per_packet; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_SPEEX; st->codec->sample_rate = AV_RL32(p + 36); diff --git a/libavformat/oggparsetheora.c b/libavformat/oggparsetheora.c index ecd2bbe011..8c1b1c5b40 100644 --- a/libavformat/oggparsetheora.c +++ b/libavformat/oggparsetheora.c @@ -104,7 +104,7 @@ theora_header (AVFormatContext * s, int idx) thp->gpshift = get_bits(&gb, 5); thp->gpmask = (1 << thp->gpshift) - 1; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_THEORA; st->need_parsing = AVSTREAM_PARSE_HEADERS; diff --git a/libavformat/oggparsevorbis.c b/libavformat/oggparsevorbis.c index 3bd692427c..886ef522b5 100644 --- a/libavformat/oggparsevorbis.c +++ b/libavformat/oggparsevorbis.c @@ -237,7 +237,7 @@ vorbis_header (AVFormatContext * s, int idx) if (bytestream_get_byte(&p) != 1) /* framing_flag */ return -1; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_VORBIS; st->time_base.num = 1; diff --git a/libavformat/oma.c b/libavformat/oma.c index 7052ad374e..dc47b1b54c 100644 --- a/libavformat/oma.c +++ b/libavformat/oma.c @@ -112,7 +112,7 @@ static int oma_read_header(AVFormatContext *s, return AVERROR(ENOMEM); st->start_time = 0; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = buf[32]; st->codec->codec_id = ff_codec_get_id(codec_oma_tags, st->codec->codec_tag); diff --git a/libavformat/output-example.c b/libavformat/output-example.c index fb1d3a7819..fc070b736c 100644 --- a/libavformat/output-example.c +++ b/libavformat/output-example.c @@ -65,7 +65,7 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id) c = st->codec; c->codec_id = codec_id; - c->codec_type = CODEC_TYPE_AUDIO; + c->codec_type = AVMEDIA_TYPE_AUDIO; /* put sample parameters */ c->bit_rate = 64000; @@ -199,7 +199,7 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id) c = st->codec; c->codec_id = codec_id; - c->codec_type = CODEC_TYPE_VIDEO; + c->codec_type = AVMEDIA_TYPE_VIDEO; /* put sample parameters */ c->bit_rate = 400000; diff --git a/libavformat/psxstr.c b/libavformat/psxstr.c index f5fea95cd6..b1ed66364c 100644 --- a/libavformat/psxstr.c +++ b/libavformat/psxstr.c @@ -169,7 +169,7 @@ static int str_read_packet(AVFormatContext *s, str->channels[channel].video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MDEC; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = AV_RL16(§or[0x28]); @@ -216,7 +216,7 @@ static int str_read_packet(AVFormatContext *s, str->channels[channel].audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_XA; st->codec->codec_tag = 0; /* no fourcc */ st->codec->channels = (fmt&1)?2:1; diff --git a/libavformat/pva.c b/libavformat/pva.c index 4255f8a71c..abbc6f1c60 100644 --- a/libavformat/pva.c +++ b/libavformat/pva.c @@ -45,7 +45,7 @@ static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) { if (!(st = av_new_stream(s, 0))) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MPEG2VIDEO; st->need_parsing = AVSTREAM_PARSE_FULL; av_set_pts_info(st, 32, 1, 90000); @@ -53,7 +53,7 @@ static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) { if (!(st = av_new_stream(s, 1))) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_MP2; st->need_parsing = AVSTREAM_PARSE_FULL; av_set_pts_info(st, 33, 1, 90000); diff --git a/libavformat/qcp.c b/libavformat/qcp.c index 2aadb2d79b..78b7ef734f 100644 --- a/libavformat/qcp.c +++ b/libavformat/qcp.c @@ -95,7 +95,7 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap) s->file_size = get_le32(pb) + 8; url_fskip(pb, 8 + 4 + 1 + 1); // "QLCMfmt " + chunk-size + major-version + minor-version - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->channels = 1; get_buffer(pb, buf, 16); if (is_qcelp_13k_guid(buf)) { diff --git a/libavformat/r3d.c b/libavformat/r3d.c index 4f03d7f248..398ef62048 100644 --- a/libavformat/r3d.c +++ b/libavformat/r3d.c @@ -56,7 +56,7 @@ static int r3d_read_red1(AVFormatContext *s) if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_JPEG2000; tmp = get_byte(s->pb); // major version @@ -89,7 +89,7 @@ static int r3d_read_red1(AVFormatContext *s) AVStream *ast = av_new_stream(s, 1); if (!ast) return AVERROR(ENOMEM); - ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_id = CODEC_ID_PCM_S32BE; ast->codec->channels = tmp; av_set_pts_info(ast, 32, 1, st->time_base.den); diff --git a/libavformat/raw.c b/libavformat/raw.c index b2e3ae8aa8..7837de842a 100644 --- a/libavformat/raw.c +++ b/libavformat/raw.c @@ -74,14 +74,14 @@ static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) id = s->iformat->value; if (id == CODEC_ID_RAWVIDEO) { - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; } else { - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; } st->codec->codec_id = id; switch(st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: st->codec->sample_rate = ap->sample_rate; if(ap->channels) st->codec->channels = ap->channels; else st->codec->channels = 1; @@ -90,7 +90,7 @@ static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8; av_set_pts_info(st, 64, 1, st->codec->sample_rate); break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if(ap->time_base.num) av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); else @@ -253,7 +253,7 @@ static int audio_read_header(AVFormatContext *s, AVStream *st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = s->iformat->value; st->need_parsing = AVSTREAM_PARSE_FULL; /* the parameters will be extracted from the compressed bitstream */ @@ -271,7 +271,7 @@ static int video_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = s->iformat->value; st->need_parsing = AVSTREAM_PARSE_FULL; @@ -700,7 +700,7 @@ static int adts_aac_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = s->iformat->value; st->need_parsing = AVSTREAM_PARSE_FULL; diff --git a/libavformat/rdt.c b/libavformat/rdt.c index 0a390614c2..268d5dedac 100644 --- a/libavformat/rdt.c +++ b/libavformat/rdt.c @@ -546,10 +546,10 @@ static RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \ .parse_packet = rdt_parse_packet \ }; -RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live", CODEC_TYPE_VIDEO); -RDT_HANDLER(live_audio, "x-pn-multirate-realaudio-live", CODEC_TYPE_AUDIO); -RDT_HANDLER(video, "x-pn-realvideo", CODEC_TYPE_VIDEO); -RDT_HANDLER(audio, "x-pn-realaudio", CODEC_TYPE_AUDIO); +RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live", AVMEDIA_TYPE_VIDEO); +RDT_HANDLER(live_audio, "x-pn-multirate-realaudio-live", AVMEDIA_TYPE_AUDIO); +RDT_HANDLER(video, "x-pn-realvideo", AVMEDIA_TYPE_VIDEO); +RDT_HANDLER(audio, "x-pn-realaudio", AVMEDIA_TYPE_AUDIO); void av_register_rdt_dynamic_payload_handlers(void) { diff --git a/libavformat/riff.c b/libavformat/riff.c index 8db684ae8e..12a7ce711b 100644 --- a/libavformat/riff.c +++ b/libavformat/riff.c @@ -461,7 +461,7 @@ void ff_get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size) int id; id = get_le16(pb); - codec->codec_type = CODEC_TYPE_AUDIO; + codec->codec_type = AVMEDIA_TYPE_AUDIO; codec->codec_tag = id; codec->channels = get_le16(pb); codec->sample_rate = get_le32(pb); @@ -527,8 +527,8 @@ void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssiz if(stream->frame_size && stream->sample_rate){ *au_scale=stream->frame_size; *au_rate= stream->sample_rate; - }else if(stream->codec_type == CODEC_TYPE_VIDEO || - stream->codec_type == CODEC_TYPE_SUBTITLE){ + }else if(stream->codec_type == AVMEDIA_TYPE_VIDEO || + stream->codec_type == AVMEDIA_TYPE_SUBTITLE){ *au_scale= stream->time_base.num; *au_rate = stream->time_base.den; }else{ diff --git a/libavformat/rl2.c b/libavformat/rl2.c index 1b193b002a..7057e7e33d 100644 --- a/libavformat/rl2.c +++ b/libavformat/rl2.c @@ -116,7 +116,7 @@ static av_cold int rl2_read_header(AVFormatContext *s, if(!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_RL2; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = 320; @@ -145,7 +145,7 @@ static av_cold int rl2_read_header(AVFormatContext *s, st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_PCM_U8; st->codec->codec_tag = 1; st->codec->channels = channels; diff --git a/libavformat/rmdec.c b/libavformat/rmdec.c index 350970ab03..7f0db866d9 100644 --- a/libavformat/rmdec.c +++ b/libavformat/rmdec.c @@ -161,7 +161,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb, url_fskip(pb, header_size + startpos - url_ftell(pb)); st->codec->sample_rate = 8000; st->codec->channels = 1; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_RA_144; } else { int flavor, sub_packet_h, coded_framesize, sub_packet_size; @@ -195,7 +195,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb, get_str8(pb, buf, sizeof(buf)); /* desc */ get_str8(pb, buf, sizeof(buf)); /* desc */ } - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = AV_RL32(buf); st->codec->codec_id = ff_codec_get_id(rm_codec_tags, st->codec->codec_tag); switch (st->codec->codec_id) { @@ -316,7 +316,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb, st->codec->height = get_be16(pb); st->codec->time_base.num= 1; fps= get_be16(pb); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; get_be32(pb); fps2= get_be16(pb); get_be16(pb); @@ -479,7 +479,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap) st->duration = duration; get_str8(pb, buf, sizeof(buf)); /* desc */ get_str8(pb, buf, sizeof(buf)); /* mimetype */ - st->codec->codec_type = CODEC_TYPE_DATA; + st->codec->codec_type = AVMEDIA_TYPE_DATA; st->priv_data = ff_rm_alloc_rmstream(); if (ff_rm_read_mdpr_codecdata(s, s->pb, st, st->priv_data, get_be32(pb)) < 0) @@ -725,11 +725,11 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, { RMDemuxContext *rm = s->priv_data; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { rm->current_stream= st->id; if(rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq)) return -1; //got partial frame - } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if ((st->codec->codec_id == CODEC_ID_RA_288) || (st->codec->codec_id == CODEC_ID_COOK) || (st->codec->codec_id == CODEC_ID_ATRAC3) || @@ -790,7 +790,7 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, pkt->stream_index = st->index; #if 0 - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if(st->codec->codec_id == CODEC_ID_RV20){ int seq= 128*(pkt->data[2]&0x7F) + (pkt->data[3]>>1); av_log(s, AV_LOG_DEBUG, "%d %"PRId64" %d\n", *timestamp, *timestamp*512LL/25, seq); @@ -806,7 +806,7 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, if (flags & 2) pkt->flags |= PKT_FLAG_KEY; - return st->codec->codec_type == CODEC_TYPE_AUDIO ? rm->audio_pkt_cnt : 0; + return st->codec->codec_type == AVMEDIA_TYPE_AUDIO ? rm->audio_pkt_cnt : 0; } int @@ -932,7 +932,7 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index, return AV_NOPTS_VALUE; st = s->streams[stream_index2]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { h= get_byte(s->pb); len--; if(!(h & 0x40)){ seq = get_byte(s->pb); len--; diff --git a/libavformat/rmenc.c b/libavformat/rmenc.c index 21748d5d52..9dbe3d08dc 100644 --- a/libavformat/rmenc.c +++ b/libavformat/rmenc.c @@ -141,7 +141,7 @@ static void rv10_write_header(AVFormatContext *ctx, stream = &rm->streams[i]; - if (stream->enc->codec_type == CODEC_TYPE_AUDIO) { + if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) { desc = "The Audio Stream"; mimetype = "audio/x-pn-realaudio"; codec_data_size = 73; @@ -177,7 +177,7 @@ static void rv10_write_header(AVFormatContext *ctx, put_str8(s, mimetype); put_be32(s, codec_data_size); - if (stream->enc->codec_type == CODEC_TYPE_AUDIO) { + if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) { int coded_frame_size, fscode, sample_rate; sample_rate = stream->enc->sample_rate; coded_frame_size = (stream->enc->bit_rate * @@ -309,7 +309,7 @@ static int rm_write_header(AVFormatContext *s) stream->enc = codec; switch(codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: rm->audio_stream = stream; stream->frame_rate = (float)codec->sample_rate / (float)codec->frame_size; /* XXX: dummy values */ @@ -317,7 +317,7 @@ static int rm_write_header(AVFormatContext *s) stream->nb_packets = 0; stream->total_frames = stream->nb_packets; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: rm->video_stream = stream; stream->frame_rate = (float)codec->time_base.den / (float)codec->time_base.num; /* XXX: dummy values */ @@ -408,7 +408,7 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int static int rm_write_packet(AVFormatContext *s, AVPacket *pkt) { if (s->streams[pkt->stream_index]->codec->codec_type == - CODEC_TYPE_AUDIO) + AVMEDIA_TYPE_AUDIO) return rm_write_audio(s, pkt->data, pkt->size, pkt->flags); else return rm_write_video(s, pkt->data, pkt->size, pkt->flags); diff --git a/libavformat/rpl.c b/libavformat/rpl.c index ad713ffada..41c1687745 100644 --- a/libavformat/rpl.c +++ b/libavformat/rpl.c @@ -141,7 +141,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) vst = av_new_stream(s, 0); if (!vst) return AVERROR(ENOMEM); - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_tag = read_line_and_int(pb, &error); // video format vst->codec->width = read_line_and_int(pb, &error); // video width vst->codec->height = read_line_and_int(pb, &error); // video height @@ -183,7 +183,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) ast = av_new_stream(s, 0); if (!ast) return AVERROR(ENOMEM); - ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_tag = audio_format; ast->codec->sample_rate = read_line_and_int(pb, &error); // audio bitrate ast->codec->channels = read_line_and_int(pb, &error); // number of audio channels @@ -295,7 +295,7 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) if (url_fseek(pb, index_entry->pos, SEEK_SET) < 0) return AVERROR(EIO); - if (stream->codec->codec_type == CODEC_TYPE_VIDEO && + if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && stream->codec->codec_tag == 124) { // We have to split Escape 124 frames because there are // multiple frames per chunk in Escape 124 samples. @@ -327,7 +327,7 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) return AVERROR(EIO); } - if (stream->codec->codec_type == CODEC_TYPE_VIDEO) { + if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) { // frames_per_chunk should always be one here; the header // parsing will warn if it isn't. pkt->duration = rpl->frames_per_chunk; diff --git a/libavformat/rtp.c b/libavformat/rtp.c index 9c17a62aff..a8dcfd79de 100644 --- a/libavformat/rtp.c +++ b/libavformat/rtp.c @@ -35,39 +35,39 @@ static const struct { int pt; const char enc_name[6]; - enum CodecType codec_type; + enum AVMediaType codec_type; enum CodecID codec_id; int clock_rate; int audio_channels; } AVRtpPayloadTypes[]= { - {0, "PCMU", CODEC_TYPE_AUDIO, CODEC_ID_PCM_MULAW, 8000, 1}, - {3, "GSM", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, - {4, "G723", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, - {5, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, - {6, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 16000, 1}, - {7, "LPC", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, - {8, "PCMA", CODEC_TYPE_AUDIO, CODEC_ID_PCM_ALAW, 8000, 1}, - {9, "G722", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, - {10, "L16", CODEC_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 2}, - {11, "L16", CODEC_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 1}, - {12, "QCELP", CODEC_TYPE_AUDIO, CODEC_ID_QCELP, 8000, 1}, - {13, "CN", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, - {14, "MPA", CODEC_TYPE_AUDIO, CODEC_ID_MP2, -1, -1}, - {14, "MPA", CODEC_TYPE_AUDIO, CODEC_ID_MP3, -1, -1}, - {15, "G728", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, - {16, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 11025, 1}, - {17, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 22050, 1}, - {18, "G729", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, - {25, "CelB", CODEC_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, - {26, "JPEG", CODEC_TYPE_VIDEO, CODEC_ID_MJPEG, 90000, -1}, - {28, "nv", CODEC_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, - {31, "H261", CODEC_TYPE_VIDEO, CODEC_ID_H261, 90000, -1}, - {32, "MPV", CODEC_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, 90000, -1}, - {32, "MPV", CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, 90000, -1}, - {33, "MP2T", CODEC_TYPE_DATA, CODEC_ID_MPEG2TS, 90000, -1}, - {34, "H263", CODEC_TYPE_VIDEO, CODEC_ID_H263, 90000, -1}, - {-1, "", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1} + {0, "PCMU", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_MULAW, 8000, 1}, + {3, "GSM", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, + {4, "G723", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, + {5, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, + {6, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 16000, 1}, + {7, "LPC", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, + {8, "PCMA", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_ALAW, 8000, 1}, + {9, "G722", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, + {10, "L16", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 2}, + {11, "L16", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 1}, + {12, "QCELP", AVMEDIA_TYPE_AUDIO, CODEC_ID_QCELP, 8000, 1}, + {13, "CN", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, + {14, "MPA", AVMEDIA_TYPE_AUDIO, CODEC_ID_MP2, -1, -1}, + {14, "MPA", AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3, -1, -1}, + {15, "G728", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, + {16, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 11025, 1}, + {17, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 22050, 1}, + {18, "G729", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, + {25, "CelB", AVMEDIA_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, + {26, "JPEG", AVMEDIA_TYPE_VIDEO, CODEC_ID_MJPEG, 90000, -1}, + {28, "nv", AVMEDIA_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, + {31, "H261", AVMEDIA_TYPE_VIDEO, CODEC_ID_H261, 90000, -1}, + {32, "MPV", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, 90000, -1}, + {32, "MPV", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, 90000, -1}, + {33, "MP2T", AVMEDIA_TYPE_DATA, CODEC_ID_MPEG2TS, 90000, -1}, + {34, "H263", AVMEDIA_TYPE_VIDEO, CODEC_ID_H263, 90000, -1}, + {-1, "", AVMEDIA_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1} }; int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type) @@ -118,7 +118,7 @@ const char *ff_rtp_enc_name(int payload_type) return ""; } -enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type) +enum CodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type) { int i; diff --git a/libavformat/rtp.h b/libavformat/rtp.h index 80081ac9eb..7834f9deb8 100644 --- a/libavformat/rtp.h +++ b/libavformat/rtp.h @@ -66,7 +66,7 @@ const char *ff_rtp_enc_name(int payload_type); * @return In case of unknown encoding name, CODEC_ID_NONE is returned; * otherwise, the codec id is returned */ -enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type); +enum CodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type); #define RTP_PT_PRIVATE 96 #define RTP_VERSION 2 diff --git a/libavformat/rtpdec.c b/libavformat/rtpdec.c index 6ffe1dadac..e329ad291d 100644 --- a/libavformat/rtpdec.c +++ b/libavformat/rtpdec.c @@ -51,8 +51,8 @@ /* statistics functions */ RTPDynamicProtocolHandler *RTPFirstDynamicPayloadHandler= NULL; -static RTPDynamicProtocolHandler mp4v_es_handler= {"MP4V-ES", CODEC_TYPE_VIDEO, CODEC_ID_MPEG4}; -static RTPDynamicProtocolHandler mpeg4_generic_handler= {"mpeg4-generic", CODEC_TYPE_AUDIO, CODEC_ID_AAC}; +static RTPDynamicProtocolHandler mp4v_es_handler= {"MP4V-ES", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4}; +static RTPDynamicProtocolHandler mpeg4_generic_handler= {"mpeg4-generic", AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC}; void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler) { @@ -350,7 +350,7 @@ RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *r st->need_parsing = AVSTREAM_PARSE_FULL; break; default: - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { av_set_pts_info(st, 32, 1, st->codec->sample_rate); } break; diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h index 6907a0c687..366102af99 100644 --- a/libavformat/rtpdec.h +++ b/libavformat/rtpdec.h @@ -132,7 +132,7 @@ typedef int (*DynamicPayloadPacketHandlerProc) (AVFormatContext *ctx, struct RTPDynamicProtocolHandler_s { // fields from AVRtpDynamicPayloadType_s const char enc_name[50]; /* XXX: still why 50 ? ;-) */ - enum CodecType codec_type; + enum AVMediaType codec_type; enum CodecID codec_id; // may be null diff --git a/libavformat/rtpdec_amr.c b/libavformat/rtpdec_amr.c index cbf9f28d02..38399c6660 100644 --- a/libavformat/rtpdec_amr.c +++ b/libavformat/rtpdec_amr.c @@ -170,7 +170,7 @@ static int amr_parse_sdp_line(AVFormatContext *s, int st_index, RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = { .enc_name = "AMR", - .codec_type = CODEC_TYPE_AUDIO, + .codec_type = AVMEDIA_TYPE_AUDIO, .codec_id = CODEC_ID_AMR_NB, .parse_sdp_a_line = amr_parse_sdp_line, .parse_packet = amr_handle_packet, @@ -178,7 +178,7 @@ RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = { RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = { .enc_name = "AMR-WB", - .codec_type = CODEC_TYPE_AUDIO, + .codec_type = AVMEDIA_TYPE_AUDIO, .codec_id = CODEC_ID_AMR_WB, .parse_sdp_a_line = amr_parse_sdp_line, .parse_packet = amr_handle_packet, diff --git a/libavformat/rtpdec_asf.c b/libavformat/rtpdec_asf.c index 44c1c83ea4..8fea872014 100644 --- a/libavformat/rtpdec_asf.c +++ b/libavformat/rtpdec_asf.c @@ -277,5 +277,5 @@ RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \ .parse_packet = asfrtp_parse_packet, \ }; -RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", CODEC_TYPE_VIDEO); -RTP_ASF_HANDLER(asf_pfa, "x-asf-pf", CODEC_TYPE_AUDIO); +RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", AVMEDIA_TYPE_VIDEO); +RTP_ASF_HANDLER(asf_pfa, "x-asf-pf", AVMEDIA_TYPE_AUDIO); diff --git a/libavformat/rtpdec_h263.c b/libavformat/rtpdec_h263.c index 7d498f3af0..3d5925e9a4 100644 --- a/libavformat/rtpdec_h263.c +++ b/libavformat/rtpdec_h263.c @@ -94,14 +94,14 @@ static int h263_handle_packet(AVFormatContext *ctx, RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler = { .enc_name = "H263-1998", - .codec_type = CODEC_TYPE_VIDEO, + .codec_type = AVMEDIA_TYPE_VIDEO, .codec_id = CODEC_ID_H263, .parse_packet = h263_handle_packet, }; RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler = { .enc_name = "H263-2000", - .codec_type = CODEC_TYPE_VIDEO, + .codec_type = AVMEDIA_TYPE_VIDEO, .codec_id = CODEC_ID_H263, .parse_packet = h263_handle_packet, }; diff --git a/libavformat/rtpdec_h264.c b/libavformat/rtpdec_h264.c index 970e6fdcc7..dd32e18b44 100644 --- a/libavformat/rtpdec_h264.c +++ b/libavformat/rtpdec_h264.c @@ -411,7 +411,7 @@ This is the structure for expanding on the dynamic rtp protocols (makes everythi */ RTPDynamicProtocolHandler ff_h264_dynamic_handler = { .enc_name = "H264", - .codec_type = CODEC_TYPE_VIDEO, + .codec_type = AVMEDIA_TYPE_VIDEO, .codec_id = CODEC_ID_H264, .parse_sdp_a_line = parse_h264_sdp_line, .open = h264_new_context, diff --git a/libavformat/rtpdec_theora.c b/libavformat/rtpdec_theora.c index b87a6f7994..56a59e4e16 100644 --- a/libavformat/rtpdec_theora.c +++ b/libavformat/rtpdec_theora.c @@ -378,7 +378,7 @@ static int theora_parse_sdp_line(AVFormatContext *s, int st_index, RTPDynamicProtocolHandler ff_theora_dynamic_handler = { .enc_name = "theora", - .codec_type = CODEC_TYPE_VIDEO, + .codec_type = AVMEDIA_TYPE_VIDEO, .codec_id = CODEC_ID_THEORA, .parse_sdp_a_line = theora_parse_sdp_line, .open = theora_new_context, diff --git a/libavformat/rtpdec_vorbis.c b/libavformat/rtpdec_vorbis.c index 3d1b2cc1ef..35b672f409 100644 --- a/libavformat/rtpdec_vorbis.c +++ b/libavformat/rtpdec_vorbis.c @@ -209,7 +209,7 @@ vorbis_handle_packet(AVFormatContext * ctx, RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = { .enc_name = "vorbis", - .codec_type = CODEC_TYPE_AUDIO, + .codec_type = AVMEDIA_TYPE_AUDIO, .codec_id = CODEC_ID_VORBIS, .parse_sdp_a_line = NULL, .open = vorbis_new_context, diff --git a/libavformat/rtpenc.c b/libavformat/rtpenc.c index c5441b8312..5df101eb04 100644 --- a/libavformat/rtpenc.c +++ b/libavformat/rtpenc.c @@ -78,7 +78,7 @@ static int rtp_write_header(AVFormatContext *s1) s->payload_type = ff_rtp_get_payload_type(st->codec); if (s->payload_type < 0) - s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == CODEC_TYPE_AUDIO); + s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == AVMEDIA_TYPE_AUDIO); s->base_timestamp = ff_random_get_seed(); s->timestamp = s->base_timestamp; @@ -102,14 +102,14 @@ static int rtp_write_header(AVFormatContext *s1) s->max_frames_per_packet = 0; if (s1->max_delay) { - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if (st->codec->frame_size == 0) { av_log(s1, AV_LOG_ERROR, "Cannot respect max delay: frame size = 0\n"); } else { s->max_frames_per_packet = av_rescale_rnd(s1->max_delay, st->codec->sample_rate, AV_TIME_BASE * st->codec->frame_size, AV_ROUND_DOWN); } } - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { /* FIXME: We should round down here... */ s->max_frames_per_packet = av_rescale_q(s1->max_delay, (AVRational){1, 1000000}, st->codec->time_base); } @@ -151,7 +151,7 @@ static int rtp_write_header(AVFormatContext *s1) case CODEC_ID_AAC: s->num_frames = 0; default: - if (st->codec->codec_type == CODEC_TYPE_AUDIO) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { av_set_pts_info(st, 32, 1, st->codec->sample_rate); } s->buf_ptr = s->buf; diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index a675e9a333..352426e333 100644 --- a/libavformat/rtsp.c +++ b/libavformat/rtsp.c @@ -141,7 +141,7 @@ static int sdp_parse_rtpmap(AVFormatContext *s, get_word_sep(buf, sizeof(buf), "/", &p); i = atoi(buf); switch (codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: av_log(s, AV_LOG_DEBUG, "audio codec set to: %s\n", c_name); codec->sample_rate = RTSP_DEFAULT_AUDIO_SAMPLERATE; codec->channels = RTSP_DEFAULT_NB_AUDIO_CHANNELS; @@ -161,7 +161,7 @@ static int sdp_parse_rtpmap(AVFormatContext *s, av_log(s, AV_LOG_DEBUG, "audio channels set to: %i\n", codec->channels); break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: av_log(s, AV_LOG_DEBUG, "video codec set to: %s\n", c_name); break; default: @@ -343,7 +343,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, RTSPState *rt = s->priv_data; char buf1[64], st_type[64]; const char *p; - enum CodecType codec_type; + enum AVMediaType codec_type; int payload_type, i; AVStream *st; RTSPStream *rtsp_st; @@ -396,11 +396,11 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, s1->skip_media = 0; get_word(st_type, sizeof(st_type), &p); if (!strcmp(st_type, "audio")) { - codec_type = CODEC_TYPE_AUDIO; + codec_type = AVMEDIA_TYPE_AUDIO; } else if (!strcmp(st_type, "video")) { - codec_type = CODEC_TYPE_VIDEO; + codec_type = AVMEDIA_TYPE_VIDEO; } else if (!strcmp(st_type, "application")) { - codec_type = CODEC_TYPE_DATA; + codec_type = AVMEDIA_TYPE_DATA; } else { s1->skip_media = 1; return; @@ -1181,7 +1181,7 @@ static int make_setup_request(AVFormatContext *s, const char *host, int port, * will return an error. Therefore, we skip those streams. */ if (rt->server_type == RTSP_SERVER_WMS && s->streams[rtsp_st->stream_index]->codec->codec_type == - CODEC_TYPE_DATA) + AVMEDIA_TYPE_DATA) continue; snprintf(transport, sizeof(transport) - 1, "%s/TCP;", trans_pref); diff --git a/libavformat/sdp.c b/libavformat/sdp.c index d48a5df950..a8cab6a68f 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -301,13 +301,13 @@ static void sdp_write_media(char *buff, int size, AVCodecContext *c, const char payload_type = ff_rtp_get_payload_type(c); if (payload_type < 0) { - payload_type = RTP_PT_PRIVATE + (c->codec_type == CODEC_TYPE_AUDIO); + payload_type = RTP_PT_PRIVATE + (c->codec_type == AVMEDIA_TYPE_AUDIO); } switch (c->codec_type) { - case CODEC_TYPE_VIDEO : type = "video" ; break; - case CODEC_TYPE_AUDIO : type = "audio" ; break; - case CODEC_TYPE_SUBTITLE: type = "text" ; break; + case AVMEDIA_TYPE_VIDEO : type = "video" ; break; + case AVMEDIA_TYPE_AUDIO : type = "audio" ; break; + case AVMEDIA_TYPE_SUBTITLE: type = "text" ; break; default : type = "application"; break; } diff --git a/libavformat/segafilm.c b/libavformat/segafilm.c index ae1263cf98..aec8c4bd79 100644 --- a/libavformat/segafilm.c +++ b/libavformat/segafilm.c @@ -133,7 +133,7 @@ static int film_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); film->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = film->video_type; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = AV_RB32(&scratch[16]); @@ -145,7 +145,7 @@ static int film_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); film->audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = film->audio_type; st->codec->codec_tag = 1; st->codec->channels = film->audio_channels; diff --git a/libavformat/sierravmd.c b/libavformat/sierravmd.c index 9d069fdff6..a052e7bffa 100644 --- a/libavformat/sierravmd.c +++ b/libavformat/sierravmd.c @@ -109,7 +109,7 @@ static int vmd_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(vst, 33, 1, 10); vmd->video_stream_index = vst->index; - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = vmd->is_indeo3 ? CODEC_ID_INDEO3 : CODEC_ID_VMDVIDEO; vst->codec->codec_tag = 0; /* no fourcc */ vst->codec->width = AV_RL16(&vmd->vmd_header[12]); @@ -129,7 +129,7 @@ static int vmd_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); vmd->audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_VMDAUDIO; st->codec->codec_tag = 0; /* no fourcc */ st->codec->channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1; diff --git a/libavformat/siff.c b/libavformat/siff.c index 1194f71bf6..fcf736fd27 100644 --- a/libavformat/siff.c +++ b/libavformat/siff.c @@ -74,7 +74,7 @@ static int create_audio_stream(AVFormatContext *s, SIFFContext *c) ast = av_new_stream(s, 0); if (!ast) return -1; - ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_id = CODEC_ID_PCM_U8; ast->codec->channels = 1; ast->codec->bits_per_coded_sample = c->bits; @@ -118,7 +118,7 @@ static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, ByteIOContext *pb st = av_new_stream(s, 0); if (!st) return -1; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_VB; st->codec->codec_tag = MKTAG('V', 'B', 'V', '1'); st->codec->width = width; diff --git a/libavformat/smacker.c b/libavformat/smacker.c index 59fed35d3f..0dcc286556 100644 --- a/libavformat/smacker.c +++ b/libavformat/smacker.c @@ -158,7 +158,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) st->codec->width = smk->width; st->codec->height = smk->height; st->codec->pix_fmt = PIX_FMT_PAL8; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_SMACKVIDEO; st->codec->codec_tag = smk->magic; /* Smacker uses 100000 as internal timebase */ @@ -176,7 +176,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) if(smk->rates[i] & 0xFFFFFF){ ast[i] = av_new_stream(s, 0); smk->indexes[i] = ast[i]->index; - ast[i]->codec->codec_type = CODEC_TYPE_AUDIO; + ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO; if (smk->rates[i] & SMK_AUD_BINKAUD) { ast[i]->codec->codec_id = CODEC_ID_BINKAUDIO_RDFT; } else if (smk->rates[i] & SMK_AUD_USEDCT) { diff --git a/libavformat/sol.c b/libavformat/sol.c index aa566647bb..3ae2d04bb3 100644 --- a/libavformat/sol.c +++ b/libavformat/sol.c @@ -114,7 +114,7 @@ static int sol_read_header(AVFormatContext *s, st = av_new_stream(s, 0); if (!st) return -1; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_tag = id; st->codec->codec_id = codec; st->codec->channels = channels; diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c index 0151efebc1..41cf884b25 100644 --- a/libavformat/soxdec.c +++ b/libavformat/soxdec.c @@ -53,7 +53,7 @@ static int sox_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; if (get_le32(pb) == SOX_TAG) { st->codec->codec_id = CODEC_ID_PCM_S32LE; diff --git a/libavformat/swfdec.c b/libavformat/swfdec.c index 3a60fab702..64f775f783 100644 --- a/libavformat/swfdec.c +++ b/libavformat/swfdec.c @@ -97,7 +97,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) for (i=0; inb_streams; i++) { st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO && st->id == ch_id) + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) goto skip; } @@ -109,7 +109,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) vst = av_new_stream(s, ch_id); if (!vst) return -1; - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = ff_codec_get_id(swf_codec_tags, get_byte(pb)); av_set_pts_info(vst, 16, 256, swf->frame_rate); vst->codec->time_base = (AVRational){ 256, swf->frame_rate }; @@ -120,7 +120,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) for (i=0; inb_streams; i++) { st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_AUDIO && st->id == -1) + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) goto skip; } @@ -131,7 +131,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) if (!ast) return -1; ast->codec->channels = 1 + (v&1); - ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15); ast->need_parsing = AVSTREAM_PARSE_FULL; sample_rate_code= (v>>2) & 3; @@ -145,7 +145,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) len -= 2; for(i=0; inb_streams; i++) { st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO && st->id == ch_id) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) { frame = get_le16(pb); av_get_packet(pb, pkt, len-2); pkt->pos = pos; @@ -157,7 +157,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) } else if (tag == TAG_STREAMBLOCK) { for (i = 0; i < s->nb_streams; i++) { st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_AUDIO && st->id == -1) { + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) { if (st->codec->codec_id == CODEC_ID_MP3) { url_fskip(pb, 4); av_get_packet(pb, pkt, len-4); @@ -179,7 +179,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) vst = av_new_stream(s, -2); /* -2 to avoid clash with video stream and audio stream */ if (!vst) return -1; - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_MJPEG; av_set_pts_info(vst, 64, 256, swf->frame_rate); vst->codec->time_base = (AVRational){ 256, swf->frame_rate }; diff --git a/libavformat/swfenc.c b/libavformat/swfenc.c index 60b7171cc9..1a1a9ab808 100644 --- a/libavformat/swfenc.c +++ b/libavformat/swfenc.c @@ -185,7 +185,7 @@ static int swf_write_header(AVFormatContext *s) for(i=0;inb_streams;i++) { AVCodecContext *enc = s->streams[i]->codec; - if (enc->codec_type == CODEC_TYPE_AUDIO) { + if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { if (enc->codec_id == CODEC_ID_MP3) { if (!enc->frame_size) { av_log(s, AV_LOG_ERROR, "audio frame size not set\n"); @@ -464,7 +464,7 @@ static int swf_write_audio(AVFormatContext *s, static int swf_write_packet(AVFormatContext *s, AVPacket *pkt) { AVCodecContext *codec = s->streams[pkt->stream_index]->codec; - if (codec->codec_type == CODEC_TYPE_AUDIO) + if (codec->codec_type == AVMEDIA_TYPE_AUDIO) return swf_write_audio(s, codec, pkt->data, pkt->size); else return swf_write_video(s, codec, pkt->data, pkt->size); @@ -480,7 +480,7 @@ static int swf_write_trailer(AVFormatContext *s) video_enc = NULL; for(i=0;inb_streams;i++) { enc = s->streams[i]->codec; - if (enc->codec_type == CODEC_TYPE_VIDEO) + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) video_enc = enc; else av_fifo_free(swf->audio_fifo); diff --git a/libavformat/thp.c b/libavformat/thp.c index a5c9476d1a..82966dde7e 100644 --- a/libavformat/thp.c +++ b/libavformat/thp.c @@ -100,7 +100,7 @@ static int thp_read_header(AVFormatContext *s, /* The denominator and numerator are switched because 1/fps is required. */ av_set_pts_info(st, 64, thp->fps.den, thp->fps.num); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_THP; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = get_be32(pb); @@ -120,7 +120,7 @@ static int thp_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_THP; st->codec->codec_tag = 0; /* no fourcc */ st->codec->channels = get_be32(pb); /* numChannels. */ diff --git a/libavformat/tiertexseq.c b/libavformat/tiertexseq.c index 43ee6b1e21..b8516f9f8a 100644 --- a/libavformat/tiertexseq.c +++ b/libavformat/tiertexseq.c @@ -212,7 +212,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) av_set_pts_info(st, 32, 1, SEQ_FRAME_RATE); seq->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_TIERTEXSEQVIDEO; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = SEQ_FRAME_W; @@ -225,7 +225,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) av_set_pts_info(st, 32, 1, SEQ_SAMPLE_RATE); seq->audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_PCM_S16BE; st->codec->codec_tag = 0; /* no tag */ st->codec->channels = 1; diff --git a/libavformat/tmv.c b/libavformat/tmv.c index 27afbbfa6d..cec6f99148 100644 --- a/libavformat/tmv.c +++ b/libavformat/tmv.c @@ -109,7 +109,7 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap) return -1; } - ast->codec->codec_type = CODEC_TYPE_AUDIO; + ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; ast->codec->codec_id = CODEC_ID_PCM_U8; ast->codec->channels = features & TMV_STEREO ? 2 : 1; ast->codec->bits_per_coded_sample = 8; @@ -121,7 +121,7 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap) fps.den = tmv->audio_chunk_size; av_reduce(&fps.num, &fps.den, fps.num, fps.den, 0xFFFFFFFFLL); - vst->codec->codec_type = CODEC_TYPE_VIDEO; + vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; vst->codec->codec_id = CODEC_ID_TMV; vst->codec->pix_fmt = PIX_FMT_PAL8; vst->codec->width = char_cols * 8; diff --git a/libavformat/tta.c b/libavformat/tta.c index e5b9e5f4ed..66d3bad904 100644 --- a/libavformat/tta.c +++ b/libavformat/tta.c @@ -101,7 +101,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap) } url_fskip(s->pb, 4); // seektable crc - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_TTA; st->codec->channels = channels; st->codec->sample_rate = samplerate; diff --git a/libavformat/txd.c b/libavformat/txd.c index 6a06711bc4..38bdb1ba94 100644 --- a/libavformat/txd.c +++ b/libavformat/txd.c @@ -43,7 +43,7 @@ static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) { st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_TXD; st->codec->time_base.den = 5; st->codec->time_base.num = 1; diff --git a/libavformat/utils.c b/libavformat/utils.c index b29e65d93c..8b57b39d59 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -254,8 +254,8 @@ AVOutputFormat *guess_stream_format(const char *short_name, const char *filename #endif enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, - const char *filename, const char *mime_type, enum CodecType type){ - if(type == CODEC_TYPE_VIDEO){ + const char *filename, const char *mime_type, enum AVMediaType type){ + if(type == AVMEDIA_TYPE_VIDEO){ enum CodecID codec_id= CODEC_ID_NONE; #if CONFIG_IMAGE2_MUXER @@ -266,7 +266,7 @@ enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, if(codec_id == CODEC_ID_NONE) codec_id= fmt->video_codec; return codec_id; - }else if(type == CODEC_TYPE_AUDIO) + }else if(type == AVMEDIA_TYPE_AUDIO) return fmt->audio_codec; else return CODEC_ID_NONE; @@ -351,25 +351,25 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, AVProbeDa pd->buf_size, MAX_PROBE_PACKETS - st->probe_packets, fmt->name, score); if (!strcmp(fmt->name, "mp3")) { st->codec->codec_id = CODEC_ID_MP3; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; } else if (!strcmp(fmt->name, "ac3")) { st->codec->codec_id = CODEC_ID_AC3; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; } else if (!strcmp(fmt->name, "eac3")) { st->codec->codec_id = CODEC_ID_EAC3; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; } else if (!strcmp(fmt->name, "mpegvideo")) { st->codec->codec_id = CODEC_ID_MPEG2VIDEO; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; } else if (!strcmp(fmt->name, "m4v")) { st->codec->codec_id = CODEC_ID_MPEG4; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; } else if (!strcmp(fmt->name, "h264")) { st->codec->codec_id = CODEC_ID_H264; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; } else if (!strcmp(fmt->name, "dts")) { st->codec->codec_id = CODEC_ID_DTS; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; } } return !!fmt; @@ -646,13 +646,13 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt) st= s->streams[pkt->stream_index]; switch(st->codec->codec_type){ - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if(s->video_codec_id) st->codec->codec_id= s->video_codec_id; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if(s->audio_codec_id) st->codec->codec_id= s->audio_codec_id; break; - case CODEC_TYPE_SUBTITLE: + case AVMEDIA_TYPE_SUBTITLE: if(s->subtitle_codec_id)st->codec->codec_id= s->subtitle_codec_id; break; } @@ -729,7 +729,7 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st, *pnum = 0; *pden = 0; switch(st->codec->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if(st->time_base.num*1000LL > st->time_base.den){ *pnum = st->time_base.num; *pden = st->time_base.den; @@ -741,7 +741,7 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st, } } break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: frame_size = get_audio_frame_size(st->codec, pkt->size); if (frame_size < 0) break; @@ -754,9 +754,9 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st, } static int is_intra_only(AVCodecContext *enc){ - if(enc->codec_type == CODEC_TYPE_AUDIO){ + if(enc->codec_type == AVMEDIA_TYPE_AUDIO){ return 1; - }else if(enc->codec_type == CODEC_TYPE_VIDEO){ + }else if(enc->codec_type == AVMEDIA_TYPE_VIDEO){ switch(enc->codec_id){ case CODEC_ID_MJPEG: case CODEC_ID_MJPEGB: @@ -1223,10 +1223,10 @@ int av_find_default_stream_index(AVFormatContext *s) return -1; for(i = 0; i < s->nb_streams; i++) { st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { return i; } - if (first_audio_index < 0 && st->codec->codec_type == CODEC_TYPE_AUDIO) + if (first_audio_index < 0 && st->codec->codec_type == AVMEDIA_TYPE_AUDIO) first_audio_index = i; } return first_audio_index >= 0 ? first_audio_index : 0; @@ -1953,7 +1953,7 @@ static int has_codec_parameters(AVCodecContext *enc) { int val; switch(enc->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: val = enc->sample_rate && enc->channels && enc->sample_fmt != SAMPLE_FMT_NONE; if(!enc->frame_size && (enc->codec_id == CODEC_ID_VORBIS || @@ -1964,7 +1964,7 @@ static int has_codec_parameters(AVCodecContext *enc) enc->codec_id == CODEC_ID_SPEEX)) return 0; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: val = enc->width && enc->pix_fmt != PIX_FMT_NONE; break; default: @@ -1992,12 +1992,12 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt) if(!has_codec_parameters(st->codec)){ switch(st->codec->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: avcodec_get_frame_defaults(&picture); ret = avcodec_decode_video2(st->codec, &picture, &got_picture, avpkt); break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: data_size = FFMAX(avpkt->size, AVCODEC_MAX_AUDIO_FRAME_SIZE); samples = av_malloc(data_size); if (!samples) @@ -2129,7 +2129,7 @@ int av_find_stream_info(AVFormatContext *ic) st->codec->frame_size = 0; st->codec->channels = 0; } - if(st->codec->codec_type == CODEC_TYPE_VIDEO){ + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ /* if(!st->time_base.num) st->time_base= */ if(!st->codec->time_base.num) @@ -2171,7 +2171,7 @@ int av_find_stream_info(AVFormatContext *ic) break; /* variable fps and no guess at the real fps */ if( tb_unreliable(st->codec) && !(st->r_frame_rate.num && st->avg_frame_rate.num) - && duration_count[i]<20 && st->codec->codec_type == CODEC_TYPE_VIDEO) + && duration_count[i]<20 && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) break; if(st->parser && st->parser->parser->split && !st->codec->extradata) break; @@ -2243,7 +2243,7 @@ int av_find_stream_info(AVFormatContext *ic) if(pkt->dts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && duration>0){ double dur= duration * av_q2d(st->time_base); -// if(st->codec->codec_type == CODEC_TYPE_VIDEO) +// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO) // av_log(NULL, AV_LOG_ERROR, "%f\n", dur); if(duration_count[index] < 2) memset(duration_error[index], 0, sizeof(*duration_error)); @@ -2293,7 +2293,7 @@ int av_find_stream_info(AVFormatContext *ic) av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, (st->codec_info_nb_frames-2)*(int64_t)st->time_base.den, codec_info_duration[i] *(int64_t)st->time_base.num, 60000); - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample) st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); @@ -2312,7 +2312,7 @@ int av_find_stream_info(AVFormatContext *ic) for(j=1; jcodec->codec_type == CODEC_TYPE_VIDEO) +// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO) // av_log(NULL, AV_LOG_ERROR, "%f %f\n", get_std_framerate(j) / 12.0/1001, error); if(error < best_error){ best_error= error; @@ -2334,7 +2334,7 @@ int av_find_stream_info(AVFormatContext *ic) st->r_frame_rate.den = st->time_base.num; } } - }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) { + }else if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { if(!st->codec->bits_per_coded_sample) st->codec->bits_per_coded_sample= av_get_bits_per_sample(st->codec->codec_id); } @@ -2348,7 +2348,7 @@ int av_find_stream_info(AVFormatContext *ic) /* correct DTS for B-frame streams with no timestamps */ for(i=0;inb_streams;i++) { st = ic->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if(b-frames){ ppktl = &ic->packet_buffer; while(ppkt1){ @@ -2581,7 +2581,7 @@ int av_write_header(AVFormatContext *s) st = s->streams[i]; switch (st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if(st->codec->sample_rate<=0){ av_log(s, AV_LOG_ERROR, "sample rate not set\n"); return -1; @@ -2590,7 +2590,7 @@ int av_write_header(AVFormatContext *s) st->codec->block_align = st->codec->channels * av_get_bits_per_sample(st->codec->codec_id) >> 3; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if(st->codec->time_base.num<=0 || st->codec->time_base.den<=0){ //FIXME audio too? av_log(s, AV_LOG_ERROR, "time base not set\n"); return -1; @@ -2658,10 +2658,10 @@ int av_write_header(AVFormatContext *s) st = s->streams[i]; switch (st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: den = (int64_t)st->time_base.num * st->codec->sample_rate; break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: den = (int64_t)st->time_base.num * st->codec->time_base.den; break; default: @@ -2732,7 +2732,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){ /* update pts */ switch (st->codec->codec_type) { - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: frame_size = get_audio_frame_size(st->codec, pkt->size); /* HACK/FIXME, we skip the initial 0 size packets as they are most @@ -2742,7 +2742,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){ av_frac_add(&st->pts, (int64_t)st->time_base.den * frame_size); } break; - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: av_frac_add(&st->pts, (int64_t)st->time_base.den * st->codec->time_base.num); break; default: @@ -2859,7 +2859,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){ AVStream *st= s->streams[ pkt->stream_index]; //FIXME/XXX/HACK drop zero sized packets - if(st->codec->codec_type == CODEC_TYPE_AUDIO && pkt->size==0) + if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->size==0) return 0; //av_log(NULL, AV_LOG_DEBUG, "av_interleaved_write_frame %d %"PRId64" %"PRId64"\n", pkt->size, pkt->dts, pkt->pts); @@ -2999,7 +2999,7 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, display_aspect_ratio.num, display_aspect_ratio.den); } - if(st->codec->codec_type == CODEC_TYPE_VIDEO){ + if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ if(st->avg_frame_rate.den && st->avg_frame_rate.num) print_fps(av_q2d(st->avg_frame_rate), "fps"); if(st->r_frame_rate.den && st->r_frame_rate.num) diff --git a/libavformat/vc1test.c b/libavformat/vc1test.c index 11a4a6f4a7..d47fe6af32 100644 --- a/libavformat/vc1test.c +++ b/libavformat/vc1test.c @@ -58,7 +58,7 @@ static int vc1t_read_header(AVFormatContext *s, if (!st) return -1; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_WMV3; st->codec->extradata = av_malloc(VC1_EXTRADATA_SIZE); diff --git a/libavformat/vocdec.c b/libavformat/vocdec.c index 246dbd91b4..13d48f7397 100644 --- a/libavformat/vocdec.c +++ b/libavformat/vocdec.c @@ -54,7 +54,7 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap) st = av_new_stream(s, 0); if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; voc->remaining_size = 0; return 0; diff --git a/libavformat/vocenc.c b/libavformat/vocenc.c index 744b2337a0..f127c7e826 100644 --- a/libavformat/vocenc.c +++ b/libavformat/vocenc.c @@ -33,7 +33,7 @@ static int voc_write_header(AVFormatContext *s) const int version = 0x0114; if (s->nb_streams != 1 - || s->streams[0]->codec->codec_type != CODEC_TYPE_AUDIO) + || s->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO) return AVERROR_PATCHWELCOME; put_buffer(pb, ff_voc_magic, sizeof(ff_voc_magic) - 1); diff --git a/libavformat/vqf.c b/libavformat/vqf.c index 40fea47157..27890f8482 100644 --- a/libavformat/vqf.c +++ b/libavformat/vqf.c @@ -76,7 +76,7 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap) header_size = get_be32(s->pb); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_TWINVQ; st->start_time = 0; diff --git a/libavformat/wc3movie.c b/libavformat/wc3movie.c index 502ff52564..4138873573 100644 --- a/libavformat/wc3movie.c +++ b/libavformat/wc3movie.c @@ -243,7 +243,7 @@ static int wc3_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, WC3_FRAME_FPS); wc3->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_XAN_WC3; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = wc3->width; @@ -257,7 +257,7 @@ static int wc3_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, WC3_FRAME_FPS); wc3->audio_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_PCM_S16LE; st->codec->codec_tag = 1; st->codec->channels = WC3_AUDIO_CHANNELS; diff --git a/libavformat/westwood.c b/libavformat/westwood.c index 7b016fdeda..369d67a85e 100644 --- a/libavformat/westwood.c +++ b/libavformat/westwood.c @@ -148,7 +148,7 @@ static int wsaud_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, wsaud->audio_samplerate); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = wsaud->audio_type; st->codec->codec_tag = 0; /* no tag */ st->codec->channels = wsaud->audio_channels; @@ -226,7 +226,7 @@ static int wsvqa_read_header(AVFormatContext *s, return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, VQA_FRAMERATE); wsvqa->video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_WS_VQA; st->codec->codec_tag = 0; /* no fourcc */ @@ -251,7 +251,7 @@ static int wsvqa_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); av_set_pts_info(st, 33, 1, VQA_FRAMERATE); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; if (AV_RL16(&header[0]) == 1) st->codec->codec_id = CODEC_ID_WESTWOOD_SND1; else diff --git a/libavformat/wv.c b/libavformat/wv.c index 6290a99412..03b864bdaf 100644 --- a/libavformat/wv.c +++ b/libavformat/wv.c @@ -162,7 +162,7 @@ static int wv_read_header(AVFormatContext *s, st = av_new_stream(s, 0); if (!st) return -1; - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_WAVPACK; st->codec->channels = wc->chan; st->codec->sample_rate = wc->rate; diff --git a/libavformat/xa.c b/libavformat/xa.c index d9179df6b7..6576c52780 100644 --- a/libavformat/xa.c +++ b/libavformat/xa.c @@ -74,7 +74,7 @@ static int xa_read_header(AVFormatContext *s, if (!st) return AVERROR(ENOMEM); - st->codec->codec_type = CODEC_TYPE_AUDIO; + st->codec->codec_type = AVMEDIA_TYPE_AUDIO; st->codec->codec_id = CODEC_ID_ADPCM_EA_MAXIS_XA; url_fskip(pb, 4); /* Skip the XA ID */ xa->out_size = get_le32(pb); diff --git a/libavformat/yop.c b/libavformat/yop.c index 36c9369916..9c0e5822b5 100644 --- a/libavformat/yop.c +++ b/libavformat/yop.c @@ -71,14 +71,14 @@ static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap) // Audio audio_dec = audio_stream->codec; - audio_dec->codec_type = CODEC_TYPE_AUDIO; + audio_dec->codec_type = AVMEDIA_TYPE_AUDIO; audio_dec->codec_id = CODEC_ID_ADPCM_IMA_WS; audio_dec->channels = 1; audio_dec->sample_rate = 22050; // Video video_dec = video_stream->codec; - video_dec->codec_type = CODEC_TYPE_VIDEO; + video_dec->codec_type = AVMEDIA_TYPE_VIDEO; video_dec->codec_id = CODEC_ID_YOP; url_fskip(pb, 6); diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c index 8e7acebe71..99a1ce2f38 100644 --- a/libavformat/yuv4mpeg.c +++ b/libavformat/yuv4mpeg.c @@ -335,7 +335,7 @@ static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap) av_reduce(&raten, &rated, raten, rated, (1UL<<31)-1); av_set_pts_info(st, 64, rated, raten); st->codec->pix_fmt = pix_fmt; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_RAWVIDEO; st->sample_aspect_ratio= (AVRational){aspectn, aspectd}; st->codec->chroma_sample_location = chroma_sample_location;