aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2010-03-30 23:30:55 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2010-03-30 23:30:55 +0000
commit72415b2adb2c25f95ceede49001bb97ed9247dbb (patch)
tree99247889aa61bb7621c966466ea4b84c100207d3 /libavformat
parentca6e7708b42e7d33ba3053bcd447d52a077bca25 (diff)
downloadffmpeg-72415b2adb2c25f95ceede49001bb97ed9247dbb.tar.gz
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
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/4xm.c4
-rw-r--r--libavformat/aea.c2
-rw-r--r--libavformat/aiffdec.c2
-rw-r--r--libavformat/amr.c2
-rw-r--r--libavformat/anm.c2
-rw-r--r--libavformat/apc.c2
-rw-r--r--libavformat/ape.c2
-rw-r--r--libavformat/asfdec.c20
-rw-r--r--libavformat/asfenc.c18
-rw-r--r--libavformat/assdec.c2
-rw-r--r--libavformat/au.c2
-rw-r--r--libavformat/audiointerleave.c8
-rw-r--r--libavformat/avformat.h2
-rw-r--r--libavformat/avidec.c26
-rw-r--r--libavformat/avienc.c40
-rw-r--r--libavformat/avisynth.c4
-rw-r--r--libavformat/avs.c4
-rw-r--r--libavformat/bethsoftvid.c4
-rw-r--r--libavformat/bfi.c4
-rw-r--r--libavformat/bink.c4
-rw-r--r--libavformat/c93.c4
-rw-r--r--libavformat/cafdec.c2
-rw-r--r--libavformat/cdg.c2
-rw-r--r--libavformat/daud.c2
-rw-r--r--libavformat/dsicin.c4
-rw-r--r--libavformat/dv.c4
-rw-r--r--libavformat/dvenc.c8
-rw-r--r--libavformat/dxa.c2
-rw-r--r--libavformat/eacdata.c2
-rw-r--r--libavformat/electronicarts.c4
-rw-r--r--libavformat/ffmdec.c4
-rw-r--r--libavformat/ffmenc.c4
-rw-r--r--libavformat/filmstripdec.c2
-rw-r--r--libavformat/flacdec.c2
-rw-r--r--libavformat/flic.c2
-rw-r--r--libavformat/flvdec.c6
-rw-r--r--libavformat/flvenc.c8
-rw-r--r--libavformat/gif.c4
-rw-r--r--libavformat/gxf.c20
-rw-r--r--libavformat/gxfenc.c16
-rw-r--r--libavformat/idcin.c4
-rw-r--r--libavformat/idroq.c4
-rw-r--r--libavformat/iff.c14
-rw-r--r--libavformat/img2.c8
-rw-r--r--libavformat/ipmovie.c4
-rw-r--r--libavformat/iss.c2
-rw-r--r--libavformat/iv8.c2
-rw-r--r--libavformat/libnut.c12
-rw-r--r--libavformat/lmlm4.c4
-rw-r--r--libavformat/matroskadec.c8
-rw-r--r--libavformat/matroskaenc.c14
-rw-r--r--libavformat/mm.c4
-rw-r--r--libavformat/mmf.c2
-rw-r--r--libavformat/mov.c38
-rw-r--r--libavformat/movenc.c52
-rw-r--r--libavformat/mp3.c2
-rw-r--r--libavformat/mpc.c2
-rw-r--r--libavformat/mpc8.c2
-rw-r--r--libavformat/mpeg.c36
-rw-r--r--libavformat/mpegenc.c10
-rw-r--r--libavformat/mpegts.c58
-rw-r--r--libavformat/mpegtsenc.c22
-rw-r--r--libavformat/msnwc_tcp.c2
-rw-r--r--libavformat/mtv.c4
-rw-r--r--libavformat/mvi.c4
-rw-r--r--libavformat/mxf.c6
-rw-r--r--libavformat/mxfdec.c6
-rw-r--r--libavformat/mxfenc.c6
-rw-r--r--libavformat/ncdec.c2
-rw-r--r--libavformat/nsvdec.c4
-rw-r--r--libavformat/nutdec.c12
-rw-r--r--libavformat/nutenc.c12
-rw-r--r--libavformat/nuv.c4
-rw-r--r--libavformat/oggdec.c2
-rw-r--r--libavformat/oggenc.c4
-rw-r--r--libavformat/oggparsedirac.c4
-rw-r--r--libavformat/oggparseflac.c4
-rw-r--r--libavformat/oggparseogm.c12
-rw-r--r--libavformat/oggparseskeleton.c2
-rw-r--r--libavformat/oggparsespeex.c2
-rw-r--r--libavformat/oggparsetheora.c2
-rw-r--r--libavformat/oggparsevorbis.c2
-rw-r--r--libavformat/oma.c2
-rw-r--r--libavformat/output-example.c4
-rw-r--r--libavformat/psxstr.c4
-rw-r--r--libavformat/pva.c4
-rw-r--r--libavformat/qcp.c2
-rw-r--r--libavformat/r3d.c4
-rw-r--r--libavformat/raw.c14
-rw-r--r--libavformat/rdt.c8
-rw-r--r--libavformat/riff.c6
-rw-r--r--libavformat/rl2.c4
-rw-r--r--libavformat/rmdec.c18
-rw-r--r--libavformat/rmenc.c10
-rw-r--r--libavformat/rpl.c8
-rw-r--r--libavformat/rtp.c58
-rw-r--r--libavformat/rtp.h2
-rw-r--r--libavformat/rtpdec.c6
-rw-r--r--libavformat/rtpdec.h2
-rw-r--r--libavformat/rtpdec_amr.c4
-rw-r--r--libavformat/rtpdec_asf.c4
-rw-r--r--libavformat/rtpdec_h263.c4
-rw-r--r--libavformat/rtpdec_h264.c2
-rw-r--r--libavformat/rtpdec_theora.c2
-rw-r--r--libavformat/rtpdec_vorbis.c2
-rw-r--r--libavformat/rtpenc.c8
-rw-r--r--libavformat/rtsp.c14
-rw-r--r--libavformat/sdp.c8
-rw-r--r--libavformat/segafilm.c4
-rw-r--r--libavformat/sierravmd.c4
-rw-r--r--libavformat/siff.c4
-rw-r--r--libavformat/smacker.c4
-rw-r--r--libavformat/sol.c2
-rw-r--r--libavformat/soxdec.c2
-rw-r--r--libavformat/swfdec.c14
-rw-r--r--libavformat/swfenc.c6
-rw-r--r--libavformat/thp.c4
-rw-r--r--libavformat/tiertexseq.c4
-rw-r--r--libavformat/tmv.c4
-rw-r--r--libavformat/tta.c2
-rw-r--r--libavformat/txd.c2
-rw-r--r--libavformat/utils.c76
-rw-r--r--libavformat/vc1test.c2
-rw-r--r--libavformat/vocdec.c2
-rw-r--r--libavformat/vocenc.c2
-rw-r--r--libavformat/vqf.c2
-rw-r--r--libavformat/wc3movie.c4
-rw-r--r--libavformat/westwood.c6
-rw-r--r--libavformat/wv.c2
-rw-r--r--libavformat/xa.c2
-rw-r--r--libavformat/yop.c4
-rw-r--r--libavformat/yuv4mpeg.c2
132 files changed, 510 insertions, 510 deletions
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;n<s->nb_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; i<s->nb_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; i<s->nb_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;i<s->nb_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(&sector[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; i<s->nb_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; 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)
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; i<s->nb_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;i<s->nb_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;i<s->nb_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; j<MAX_STD_TIMEBASES; j++){
double error= duration_error[i][j] * get_std_framerate(j);
-// if(st->codec->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;i<ic->nb_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;