Revision 72415b2a

View differences:

cmdutils.c
48 48

  
49 49
const char **opt_names;
50 50
static int opt_name_count;
51
AVCodecContext *avcodec_opts[CODEC_TYPE_NB];
51
AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
52 52
AVFormatContext *avformat_opts;
53 53
struct SwsContext *sws_opts;
54 54

  
......
191 191
    const AVOption *o= NULL;
192 192
    int opt_types[]={AV_OPT_FLAG_VIDEO_PARAM, AV_OPT_FLAG_AUDIO_PARAM, 0, AV_OPT_FLAG_SUBTITLE_PARAM, 0};
193 193

  
194
    for(type=0; type<CODEC_TYPE_NB && ret>= 0; type++){
194
    for(type=0; type<AVMEDIA_TYPE_NB && ret>= 0; type++){
195 195
        const AVOption *o2 = av_find_opt(avcodec_opts[0], opt, NULL, opt_types[type], opt_types[type]);
196 196
        if(o2)
197 197
            ret = av_set_string3(avcodec_opts[type], opt, arg, 1, &o);
......
202 202
        ret = av_set_string3(sws_opts, opt, arg, 1, &o);
203 203
    if(!o){
204 204
        if(opt[0] == 'a')
205
            ret = av_set_string3(avcodec_opts[CODEC_TYPE_AUDIO], opt+1, arg, 1, &o);
205
            ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_AUDIO], opt+1, arg, 1, &o);
206 206
        else if(opt[0] == 'v')
207
            ret = av_set_string3(avcodec_opts[CODEC_TYPE_VIDEO], opt+1, arg, 1, &o);
207
            ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_VIDEO], opt+1, arg, 1, &o);
208 208
        else if(opt[0] == 's')
209
            ret = av_set_string3(avcodec_opts[CODEC_TYPE_SUBTITLE], opt+1, arg, 1, &o);
209
            ret = av_set_string3(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], opt+1, arg, 1, &o);
210 210
    }
211 211
    if (o && ret < 0) {
212 212
        fprintf(stderr, "Invalid value '%s' for option '%s'\n", arg, opt);
......
535 535
        last_name= p2->name;
536 536

  
537 537
        switch(p2->type) {
538
        case CODEC_TYPE_VIDEO:
538
        case AVMEDIA_TYPE_VIDEO:
539 539
            type_str = "V";
540 540
            break;
541
        case CODEC_TYPE_AUDIO:
541
        case AVMEDIA_TYPE_AUDIO:
542 542
            type_str = "A";
543 543
            break;
544
        case CODEC_TYPE_SUBTITLE:
544
        case AVMEDIA_TYPE_SUBTITLE:
545 545
            type_str = "S";
546 546
            break;
547 547
        default:
cmdutils.h
40 40
extern const int this_year;
41 41

  
42 42
extern const char **opt_names;
43
extern AVCodecContext *avcodec_opts[CODEC_TYPE_NB];
43
extern AVCodecContext *avcodec_opts[AVMEDIA_TYPE_NB];
44 44
extern AVFormatContext *avformat_opts;
45 45
extern struct SwsContext *sws_opts;
46 46

  
ffmpeg.c
452 452
    powerpc_display_perf_report();
453 453
#endif /* CONFIG_POWERPC_PERF */
454 454

  
455
    for (i=0;i<CODEC_TYPE_NB;i++)
455
    for (i=0;i<AVMEDIA_TYPE_NB;i++)
456 456
        av_free(avcodec_opts[i]);
457 457
    av_free(avformat_opts);
458 458
    av_free(sws_opts);
......
527 527
        memcpy(st->codec, ic->streams[i]->codec, sizeof(AVCodecContext));
528 528
        s->streams[i] = st;
529 529

  
530
        if (st->codec->codec_type == CODEC_TYPE_AUDIO && audio_stream_copy)
530
        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && audio_stream_copy)
531 531
            st->stream_copy = 1;
532
        else if (st->codec->codec_type == CODEC_TYPE_VIDEO && video_stream_copy)
532
        else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && video_stream_copy)
533 533
            st->stream_copy = 1;
534 534

  
535 535
        if(!st->codec->thread_count)
......
967 967
    }else
968 968
        ost->sync_opts= lrintf(sync_ipts);
969 969

  
970
    nb_frames= FFMIN(nb_frames, max_frames[CODEC_TYPE_VIDEO] - ost->frame_number);
970
    nb_frames= FFMIN(nb_frames, max_frames[AVMEDIA_TYPE_VIDEO] - ost->frame_number);
971 971
    if (nb_frames <= 0)
972 972
        return;
973 973

  
......
1088 1088
            /* better than nothing: use input picture interlaced
1089 1089
               settings */
1090 1090
            big_picture.interlaced_frame = in_picture->interlaced_frame;
1091
            if(avcodec_opts[CODEC_TYPE_VIDEO]->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)){
1091
            if(avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags & (CODEC_FLAG_INTERLACED_DCT|CODEC_FLAG_INTERLACED_ME)){
1092 1092
                if(top_field_first == -1)
1093 1093
                    big_picture.top_field_first = in_picture->top_field_first;
1094 1094
                else
......
1163 1163
    }
1164 1164

  
1165 1165
    enc = ost->st->codec;
1166
    if (enc->codec_type == CODEC_TYPE_VIDEO) {
1166
    if (enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1167 1167
        frame_number = ost->frame_number;
1168 1168
        fprintf(vstats_file, "frame= %5d q= %2.1f ", frame_number, enc->coded_frame->quality/(float)FF_QP2LAMBDA);
1169 1169
        if (enc->flags&CODEC_FLAG_PSNR)
......
1223 1223
    for(i=0;i<nb_ostreams;i++) {
1224 1224
        ost = ost_table[i];
1225 1225
        enc = ost->st->codec;
1226
        if (vid && enc->codec_type == CODEC_TYPE_VIDEO) {
1226
        if (vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1227 1227
            snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "q=%2.1f ",
1228 1228
                     !ost->st->stream_copy ?
1229 1229
                     enc->coded_frame->quality/(float)FF_QP2LAMBDA : -1);
1230 1230
        }
1231
        if (!vid && enc->codec_type == CODEC_TYPE_VIDEO) {
1231
        if (!vid && enc->codec_type == AVMEDIA_TYPE_VIDEO) {
1232 1232
            float t = (av_gettime()-timer_start) / 1000000.0;
1233 1233

  
1234 1234
            frame_number = ost->frame_number;
......
1360 1360
        subtitle_to_free = NULL;
1361 1361
        if (ist->decoding_needed) {
1362 1362
            switch(ist->st->codec->codec_type) {
1363
            case CODEC_TYPE_AUDIO:{
1363
            case AVMEDIA_TYPE_AUDIO:{
1364 1364
                if(pkt && samples_size < FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE)) {
1365 1365
                    samples_size = FFMAX(pkt->size*sizeof(*samples), AVCODEC_MAX_AUDIO_FRAME_SIZE);
1366 1366
                    av_free(samples);
......
1386 1386
                ist->next_pts += ((int64_t)AV_TIME_BASE/bps * decoded_data_size) /
1387 1387
                    (ist->st->codec->sample_rate * ist->st->codec->channels);
1388 1388
                break;}
1389
            case CODEC_TYPE_VIDEO:
1389
            case AVMEDIA_TYPE_VIDEO:
1390 1390
                    decoded_data_size = (ist->st->codec->width * ist->st->codec->height * 3) / 2;
1391 1391
                    /* XXX: allocate picture correctly */
1392 1392
                    avcodec_get_frame_defaults(&picture);
......
1408 1408
                    }
1409 1409
                    avpkt.size = 0;
1410 1410
                    break;
1411
            case CODEC_TYPE_SUBTITLE:
1411
            case AVMEDIA_TYPE_SUBTITLE:
1412 1412
                ret = avcodec_decode_subtitle2(ist->st->codec,
1413 1413
                                               &subtitle, &got_subtitle, &avpkt);
1414 1414
                if (ret < 0)
......
1424 1424
            }
1425 1425
        } else {
1426 1426
            switch(ist->st->codec->codec_type) {
1427
            case CODEC_TYPE_AUDIO:
1427
            case AVMEDIA_TYPE_AUDIO:
1428 1428
                ist->next_pts += ((int64_t)AV_TIME_BASE * ist->st->codec->frame_size) /
1429 1429
                    ist->st->codec->sample_rate;
1430 1430
                break;
1431
            case CODEC_TYPE_VIDEO:
1431
            case AVMEDIA_TYPE_VIDEO:
1432 1432
                if (ist->st->codec->time_base.num != 0) {
1433 1433
                    int ticks= ist->st->parser ? ist->st->parser->repeat_pict+1 : ist->st->codec->ticks_per_frame;
1434 1434
                    ist->next_pts += ((int64_t)AV_TIME_BASE *
......
1442 1442
        }
1443 1443

  
1444 1444
        buffer_to_free = NULL;
1445
        if (ist->st->codec->codec_type == CODEC_TYPE_VIDEO) {
1445
        if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
1446 1446
            pre_process_video_frame(ist, (AVPicture *)&picture,
1447 1447
                                    &buffer_to_free);
1448 1448
        }
1449 1449

  
1450 1450
        // preprocess audio (volume)
1451
        if (ist->st->codec->codec_type == CODEC_TYPE_AUDIO) {
1451
        if (ist->st->codec->codec_type == AVMEDIA_TYPE_AUDIO) {
1452 1452
            if (audio_volume != 256) {
1453 1453
                short *volp;
1454 1454
                volp = samples;
......
1485 1485
                    if (ost->encoding_needed) {
1486 1486
                        assert(ist->decoding_needed);
1487 1487
                        switch(ost->st->codec->codec_type) {
1488
                        case CODEC_TYPE_AUDIO:
1488
                        case AVMEDIA_TYPE_AUDIO:
1489 1489
                            do_audio_out(os, ost, ist, decoded_data_buf, decoded_data_size);
1490 1490
                            break;
1491
                        case CODEC_TYPE_VIDEO:
1491
                        case AVMEDIA_TYPE_VIDEO:
1492 1492
                            do_video_out(os, ost, ist, &picture, &frame_size);
1493 1493
                            if (vstats_filename && frame_size)
1494 1494
                                do_video_stats(os, ost, frame_size);
1495 1495
                            break;
1496
                        case CODEC_TYPE_SUBTITLE:
1496
                        case AVMEDIA_TYPE_SUBTITLE:
1497 1497
                            do_subtitle_out(os, ost, ist, &subtitle,
1498 1498
                                            pkt->pts);
1499 1499
                            break;
......
1517 1517
                        ost->st->codec->coded_frame= &avframe;
1518 1518
                        avframe.key_frame = pkt->flags & PKT_FLAG_KEY;
1519 1519

  
1520
                        if(ost->st->codec->codec_type == CODEC_TYPE_AUDIO)
1520
                        if(ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO)
1521 1521
                            audio_size += data_size;
1522
                        else if (ost->st->codec->codec_type == CODEC_TYPE_VIDEO) {
1522
                        else if (ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
1523 1523
                            video_size += data_size;
1524 1524
                            ost->sync_opts++;
1525 1525
                        }
......
1583 1583
                AVCodecContext *enc= ost->st->codec;
1584 1584
                os = output_files[ost->file_index];
1585 1585

  
1586
                if(ost->st->codec->codec_type == CODEC_TYPE_AUDIO && enc->frame_size <=1)
1586
                if(ost->st->codec->codec_type == AVMEDIA_TYPE_AUDIO && enc->frame_size <=1)
1587 1587
                    continue;
1588
                if(ost->st->codec->codec_type == CODEC_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE))
1588
                if(ost->st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (os->oformat->flags & AVFMT_RAWPICTURE))
1589 1589
                    continue;
1590 1590

  
1591 1591
                if (ost->encoding_needed) {
......
1596 1596
                        pkt.stream_index= ost->index;
1597 1597

  
1598 1598
                        switch(ost->st->codec->codec_type) {
1599
                        case CODEC_TYPE_AUDIO:
1599
                        case AVMEDIA_TYPE_AUDIO:
1600 1600
                            fifo_bytes = av_fifo_size(ost->fifo);
1601 1601
                            ret = 0;
1602 1602
                            /* encode any samples remaining in fifo */
......
1629 1629
                            audio_size += ret;
1630 1630
                            pkt.flags |= PKT_FLAG_KEY;
1631 1631
                            break;
1632
                        case CODEC_TYPE_VIDEO:
1632
                        case AVMEDIA_TYPE_VIDEO:
1633 1633
                            ret = avcodec_encode_video(enc, bit_buffer, bit_buffer_size, NULL);
1634 1634
                            if (ret < 0) {
1635 1635
                                fprintf(stderr, "Video encoding failed\n");
......
1946 1946
            }else
1947 1947
                codec->time_base = ist->st->time_base;
1948 1948
            switch(codec->codec_type) {
1949
            case CODEC_TYPE_AUDIO:
1949
            case AVMEDIA_TYPE_AUDIO:
1950 1950
                if(audio_volume != 256) {
1951 1951
                    fprintf(stderr,"-acodec copy and -vol are incompatible (frames are not decoded)\n");
1952 1952
                    av_exit(1);
......
1961 1961
                if(codec->codec_id == CODEC_ID_AC3)
1962 1962
                    codec->block_align= 0;
1963 1963
                break;
1964
            case CODEC_TYPE_VIDEO:
1964
            case AVMEDIA_TYPE_VIDEO:
1965 1965
                codec->pix_fmt = icodec->pix_fmt;
1966 1966
                codec->width = icodec->width;
1967 1967
                codec->height = icodec->height;
1968 1968
                codec->has_b_frames = icodec->has_b_frames;
1969 1969
                break;
1970
            case CODEC_TYPE_SUBTITLE:
1970
            case AVMEDIA_TYPE_SUBTITLE:
1971 1971
                codec->width = icodec->width;
1972 1972
                codec->height = icodec->height;
1973 1973
                break;
......
1976 1976
            }
1977 1977
        } else {
1978 1978
            switch(codec->codec_type) {
1979
            case CODEC_TYPE_AUDIO:
1979
            case AVMEDIA_TYPE_AUDIO:
1980 1980
                ost->fifo= av_fifo_alloc(1024);
1981 1981
                if(!ost->fifo)
1982 1982
                    goto fail;
......
1986 1986
                ist->decoding_needed = 1;
1987 1987
                ost->encoding_needed = 1;
1988 1988
                break;
1989
            case CODEC_TYPE_VIDEO:
1989
            case AVMEDIA_TYPE_VIDEO:
1990 1990
                if (ost->st->codec->pix_fmt == PIX_FMT_NONE) {
1991 1991
                    fprintf(stderr, "Video pixel format is unknown, stream cannot be encoded\n");
1992 1992
                    av_exit(1);
......
2050 2050
                ost->encoding_needed = 1;
2051 2051
                ist->decoding_needed = 1;
2052 2052
                break;
2053
            case CODEC_TYPE_SUBTITLE:
2053
            case AVMEDIA_TYPE_SUBTITLE:
2054 2054
                ost->encoding_needed = 1;
2055 2055
                ist->decoding_needed = 1;
2056 2056
                break;
......
2098 2098
                }
2099 2099
            }
2100 2100
        }
2101
        if(codec->codec_type == CODEC_TYPE_VIDEO){
2101
        if(codec->codec_type == AVMEDIA_TYPE_VIDEO){
2102 2102
            int size= codec->width * codec->height;
2103 2103
            bit_buffer_size= FFMAX(bit_buffer_size, 6*size + 200);
2104 2104
        }
......
2155 2155
                ret = AVERROR(EINVAL);
2156 2156
                goto dump_format;
2157 2157
            }
2158
            //if (ist->st->codec->codec_type == CODEC_TYPE_VIDEO)
2158
            //if (ist->st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
2159 2159
            //    ist->st->codec->flags |= CODEC_FLAG_REPEAT_FIELD;
2160 2160
        }
2161 2161
    }
......
2528 2528

  
2529 2529
static int opt_bitrate(const char *opt, const char *arg)
2530 2530
{
2531
    int codec_type = opt[0]=='a' ? CODEC_TYPE_AUDIO : CODEC_TYPE_VIDEO;
2531
    int codec_type = opt[0]=='a' ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO;
2532 2532

  
2533 2533
    opt_default(opt, arg);
2534 2534

  
......
2781 2781

  
2782 2782
static void opt_audio_codec(const char *arg)
2783 2783
{
2784
    opt_codec(&audio_stream_copy, &audio_codec_name, CODEC_TYPE_AUDIO, arg);
2784
    opt_codec(&audio_stream_copy, &audio_codec_name, AVMEDIA_TYPE_AUDIO, arg);
2785 2785
}
2786 2786

  
2787 2787
static void opt_audio_tag(const char *arg)
......
2804 2804

  
2805 2805
static void opt_video_codec(const char *arg)
2806 2806
{
2807
    opt_codec(&video_stream_copy, &video_codec_name, CODEC_TYPE_VIDEO, arg);
2807
    opt_codec(&video_stream_copy, &video_codec_name, AVMEDIA_TYPE_VIDEO, arg);
2808 2808
}
2809 2809

  
2810 2810
static void opt_subtitle_codec(const char *arg)
2811 2811
{
2812
    opt_codec(&subtitle_stream_copy, &subtitle_codec_name, CODEC_TYPE_SUBTITLE, arg);
2812
    opt_codec(&subtitle_stream_copy, &subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, arg);
2813 2813
}
2814 2814

  
2815 2815
static void opt_subtitle_tag(const char *arg)
......
2965 2965

  
2966 2966
    set_context_opts(ic, avformat_opts, AV_OPT_FLAG_DECODING_PARAM);
2967 2967

  
2968
    ic->video_codec_id   = find_codec_or_die(video_codec_name   , CODEC_TYPE_VIDEO   , 0);
2969
    ic->audio_codec_id   = find_codec_or_die(audio_codec_name   , CODEC_TYPE_AUDIO   , 0);
2970
    ic->subtitle_codec_id= find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 0);
2968
    ic->video_codec_id   = find_codec_or_die(video_codec_name   , AVMEDIA_TYPE_VIDEO   , 0);
2969
    ic->audio_codec_id   = find_codec_or_die(audio_codec_name   , AVMEDIA_TYPE_AUDIO   , 0);
2970
    ic->subtitle_codec_id= find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 0);
2971 2971
    ic->flags |= AVFMT_FLAG_NONBLOCK;
2972 2972

  
2973 2973
    if(pgmyuv_compatibility_hack)
......
3035 3035
        AVCodecContext *enc = st->codec;
3036 3036
        avcodec_thread_init(enc, thread_count);
3037 3037
        switch(enc->codec_type) {
3038
        case CODEC_TYPE_AUDIO:
3039
            set_context_opts(enc, avcodec_opts[CODEC_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
3038
        case AVMEDIA_TYPE_AUDIO:
3039
            set_context_opts(enc, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
3040 3040
            //fprintf(stderr, "\nInput Audio channels: %d", enc->channels);
3041 3041
            channel_layout = enc->channel_layout;
3042 3042
            audio_channels = enc->channels;
......
3046 3046
            if(audio_disable)
3047 3047
                st->discard= AVDISCARD_ALL;
3048 3048
            break;
3049
        case CODEC_TYPE_VIDEO:
3050
            set_context_opts(enc, avcodec_opts[CODEC_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
3049
        case AVMEDIA_TYPE_VIDEO:
3050
            set_context_opts(enc, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_DECODING_PARAM);
3051 3051
            frame_height = enc->height;
3052 3052
            frame_width = enc->width;
3053 3053
            if(ic->streams[i]->sample_aspect_ratio.num)
......
3084 3084
            else if(video_discard)
3085 3085
                st->discard= video_discard;
3086 3086
            break;
3087
        case CODEC_TYPE_DATA:
3087
        case AVMEDIA_TYPE_DATA:
3088 3088
            break;
3089
        case CODEC_TYPE_SUBTITLE:
3089
        case AVMEDIA_TYPE_SUBTITLE:
3090 3090
            input_codecs[nb_icodecs++] = avcodec_find_decoder_by_name(subtitle_codec_name);
3091 3091
            if(subtitle_disable)
3092 3092
                st->discard = AVDISCARD_ALL;
3093 3093
            break;
3094
        case CODEC_TYPE_ATTACHMENT:
3095
        case CODEC_TYPE_UNKNOWN:
3094
        case AVMEDIA_TYPE_ATTACHMENT:
3095
        case AVMEDIA_TYPE_UNKNOWN:
3096 3096
            nb_icodecs++;
3097 3097
            break;
3098 3098
        default:
......
3129 3129
        for(i=0;i<ic->nb_streams;i++) {
3130 3130
            AVCodecContext *enc = ic->streams[i]->codec;
3131 3131
            switch(enc->codec_type) {
3132
            case CODEC_TYPE_AUDIO:
3132
            case AVMEDIA_TYPE_AUDIO:
3133 3133
                has_audio = 1;
3134 3134
                break;
3135
            case CODEC_TYPE_VIDEO:
3135
            case AVMEDIA_TYPE_VIDEO:
3136 3136
                has_video = 1;
3137 3137
                break;
3138
            case CODEC_TYPE_SUBTITLE:
3138
            case AVMEDIA_TYPE_SUBTITLE:
3139 3139
                has_subtitle = 1;
3140 3140
                break;
3141
            case CODEC_TYPE_DATA:
3142
            case CODEC_TYPE_ATTACHMENT:
3143
            case CODEC_TYPE_UNKNOWN:
3141
            case AVMEDIA_TYPE_DATA:
3142
            case AVMEDIA_TYPE_ATTACHMENT:
3143
            case AVMEDIA_TYPE_UNKNOWN:
3144 3144
                break;
3145 3145
            default:
3146 3146
                abort();
......
3163 3163
        fprintf(stderr, "Could not alloc stream\n");
3164 3164
        av_exit(1);
3165 3165
    }
3166
    avcodec_get_context_defaults2(st->codec, CODEC_TYPE_VIDEO);
3166
    avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_VIDEO);
3167 3167
    bitstream_filters[nb_output_files][oc->nb_streams - 1]= video_bitstream_filters;
3168 3168
    video_bitstream_filters= NULL;
3169 3169

  
......
3177 3177
    if(   (video_global_header&1)
3178 3178
       || (video_global_header==0 && (oc->oformat->flags & AVFMT_GLOBALHEADER))){
3179 3179
        video_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
3180
        avcodec_opts[CODEC_TYPE_VIDEO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
3180
        avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
3181 3181
    }
3182 3182
    if(video_global_header&2){
3183 3183
        video_enc->flags2 |= CODEC_FLAG2_LOCAL_HEADER;
3184
        avcodec_opts[CODEC_TYPE_VIDEO]->flags2|= CODEC_FLAG2_LOCAL_HEADER;
3184
        avcodec_opts[AVMEDIA_TYPE_VIDEO]->flags2|= CODEC_FLAG2_LOCAL_HEADER;
3185 3185
    }
3186 3186

  
3187 3187
    if (video_stream_copy) {
3188 3188
        st->stream_copy = 1;
3189
        video_enc->codec_type = CODEC_TYPE_VIDEO;
3189
        video_enc->codec_type = AVMEDIA_TYPE_VIDEO;
3190 3190
        video_enc->sample_aspect_ratio =
3191 3191
        st->sample_aspect_ratio = av_d2q(frame_aspect_ratio*frame_height/frame_width, 255);
3192 3192
    } else {
......
3196 3196
        AVRational fps= frame_rate.num ? frame_rate : (AVRational){25,1};
3197 3197

  
3198 3198
        if (video_codec_name) {
3199
            codec_id = find_codec_or_die(video_codec_name, CODEC_TYPE_VIDEO, 1);
3199
            codec_id = find_codec_or_die(video_codec_name, AVMEDIA_TYPE_VIDEO, 1);
3200 3200
            codec = avcodec_find_encoder_by_name(video_codec_name);
3201 3201
            output_codecs[nb_ocodecs] = codec;
3202 3202
        } else {
3203
            codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_VIDEO);
3203
            codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_VIDEO);
3204 3204
            codec = avcodec_find_encoder(codec_id);
3205 3205
        }
3206 3206

  
3207 3207
        video_enc->codec_id = codec_id;
3208 3208

  
3209
        set_context_opts(video_enc, avcodec_opts[CODEC_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
3209
        set_context_opts(video_enc, avcodec_opts[AVMEDIA_TYPE_VIDEO], AV_OPT_FLAG_VIDEO_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
3210 3210

  
3211 3211
        if (codec && codec->supported_framerates && !force_fps)
3212 3212
            fps = codec->supported_framerates[av_find_nearest_q_idx(fps, codec->supported_framerates)];
......
3300 3300
        fprintf(stderr, "Could not alloc stream\n");
3301 3301
        av_exit(1);
3302 3302
    }
3303
    avcodec_get_context_defaults2(st->codec, CODEC_TYPE_AUDIO);
3303
    avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_AUDIO);
3304 3304

  
3305 3305
    bitstream_filters[nb_output_files][oc->nb_streams - 1]= audio_bitstream_filters;
3306 3306
    audio_bitstream_filters= NULL;
......
3308 3308
    avcodec_thread_init(st->codec, thread_count);
3309 3309

  
3310 3310
    audio_enc = st->codec;
3311
    audio_enc->codec_type = CODEC_TYPE_AUDIO;
3311
    audio_enc->codec_type = AVMEDIA_TYPE_AUDIO;
3312 3312

  
3313 3313
    if(audio_codec_tag)
3314 3314
        audio_enc->codec_tag= audio_codec_tag;
3315 3315

  
3316 3316
    if (oc->oformat->flags & AVFMT_GLOBALHEADER) {
3317 3317
        audio_enc->flags |= CODEC_FLAG_GLOBAL_HEADER;
3318
        avcodec_opts[CODEC_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
3318
        avcodec_opts[AVMEDIA_TYPE_AUDIO]->flags|= CODEC_FLAG_GLOBAL_HEADER;
3319 3319
    }
3320 3320
    if (audio_stream_copy) {
3321 3321
        st->stream_copy = 1;
......
3323 3323
    } else {
3324 3324
        AVCodec *codec;
3325 3325

  
3326
        set_context_opts(audio_enc, avcodec_opts[CODEC_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
3326
        set_context_opts(audio_enc, avcodec_opts[AVMEDIA_TYPE_AUDIO], AV_OPT_FLAG_AUDIO_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
3327 3327

  
3328 3328
        if (audio_codec_name) {
3329
            codec_id = find_codec_or_die(audio_codec_name, CODEC_TYPE_AUDIO, 1);
3329
            codec_id = find_codec_or_die(audio_codec_name, AVMEDIA_TYPE_AUDIO, 1);
3330 3330
            codec = avcodec_find_encoder_by_name(audio_codec_name);
3331 3331
            output_codecs[nb_ocodecs] = codec;
3332 3332
        } else {
3333
            codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, CODEC_TYPE_AUDIO);
3333
            codec_id = av_guess_codec(oc->oformat, NULL, oc->filename, NULL, AVMEDIA_TYPE_AUDIO);
3334 3334
            codec = avcodec_find_encoder(codec_id);
3335 3335
        }
3336 3336
        audio_enc->codec_id = codec_id;
......
3370 3370
        fprintf(stderr, "Could not alloc stream\n");
3371 3371
        av_exit(1);
3372 3372
    }
3373
    avcodec_get_context_defaults2(st->codec, CODEC_TYPE_SUBTITLE);
3373
    avcodec_get_context_defaults2(st->codec, AVMEDIA_TYPE_SUBTITLE);
3374 3374

  
3375 3375
    bitstream_filters[nb_output_files][oc->nb_streams - 1]= subtitle_bitstream_filters;
3376 3376
    subtitle_bitstream_filters= NULL;
3377 3377

  
3378 3378
    subtitle_enc = st->codec;
3379
    subtitle_enc->codec_type = CODEC_TYPE_SUBTITLE;
3379
    subtitle_enc->codec_type = AVMEDIA_TYPE_SUBTITLE;
3380 3380

  
3381 3381
    if(subtitle_codec_tag)
3382 3382
        subtitle_enc->codec_tag= subtitle_codec_tag;
......
3384 3384
    if (subtitle_stream_copy) {
3385 3385
        st->stream_copy = 1;
3386 3386
    } else {
3387
        set_context_opts(avcodec_opts[CODEC_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
3388
        subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 1);
3387
        set_context_opts(avcodec_opts[AVMEDIA_TYPE_SUBTITLE], subtitle_enc, AV_OPT_FLAG_SUBTITLE_PARAM | AV_OPT_FLAG_ENCODING_PARAM);
3388
        subtitle_enc->codec_id = find_codec_or_die(subtitle_codec_name, AVMEDIA_TYPE_SUBTITLE, 1);
3389 3389
        output_codecs[nb_ocodecs] = avcodec_find_encoder_by_name(subtitle_codec_name);
3390 3390
    }
3391 3391
    nb_ocodecs++;
......
3739 3739
                for(j = 0; j < nb_input_files; j++) {
3740 3740
                    for(i = 0; i < input_files[j]->nb_streams; i++) {
3741 3741
                        AVCodecContext *c = input_files[j]->streams[i]->codec;
3742
                        if(c->codec_type != CODEC_TYPE_VIDEO)
3742
                        if(c->codec_type != AVMEDIA_TYPE_VIDEO)
3743 3743
                            continue;
3744 3744
                        fr = c->time_base.den * 1000 / c->time_base.num;
3745 3745
                        if(fr == 25000) {
......
3965 3965
    { "itsscale", HAS_ARG, {(void*)opt_input_ts_scale}, "set the input ts scale", "stream:scale" },
3966 3966
    { "timestamp", OPT_FUNC2 | HAS_ARG, {(void*)opt_rec_timestamp}, "set the timestamp ('now' to set the current time)", "time" },
3967 3967
    { "metadata", OPT_FUNC2 | HAS_ARG, {(void*)opt_metadata}, "add metadata", "string=string" },
3968
    { "dframes", OPT_INT | HAS_ARG, {(void*)&max_frames[CODEC_TYPE_DATA]}, "set the number of data frames to record", "number" },
3968
    { "dframes", OPT_INT | HAS_ARG, {(void*)&max_frames[AVMEDIA_TYPE_DATA]}, "set the number of data frames to record", "number" },
3969 3969
    { "benchmark", OPT_BOOL | OPT_EXPERT, {(void*)&do_benchmark},
3970 3970
      "add timings for benchmarking" },
3971 3971
    { "timelimit", OPT_FUNC2 | HAS_ARG, {(void*)opt_timelimit}, "set max runtime in seconds", "limit" },
......
3993 3993
    /* video options */
3994 3994
    { "b", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
3995 3995
    { "vb", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
3996
    { "vframes", OPT_INT | HAS_ARG | OPT_VIDEO, {(void*)&max_frames[CODEC_TYPE_VIDEO]}, "set the number of video frames to record", "number" },
3996
    { "vframes", OPT_INT | HAS_ARG | OPT_VIDEO, {(void*)&max_frames[AVMEDIA_TYPE_VIDEO]}, "set the number of video frames to record", "number" },
3997 3997
    { "r", OPT_FUNC2 | HAS_ARG | OPT_VIDEO, {(void*)opt_frame_rate}, "set frame rate (Hz value, fraction or abbreviation)", "rate" },
3998 3998
    { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
3999 3999
    { "aspect", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_aspect_ratio}, "set aspect ratio (4:3, 16:9 or 1.3333, 1.7777)", "aspect" },
......
4035 4035

  
4036 4036
    /* audio options */
4037 4037
    { "ab", OPT_FUNC2 | HAS_ARG | OPT_AUDIO, {(void*)opt_bitrate}, "set bitrate (in bits/s)", "bitrate" },
4038
    { "aframes", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&max_frames[CODEC_TYPE_AUDIO]}, "set the number of audio frames to record", "number" },
4038
    { "aframes", OPT_INT | HAS_ARG | OPT_AUDIO, {(void*)&max_frames[AVMEDIA_TYPE_AUDIO]}, "set the number of audio frames to record", "number" },
4039 4039
    { "aq", OPT_FLOAT | HAS_ARG | OPT_AUDIO, {(void*)&audio_qscale}, "set audio quality (codec-specific)", "quality", },
4040 4040
    { "ar", HAS_ARG | OPT_FUNC2 | OPT_AUDIO, {(void*)opt_audio_rate}, "set audio sampling rate (in Hz)", "rate" },
4041 4041
    { "ac", HAS_ARG | OPT_FUNC2 | OPT_AUDIO, {(void*)opt_audio_channels}, "set number of audio channels", "channels" },
......
4090 4090
        url_set_interrupt_cb(decode_interrupt_cb);
4091 4091
#endif
4092 4092

  
4093
    for(i=0; i<CODEC_TYPE_NB; i++){
4093
    for(i=0; i<AVMEDIA_TYPE_NB; i++){
4094 4094
        avcodec_opts[i]= avcodec_alloc_context2(i);
4095 4095
    }
4096 4096
    avformat_opts = avformat_alloc_context();
ffplay.c
234 234
static enum PixelFormat frame_pix_fmt = PIX_FMT_NONE;
235 235
static int audio_disable;
236 236
static int video_disable;
237
static int wanted_stream[CODEC_TYPE_NB]={
238
    [CODEC_TYPE_AUDIO]=-1,
239
    [CODEC_TYPE_VIDEO]=-1,
240
    [CODEC_TYPE_SUBTITLE]=-1,
237
static int wanted_stream[AVMEDIA_TYPE_NB]={
238
    [AVMEDIA_TYPE_AUDIO]=-1,
239
    [AVMEDIA_TYPE_VIDEO]=-1,
240
    [AVMEDIA_TYPE_SUBTITLE]=-1,
241 241
};
242 242
static int seek_by_bytes=-1;
243 243
static int display_disable;
......
1643 1643

  
1644 1644
    .inputs    = (AVFilterPad[]) {{ .name = NULL }},
1645 1645
    .outputs   = (AVFilterPad[]) {{ .name = "default",
1646
                                    .type = CODEC_TYPE_VIDEO,
1646
                                    .type = AVMEDIA_TYPE_VIDEO,
1647 1647
                                    .request_frame = input_request_frame,
1648 1648
                                    .config_props  = input_config_props, },
1649 1649
                                  { .name = NULL }},
......
1689 1689
    .query_formats = output_query_formats,
1690 1690

  
1691 1691
    .inputs    = (AVFilterPad[]) {{ .name          = "default",
1692
                                    .type          = CODEC_TYPE_VIDEO,
1692
                                    .type          = AVMEDIA_TYPE_VIDEO,
1693 1693
                                    .end_frame     = output_end_frame,
1694 1694
                                    .min_perms     = AV_PERM_READ, },
1695 1695
                                  { .name = NULL }},
......
2122 2122
    avctx = ic->streams[stream_index]->codec;
2123 2123

  
2124 2124
    /* prepare audio output */
2125
    if (avctx->codec_type == CODEC_TYPE_AUDIO) {
2125
    if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
2126 2126
        if (avctx->channels > 0) {
2127 2127
            avctx->request_channels = FFMIN(2, avctx->channels);
2128 2128
        } else {
......
2152 2152
        return -1;
2153 2153

  
2154 2154
    /* prepare audio output */
2155
    if (avctx->codec_type == CODEC_TYPE_AUDIO) {
2155
    if (avctx->codec_type == AVMEDIA_TYPE_AUDIO) {
2156 2156
        wanted_spec.freq = avctx->sample_rate;
2157 2157
        wanted_spec.format = AUDIO_S16SYS;
2158 2158
        wanted_spec.channels = avctx->channels;
......
2170 2170

  
2171 2171
    ic->streams[stream_index]->discard = AVDISCARD_DEFAULT;
2172 2172
    switch(avctx->codec_type) {
2173
    case CODEC_TYPE_AUDIO:
2173
    case AVMEDIA_TYPE_AUDIO:
2174 2174
        is->audio_stream = stream_index;
2175 2175
        is->audio_st = ic->streams[stream_index];
2176 2176
        is->audio_buf_size = 0;
......
2187 2187
        packet_queue_init(&is->audioq);
2188 2188
        SDL_PauseAudio(0);
2189 2189
        break;
2190
    case CODEC_TYPE_VIDEO:
2190
    case AVMEDIA_TYPE_VIDEO:
2191 2191
        is->video_stream = stream_index;
2192 2192
        is->video_st = ic->streams[stream_index];
2193 2193

  
......
2196 2196
        packet_queue_init(&is->videoq);
2197 2197
        is->video_tid = SDL_CreateThread(video_thread, is);
2198 2198
        break;
2199
    case CODEC_TYPE_SUBTITLE:
2199
    case AVMEDIA_TYPE_SUBTITLE:
2200 2200
        is->subtitle_stream = stream_index;
2201 2201
        is->subtitle_st = ic->streams[stream_index];
2202 2202
        packet_queue_init(&is->subtitleq);
......
2219 2219
    avctx = ic->streams[stream_index]->codec;
2220 2220

  
2221 2221
    switch(avctx->codec_type) {
2222
    case CODEC_TYPE_AUDIO:
2222
    case AVMEDIA_TYPE_AUDIO:
2223 2223
        packet_queue_abort(&is->audioq);
2224 2224

  
2225 2225
        SDL_CloseAudio();
......
2229 2229
            av_audio_convert_free(is->reformat_ctx);
2230 2230
        is->reformat_ctx = NULL;
2231 2231
        break;
2232
    case CODEC_TYPE_VIDEO:
2232
    case AVMEDIA_TYPE_VIDEO:
2233 2233
        packet_queue_abort(&is->videoq);
2234 2234

  
2235 2235
        /* note: we also signal this mutex to make sure we deblock the
......
2242 2242

  
2243 2243
        packet_queue_end(&is->videoq);
2244 2244
        break;
2245
    case CODEC_TYPE_SUBTITLE:
2245
    case AVMEDIA_TYPE_SUBTITLE:
2246 2246
        packet_queue_abort(&is->subtitleq);
2247 2247

  
2248 2248
        /* note: we also signal this mutex to make sure we deblock the
......
2264 2264
    ic->streams[stream_index]->discard = AVDISCARD_ALL;
2265 2265
    avcodec_close(avctx);
2266 2266
    switch(avctx->codec_type) {
2267
    case CODEC_TYPE_AUDIO:
2267
    case AVMEDIA_TYPE_AUDIO:
2268 2268
        is->audio_st = NULL;
2269 2269
        is->audio_stream = -1;
2270 2270
        break;
2271
    case CODEC_TYPE_VIDEO:
2271
    case AVMEDIA_TYPE_VIDEO:
2272 2272
        is->video_st = NULL;
2273 2273
        is->video_stream = -1;
2274 2274
        break;
2275
    case CODEC_TYPE_SUBTITLE:
2275
    case AVMEDIA_TYPE_SUBTITLE:
2276 2276
        is->subtitle_st = NULL;
2277 2277
        is->subtitle_stream = -1;
2278 2278
        break;
......
2296 2296
    VideoState *is = arg;
2297 2297
    AVFormatContext *ic;
2298 2298
    int err, i, ret;
2299
    int st_index[CODEC_TYPE_NB];
2300
    int st_count[CODEC_TYPE_NB]={0};
2301
    int st_best_packet_count[CODEC_TYPE_NB];
2299
    int st_index[AVMEDIA_TYPE_NB];
2300
    int st_count[AVMEDIA_TYPE_NB]={0};
2301
    int st_best_packet_count[AVMEDIA_TYPE_NB];
2302 2302
    AVPacket pkt1, *pkt = &pkt1;
2303 2303
    AVFormatParameters params, *ap = &params;
2304 2304
    int eof=0;
......
2366 2366
        AVStream *st= ic->streams[i];
2367 2367
        AVCodecContext *avctx = st->codec;
2368 2368
        ic->streams[i]->discard = AVDISCARD_ALL;
2369
        if(avctx->codec_type >= (unsigned)CODEC_TYPE_NB)
2369
        if(avctx->codec_type >= (unsigned)AVMEDIA_TYPE_NB)
2370 2370
            continue;
2371 2371
        if(st_count[avctx->codec_type]++ != wanted_stream[avctx->codec_type] && wanted_stream[avctx->codec_type] >= 0)
2372 2372
            continue;
......
2376 2376
        st_best_packet_count[avctx->codec_type]= st->codec_info_nb_frames;
2377 2377

  
2378 2378
        switch(avctx->codec_type) {
2379
        case CODEC_TYPE_AUDIO:
2379
        case AVMEDIA_TYPE_AUDIO:
2380 2380
            if (!audio_disable)
2381
                st_index[CODEC_TYPE_AUDIO] = i;
2381
                st_index[AVMEDIA_TYPE_AUDIO] = i;
2382 2382
            break;
2383
        case CODEC_TYPE_VIDEO:
2384
        case CODEC_TYPE_SUBTITLE:
2383
        case AVMEDIA_TYPE_VIDEO:
2384
        case AVMEDIA_TYPE_SUBTITLE:
2385 2385
            if (!video_disable)
2386 2386
                st_index[avctx->codec_type] = i;
2387 2387
            break;
......
2394 2394
    }
2395 2395

  
2396 2396
    /* open the streams */
2397
    if (st_index[CODEC_TYPE_AUDIO] >= 0) {
2398
        stream_component_open(is, st_index[CODEC_TYPE_AUDIO]);
2397
    if (st_index[AVMEDIA_TYPE_AUDIO] >= 0) {
2398
        stream_component_open(is, st_index[AVMEDIA_TYPE_AUDIO]);
2399 2399
    }
2400 2400

  
2401 2401
    ret=-1;
2402
    if (st_index[CODEC_TYPE_VIDEO] >= 0) {
2403
        ret= stream_component_open(is, st_index[CODEC_TYPE_VIDEO]);
2402
    if (st_index[AVMEDIA_TYPE_VIDEO] >= 0) {
2403
        ret= stream_component_open(is, st_index[AVMEDIA_TYPE_VIDEO]);
2404 2404
    }
2405 2405
    is->refresh_tid = SDL_CreateThread(refresh_thread, is);
2406 2406
    if(ret<0) {
......
2408 2408
            is->show_audio = 2;
2409 2409
    }
2410 2410

  
2411
    if (st_index[CODEC_TYPE_SUBTITLE] >= 0) {
2412
        stream_component_open(is, st_index[CODEC_TYPE_SUBTITLE]);
2411
    if (st_index[AVMEDIA_TYPE_SUBTITLE] >= 0) {
2412
        stream_component_open(is, st_index[AVMEDIA_TYPE_SUBTITLE]);
2413 2413
    }
2414 2414

  
2415 2415
    if (is->video_stream < 0 && is->audio_stream < 0) {
......
2612 2612
    int start_index, stream_index;
2613 2613
    AVStream *st;
2614 2614

  
2615
    if (codec_type == CODEC_TYPE_VIDEO)
2615
    if (codec_type == AVMEDIA_TYPE_VIDEO)
2616 2616
        start_index = is->video_stream;
2617
    else if (codec_type == CODEC_TYPE_AUDIO)
2617
    else if (codec_type == AVMEDIA_TYPE_AUDIO)
2618 2618
        start_index = is->audio_stream;
2619 2619
    else
2620 2620
        start_index = is->subtitle_stream;
2621
    if (start_index < (codec_type == CODEC_TYPE_SUBTITLE ? -1 : 0))
2621
    if (start_index < (codec_type == AVMEDIA_TYPE_SUBTITLE ? -1 : 0))
2622 2622
        return;
2623 2623
    stream_index = start_index;
2624 2624
    for(;;) {
2625 2625
        if (++stream_index >= is->ic->nb_streams)
2626 2626
        {
2627
            if (codec_type == CODEC_TYPE_SUBTITLE)
2627
            if (codec_type == AVMEDIA_TYPE_SUBTITLE)
2628 2628
            {
2629 2629
                stream_index = -1;
2630 2630
                goto the_end;
......
2637 2637
        if (st->codec->codec_type == codec_type) {
2638 2638
            /* check that parameters are OK */
2639 2639
            switch(codec_type) {
2640
            case CODEC_TYPE_AUDIO:
2640
            case AVMEDIA_TYPE_AUDIO:
2641 2641
                if (st->codec->sample_rate != 0 &&
2642 2642
                    st->codec->channels != 0)
2643 2643
                    goto the_end;
2644 2644
                break;
2645
            case CODEC_TYPE_VIDEO:
2646
            case CODEC_TYPE_SUBTITLE:
2645
            case AVMEDIA_TYPE_VIDEO:
2646
            case AVMEDIA_TYPE_SUBTITLE:
2647 2647
                goto the_end;
2648 2648
            default:
2649 2649
                break;
......
2690 2690
        stream_close(cur_stream);
2691 2691
        cur_stream = NULL;
2692 2692
    }
2693
    for (i = 0; i < CODEC_TYPE_NB; i++)
2693
    for (i = 0; i < AVMEDIA_TYPE_NB; i++)
2694 2694
        av_free(avcodec_opts[i]);
2695 2695
    av_free(avformat_opts);
2696 2696
    av_free(sws_opts);
......
2743 2743
                break;
2744 2744
            case SDLK_a:
2745 2745
                if (cur_stream)
2746
                    stream_cycle_channel(cur_stream, CODEC_TYPE_AUDIO);
2746
                    stream_cycle_channel(cur_stream, AVMEDIA_TYPE_AUDIO);
2747 2747
                break;
2748 2748
            case SDLK_v:
2749 2749
                if (cur_stream)
2750
                    stream_cycle_channel(cur_stream, CODEC_TYPE_VIDEO);
2750
                    stream_cycle_channel(cur_stream, AVMEDIA_TYPE_VIDEO);
2751 2751
                break;
2752 2752
            case SDLK_t:
2753 2753
                if (cur_stream)
2754
                    stream_cycle_channel(cur_stream, CODEC_TYPE_SUBTITLE);
2754
                    stream_cycle_channel(cur_stream, AVMEDIA_TYPE_SUBTITLE);
2755 2755
                break;
2756 2756
            case SDLK_w:
2757 2757
                toggle_audio_display();
......
2943 2943
    { "fs", OPT_BOOL, {(void*)&is_full_screen}, "force full screen" },
2944 2944
    { "an", OPT_BOOL, {(void*)&audio_disable}, "disable audio" },
2945 2945
    { "vn", OPT_BOOL, {(void*)&video_disable}, "disable video" },
2946
    { "ast", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[CODEC_TYPE_AUDIO]}, "select desired audio stream", "stream_number" },
2947
    { "vst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[CODEC_TYPE_VIDEO]}, "select desired video stream", "stream_number" },
2948
    { "sst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[CODEC_TYPE_SUBTITLE]}, "select desired subtitle stream", "stream_number" },
2946
    { "ast", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_AUDIO]}, "select desired audio stream", "stream_number" },
2947
    { "vst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_VIDEO]}, "select desired video stream", "stream_number" },
2948
    { "sst", OPT_INT | HAS_ARG | OPT_EXPERT, {(void*)&wanted_stream[AVMEDIA_TYPE_SUBTITLE]}, "select desired subtitle stream", "stream_number" },
2949 2949
    { "ss", HAS_ARG | OPT_FUNC2, {(void*)&opt_seek}, "seek to a given position in seconds", "pos" },
2950 2950
    { "bytes", OPT_INT | HAS_ARG, {(void*)&seek_by_bytes}, "seek by bytes 0=off 1=on -1=auto", "val" },
2951 2951
    { "nodisp", OPT_BOOL, {(void*)&display_disable}, "disable graphical display" },
......
3032 3032
#endif
3033 3033
    av_register_all();
3034 3034

  
3035
    for(i=0; i<CODEC_TYPE_NB; i++){
3035
    for(i=0; i<AVMEDIA_TYPE_NB; i++){
3036 3036
        avcodec_opts[i]= avcodec_alloc_context2(i);
3037 3037
    }
3038 3038
    avformat_opts = avformat_alloc_context();
ffprobe.c
101 101
    return buf;
102 102
}
103 103

  
104
static const char *codec_type_string(enum CodecType codec_type)
104
static const char *media_type_string(enum AVMediaType media_type)
105 105
{
106
    switch (codec_type) {
107
    case CODEC_TYPE_VIDEO:        return "video";
108
    case CODEC_TYPE_AUDIO:        return "audio";
109
    case CODEC_TYPE_DATA:         return "data";
110
    case CODEC_TYPE_SUBTITLE:     return "subtitle";
111
    case CODEC_TYPE_ATTACHMENT:   return "attachment";
106
    switch (media_type) {
107
    case AVMEDIA_TYPE_VIDEO:      return "video";
108
    case AVMEDIA_TYPE_AUDIO:      return "audio";
109
    case AVMEDIA_TYPE_DATA:       return "data";
110
    case AVMEDIA_TYPE_SUBTITLE:   return "subtitle";
111
    case AVMEDIA_TYPE_ATTACHMENT: return "attachment";
112 112
    default:                      return "unknown";
113 113
    }
114 114
}
......
134 134
            printf("codec_name=unknown\n");
135 135
        }
136 136

  
137
        printf("codec_type=%s\n",         codec_type_string(dec_ctx->codec_type));
137
        printf("codec_type=%s\n",         media_type_string(dec_ctx->codec_type));
138 138
        printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den);
139 139

  
140 140
        /* print AVI/FourCC tag */
......
150 150
        printf("\ncodec_tag=0x%04x\n", dec_ctx->codec_tag);
151 151

  
152 152
        switch (dec_ctx->codec_type) {
153
        case CODEC_TYPE_VIDEO:
153
        case AVMEDIA_TYPE_VIDEO:
154 154
            printf("width=%d\n",                   dec_ctx->width);
155 155
            printf("height=%d\n",                  dec_ctx->height);
156 156
            printf("has_b_frames=%d\n",            dec_ctx->has_b_frames);
......
162 162
                   av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
163 163
            break;
164 164

  
165
        case CODEC_TYPE_AUDIO:
165
        case AVMEDIA_TYPE_AUDIO:
166 166
            printf("sample_rate=%s\n",             value_string(val_str, sizeof(val_str),
167 167
                                                                dec_ctx->sample_rate,
168 168
                                                                unit_hertz_str));
ffserver.c
1805 1805
                        AVStream *st = stream->streams[i];
1806 1806
                        AVCodec *codec = avcodec_find_encoder(st->codec->codec_id);
1807 1807
                        switch(st->codec->codec_type) {
1808
                        case CODEC_TYPE_AUDIO:
1808
                        case AVMEDIA_TYPE_AUDIO:
1809 1809
                            audio_bit_rate += st->codec->bit_rate;
1810 1810
                            if (codec) {
1811 1811
                                if (*audio_codec_name)
......
1813 1813
                                audio_codec_name = codec->name;
1814 1814
                            }
1815 1815
                            break;
1816
                        case CODEC_TYPE_VIDEO:
1816
                        case AVMEDIA_TYPE_VIDEO:
1817 1817
                            video_bit_rate += st->codec->bit_rate;
1818 1818
                            if (codec) {
1819 1819
                                if (*video_codec_name)
......
1821 1821
                                video_codec_name = codec->name;
1822 1822
                            }
1823 1823
                            break;
1824
                        case CODEC_TYPE_DATA:
1824
                        case AVMEDIA_TYPE_DATA:
1825 1825
                            video_bit_rate += st->codec->bit_rate;
1826 1826
                            break;
1827 1827
                        default:
......
1894 1894
                parameters[0] = 0;
1895 1895

  
1896 1896
                switch(st->codec->codec_type) {
1897
                case CODEC_TYPE_AUDIO:
1897
                case AVMEDIA_TYPE_AUDIO:
1898 1898
                    type = "audio";
1899 1899
                    snprintf(parameters, sizeof(parameters), "%d channel(s), %d Hz", st->codec->channels, st->codec->sample_rate);
1900 1900
                    break;
1901
                case CODEC_TYPE_VIDEO:
1901
                case AVMEDIA_TYPE_VIDEO:
1902 1902
                    type = "video";
1903 1903
                    snprintf(parameters, sizeof(parameters), "%dx%d, q=%d-%d, fps=%d", st->codec->width, st->codec->height,
1904 1904
                                st->codec->qmin, st->codec->qmax, st->codec->time_base.den / st->codec->time_base.num);
......
2047 2047
    c->pts_stream_index = 0;
2048 2048
    for(i=0;i<c->stream->nb_streams;i++) {
2049 2049
        if (c->pts_stream_index == 0 &&
2050
            c->stream->streams[i]->codec->codec_type == CODEC_TYPE_VIDEO) {
2050
            c->stream->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
2051 2051
            c->pts_stream_index = i;
2052 2052
        }
2053 2053
    }
......
2210 2210
                            AVStream *st = c->fmt_in->streams[source_index];
2211 2211
                            pkt.stream_index = i;
2212 2212
                            if (pkt.flags & PKT_FLAG_KEY &&
2213
                                (st->codec->codec_type == CODEC_TYPE_VIDEO ||
2213
                                (st->codec->codec_type == AVMEDIA_TYPE_VIDEO ||
2214 2214
                                 c->stream->nb_streams == 1))
2215 2215
                                c->got_key_frame = 1;
2216 2216
                            if (!c->stream->send_on_key || c->got_key_frame)
......
3346 3346
            av1->bit_rate == av->bit_rate) {
3347 3347

  
3348 3348
            switch(av->codec_type) {
3349
            case CODEC_TYPE_AUDIO:
3349
            case AVMEDIA_TYPE_AUDIO:
3350 3350
                if (av1->channels == av->channels &&
3351 3351
                    av1->sample_rate == av->sample_rate)
3352 3352
                    goto found;
3353 3353
                break;
3354
            case CODEC_TYPE_VIDEO:
3354
            case AVMEDIA_TYPE_VIDEO:
3355 3355
                if (av1->width == av->width &&
3356 3356
                    av1->height == av->height &&
3357 3357
                    av1->time_base.den == av->time_base.den &&
......
3549 3549
                            } else if (CHECK_CODEC(bit_rate) || CHECK_CODEC(flags)) {
3550 3550
                                http_log("Codec bitrates do not match for stream %d\n", i);
3551 3551
                                matches = 0;
3552
                            } else if (ccf->codec_type == CODEC_TYPE_VIDEO) {
3552
                            } else if (ccf->codec_type == AVMEDIA_TYPE_VIDEO) {
3553 3553
                                if (CHECK_CODEC(time_base.den) ||
3554 3554
                                    CHECK_CODEC(time_base.num) ||
3555 3555
                                    CHECK_CODEC(width) ||
......
3557 3557
                                    http_log("Codec width, height and framerate do not match for stream %d\n", i);
3558 3558
                                    matches = 0;
3559 3559
                                }
3560
                            } else if (ccf->codec_type == CODEC_TYPE_AUDIO) {
3560
                            } else if (ccf->codec_type == AVMEDIA_TYPE_AUDIO) {
3561 3561
                                if (CHECK_CODEC(sample_rate) ||
3562 3562
                                    CHECK_CODEC(channels) ||
3563 3563
                                    CHECK_CODEC(frame_size)) {
......
3651 3651
        for(i=0;i<stream->nb_streams;i++) {
3652 3652
            AVStream *st = stream->streams[i];
3653 3653
            switch(st->codec->codec_type) {
3654
            case CODEC_TYPE_AUDIO:
3655
            case CODEC_TYPE_VIDEO:
3654
            case AVMEDIA_TYPE_AUDIO:
3655
            case AVMEDIA_TYPE_VIDEO:
3656 3656
                bandwidth += st->codec->bit_rate;
3657 3657
                break;
3658 3658
            default:
......
3670 3670

  
3671 3671
    /* compute default parameters */
3672 3672
    switch(av->codec_type) {
3673
    case CODEC_TYPE_AUDIO:
3673
    case AVMEDIA_TYPE_AUDIO:
3674 3674
        if (av->bit_rate == 0)
3675 3675
            av->bit_rate = 64000;
3676 3676
        if (av->sample_rate == 0)
......
3678 3678
        if (av->channels == 0)
3679 3679
            av->channels = 1;
3680 3680
        break;
3681
    case CODEC_TYPE_VIDEO:
3681
    case AVMEDIA_TYPE_VIDEO:
3682 3682
        if (av->bit_rate == 0)
3683 3683
            av->bit_rate = 64000;
3684 3684
        if (av->time_base.num == 0){
......
3742 3742
{
3743 3743
    AVCodec *p= avcodec_find_encoder_by_name(arg);
3744 3744

  
3745
    if (p == NULL || p->type != CODEC_TYPE_AUDIO)
3745
    if (p == NULL || p->type != AVMEDIA_TYPE_AUDIO)
3746 3746
        return CODEC_ID_NONE;
3747 3747

  
3748 3748
    return p->id;
......
3752 3752
{
3753 3753
    AVCodec *p= avcodec_find_encoder_by_name(arg);
3754 3754

  
3755
    if (p == NULL || p->type != CODEC_TYPE_VIDEO)
3755
    if (p == NULL || p->type != AVMEDIA_TYPE_VIDEO)
3756 3756
        return CODEC_ID_NONE;
3757 3757

  
3758 3758
    return p->id;
......
4445 4445
            } else {
4446 4446
                if (stream->feed && stream->fmt && strcmp(stream->fmt->name, "ffm") != 0) {
4447 4447
                    if (audio_id != CODEC_ID_NONE) {
4448
                        audio_enc.codec_type = CODEC_TYPE_AUDIO;
4448
                        audio_enc.codec_type = AVMEDIA_TYPE_AUDIO;
4449 4449
                        audio_enc.codec_id = audio_id;
4450 4450
                        add_codec(stream, &audio_enc);
4451 4451
                    }
4452 4452
                    if (video_id != CODEC_ID_NONE) {
4453
                        video_enc.codec_type = CODEC_TYPE_VIDEO;
4453
                        video_enc.codec_type = AVMEDIA_TYPE_VIDEO;
4454 4454
                        video_enc.codec_id = video_id;
4455 4455
                        add_codec(stream, &video_enc);
4456 4456
                    }
libavcodec/4xm.c
842 842

  
843 843
AVCodec fourxm_decoder = {
844 844
    "4xm",
845
    CODEC_TYPE_VIDEO,
845
    AVMEDIA_TYPE_VIDEO,
846 846
    CODEC_ID_4XM,
847 847
    sizeof(FourXContext),
848 848
    decode_init,
libavcodec/8bps.c
221 221

  
222 222
AVCodec eightbps_decoder = {
223 223
        "8bps",
224
        CODEC_TYPE_VIDEO,
224
        AVMEDIA_TYPE_VIDEO,
225 225
        CODEC_ID_8BPS,
226 226
        sizeof(EightBpsContext),
227 227
        decode_init,
libavcodec/8svx.c
94 94

  
95 95
AVCodec eightsvx_fib_decoder = {
96 96
  .name           = "8svx_fib",
97
  .type           = CODEC_TYPE_AUDIO,
97
  .type           = AVMEDIA_TYPE_AUDIO,
98 98
  .id             = CODEC_ID_8SVX_FIB,
99 99
  .priv_data_size = sizeof (EightSvxContext),
100 100
  .init           = eightsvx_decode_init,
......
104 104

  
105 105
AVCodec eightsvx_exp_decoder = {
106 106
  .name           = "8svx_exp",
107
  .type           = CODEC_TYPE_AUDIO,
107
  .type           = AVMEDIA_TYPE_AUDIO,
108 108
  .id             = CODEC_ID_8SVX_EXP,
109 109
  .priv_data_size = sizeof (EightSvxContext),
110 110
  .init           = eightsvx_decode_init,
libavcodec/aac.c
2091 2091

  
2092 2092
AVCodec aac_decoder = {
2093 2093
    "aac",
2094
    CODEC_TYPE_AUDIO,
2094
    AVMEDIA_TYPE_AUDIO,
2095 2095
    CODEC_ID_AAC,
2096 2096
    sizeof(AACContext),
2097 2097
    aac_decode_init,
libavcodec/aacenc.c
629 629

  
630 630
AVCodec aac_encoder = {
631 631
    "aac",
632
    CODEC_TYPE_AUDIO,
632
    AVMEDIA_TYPE_AUDIO,
633 633
    CODEC_ID_AAC,
634 634
    sizeof(AACEncContext),
635 635
    aac_encode_init,
libavcodec/aasc.c
111 111

  
112 112
AVCodec aasc_decoder = {
113 113
    "aasc",
114
    CODEC_TYPE_VIDEO,
114
    AVMEDIA_TYPE_VIDEO,
115 115
    CODEC_ID_AASC,
116 116
    sizeof(AascContext),
117 117
    aasc_decode_init,
libavcodec/ac3dec.c
1439 1439

  
1440 1440
AVCodec ac3_decoder = {
1441 1441
    .name = "ac3",
1442
    .type = CODEC_TYPE_AUDIO,
1442
    .type = AVMEDIA_TYPE_AUDIO,
1443 1443
    .id = CODEC_ID_AC3,
1444 1444
    .priv_data_size = sizeof (AC3DecodeContext),
1445 1445
    .init = ac3_decode_init,
......
1451 1451
#if CONFIG_EAC3_DECODER
1452 1452
AVCodec eac3_decoder = {
1453 1453
    .name = "eac3",
1454
    .type = CODEC_TYPE_AUDIO,
1454
    .type = AVMEDIA_TYPE_AUDIO,
1455 1455
    .id = CODEC_ID_EAC3,
1456 1456
    .priv_data_size = sizeof (AC3DecodeContext),
1457 1457
    .init = ac3_decode_init,
libavcodec/ac3enc.c
1393 1393

  
1394 1394
AVCodec ac3_encoder = {
1395 1395
    "ac3",
1396
    CODEC_TYPE_AUDIO,
1396
    AVMEDIA_TYPE_AUDIO,
1397 1397
    CODEC_ID_AC3,
1398 1398
    sizeof(AC3EncodeContext),
1399 1399
    AC3_encode_init,
libavcodec/adpcm.c
1638 1638
#define ADPCM_ENCODER(id,name,long_name_)       \
1639 1639
AVCodec name ## _encoder = {                    \
1640 1640
    #name,                                      \
1641
    CODEC_TYPE_AUDIO,                           \
1641
    AVMEDIA_TYPE_AUDIO,                         \
1642 1642
    id,                                         \
1643 1643
    sizeof(ADPCMContext),                       \
1644 1644
    adpcm_encode_init,                          \
......
1656 1656
#define ADPCM_DECODER(id,name,long_name_)       \
1657 1657
AVCodec name ## _decoder = {                    \
1658 1658
    #name,                                      \
1659
    CODEC_TYPE_AUDIO,                           \
1659
    AVMEDIA_TYPE_AUDIO,                         \
1660 1660
    id,                                         \
1661 1661
    sizeof(ADPCMContext),                       \
1662 1662
    adpcm_decode_init,                          \
libavcodec/adxdec.c
168 168

  
169 169
AVCodec adpcm_adx_decoder = {
170 170
    "adpcm_adx",
171
    CODEC_TYPE_AUDIO,
171
    AVMEDIA_TYPE_AUDIO,
172 172
    CODEC_ID_ADPCM_ADX,
173 173
    sizeof(ADXContext),
174 174
    adx_decode_init,
libavcodec/adxenc.c
185 185

  
186 186
AVCodec adpcm_adx_encoder = {
187 187
    "adpcm_adx",
188
    CODEC_TYPE_AUDIO,
188
    AVMEDIA_TYPE_AUDIO,
189 189
    CODEC_ID_ADPCM_ADX,
190 190
    sizeof(ADXContext),
191 191
    adx_encode_init,
libavcodec/alac.c
701 701

  
702 702
AVCodec alac_decoder = {
703 703
    "alac",
704
    CODEC_TYPE_AUDIO,
704
    AVMEDIA_TYPE_AUDIO,
705 705
    CODEC_ID_ALAC,
706 706
    sizeof(ALACContext),
707 707
    alac_decode_init,
libavcodec/alacenc.c
521 521

  
522 522
AVCodec alac_encoder = {
523 523
    "alac",
524
    CODEC_TYPE_AUDIO,
524
    AVMEDIA_TYPE_AUDIO,
525 525
    CODEC_ID_ALAC,
526 526
    sizeof(AlacEncodeContext),
527 527
    alac_encode_init,
libavcodec/alsdec.c
1622 1622

  
1623 1623
AVCodec als_decoder = {
1624 1624
    "als",
1625
    CODEC_TYPE_AUDIO,
1625
    AVMEDIA_TYPE_AUDIO,
1626 1626
    CODEC_ID_MP4ALS,
1627 1627
    sizeof(ALSDecContext),
1628 1628
    decode_init,
libavcodec/amrnbdec.c
1071 1071

  
1072 1072
AVCodec amrnb_decoder = {
1073 1073
    .name           = "amrnb",
1074
    .type           = CODEC_TYPE_AUDIO,
1074
    .type           = AVMEDIA_TYPE_AUDIO,
1075 1075
    .id             = CODEC_ID_AMR_NB,
1076 1076
    .priv_data_size = sizeof(AMRContext),
1077 1077
    .init           = amrnb_decode_init,
libavcodec/anm.c
185 185

  
186 186
AVCodec anm_decoder = {
187 187
    "anm",
188
    CODEC_TYPE_VIDEO,
188
    AVMEDIA_TYPE_VIDEO,
189 189
    CODEC_ID_ANM,
190 190
    sizeof(AnmContext),
191 191
    decode_init,
libavcodec/apedec.c
879 879

  
880 880
AVCodec ape_decoder = {
881 881
    "ape",
882
    CODEC_TYPE_AUDIO,
882
    AVMEDIA_TYPE_AUDIO,
883 883
    CODEC_ID_APE,
884 884
    sizeof(APEContext),
885 885
    ape_decode_init,
libavcodec/asv1.c
615 615

  
616 616
AVCodec asv1_decoder = {
617 617
    "asv1",
618
    CODEC_TYPE_VIDEO,
618
    AVMEDIA_TYPE_VIDEO,
619 619
    CODEC_ID_ASV1,
620 620
    sizeof(ASV1Context),
621 621
    decode_init,
......
628 628

  
629 629
AVCodec asv2_decoder = {
630 630
    "asv2",
631
    CODEC_TYPE_VIDEO,
631
    AVMEDIA_TYPE_VIDEO,
632 632
    CODEC_ID_ASV2,
633 633
    sizeof(ASV1Context),
634 634
    decode_init,
......
642 642
#if CONFIG_ASV1_ENCODER
643 643
AVCodec asv1_encoder = {
644 644
    "asv1",
645
    CODEC_TYPE_VIDEO,
645
    AVMEDIA_TYPE_VIDEO,
646 646
    CODEC_ID_ASV1,
647 647
    sizeof(ASV1Context),
648 648
    encode_init,
......
656 656
#if CONFIG_ASV2_ENCODER
657 657
AVCodec asv2_encoder = {
658 658
    "asv2",
659
    CODEC_TYPE_VIDEO,
659
    AVMEDIA_TYPE_VIDEO,
660 660
    CODEC_ID_ASV2,
661 661
    sizeof(ASV1Context),
662 662
    encode_init,
libavcodec/atrac1.c
372 372

  
373 373
AVCodec atrac1_decoder = {
374 374
    .name = "atrac1",
375
    .type = CODEC_TYPE_AUDIO,
375
    .type = AVMEDIA_TYPE_AUDIO,
376 376
    .id = CODEC_ID_ATRAC1,
377 377
    .priv_data_size = sizeof(AT1Ctx),
378 378
    .init = atrac1_decode_init,
libavcodec/atrac3.c
1016 1016
AVCodec atrac3_decoder =
1017 1017
{
1018 1018
    .name = "atrac3",
1019
    .type = CODEC_TYPE_AUDIO,
1019
    .type = AVMEDIA_TYPE_AUDIO,
1020 1020
    .id = CODEC_ID_ATRAC3,
1021 1021
    .priv_data_size = sizeof(ATRAC3Context),
1022 1022
    .init = atrac3_decode_init,
libavcodec/aura.c
124 124

  
125 125
AVCodec aura2_decoder = {
126 126
    "aura2",
127
    CODEC_TYPE_VIDEO,
127
    AVMEDIA_TYPE_VIDEO,
128 128
    CODEC_ID_AURA2,
129 129
    sizeof(AuraDecodeContext),
130 130
    aura_decode_init,
libavcodec/avcodec.h
30 30
#include "libavutil/avutil.h"
31 31

  
32 32
#define LIBAVCODEC_VERSION_MAJOR 52
33
#define LIBAVCODEC_VERSION_MINOR 63
33
#define LIBAVCODEC_VERSION_MINOR 64
34 34
#define LIBAVCODEC_VERSION_MICRO  0
35 35

  
36 36
#define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
......
355 355
                                * stream (only used by libavformat) */
356 356
};
357 357

  
358
enum CodecType {
359
    CODEC_TYPE_UNKNOWN = -1,
360
    CODEC_TYPE_VIDEO,
361
    CODEC_TYPE_AUDIO,
362
    CODEC_TYPE_DATA,
363
    CODEC_TYPE_SUBTITLE,
364
    CODEC_TYPE_ATTACHMENT,
365
    CODEC_TYPE_NB
358
enum AVMediaType {
359
    AVMEDIA_TYPE_UNKNOWN = -1,
360
    AVMEDIA_TYPE_VIDEO,
361
    AVMEDIA_TYPE_AUDIO,
362
    AVMEDIA_TYPE_DATA,
363
    AVMEDIA_TYPE_SUBTITLE,
364
    AVMEDIA_TYPE_ATTACHMENT,
365
    AVMEDIA_TYPE_NB
366 366
};
367 367

  
368
#if LIBAVCODEC_VERSION_MAJOR < 53
369
#define CodecType AVMediaType
370

  
371
#define CODEC_TYPE_UNKNOWN    AVMEDIA_TYPE_UNKNOWN
372
#define CODEC_TYPE_VIDEO      AVMEDIA_TYPE_VIDEO
373
#define CODEC_TYPE_AUDIO      AVMEDIA_TYPE_AUDIO
374
#define CODEC_TYPE_DATA       AVMEDIA_TYPE_DATA
375
#define CODEC_TYPE_SUBTITLE   AVMEDIA_TYPE_SUBTITLE
376
#define CODEC_TYPE_ATTACHMENT AVMEDIA_TYPE_ATTACHMENT
377
#define CODEC_TYPE_NB         AVMEDIA_TYPE_NB
378
#endif
379

  
368 380
/**
369 381
 * all in native-endian format
370 382
 */
......
1277 1289
    void *opaque;
1278 1290

  
1279 1291
    char codec_name[32];
1280
    enum CodecType codec_type; /* see CODEC_TYPE_xxx */
1292
    enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */
1281 1293
    enum CodecID codec_id; /* see CODEC_ID_xxx */
1282 1294

  
1283 1295
    /**
......
2657 2669
     * This is the primary way to find a codec from the user perspective.
2658 2670
     */
2659 2671
    const char *name;
2660
    enum CodecType type;
2672
    enum AVMediaType type;
2661 2673
    enum CodecID id;
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff