# HG changeset patch # User stefano # Date 1269991855 0 # Node ID 536e5527c1e0c7e7a14ec38ed23cf53c6c2d0e36 # Parent b8041f85c3273eaa3738d6374682dd9328343713 Define AVMediaType enum, and use it instead of enum CodecType, which is deprecated and will be dropped at the next major bump. diff -r b8041f85c327 -r 536e5527c1e0 4xm.c --- a/4xm.c Tue Mar 30 15:50:57 2010 +0000 +++ b/4xm.c Tue Mar 30 23:30:55 2010 +0000 @@ -149,7 +149,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 aea.c --- a/aea.c Tue Mar 30 15:50:57 2010 +0000 +++ b/aea.c Tue Mar 30 23:30:55 2010 +0000 @@ -71,7 +71,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 aiffdec.c --- a/aiffdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/aiffdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -92,7 +92,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 amr.c --- a/amr.c Tue Mar 30 15:50:57 2010 +0000 +++ b/amr.c Tue Mar 30 23:30:55 2010 +0000 @@ -108,7 +108,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 anm.c --- a/anm.c Tue Mar 30 15:50:57 2010 +0000 +++ b/anm.c Tue Mar 30 23:30:55 2010 +0000 @@ -100,7 +100,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 apc.c --- a/apc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/apc.c Tue Mar 30 23:30:55 2010 +0000 @@ -43,7 +43,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 ape.c --- a/ape.c Tue Mar 30 15:50:57 2010 +0000 +++ b/ape.c Tue Mar 30 23:30:55 2010 +0000 @@ -301,7 +301,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 asfdec.c --- a/asfdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/asfdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -236,7 +236,7 @@ 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 @@ 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 @@ 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 @@ } 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 asfenc.c --- a/asfenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/asfenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -375,13 +375,13 @@ 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 @@ } 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 @@ 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 @@ 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 @@ /* 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 @@ // 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 assdec.c --- a/assdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/assdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -99,7 +99,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 au.c --- a/au.c Tue Mar 30 15:50:57 2010 +0000 +++ b/au.c Tue Mar 30 23:30:55 2010 +0000 @@ -148,7 +148,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 audiointerleave.c --- a/audiointerleave.c Tue Mar 30 15:50:57 2010 +0000 +++ b/audiointerleave.c Tue Mar 30 23:30:55 2010 +0000 @@ -32,7 +32,7 @@ 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 avformat.h --- a/avformat.h Tue Mar 30 15:50:57 2010 +0000 +++ b/avformat.h Tue Mar 30 23:30:55 2010 +0000 @@ -804,7 +804,7 @@ */ 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 -r b8041f85c327 -r 536e5527c1e0 avidec.c --- a/avidec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/avidec.c Tue Mar 30 23:30:55 2010 +0000 @@ -442,19 +442,19 @@ 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 @@ 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 @@ 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 @@ #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 @@ // 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 @@ 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 @@ //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 @@ //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 -r b8041f85c327 -r 536e5527c1e0 avienc.c --- a/avienc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/avienc.c Tue Mar 30 23:30:55 2010 +0000 @@ -83,14 +83,14 @@ 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 @@ } 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 @@ for(n=0;nnb_streams;n++) { stream = s->streams[n]->codec; bitrate += stream->bit_rate; - if (stream->codec_type == CODEC_TYPE_VIDEO) + if (stream->codec_type == AVMEDIA_TYPE_VIDEO) video_enc = stream; } @@ -222,16 +222,16 @@ /* 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 avisynth.c --- a/avisynth.c Tue Mar 30 15:50:57 2010 +0000 +++ b/avisynth.c Tue Mar 30 23:30:55 2010 +0000 @@ -85,7 +85,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 avs.c --- a/avs.c Tue Mar 30 15:50:57 2010 +0000 +++ b/avs.c Tue Mar 30 23:30:55 2010 +0000 @@ -178,7 +178,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 bethsoftvid.c --- a/bethsoftvid.c Tue Mar 30 15:50:57 2010 +0000 +++ b/bethsoftvid.c Tue Mar 30 23:30:55 2010 +0000 @@ -74,7 +74,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 bfi.c --- a/bfi.c Tue Mar 30 15:50:57 2010 +0000 +++ b/bfi.c Tue Mar 30 23:30:55 2010 +0000 @@ -87,12 +87,12 @@ /* 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 -r b8041f85c327 -r 536e5527c1e0 bink.c --- a/bink.c Tue Mar 30 15:50:57 2010 +0000 +++ b/bink.c Tue Mar 30 23:30:55 2010 +0000 @@ -111,7 +111,7 @@ } 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 c93.c --- a/c93.c Tue Mar 30 15:50:57 2010 +0000 +++ b/c93.c Tue Mar 30 23:30:55 2010 +0000 @@ -83,7 +83,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 cafdec.c --- a/cafdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/cafdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -64,7 +64,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 cdg.c --- a/cdg.c Tue Mar 30 15:50:57 2010 +0000 +++ b/cdg.c Tue Mar 30 23:30:55 2010 +0000 @@ -32,7 +32,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 daud.c --- a/daud.c Tue Mar 30 15:50:57 2010 +0000 +++ b/daud.c Tue Mar 30 23:30:55 2010 +0000 @@ -24,7 +24,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 dsicin.c --- a/dsicin.c Tue Mar 30 15:50:57 2010 +0000 +++ b/dsicin.c Tue Mar 30 23:30:55 2010 +0000 @@ -113,7 +113,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 dv.c --- a/dv.c Tue Mar 30 15:50:57 2010 +0000 +++ b/dv.c Tue Mar 30 23:30:55 2010 +0000 @@ -214,7 +214,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 dvenc.c --- a/dvenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/dvenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -239,7 +239,7 @@ 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 @@ 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 @@ /* We have to sort out where audio and where video stream is */ for (i=0; inb_streams; i++) { switch (s->streams[i]->codec->codec_type) { - case CODEC_TYPE_VIDEO: + case AVMEDIA_TYPE_VIDEO: if (vst) return NULL; vst = s->streams[i]; break; - case CODEC_TYPE_AUDIO: + case AVMEDIA_TYPE_AUDIO: if (c->n_ast > 1) return NULL; c->ast[c->n_ast++] = s->streams[i]; break; diff -r b8041f85c327 -r 536e5527c1e0 dxa.c --- a/dxa.c Tue Mar 30 15:50:57 2010 +0000 +++ b/dxa.c Tue Mar 30 23:30:55 2010 +0000 @@ -119,7 +119,7 @@ } /* 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 -r b8041f85c327 -r 536e5527c1e0 eacdata.c --- a/eacdata.c Tue Mar 30 15:50:57 2010 +0000 +++ b/eacdata.c Tue Mar 30 23:30:55 2010 +0000 @@ -67,7 +67,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 electronicarts.c --- a/electronicarts.c Tue Mar 30 15:50:57 2010 +0000 +++ b/electronicarts.c Tue Mar 30 23:30:55 2010 +0000 @@ -414,7 +414,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 ffmdec.c --- a/ffmdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/ffmdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -301,7 +301,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 ffmenc.c --- a/ffmenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/ffmenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -119,7 +119,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 filmstripdec.c --- a/filmstripdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/filmstripdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -60,7 +60,7 @@ } 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 -r b8041f85c327 -r 536e5527c1e0 flacdec.c --- a/flacdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/flacdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -36,7 +36,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 flic.c --- a/flic.c Tue Mar 30 15:50:57 2010 +0000 +++ b/flic.c Tue Mar 30 23:30:55 2010 +0000 @@ -103,7 +103,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 flvdec.c --- a/flvdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/flvdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -221,8 +221,8 @@ //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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 flvenc.c --- a/flvenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/flvenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -166,7 +166,7 @@ for(i=0; inb_streams; i++){ AVCodecContext *enc = s->streams[i]->codec; - if (enc->codec_type == CODEC_TYPE_VIDEO) { + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) { framerate = av_q2d(s->streams[i]->r_frame_rate); } else { @@ -275,7 +275,7 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 gif.c --- a/gif.c Tue Mar 30 15:50:57 2010 +0000 +++ b/gif.c Tue Mar 30 23:30:55 2010 +0000 @@ -266,7 +266,7 @@ video_enc = NULL; for(i=0;inb_streams;i++) { enc = s->streams[i]->codec; - if (enc->codec_type != CODEC_TYPE_AUDIO) + if (enc->codec_type != AVMEDIA_TYPE_AUDIO) video_enc = enc; } @@ -329,7 +329,7 @@ static int gif_write_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 -r b8041f85c327 -r 536e5527c1e0 gxf.c --- a/gxf.c Tue Mar 30 15:50:57 2010 +0000 +++ b/gxf.c Tue Mar 30 23:30:55 2010 +0000 @@ -87,34 +87,34 @@ 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 gxfenc.c --- a/gxfenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/gxfenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -644,7 +644,7 @@ 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 @@ 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 @@ /* 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 @@ 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 @@ 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 @@ 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_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 -r b8041f85c327 -r 536e5527c1e0 idcin.c --- a/idcin.c Tue Mar 30 15:50:57 2010 +0000 +++ b/idcin.c Tue Mar 30 23:30:55 2010 +0000 @@ -160,7 +160,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 idroq.c --- a/idroq.c Tue Mar 30 15:50:57 2010 +0000 +++ b/idroq.c Tue Mar 30 23:30:55 2010 +0000 @@ -89,7 +89,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 iff.c --- a/iff.c Tue Mar 30 15:50:57 2010 +0000 +++ b/iff.c Tue Mar 30 23:30:55 2010 +0000 @@ -119,7 +119,7 @@ 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 @@ 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 @@ } 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 img2.c --- a/img2.c Tue Mar 30 15:50:57 2010 +0000 +++ b/img2.c Tue Mar 30 23:30:55 2010 +0000 @@ -233,16 +233,16 @@ } 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 -r b8041f85c327 -r 536e5527c1e0 ipmovie.c --- a/ipmovie.c Tue Mar 30 15:50:57 2010 +0000 +++ b/ipmovie.c Tue Mar 30 23:30:55 2010 +0000 @@ -566,7 +566,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 iss.c --- a/iss.c Tue Mar 30 15:50:57 2010 +0000 +++ b/iss.c Tue Mar 30 23:30:55 2010 +0000 @@ -92,7 +92,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 iv8.c --- a/iv8.c Tue Mar 30 15:50:57 2010 +0000 +++ b/iv8.c Tue Mar 30 23:30:55 2010 +0000 @@ -44,7 +44,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 libnut.c --- a/libnut.c Tue Mar 30 15:50:57 2010 +0000 +++ b/libnut.c Tue Mar 30 23:30:55 2010 +0000 @@ -77,14 +77,14 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 lmlm4.c --- a/lmlm4.c Tue Mar 30 15:50:57 2010 +0000 +++ b/lmlm4.c Tue Mar 30 23:30:55 2010 +0000 @@ -62,14 +62,14 @@ 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 -r b8041f85c327 -r 536e5527c1e0 matroskadec.c --- a/matroskadec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/matroskadec.c Tue Mar 30 23:30:55 2010 +0000 @@ -1378,7 +1378,7 @@ } 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 matroskaenc.c --- a/matroskaenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/matroskaenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -475,7 +475,7 @@ 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 @@ 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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mm.c --- a/mm.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mm.c Tue Mar 30 23:30:55 2010 +0000 @@ -108,7 +108,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mmf.c --- a/mmf.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mmf.c Tue Mar 30 23:30:55 2010 +0000 @@ -244,7 +244,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mov.c --- a/mov.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mov.c Tue Mar 30 23:30:55 2010 +0000 @@ -411,13 +411,13 @@ 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 @@ 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 @@ (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 @@ } 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 @@ 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 @@ 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 @@ 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 @@ } /* 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 @@ 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 @@ 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 @@ } 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 movenc.c --- a/movenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/movenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -333,7 +333,7 @@ // 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ "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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ "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 @@ "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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mp3.c --- a/mp3.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mp3.c Tue Mar 30 23:30:55 2010 +0000 @@ -140,7 +140,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mpc.c --- a/mpc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mpc.c Tue Mar 30 23:30:55 2010 +0000 @@ -104,7 +104,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mpc8.c --- a/mpc8.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mpc8.c Tue Mar 30 23:30:55 2010 +0000 @@ -224,7 +224,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mpeg.c --- a/mpeg.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mpeg.c Tue Mar 30 23:30:55 2010 +0000 @@ -417,7 +417,7 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mpegenc.c --- a/mpegenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mpegenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -335,7 +335,7 @@ 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 @@ 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 @@ #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 @@ /* 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mpegts.c --- a/mpegts.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mpegts.c Tue Mar 30 23:30:55 2010 +0000 @@ -486,54 +486,54 @@ 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 @@ { 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mpegtsenc.c --- a/mpegtsenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mpegtsenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -255,7 +255,7 @@ /* 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 @@ *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 @@ 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 @@ 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 @@ /* 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 @@ *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 @@ 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 @@ *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 @@ } } - 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 -r b8041f85c327 -r 536e5527c1e0 msnwc_tcp.c --- a/msnwc_tcp.c Tue Mar 30 15:50:57 2010 +0000 +++ b/msnwc_tcp.c Tue Mar 30 23:30:55 2010 +0000 @@ -80,7 +80,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mtv.c --- a/mtv.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mtv.c Tue Mar 30 23:30:55 2010 +0000 @@ -123,7 +123,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mvi.c --- a/mvi.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mvi.c Tue Mar 30 23:30:55 2010 +0000 @@ -77,14 +77,14 @@ } 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 -r b8041f85c327 -r 536e5527c1e0 mxf.c --- a/mxf.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mxf.c Tue Mar 30 23:30:55 2010 +0000 @@ -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 -r b8041f85c327 -r 536e5527c1e0 mxfdec.c --- a/mxfdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mxfdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -795,7 +795,7 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 mxfenc.c --- a/mxfenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/mxfenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -1415,7 +1415,7 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 ncdec.c --- a/ncdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/ncdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -50,7 +50,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 nsvdec.c --- a/nsvdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/nsvdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -456,7 +456,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 nutdec.c --- a/nutdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/nutdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -315,19 +315,19 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 nutenc.c --- a/nutenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/nutenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -152,7 +152,7 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 nuv.c --- a/nuv.c Tue Mar 30 15:50:57 2010 +0000 +++ b/nuv.c Tue Mar 30 23:30:55 2010 +0000 @@ -155,7 +155,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oggdec.c --- a/oggdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -612,7 +612,7 @@ // 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 -r b8041f85c327 -r 536e5527c1e0 oggenc.c --- a/oggenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -178,9 +178,9 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oggparsedirac.c --- a/oggparsedirac.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggparsedirac.c Tue Mar 30 23:30:55 2010 +0000 @@ -39,7 +39,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oggparseflac.c --- a/oggparseflac.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggparseflac.c Tue Mar 30 23:30:55 2010 +0000 @@ -57,7 +57,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oggparseogm.c --- a/oggparseogm.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggparseogm.c Tue Mar 30 23:30:55 2010 +0000 @@ -49,19 +49,19 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oggparseskeleton.c --- a/oggparseskeleton.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggparseskeleton.c Tue Mar 30 23:30:55 2010 +0000 @@ -33,7 +33,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oggparsespeex.c --- a/oggparsespeex.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggparsespeex.c Tue Mar 30 23:30:55 2010 +0000 @@ -52,7 +52,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oggparsetheora.c --- a/oggparsetheora.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggparsetheora.c Tue Mar 30 23:30:55 2010 +0000 @@ -104,7 +104,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oggparsevorbis.c --- a/oggparsevorbis.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oggparsevorbis.c Tue Mar 30 23:30:55 2010 +0000 @@ -237,7 +237,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 oma.c --- a/oma.c Tue Mar 30 15:50:57 2010 +0000 +++ b/oma.c Tue Mar 30 23:30:55 2010 +0000 @@ -112,7 +112,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 output-example.c --- a/output-example.c Tue Mar 30 15:50:57 2010 +0000 +++ b/output-example.c Tue Mar 30 23:30:55 2010 +0000 @@ -65,7 +65,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 psxstr.c --- a/psxstr.c Tue Mar 30 15:50:57 2010 +0000 +++ b/psxstr.c Tue Mar 30 23:30:55 2010 +0000 @@ -169,7 +169,7 @@ str->channels[channel].video_stream_index = st->index; - st->codec->codec_type = CODEC_TYPE_VIDEO; + st->codec->codec_type = AVMEDIA_TYPE_VIDEO; st->codec->codec_id = CODEC_ID_MDEC; st->codec->codec_tag = 0; /* no fourcc */ st->codec->width = AV_RL16(§or[0x28]); @@ -216,7 +216,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 pva.c --- a/pva.c Tue Mar 30 15:50:57 2010 +0000 +++ b/pva.c Tue Mar 30 23:30:55 2010 +0000 @@ -45,7 +45,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 qcp.c --- a/qcp.c Tue Mar 30 15:50:57 2010 +0000 +++ b/qcp.c Tue Mar 30 23:30:55 2010 +0000 @@ -95,7 +95,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 r3d.c --- a/r3d.c Tue Mar 30 15:50:57 2010 +0000 +++ b/r3d.c Tue Mar 30 23:30:55 2010 +0000 @@ -56,7 +56,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 raw.c --- a/raw.c Tue Mar 30 15:50:57 2010 +0000 +++ b/raw.c Tue Mar 30 23:30:55 2010 +0000 @@ -74,14 +74,14 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rdt.c --- a/rdt.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rdt.c Tue Mar 30 23:30:55 2010 +0000 @@ -546,10 +546,10 @@ .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 -r b8041f85c327 -r 536e5527c1e0 riff.c --- a/riff.c Tue Mar 30 15:50:57 2010 +0000 +++ b/riff.c Tue Mar 30 23:30:55 2010 +0000 @@ -461,7 +461,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rl2.c --- a/rl2.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rl2.c Tue Mar 30 23:30:55 2010 +0000 @@ -116,7 +116,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rmdec.c --- a/rmdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rmdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -161,7 +161,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ { 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rmenc.c --- a/rmenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rmenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -141,7 +141,7 @@ 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 @@ 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 @@ 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 @@ 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_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 -r b8041f85c327 -r 536e5527c1e0 rpl.c --- a/rpl.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rpl.c Tue Mar 30 23:30:55 2010 +0000 @@ -141,7 +141,7 @@ 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rtp.c --- a/rtp.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtp.c Tue Mar 30 23:30:55 2010 +0000 @@ -35,39 +35,39 @@ { 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rtp.h --- a/rtp.h Tue Mar 30 15:50:57 2010 +0000 +++ b/rtp.h Tue Mar 30 23:30:55 2010 +0000 @@ -66,7 +66,7 @@ * @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 -r b8041f85c327 -r 536e5527c1e0 rtpdec.c --- a/rtpdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rtpdec.h --- a/rtpdec.h Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpdec.h Tue Mar 30 23:30:55 2010 +0000 @@ -132,7 +132,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rtpdec_amr.c --- a/rtpdec_amr.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpdec_amr.c Tue Mar 30 23:30:55 2010 +0000 @@ -170,7 +170,7 @@ 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_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 -r b8041f85c327 -r 536e5527c1e0 rtpdec_asf.c --- a/rtpdec_asf.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpdec_asf.c Tue Mar 30 23:30:55 2010 +0000 @@ -277,5 +277,5 @@ .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 -r b8041f85c327 -r 536e5527c1e0 rtpdec_h263.c --- a/rtpdec_h263.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpdec_h263.c Tue Mar 30 23:30:55 2010 +0000 @@ -94,14 +94,14 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rtpdec_h264.c --- a/rtpdec_h264.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpdec_h264.c Tue Mar 30 23:30:55 2010 +0000 @@ -411,7 +411,7 @@ */ 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 -r b8041f85c327 -r 536e5527c1e0 rtpdec_theora.c --- a/rtpdec_theora.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpdec_theora.c Tue Mar 30 23:30:55 2010 +0000 @@ -378,7 +378,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rtpdec_vorbis.c --- a/rtpdec_vorbis.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpdec_vorbis.c Tue Mar 30 23:30:55 2010 +0000 @@ -209,7 +209,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rtpenc.c --- a/rtpenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtpenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -78,7 +78,7 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 rtsp.c --- a/rtsp.c Tue Mar 30 15:50:57 2010 +0000 +++ b/rtsp.c Tue Mar 30 23:30:55 2010 +0000 @@ -141,7 +141,7 @@ 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 @@ 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 @@ 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 @@ 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 @@ * 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 -r b8041f85c327 -r 536e5527c1e0 sdp.c --- a/sdp.c Tue Mar 30 15:50:57 2010 +0000 +++ b/sdp.c Tue Mar 30 23:30:55 2010 +0000 @@ -301,13 +301,13 @@ 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 -r b8041f85c327 -r 536e5527c1e0 segafilm.c --- a/segafilm.c Tue Mar 30 15:50:57 2010 +0000 +++ b/segafilm.c Tue Mar 30 23:30:55 2010 +0000 @@ -133,7 +133,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 sierravmd.c --- a/sierravmd.c Tue Mar 30 15:50:57 2010 +0000 +++ b/sierravmd.c Tue Mar 30 23:30:55 2010 +0000 @@ -109,7 +109,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 siff.c --- a/siff.c Tue Mar 30 15:50:57 2010 +0000 +++ b/siff.c Tue Mar 30 23:30:55 2010 +0000 @@ -74,7 +74,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 smacker.c --- a/smacker.c Tue Mar 30 15:50:57 2010 +0000 +++ b/smacker.c Tue Mar 30 23:30:55 2010 +0000 @@ -158,7 +158,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 sol.c --- a/sol.c Tue Mar 30 15:50:57 2010 +0000 +++ b/sol.c Tue Mar 30 23:30:55 2010 +0000 @@ -114,7 +114,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 soxdec.c --- a/soxdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/soxdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -53,7 +53,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 swfdec.c --- a/swfdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/swfdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -97,7 +97,7 @@ for (i=0; inb_streams; i++) { st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO && st->id == ch_id) + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) goto skip; } @@ -109,7 +109,7 @@ 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 @@ for (i=0; inb_streams; i++) { st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_AUDIO && st->id == -1) + if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) goto skip; } @@ -131,7 +131,7 @@ 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 @@ len -= 2; for(i=0; inb_streams; i++) { st = s->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO && st->id == ch_id) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) { frame = get_le16(pb); av_get_packet(pb, pkt, len-2); pkt->pos = pos; @@ -157,7 +157,7 @@ } 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 swfenc.c --- a/swfenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/swfenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -185,7 +185,7 @@ for(i=0;inb_streams;i++) { AVCodecContext *enc = s->streams[i]->codec; - if (enc->codec_type == CODEC_TYPE_AUDIO) { + if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { if (enc->codec_id == CODEC_ID_MP3) { if (!enc->frame_size) { av_log(s, AV_LOG_ERROR, "audio frame size not set\n"); @@ -464,7 +464,7 @@ static int swf_write_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 @@ video_enc = NULL; for(i=0;inb_streams;i++) { enc = s->streams[i]->codec; - if (enc->codec_type == CODEC_TYPE_VIDEO) + if (enc->codec_type == AVMEDIA_TYPE_VIDEO) video_enc = enc; else av_fifo_free(swf->audio_fifo); diff -r b8041f85c327 -r 536e5527c1e0 thp.c --- a/thp.c Tue Mar 30 15:50:57 2010 +0000 +++ b/thp.c Tue Mar 30 23:30:55 2010 +0000 @@ -100,7 +100,7 @@ /* 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 tiertexseq.c --- a/tiertexseq.c Tue Mar 30 15:50:57 2010 +0000 +++ b/tiertexseq.c Tue Mar 30 23:30:55 2010 +0000 @@ -212,7 +212,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 tmv.c --- a/tmv.c Tue Mar 30 15:50:57 2010 +0000 +++ b/tmv.c Tue Mar 30 23:30:55 2010 +0000 @@ -109,7 +109,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 tta.c --- a/tta.c Tue Mar 30 15:50:57 2010 +0000 +++ b/tta.c Tue Mar 30 23:30:55 2010 +0000 @@ -101,7 +101,7 @@ } 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 -r b8041f85c327 -r 536e5527c1e0 txd.c --- a/txd.c Tue Mar 30 15:50:57 2010 +0000 +++ b/txd.c Tue Mar 30 23:30:55 2010 +0000 @@ -43,7 +43,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 utils.c --- a/utils.c Tue Mar 30 15:50:57 2010 +0000 +++ b/utils.c Tue Mar 30 23:30:55 2010 +0000 @@ -254,8 +254,8 @@ #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 @@ 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 @@ 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 @@ 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 @@ *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 @@ } } 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 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 @@ 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 @@ { 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ 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 @@ for(j=1; jcodec->codec_type == CODEC_TYPE_VIDEO) +// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO) // av_log(NULL, AV_LOG_ERROR, "%f %f\n", get_std_framerate(j) / 12.0/1001, error); if(error < best_error){ best_error= error; @@ -2334,7 +2334,7 @@ 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 @@ /* correct DTS for B-frame streams with no timestamps */ for(i=0;inb_streams;i++) { st = ic->streams[i]; - if (st->codec->codec_type == CODEC_TYPE_VIDEO) { + if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { if(b-frames){ ppktl = &ic->packet_buffer; while(ppkt1){ @@ -2581,7 +2581,7 @@ 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 @@ 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 @@ 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 @@ /* 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 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 vc1test.c --- a/vc1test.c Tue Mar 30 15:50:57 2010 +0000 +++ b/vc1test.c Tue Mar 30 23:30:55 2010 +0000 @@ -58,7 +58,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 vocdec.c --- a/vocdec.c Tue Mar 30 15:50:57 2010 +0000 +++ b/vocdec.c Tue Mar 30 23:30:55 2010 +0000 @@ -54,7 +54,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 vocenc.c --- a/vocenc.c Tue Mar 30 15:50:57 2010 +0000 +++ b/vocenc.c Tue Mar 30 23:30:55 2010 +0000 @@ -33,7 +33,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 vqf.c --- a/vqf.c Tue Mar 30 15:50:57 2010 +0000 +++ b/vqf.c Tue Mar 30 23:30:55 2010 +0000 @@ -76,7 +76,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 wc3movie.c --- a/wc3movie.c Tue Mar 30 15:50:57 2010 +0000 +++ b/wc3movie.c Tue Mar 30 23:30:55 2010 +0000 @@ -243,7 +243,7 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 westwood.c --- a/westwood.c Tue Mar 30 15:50:57 2010 +0000 +++ b/westwood.c Tue Mar 30 23:30:55 2010 +0000 @@ -148,7 +148,7 @@ 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 @@ 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 @@ 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 -r b8041f85c327 -r 536e5527c1e0 wv.c --- a/wv.c Tue Mar 30 15:50:57 2010 +0000 +++ b/wv.c Tue Mar 30 23:30:55 2010 +0000 @@ -162,7 +162,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 xa.c --- a/xa.c Tue Mar 30 15:50:57 2010 +0000 +++ b/xa.c Tue Mar 30 23:30:55 2010 +0000 @@ -74,7 +74,7 @@ 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 -r b8041f85c327 -r 536e5527c1e0 yop.c --- a/yop.c Tue Mar 30 15:50:57 2010 +0000 +++ b/yop.c Tue Mar 30 23:30:55 2010 +0000 @@ -71,14 +71,14 @@ // 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 -r b8041f85c327 -r 536e5527c1e0 yuv4mpeg.c --- a/yuv4mpeg.c Tue Mar 30 15:50:57 2010 +0000 +++ b/yuv4mpeg.c Tue Mar 30 23:30:55 2010 +0000 @@ -335,7 +335,7 @@ 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;