Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
Stefano Sabatini authored on 2010/03/31 08:30:55... | ... |
@@ -48,7 +48,7 @@ |
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,7 +191,7 @@ int opt_default(const char *opt, const char *arg){ |
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,11 +202,11 @@ int opt_default(const char *opt, const char *arg){ |
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,13 +535,13 @@ void show_codecs(void) |
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: |
... | ... |
@@ -40,7 +40,7 @@ extern const int program_birth_year; |
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 |
|
... | ... |
@@ -452,7 +452,7 @@ static int av_exit(int ret) |
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,9 +527,9 @@ static int read_ffserver_streams(AVFormatContext *s, const char *filename) |
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,7 +967,7 @@ static void do_video_out(AVFormatContext *s, |
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,7 +1088,7 @@ static void do_video_out(AVFormatContext *s, |
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,7 +1163,7 @@ static void do_video_stats(AVFormatContext *os, AVOutputStream *ost, |
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,12 +1223,12 @@ static void print_report(AVFormatContext **output_files, |
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,7 +1360,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,7 +1386,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,7 +1408,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,11 +1424,11 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,13 +1442,13 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,15 +1485,15 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,9 +1517,9 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,9 +1583,9 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,7 +1596,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,7 +1629,7 @@ static int output_packet(AVInputStream *ist, int ist_index, |
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,7 +1946,7 @@ static int av_encode(AVFormatContext **output_files, |
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,13 +1961,13 @@ static int av_encode(AVFormatContext **output_files, |
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,7 +1976,7 @@ static int av_encode(AVFormatContext **output_files, |
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,7 +1986,7 @@ static int av_encode(AVFormatContext **output_files, |
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,7 +2050,7 @@ static int av_encode(AVFormatContext **output_files, |
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,7 +2098,7 @@ static int av_encode(AVFormatContext **output_files, |
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,7 +2155,7 @@ static int av_encode(AVFormatContext **output_files, |
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,7 +2528,7 @@ static int opt_frame_rate(const char *opt, const char *arg) |
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,7 +2781,7 @@ static void opt_codec(int *pstream_copy, char **pcodec_name, |
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,12 +2804,12 @@ static void opt_video_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,9 +2965,9 @@ static void opt_input_file(const char *filename) |
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,8 +3035,8 @@ static void opt_input_file(const char *filename) |
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,8 +3046,8 @@ static void opt_input_file(const char *filename) |
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,15 +3084,15 @@ static void opt_input_file(const char *filename) |
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,18 +3129,18 @@ static void check_audio_video_sub_inputs(int *has_video_ptr, int *has_audio_ptr, |
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,7 +3163,7 @@ static void new_video_stream(AVFormatContext *oc) |
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,16 +3177,16 @@ static void new_video_stream(AVFormatContext *oc) |
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,17 +3196,17 @@ static void new_video_stream(AVFormatContext *oc) |
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,7 +3300,7 @@ static void new_audio_stream(AVFormatContext *oc) |
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,14 +3308,14 @@ static void new_audio_stream(AVFormatContext *oc) |
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,14 +3323,14 @@ static void new_audio_stream(AVFormatContext *oc) |
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,13 +3370,13 @@ static void new_subtitle_stream(AVFormatContext *oc) |
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,8 +3384,8 @@ static void new_subtitle_stream(AVFormatContext *oc) |
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,7 +3739,7 @@ static void opt_target(const char *arg) |
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,7 +3965,7 @@ static const OptionDef options[] = { |
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,7 +3993,7 @@ static const OptionDef options[] = { |
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,7 +4035,7 @@ static const OptionDef options[] = { |
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,7 +4090,7 @@ int main(int argc, char **argv) |
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(); |
... | ... |
@@ -234,10 +234,10 @@ static int frame_height = 0; |
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,7 +1643,7 @@ static AVFilter input_filter = |
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,7 +1689,7 @@ static AVFilter output_filter = |
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,7 +2122,7 @@ static int stream_component_open(VideoState *is, int stream_index) |
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,7 +2152,7 @@ static int stream_component_open(VideoState *is, int stream_index) |
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,7 +2170,7 @@ static int stream_component_open(VideoState *is, int stream_index) |
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,7 +2187,7 @@ static int stream_component_open(VideoState *is, int stream_index) |
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,7 +2196,7 @@ static int stream_component_open(VideoState *is, int stream_index) |
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,7 +2219,7 @@ static void stream_component_close(VideoState *is, int stream_index) |
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,7 +2229,7 @@ static void stream_component_close(VideoState *is, int stream_index) |
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,7 +2242,7 @@ static void stream_component_close(VideoState *is, int stream_index) |
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,15 +2264,15 @@ static void stream_component_close(VideoState *is, int stream_index) |
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,9 +2296,9 @@ static int decode_thread(void *arg) |
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 = ¶ms; |
2304 | 2304 |
int eof=0; |
... | ... |
@@ -2366,7 +2366,7 @@ static int decode_thread(void *arg) |
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,12 +2376,12 @@ static int decode_thread(void *arg) |
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,13 +2394,13 @@ static int decode_thread(void *arg) |
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,8 +2408,8 @@ static int decode_thread(void *arg) |
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,19 +2612,19 @@ static void stream_cycle_channel(VideoState *is, int codec_type) |
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,13 +2637,13 @@ static void stream_cycle_channel(VideoState *is, int codec_type) |
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,7 +2690,7 @@ static void do_exit(void) |
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,15 +2743,15 @@ static void event_loop(void) |
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,9 +2943,9 @@ static const OptionDef options[] = { |
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,7 +3032,7 @@ int main(int argc, char **argv) |
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(); |
... | ... |
@@ -101,14 +101,14 @@ static char *time_value_string(char *buf, int buf_size, int64_t val, const AVRat |
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,7 +134,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) |
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,7 +150,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) |
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,7 +162,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx) |
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)); |
... | ... |
@@ -1805,7 +1805,7 @@ static void compute_status(HTTPContext *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,7 +1813,7 @@ static void compute_status(HTTPContext *c) |
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,7 +1821,7 @@ static void compute_status(HTTPContext *c) |
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,11 +1894,11 @@ static void compute_status(HTTPContext *c) |
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,7 +2047,7 @@ static int open_input_stream(HTTPContext *c, const char *info) |
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,7 +2210,7 @@ static int http_prepare_data(HTTPContext *c) |
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,12 +3346,12 @@ static int add_av_stream(FFStream *feed, AVStream *st) |
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,7 +3549,7 @@ static void build_feed_streams(void) |
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,7 +3557,7 @@ static void build_feed_streams(void) |
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,8 +3651,8 @@ static void compute_bandwidth(void) |
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,7 +3670,7 @@ static void add_codec(FFStream *stream, AVCodecContext *av) |
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,7 +3678,7 @@ static void add_codec(FFStream *stream, AVCodecContext *av) |
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,7 +3742,7 @@ static enum CodecID opt_audio_codec(const char *arg) |
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,7 +3752,7 @@ static enum CodecID opt_video_codec(const char *arg) |
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,12 +4445,12 @@ static int parse_ffconfig(const char *filename) |
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 |
} |
... | ... |
@@ -94,7 +94,7 @@ static av_cold int eightsvx_decode_init(AVCodecContext *avctx) |
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,7 +104,7 @@ AVCodec eightsvx_fib_decoder = { |
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, |
... | ... |
@@ -1439,7 +1439,7 @@ static av_cold int ac3_decode_end(AVCodecContext *avctx) |
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,7 +1451,7 @@ AVCodec ac3_decoder = { |
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, |
... | ... |
@@ -1638,7 +1638,7 @@ static int adpcm_decode_frame(AVCodecContext *avctx, |
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,7 +1656,7 @@ AVCodec name ## _encoder = { \ |
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, \ |
... | ... |
@@ -1071,7 +1071,7 @@ static int amrnb_decode_frame(AVCodecContext *avctx, void *data, int *data_size, |
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, |
... | ... |
@@ -615,7 +615,7 @@ static av_cold int decode_end(AVCodecContext *avctx){ |
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,7 +628,7 @@ AVCodec asv1_decoder = { |
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,7 +642,7 @@ AVCodec asv2_decoder = { |
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,7 +656,7 @@ AVCodec asv1_encoder = { |
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, |
... | ... |
@@ -372,7 +372,7 @@ static av_cold int atrac1_decode_end(AVCodecContext * avctx) { |
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, |
... | ... |
@@ -1016,7 +1016,7 @@ static av_cold int atrac3_decode_init(AVCodecContext *avctx) |
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, |
... | ... |
@@ -30,7 +30,7 @@ |
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,16 +355,28 @@ enum CodecID { |
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,7 +1289,7 @@ typedef struct AVCodecContext { |
1277 | 1277 |
void *opaque; |
1278 | 1278 |
|
1279 | 1279 |
char codec_name[32]; |
1280 |
- enum CodecType codec_type; /* see CODEC_TYPE_xxx */ |
|
1280 |
+ enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ |
|
1281 | 1281 |
enum CodecID codec_id; /* see CODEC_ID_xxx */ |
1282 | 1282 |
|
1283 | 1283 |
/** |
... | ... |
@@ -2657,7 +2669,7 @@ typedef struct AVCodec { |
2657 | 2657 |
* This is the primary way to find a codec from the user perspective. |
2658 | 2658 |
*/ |
2659 | 2659 |
const char *name; |
2660 |
- enum CodecType type; |
|
2660 |
+ enum AVMediaType type; |
|
2661 | 2661 |
enum CodecID id; |
2662 | 2662 |
int priv_data_size; |
2663 | 2663 |
int (*init)(AVCodecContext *); |
... | ... |
@@ -2701,9 +2713,9 @@ typedef struct AVHWAccel { |
2701 | 2701 |
/** |
2702 | 2702 |
* Type of codec implemented by the hardware accelerator. |
2703 | 2703 |
* |
2704 |
- * See CODEC_TYPE_xxx |
|
2704 |
+ * See AVMEDIA_TYPE_xxx |
|
2705 | 2705 |
*/ |
2706 |
- enum CodecType type; |
|
2706 |
+ enum AVMediaType type; |
|
2707 | 2707 |
|
2708 | 2708 |
/** |
2709 | 2709 |
* Codec implemented by the hardware accelerator. |
... | ... |
@@ -3241,7 +3253,7 @@ void avcodec_get_context_defaults(AVCodecContext *s); |
3241 | 3241 |
|
3242 | 3242 |
/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! |
3243 | 3243 |
* we WILL change its arguments and name a few times! */ |
3244 |
-void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType); |
|
3244 |
+void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType); |
|
3245 | 3245 |
|
3246 | 3246 |
/** |
3247 | 3247 |
* Allocates an AVCodecContext and sets its fields to default values. The |
... | ... |
@@ -3254,7 +3266,7 @@ AVCodecContext *avcodec_alloc_context(void); |
3254 | 3254 |
|
3255 | 3255 |
/** THIS FUNCTION IS NOT YET PART OF THE PUBLIC API! |
3256 | 3256 |
* we WILL change its arguments and name a few times! */ |
3257 |
-AVCodecContext *avcodec_alloc_context2(enum CodecType); |
|
3257 |
+AVCodecContext *avcodec_alloc_context2(enum AVMediaType); |
|
3258 | 3258 |
|
3259 | 3259 |
/** |
3260 | 3260 |
* Sets the fields of the given AVFrame to default values. |
... | ... |
@@ -132,7 +132,7 @@ static av_cold int bethsoftvid_decode_end(AVCodecContext *avctx) |
132 | 132 |
|
133 | 133 |
AVCodec bethsoftvid_decoder = { |
134 | 134 |
.name = "bethsoftvid", |
135 |
- .type = CODEC_TYPE_VIDEO, |
|
135 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
136 | 136 |
.id = CODEC_ID_BETHSOFTVID, |
137 | 137 |
.priv_data_size = sizeof(BethsoftvidContext), |
138 | 138 |
.init = bethsoftvid_decode_init, |
... | ... |
@@ -173,7 +173,7 @@ static av_cold int bfi_decode_close(AVCodecContext * avctx) |
173 | 173 |
|
174 | 174 |
AVCodec bfi_decoder = { |
175 | 175 |
.name = "bfi", |
176 |
- .type = CODEC_TYPE_VIDEO, |
|
176 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
177 | 177 |
.id = CODEC_ID_BFI, |
178 | 178 |
.priv_data_size = sizeof(BFIContext), |
179 | 179 |
.init = bfi_decode_init, |
... | ... |
@@ -288,7 +288,7 @@ static int decode_frame(AVCodecContext *avctx, |
288 | 288 |
|
289 | 289 |
AVCodec binkaudio_rdft_decoder = { |
290 | 290 |
"binkaudio_rdft", |
291 |
- CODEC_TYPE_AUDIO, |
|
291 |
+ AVMEDIA_TYPE_AUDIO, |
|
292 | 292 |
CODEC_ID_BINKAUDIO_RDFT, |
293 | 293 |
sizeof(BinkAudioContext), |
294 | 294 |
decode_init, |
... | ... |
@@ -300,7 +300,7 @@ AVCodec binkaudio_rdft_decoder = { |
300 | 300 |
|
301 | 301 |
AVCodec binkaudio_dct_decoder = { |
302 | 302 |
"binkaudio_dct", |
303 |
- CODEC_TYPE_AUDIO, |
|
303 |
+ AVMEDIA_TYPE_AUDIO, |
|
304 | 304 |
CODEC_ID_BINKAUDIO_DCT, |
305 | 305 |
sizeof(BinkAudioContext), |
306 | 306 |
decode_init, |
... | ... |
@@ -137,7 +137,7 @@ static av_cold int encode_init(AVCodecContext *avctx){ |
137 | 137 |
|
138 | 138 |
AVCodec cljr_decoder = { |
139 | 139 |
"cljr", |
140 |
- CODEC_TYPE_VIDEO, |
|
140 |
+ AVMEDIA_TYPE_VIDEO, |
|
141 | 141 |
CODEC_ID_CLJR, |
142 | 142 |
sizeof(CLJRContext), |
143 | 143 |
decode_init, |
... | ... |
@@ -151,7 +151,7 @@ AVCodec cljr_decoder = { |
151 | 151 |
#if CONFIG_CLJR_ENCODER |
152 | 152 |
AVCodec cljr_encoder = { |
153 | 153 |
"cljr", |
154 |
- CODEC_TYPE_VIDEO, |
|
154 |
+ AVMEDIA_TYPE_VIDEO, |
|
155 | 155 |
CODEC_ID_CLJR, |
156 | 156 |
sizeof(CLJRContext), |
157 | 157 |
encode_init, |
... | ... |
@@ -1288,7 +1288,7 @@ static av_cold int cook_decode_init(AVCodecContext *avctx) |
1288 | 1288 |
AVCodec cook_decoder = |
1289 | 1289 |
{ |
1290 | 1290 |
.name = "cook", |
1291 |
- .type = CODEC_TYPE_AUDIO, |
|
1291 |
+ .type = AVMEDIA_TYPE_AUDIO, |
|
1292 | 1292 |
.id = CODEC_ID_COOK, |
1293 | 1293 |
.priv_data_size = sizeof(COOKContext), |
1294 | 1294 |
.init = cook_decode_init, |
... | ... |
@@ -180,7 +180,7 @@ static av_cold int cyuv_decode_end(AVCodecContext *avctx) |
180 | 180 |
#if CONFIG_AURA_DECODER |
181 | 181 |
AVCodec aura_decoder = { |
182 | 182 |
"aura", |
183 |
- CODEC_TYPE_VIDEO, |
|
183 |
+ AVMEDIA_TYPE_VIDEO, |
|
184 | 184 |
CODEC_ID_AURA, |
185 | 185 |
sizeof(CyuvDecodeContext), |
186 | 186 |
cyuv_decode_init, |
... | ... |
@@ -196,7 +196,7 @@ AVCodec aura_decoder = { |
196 | 196 |
#if CONFIG_CYUV_DECODER |
197 | 197 |
AVCodec cyuv_decoder = { |
198 | 198 |
"cyuv", |
199 |
- CODEC_TYPE_VIDEO, |
|
199 |
+ AVMEDIA_TYPE_VIDEO, |
|
200 | 200 |
CODEC_ID_CYUV, |
201 | 201 |
sizeof(CyuvDecodeContext), |
202 | 202 |
cyuv_decode_init, |
... | ... |
@@ -1330,7 +1330,7 @@ static av_cold int dca_decode_end(AVCodecContext * avctx) |
1330 | 1330 |
|
1331 | 1331 |
AVCodec dca_decoder = { |
1332 | 1332 |
.name = "dca", |
1333 |
- .type = CODEC_TYPE_AUDIO, |
|
1333 |
+ .type = AVMEDIA_TYPE_AUDIO, |
|
1334 | 1334 |
.id = CODEC_ID_DTS, |
1335 | 1335 |
.priv_data_size = sizeof(DCAContext), |
1336 | 1336 |
.init = dca_decode_init, |
... | ... |
@@ -301,7 +301,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, |
301 | 301 |
#define DPCM_DECODER(id, name, long_name_) \ |
302 | 302 |
AVCodec name ## _decoder = { \ |
303 | 303 |
#name, \ |
304 |
- CODEC_TYPE_AUDIO, \ |
|
304 |
+ AVMEDIA_TYPE_AUDIO, \ |
|
305 | 305 |
id, \ |
306 | 306 |
sizeof(DPCMContext), \ |
307 | 307 |
dpcm_decode_init, \ |
... | ... |
@@ -345,7 +345,7 @@ static int cinaudio_decode_frame(AVCodecContext *avctx, |
345 | 345 |
|
346 | 346 |
AVCodec dsicinvideo_decoder = { |
347 | 347 |
"dsicinvideo", |
348 |
- CODEC_TYPE_VIDEO, |
|
348 |
+ AVMEDIA_TYPE_VIDEO, |
|
349 | 349 |
CODEC_ID_DSICINVIDEO, |
350 | 350 |
sizeof(CinVideoContext), |
351 | 351 |
cinvideo_decode_init, |
... | ... |
@@ -358,7 +358,7 @@ AVCodec dsicinvideo_decoder = { |
358 | 358 |
|
359 | 359 |
AVCodec dsicinaudio_decoder = { |
360 | 360 |
"dsicinaudio", |
361 |
- CODEC_TYPE_AUDIO, |
|
361 |
+ AVMEDIA_TYPE_AUDIO, |
|
362 | 362 |
CODEC_ID_DSICINAUDIO, |
363 | 363 |
sizeof(CinAudioContext), |
364 | 364 |
cinaudio_decode_init, |
... | ... |
@@ -1282,7 +1282,7 @@ static int dvvideo_close(AVCodecContext *c) |
1282 | 1282 |
#if CONFIG_DVVIDEO_ENCODER |
1283 | 1283 |
AVCodec dvvideo_encoder = { |
1284 | 1284 |
"dvvideo", |
1285 |
- CODEC_TYPE_VIDEO, |
|
1285 |
+ AVMEDIA_TYPE_VIDEO, |
|
1286 | 1286 |
CODEC_ID_DVVIDEO, |
1287 | 1287 |
sizeof(DVVideoContext), |
1288 | 1288 |
dvvideo_init_encoder, |
... | ... |
@@ -1295,7 +1295,7 @@ AVCodec dvvideo_encoder = { |
1295 | 1295 |
#if CONFIG_DVVIDEO_DECODER |
1296 | 1296 |
AVCodec dvvideo_decoder = { |
1297 | 1297 |
"dvvideo", |
1298 |
- CODEC_TYPE_VIDEO, |
|
1298 |
+ AVMEDIA_TYPE_VIDEO, |
|
1299 | 1299 |
CODEC_ID_DVVIDEO, |
1300 | 1300 |
sizeof(DVVideoContext), |
1301 | 1301 |
dvvideo_init, |
... | ... |
@@ -425,7 +425,7 @@ static int end_frame(AVCodecContext *avctx) |
425 | 425 |
|
426 | 426 |
AVHWAccel h264_dxva2_hwaccel = { |
427 | 427 |
.name = "h264_dxva2", |
428 |
- .type = CODEC_TYPE_VIDEO, |
|
428 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
429 | 429 |
.id = CODEC_ID_H264, |
430 | 430 |
.pix_fmt = PIX_FMT_DXVA2_VLD, |
431 | 431 |
.capabilities = 0, |
... | ... |
@@ -266,7 +266,7 @@ static int end_frame(AVCodecContext *avctx) |
266 | 266 |
#if CONFIG_WMV3_DXVA2_HWACCEL |
267 | 267 |
AVHWAccel wmv3_dxva2_hwaccel = { |
268 | 268 |
.name = "wmv3_dxva2", |
269 |
- .type = CODEC_TYPE_VIDEO, |
|
269 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
270 | 270 |
.id = CODEC_ID_WMV3, |
271 | 271 |
.pix_fmt = PIX_FMT_DXVA2_VLD, |
272 | 272 |
.capabilities = 0, |
... | ... |
@@ -279,7 +279,7 @@ AVHWAccel wmv3_dxva2_hwaccel = { |
279 | 279 |
|
280 | 280 |
AVHWAccel vc1_dxva2_hwaccel = { |
281 | 281 |
.name = "vc1_dxva2", |
282 |
- .type = CODEC_TYPE_VIDEO, |
|
282 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
283 | 283 |
.id = CODEC_ID_VC1, |
284 | 284 |
.pix_fmt = PIX_FMT_DXVA2_VLD, |
285 | 285 |
.capabilities = 0, |
... | ... |
@@ -1125,7 +1125,7 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *data_size, AVPac |
1125 | 1125 |
|
1126 | 1126 |
AVCodec ffv1_decoder = { |
1127 | 1127 |
"ffv1", |
1128 |
- CODEC_TYPE_VIDEO, |
|
1128 |
+ AVMEDIA_TYPE_VIDEO, |
|
1129 | 1129 |
CODEC_ID_FFV1, |
1130 | 1130 |
sizeof(FFV1Context), |
1131 | 1131 |
decode_init, |
... | ... |
@@ -1140,7 +1140,7 @@ AVCodec ffv1_decoder = { |
1140 | 1140 |
#if CONFIG_FFV1_ENCODER |
1141 | 1141 |
AVCodec ffv1_encoder = { |
1142 | 1142 |
"ffv1", |
1143 |
- CODEC_TYPE_VIDEO, |
|
1143 |
+ AVMEDIA_TYPE_VIDEO, |
|
1144 | 1144 |
CODEC_ID_FFV1, |
1145 | 1145 |
sizeof(FFV1Context), |
1146 | 1146 |
encode_init, |
... | ... |
@@ -387,7 +387,7 @@ static int g726_decode_frame(AVCodecContext *avctx, |
387 | 387 |
#if CONFIG_ADPCM_G726_ENCODER |
388 | 388 |
AVCodec adpcm_g726_encoder = { |
389 | 389 |
"g726", |
390 |
- CODEC_TYPE_AUDIO, |
|
390 |
+ AVMEDIA_TYPE_AUDIO, |
|
391 | 391 |
CODEC_ID_ADPCM_G726, |
392 | 392 |
sizeof(G726Context), |
393 | 393 |
g726_init, |
... | ... |
@@ -401,7 +401,7 @@ AVCodec adpcm_g726_encoder = { |
401 | 401 |
|
402 | 402 |
AVCodec adpcm_g726_decoder = { |
403 | 403 |
"g726", |
404 |
- CODEC_TYPE_AUDIO, |
|
404 |
+ AVMEDIA_TYPE_AUDIO, |
|
405 | 405 |
CODEC_ID_ADPCM_G726, |
406 | 406 |
sizeof(G726Context), |
407 | 407 |
g726_init, |
... | ... |
@@ -3148,7 +3148,7 @@ av_cold int ff_h264_decode_end(AVCodecContext *avctx) |
3148 | 3148 |
|
3149 | 3149 |
AVCodec h264_decoder = { |
3150 | 3150 |
"h264", |
3151 |
- CODEC_TYPE_VIDEO, |
|
3151 |
+ AVMEDIA_TYPE_VIDEO, |
|
3152 | 3152 |
CODEC_ID_H264, |
3153 | 3153 |
sizeof(H264Context), |
3154 | 3154 |
ff_h264_decode_init, |
... | ... |
@@ -3164,7 +3164,7 @@ AVCodec h264_decoder = { |
3164 | 3164 |
#if CONFIG_H264_VDPAU_DECODER |
3165 | 3165 |
AVCodec h264_vdpau_decoder = { |
3166 | 3166 |
"h264_vdpau", |
3167 |
- CODEC_TYPE_VIDEO, |
|
3167 |
+ AVMEDIA_TYPE_VIDEO, |
|
3168 | 3168 |
CODEC_ID_H264, |
3169 | 3169 |
sizeof(H264Context), |
3170 | 3170 |
ff_h264_decode_init, |
... | ... |
@@ -1414,7 +1414,7 @@ static av_cold int encode_end(AVCodecContext *avctx) |
1414 | 1414 |
#if CONFIG_HUFFYUV_DECODER |
1415 | 1415 |
AVCodec huffyuv_decoder = { |
1416 | 1416 |
"huffyuv", |
1417 |
- CODEC_TYPE_VIDEO, |
|
1417 |
+ AVMEDIA_TYPE_VIDEO, |
|
1418 | 1418 |
CODEC_ID_HUFFYUV, |
1419 | 1419 |
sizeof(HYuvContext), |
1420 | 1420 |
decode_init, |
... | ... |
@@ -1430,7 +1430,7 @@ AVCodec huffyuv_decoder = { |
1430 | 1430 |
#if CONFIG_FFVHUFF_DECODER |
1431 | 1431 |
AVCodec ffvhuff_decoder = { |
1432 | 1432 |
"ffvhuff", |
1433 |
- CODEC_TYPE_VIDEO, |
|
1433 |
+ AVMEDIA_TYPE_VIDEO, |
|
1434 | 1434 |
CODEC_ID_FFVHUFF, |
1435 | 1435 |
sizeof(HYuvContext), |
1436 | 1436 |
decode_init, |
... | ... |
@@ -1446,7 +1446,7 @@ AVCodec ffvhuff_decoder = { |
1446 | 1446 |
#if CONFIG_HUFFYUV_ENCODER |
1447 | 1447 |
AVCodec huffyuv_encoder = { |
1448 | 1448 |
"huffyuv", |
1449 |
- CODEC_TYPE_VIDEO, |
|
1449 |
+ AVMEDIA_TYPE_VIDEO, |
|
1450 | 1450 |
CODEC_ID_HUFFYUV, |
1451 | 1451 |
sizeof(HYuvContext), |
1452 | 1452 |
encode_init, |
... | ... |
@@ -1460,7 +1460,7 @@ AVCodec huffyuv_encoder = { |
1460 | 1460 |
#if CONFIG_FFVHUFF_ENCODER |
1461 | 1461 |
AVCodec ffvhuff_encoder = { |
1462 | 1462 |
"ffvhuff", |
1463 |
- CODEC_TYPE_VIDEO, |
|
1463 |
+ AVMEDIA_TYPE_VIDEO, |
|
1464 | 1464 |
CODEC_ID_FFVHUFF, |
1465 | 1465 |
sizeof(HYuvContext), |
1466 | 1466 |
encode_init, |
... | ... |
@@ -218,7 +218,7 @@ static av_cold int decode_end(AVCodecContext *avctx) |
218 | 218 |
|
219 | 219 |
AVCodec iff_ilbm_decoder = { |
220 | 220 |
"iff_ilbm", |
221 |
- CODEC_TYPE_VIDEO, |
|
221 |
+ AVMEDIA_TYPE_VIDEO, |
|
222 | 222 |
CODEC_ID_IFF_ILBM, |
223 | 223 |
sizeof(IffContext), |
224 | 224 |
decode_init, |
... | ... |
@@ -231,7 +231,7 @@ AVCodec iff_ilbm_decoder = { |
231 | 231 |
|
232 | 232 |
AVCodec iff_byterun1_decoder = { |
233 | 233 |
"iff_byterun1", |
234 |
- CODEC_TYPE_VIDEO, |
|
234 |
+ AVMEDIA_TYPE_VIDEO, |
|
235 | 235 |
CODEC_ID_IFF_BYTERUN1, |
236 | 236 |
sizeof(IffContext), |
237 | 237 |
decode_init, |
... | ... |
@@ -823,7 +823,7 @@ static av_cold int imc_decode_close(AVCodecContext * avctx) |
823 | 823 |
|
824 | 824 |
AVCodec imc_decoder = { |
825 | 825 |
.name = "imc", |
826 |
- .type = CODEC_TYPE_AUDIO, |
|
826 |
+ .type = AVMEDIA_TYPE_AUDIO, |
|
827 | 827 |
.id = CODEC_ID_IMC, |
828 | 828 |
.priv_data_size = sizeof(IMCContext), |
829 | 829 |
.init = imc_decode_init, |
... | ... |
@@ -1138,7 +1138,7 @@ static av_cold int indeo3_decode_end(AVCodecContext *avctx) |
1138 | 1138 |
|
1139 | 1139 |
AVCodec indeo3_decoder = { |
1140 | 1140 |
"indeo3", |
1141 |
- CODEC_TYPE_VIDEO, |
|
1141 |
+ AVMEDIA_TYPE_VIDEO, |
|
1142 | 1142 |
CODEC_ID_INDEO3, |
1143 | 1143 |
sizeof(Indeo3DecodeContext), |
1144 | 1144 |
indeo3_decode_init, |
... | ... |
@@ -817,7 +817,7 @@ static av_cold int decode_close(AVCodecContext *avctx) |
817 | 817 |
|
818 | 818 |
AVCodec indeo5_decoder = { |
819 | 819 |
.name = "indeo5", |
820 |
- .type = CODEC_TYPE_VIDEO, |
|
820 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
821 | 821 |
.id = CODEC_ID_INDEO5, |
822 | 822 |
.priv_data_size = sizeof(IVI5DecContext), |
823 | 823 |
.init = decode_init, |
... | ... |
@@ -1095,7 +1095,7 @@ static av_cold int ipvideo_decode_end(AVCodecContext *avctx) |
1095 | 1095 |
|
1096 | 1096 |
AVCodec interplay_video_decoder = { |
1097 | 1097 |
"interplayvideo", |
1098 |
- CODEC_TYPE_VIDEO, |
|
1098 |
+ AVMEDIA_TYPE_VIDEO, |
|
1099 | 1099 |
CODEC_ID_INTERPLAY_VIDEO, |
1100 | 1100 |
sizeof(IpvideoContext), |
1101 | 1101 |
ipvideo_decode_init, |
... | ... |
@@ -365,7 +365,7 @@ int ff_jpegls_decode_picture(MJpegDecodeContext *s, int near, int point_transfor |
365 | 365 |
|
366 | 366 |
AVCodec jpegls_decoder = { |
367 | 367 |
"jpegls", |
368 |
- CODEC_TYPE_VIDEO, |
|
368 |
+ AVMEDIA_TYPE_VIDEO, |
|
369 | 369 |
CODEC_ID_JPEGLS, |
370 | 370 |
sizeof(MJpegDecodeContext), |
371 | 371 |
ff_mjpeg_decode_init, |
... | ... |
@@ -384,7 +384,7 @@ static av_cold int encode_init_ls(AVCodecContext *ctx) { |
384 | 384 |
|
385 | 385 |
AVCodec jpegls_encoder = { //FIXME avoid MPV_* lossless JPEG should not need them |
386 | 386 |
"jpegls", |
387 |
- CODEC_TYPE_VIDEO, |
|
387 |
+ AVMEDIA_TYPE_VIDEO, |
|
388 | 388 |
CODEC_ID_JPEGLS, |
389 | 389 |
sizeof(JpeglsContext), |
390 | 390 |
encode_init_ls, |
... | ... |
@@ -611,7 +611,7 @@ static av_cold int decode_end(AVCodecContext *avctx) |
611 | 611 |
#if CONFIG_MSZH_DECODER |
612 | 612 |
AVCodec mszh_decoder = { |
613 | 613 |
"mszh", |
614 |
- CODEC_TYPE_VIDEO, |
|
614 |
+ AVMEDIA_TYPE_VIDEO, |
|
615 | 615 |
CODEC_ID_MSZH, |
616 | 616 |
sizeof(LclDecContext), |
617 | 617 |
decode_init, |
... | ... |
@@ -626,7 +626,7 @@ AVCodec mszh_decoder = { |
626 | 626 |
#if CONFIG_ZLIB_DECODER |
627 | 627 |
AVCodec zlib_decoder = { |
628 | 628 |
"zlib", |
629 |
- CODEC_TYPE_VIDEO, |
|
629 |
+ AVMEDIA_TYPE_VIDEO, |
|
630 | 630 |
CODEC_ID_ZLIB, |
631 | 631 |
sizeof(LclDecContext), |
632 | 632 |
decode_init, |
... | ... |
@@ -393,7 +393,7 @@ static av_cold int libdirac_encode_close(AVCodecContext *avccontext) |
393 | 393 |
|
394 | 394 |
AVCodec libdirac_encoder = { |
395 | 395 |
"libdirac", |
396 |
- CODEC_TYPE_VIDEO, |
|
396 |
+ AVMEDIA_TYPE_VIDEO, |
|
397 | 397 |
CODEC_ID_DIRAC, |
398 | 398 |
sizeof(FfmpegDiracEncoderParams), |
399 | 399 |
libdirac_encode_init, |
... | ... |
@@ -114,7 +114,7 @@ static int libgsm_encode_frame(AVCodecContext *avctx, |
114 | 114 |
|
115 | 115 |
AVCodec libgsm_encoder = { |
116 | 116 |
"libgsm", |
117 |
- CODEC_TYPE_AUDIO, |
|
117 |
+ AVMEDIA_TYPE_AUDIO, |
|
118 | 118 |
CODEC_ID_GSM, |
119 | 119 |
0, |
120 | 120 |
libgsm_init, |
... | ... |
@@ -126,7 +126,7 @@ AVCodec libgsm_encoder = { |
126 | 126 |
|
127 | 127 |
AVCodec libgsm_ms_encoder = { |
128 | 128 |
"libgsm_ms", |
129 |
- CODEC_TYPE_AUDIO, |
|
129 |
+ AVMEDIA_TYPE_AUDIO, |
|
130 | 130 |
CODEC_ID_GSM_MS, |
131 | 131 |
0, |
132 | 132 |
libgsm_init, |
... | ... |
@@ -158,7 +158,7 @@ static int libgsm_decode_frame(AVCodecContext *avctx, |
158 | 158 |
|
159 | 159 |
AVCodec libgsm_decoder = { |
160 | 160 |
"libgsm", |
161 |
- CODEC_TYPE_AUDIO, |
|
161 |
+ AVMEDIA_TYPE_AUDIO, |
|
162 | 162 |
CODEC_ID_GSM, |
163 | 163 |
0, |
164 | 164 |
libgsm_init, |
... | ... |
@@ -170,7 +170,7 @@ AVCodec libgsm_decoder = { |
170 | 170 |
|
171 | 171 |
AVCodec libgsm_ms_decoder = { |
172 | 172 |
"libgsm_ms", |
173 |
- CODEC_TYPE_AUDIO, |
|
173 |
+ AVMEDIA_TYPE_AUDIO, |
|
174 | 174 |
CODEC_ID_GSM_MS, |
175 | 175 |
0, |
176 | 176 |
libgsm_init, |
... | ... |
@@ -141,7 +141,7 @@ static int amr_nb_decode_frame(AVCodecContext *avctx, void *data, |
141 | 141 |
|
142 | 142 |
AVCodec libopencore_amrnb_decoder = { |
143 | 143 |
"libopencore_amrnb", |
144 |
- CODEC_TYPE_AUDIO, |
|
144 |
+ AVMEDIA_TYPE_AUDIO, |
|
145 | 145 |
CODEC_ID_AMR_NB, |
146 | 146 |
sizeof(AMRContext), |
147 | 147 |
amr_nb_decode_init, |
... | ... |
@@ -215,7 +215,7 @@ static int amr_nb_encode_frame(AVCodecContext *avctx, |
215 | 215 |
|
216 | 216 |
AVCodec libopencore_amrnb_encoder = { |
217 | 217 |
"libopencore_amrnb", |
218 |
- CODEC_TYPE_AUDIO, |
|
218 |
+ AVMEDIA_TYPE_AUDIO, |
|
219 | 219 |
CODEC_ID_AMR_NB, |
220 | 220 |
sizeof(AMRContext), |
221 | 221 |
amr_nb_encode_init, |
... | ... |
@@ -312,7 +312,7 @@ static int amr_wb_decode_close(AVCodecContext *avctx) |
312 | 312 |
|
313 | 313 |
AVCodec libopencore_amrwb_decoder = { |
314 | 314 |
"libopencore_amrwb", |
315 |
- CODEC_TYPE_AUDIO, |
|
315 |
+ AVMEDIA_TYPE_AUDIO, |
|
316 | 316 |
CODEC_ID_AMR_WB, |
317 | 317 |
sizeof(AMRWBContext), |
318 | 318 |
amr_wb_decode_init, |
... | ... |
@@ -185,7 +185,7 @@ static av_cold int libopenjpeg_decode_close(AVCodecContext *avctx) |
185 | 185 |
|
186 | 186 |
AVCodec libopenjpeg_decoder = { |
187 | 187 |
"libopenjpeg", |
188 |
- CODEC_TYPE_VIDEO, |
|
188 |
+ AVMEDIA_TYPE_VIDEO, |
|
189 | 189 |
CODEC_ID_JPEG2000, |
190 | 190 |
sizeof(LibOpenJPEGContext), |
191 | 191 |
libopenjpeg_decode_init, |
... | ... |
@@ -347,7 +347,7 @@ static void libschroedinger_flush(AVCodecContext *avccontext) |
347 | 347 |
|
348 | 348 |
AVCodec libschroedinger_decoder = { |
349 | 349 |
"libschroedinger", |
350 |
- CODEC_TYPE_VIDEO, |
|
350 |
+ AVMEDIA_TYPE_VIDEO, |
|
351 | 351 |
CODEC_ID_DIRAC, |
352 | 352 |
sizeof(FfmpegSchroDecoderParams), |
353 | 353 |
libschroedinger_decode_init, |
... | ... |
@@ -407,7 +407,7 @@ static int libschroedinger_encode_close(AVCodecContext *avccontext) |
407 | 407 |
|
408 | 408 |
AVCodec libschroedinger_encoder = { |
409 | 409 |
"libschroedinger", |
410 |
- CODEC_TYPE_VIDEO, |
|
410 |
+ AVMEDIA_TYPE_VIDEO, |
|
411 | 411 |
CODEC_ID_DIRAC, |
412 | 412 |
sizeof(FfmpegSchroEncoderParams), |
413 | 413 |
libschroedinger_encode_init, |
... | ... |
@@ -361,7 +361,7 @@ static av_cold int encode_close(AVCodecContext* avc_context) |
361 | 361 |
/*! AVCodec struct exposed to libavcodec */ |
362 | 362 |
AVCodec libtheora_encoder = { |
363 | 363 |
.name = "libtheora", |
364 |
- .type = CODEC_TYPE_VIDEO, |
|
364 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
365 | 365 |
.id = CODEC_ID_THEORA, |
366 | 366 |
.priv_data_size = sizeof(TheoraContext), |
367 | 367 |
.init = encode_init, |
... | ... |
@@ -217,7 +217,7 @@ static av_cold int oggvorbis_encode_close(AVCodecContext *avccontext) { |
217 | 217 |
|
218 | 218 |
AVCodec libvorbis_encoder = { |
219 | 219 |
"libvorbis", |
220 |
- CODEC_TYPE_AUDIO, |
|
220 |
+ AVMEDIA_TYPE_AUDIO, |
|
221 | 221 |
CODEC_ID_VORBIS, |
222 | 222 |
sizeof(OggVorbisContext), |
223 | 223 |
oggvorbis_encode_init, |
... | ... |
@@ -317,7 +317,7 @@ static av_cold int X264_init(AVCodecContext *avctx) |
317 | 317 |
|
318 | 318 |
AVCodec libx264_encoder = { |
319 | 319 |
.name = "libx264", |
320 |
- .type = CODEC_TYPE_VIDEO, |
|
320 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
321 | 321 |
.id = CODEC_ID_H264, |
322 | 322 |
.priv_data_size = sizeof(X264Context), |
323 | 323 |
.init = X264_init, |
... | ... |
@@ -188,7 +188,7 @@ static int encode_picture_lossless(AVCodecContext *avctx, unsigned char *buf, in |
188 | 188 |
|
189 | 189 |
AVCodec ljpeg_encoder = { //FIXME avoid MPV_* lossless JPEG should not need them |
190 | 190 |
"ljpeg", |
191 |
- CODEC_TYPE_VIDEO, |
|
191 |
+ AVMEDIA_TYPE_VIDEO, |
|
192 | 192 |
CODEC_ID_LJPEG, |
193 | 193 |
sizeof(MpegEncContext), |
194 | 194 |
MPV_encode_init, |
... | ... |
@@ -281,7 +281,7 @@ static int mace_decode_frame(AVCodecContext *avctx, |
281 | 281 |
|
282 | 282 |
AVCodec mace3_decoder = { |
283 | 283 |
"mace3", |
284 |
- CODEC_TYPE_AUDIO, |
|
284 |
+ AVMEDIA_TYPE_AUDIO, |
|
285 | 285 |
CODEC_ID_MACE3, |
286 | 286 |
sizeof(MACEContext), |
287 | 287 |
mace_decode_init, |
... | ... |
@@ -293,7 +293,7 @@ AVCodec mace3_decoder = { |
293 | 293 |
|
294 | 294 |
AVCodec mace6_decoder = { |
295 | 295 |
"mace6", |
296 |
- CODEC_TYPE_AUDIO, |
|
296 |
+ AVMEDIA_TYPE_AUDIO, |
|
297 | 297 |
CODEC_ID_MACE6, |
298 | 298 |
sizeof(MACEContext), |
299 | 299 |
mace_decode_init, |
... | ... |
@@ -1533,7 +1533,7 @@ av_cold int ff_mjpeg_decode_end(AVCodecContext *avctx) |
1533 | 1533 |
|
1534 | 1534 |
AVCodec mjpeg_decoder = { |
1535 | 1535 |
"mjpeg", |
1536 |
- CODEC_TYPE_VIDEO, |
|
1536 |
+ AVMEDIA_TYPE_VIDEO, |
|
1537 | 1537 |
CODEC_ID_MJPEG, |
1538 | 1538 |
sizeof(MJpegDecodeContext), |
1539 | 1539 |
ff_mjpeg_decode_init, |
... | ... |
@@ -1547,7 +1547,7 @@ AVCodec mjpeg_decoder = { |
1547 | 1547 |
|
1548 | 1548 |
AVCodec thp_decoder = { |
1549 | 1549 |
"thp", |
1550 |
- CODEC_TYPE_VIDEO, |
|
1550 |
+ AVMEDIA_TYPE_VIDEO, |
|
1551 | 1551 |
CODEC_ID_THP, |
1552 | 1552 |
sizeof(MJpegDecodeContext), |
1553 | 1553 |
ff_mjpeg_decode_init, |
... | ... |
@@ -1136,7 +1136,7 @@ error: |
1136 | 1136 |
|
1137 | 1137 |
AVCodec mlp_decoder = { |
1138 | 1138 |
"mlp", |
1139 |
- CODEC_TYPE_AUDIO, |
|
1139 |
+ AVMEDIA_TYPE_AUDIO, |
|
1140 | 1140 |
CODEC_ID_MLP, |
1141 | 1141 |
sizeof(MLPDecodeContext), |
1142 | 1142 |
mlp_decode_init, |
... | ... |
@@ -1149,7 +1149,7 @@ AVCodec mlp_decoder = { |
1149 | 1149 |
#if CONFIG_TRUEHD_DECODER |
1150 | 1150 |
AVCodec truehd_decoder = { |
1151 | 1151 |
"truehd", |
1152 |
- CODEC_TYPE_AUDIO, |
|
1152 |
+ AVMEDIA_TYPE_AUDIO, |
|
1153 | 1153 |
CODEC_ID_TRUEHD, |
1154 | 1154 |
sizeof(MLPDecodeContext), |
1155 | 1155 |
mlp_decode_init, |
... | ... |
@@ -2502,7 +2502,7 @@ static int mpeg_decode_end(AVCodecContext *avctx) |
2502 | 2502 |
|
2503 | 2503 |
AVCodec mpeg1video_decoder = { |
2504 | 2504 |
"mpeg1video", |
2505 |
- CODEC_TYPE_VIDEO, |
|
2505 |
+ AVMEDIA_TYPE_VIDEO, |
|
2506 | 2506 |
CODEC_ID_MPEG1VIDEO, |
2507 | 2507 |
sizeof(Mpeg1Context), |
2508 | 2508 |
mpeg_decode_init, |
... | ... |
@@ -2516,7 +2516,7 @@ AVCodec mpeg1video_decoder = { |
2516 | 2516 |
|
2517 | 2517 |
AVCodec mpeg2video_decoder = { |
2518 | 2518 |
"mpeg2video", |
2519 |
- CODEC_TYPE_VIDEO, |
|
2519 |
+ AVMEDIA_TYPE_VIDEO, |
|
2520 | 2520 |
CODEC_ID_MPEG2VIDEO, |
2521 | 2521 |
sizeof(Mpeg1Context), |
2522 | 2522 |
mpeg_decode_init, |
... | ... |
@@ -2531,7 +2531,7 @@ AVCodec mpeg2video_decoder = { |
2531 | 2531 |
//legacy decoder |
2532 | 2532 |
AVCodec mpegvideo_decoder = { |
2533 | 2533 |
"mpegvideo", |
2534 |
- CODEC_TYPE_VIDEO, |
|
2534 |
+ AVMEDIA_TYPE_VIDEO, |
|
2535 | 2535 |
CODEC_ID_MPEG2VIDEO, |
2536 | 2536 |
sizeof(Mpeg1Context), |
2537 | 2537 |
mpeg_decode_init, |
... | ... |
@@ -2562,7 +2562,7 @@ static av_cold int mpeg_mc_decode_init(AVCodecContext *avctx){ |
2562 | 2562 |
|
2563 | 2563 |
AVCodec mpeg_xvmc_decoder = { |
2564 | 2564 |
"mpegvideo_xvmc", |
2565 |
- CODEC_TYPE_VIDEO, |
|
2565 |
+ AVMEDIA_TYPE_VIDEO, |
|
2566 | 2566 |
CODEC_ID_MPEG2VIDEO_XVMC, |
2567 | 2567 |
sizeof(Mpeg1Context), |
2568 | 2568 |
mpeg_mc_decode_init, |
... | ... |
@@ -2579,7 +2579,7 @@ AVCodec mpeg_xvmc_decoder = { |
2579 | 2579 |
#if CONFIG_MPEG_VDPAU_DECODER |
2580 | 2580 |
AVCodec mpeg_vdpau_decoder = { |
2581 | 2581 |
"mpegvideo_vdpau", |
2582 |
- CODEC_TYPE_VIDEO, |
|
2582 |
+ AVMEDIA_TYPE_VIDEO, |
|
2583 | 2583 |
CODEC_ID_MPEG2VIDEO, |
2584 | 2584 |
sizeof(Mpeg1Context), |
2585 | 2585 |
mpeg_decode_init, |
... | ... |
@@ -2595,7 +2595,7 @@ AVCodec mpeg_vdpau_decoder = { |
2595 | 2595 |
#if CONFIG_MPEG1_VDPAU_DECODER |
2596 | 2596 |
AVCodec mpeg1_vdpau_decoder = { |
2597 | 2597 |
"mpeg1video_vdpau", |
2598 |
- CODEC_TYPE_VIDEO, |
|
2598 |
+ AVMEDIA_TYPE_VIDEO, |
|
2599 | 2599 |
CODEC_ID_MPEG1VIDEO, |
2600 | 2600 |
sizeof(Mpeg1Context), |
2601 | 2601 |
mpeg_decode_init, |
... | ... |
@@ -932,7 +932,7 @@ static void mpeg1_encode_block(MpegEncContext *s, |
932 | 932 |
|
933 | 933 |
AVCodec mpeg1video_encoder = { |
934 | 934 |
"mpeg1video", |
935 |
- CODEC_TYPE_VIDEO, |
|
935 |
+ AVMEDIA_TYPE_VIDEO, |
|
936 | 936 |
CODEC_ID_MPEG1VIDEO, |
937 | 937 |
sizeof(MpegEncContext), |
938 | 938 |
encode_init, |
... | ... |
@@ -946,7 +946,7 @@ AVCodec mpeg1video_encoder = { |
946 | 946 |
|
947 | 947 |
AVCodec mpeg2video_encoder = { |
948 | 948 |
"mpeg2video", |
949 |
- CODEC_TYPE_VIDEO, |
|
949 |
+ AVMEDIA_TYPE_VIDEO, |
|
950 | 950 |
CODEC_ID_MPEG2VIDEO, |
951 | 951 |
sizeof(MpegEncContext), |
952 | 952 |
encode_init, |
... | ... |
@@ -2236,7 +2236,7 @@ static av_cold int decode_init(AVCodecContext *avctx) |
2236 | 2236 |
|
2237 | 2237 |
AVCodec mpeg4_decoder = { |
2238 | 2238 |
"mpeg4", |
2239 |
- CODEC_TYPE_VIDEO, |
|
2239 |
+ AVMEDIA_TYPE_VIDEO, |
|
2240 | 2240 |
CODEC_ID_MPEG4, |
2241 | 2241 |
sizeof(MpegEncContext), |
2242 | 2242 |
decode_init, |
... | ... |
@@ -2253,7 +2253,7 @@ AVCodec mpeg4_decoder = { |
2253 | 2253 |
#if CONFIG_MPEG4_VDPAU_DECODER |
2254 | 2254 |
AVCodec mpeg4_vdpau_decoder = { |
2255 | 2255 |
"mpeg4_vdpau", |
2256 |
- CODEC_TYPE_VIDEO, |
|
2256 |
+ AVMEDIA_TYPE_VIDEO, |
|
2257 | 2257 |
CODEC_ID_MPEG4, |
2258 | 2258 |
sizeof(MpegEncContext), |
2259 | 2259 |
decode_init, |
... | ... |
@@ -2485,7 +2485,7 @@ static int decode_frame_mp3on4(AVCodecContext * avctx, |
2485 | 2485 |
AVCodec mp1_decoder = |
2486 | 2486 |
{ |
2487 | 2487 |
"mp1", |
2488 |
- CODEC_TYPE_AUDIO, |
|
2488 |
+ AVMEDIA_TYPE_AUDIO, |
|
2489 | 2489 |
CODEC_ID_MP1, |
2490 | 2490 |
sizeof(MPADecodeContext), |
2491 | 2491 |
decode_init, |
... | ... |
@@ -2501,7 +2501,7 @@ AVCodec mp1_decoder = |
2501 | 2501 |
AVCodec mp2_decoder = |
2502 | 2502 |
{ |
2503 | 2503 |
"mp2", |
2504 |
- CODEC_TYPE_AUDIO, |
|
2504 |
+ AVMEDIA_TYPE_AUDIO, |
|
2505 | 2505 |
CODEC_ID_MP2, |
2506 | 2506 |
sizeof(MPADecodeContext), |
2507 | 2507 |
decode_init, |
... | ... |
@@ -2517,7 +2517,7 @@ AVCodec mp2_decoder = |
2517 | 2517 |
AVCodec mp3_decoder = |
2518 | 2518 |
{ |
2519 | 2519 |
"mp3", |
2520 |
- CODEC_TYPE_AUDIO, |
|
2520 |
+ AVMEDIA_TYPE_AUDIO, |
|
2521 | 2521 |
CODEC_ID_MP3, |
2522 | 2522 |
sizeof(MPADecodeContext), |
2523 | 2523 |
decode_init, |
... | ... |
@@ -2533,7 +2533,7 @@ AVCodec mp3_decoder = |
2533 | 2533 |
AVCodec mp3adu_decoder = |
2534 | 2534 |
{ |
2535 | 2535 |
"mp3adu", |
2536 |
- CODEC_TYPE_AUDIO, |
|
2536 |
+ AVMEDIA_TYPE_AUDIO, |
|
2537 | 2537 |
CODEC_ID_MP3ADU, |
2538 | 2538 |
sizeof(MPADecodeContext), |
2539 | 2539 |
decode_init, |
... | ... |
@@ -2549,7 +2549,7 @@ AVCodec mp3adu_decoder = |
2549 | 2549 |
AVCodec mp3on4_decoder = |
2550 | 2550 |
{ |
2551 | 2551 |
"mp3on4", |
2552 |
- CODEC_TYPE_AUDIO, |
|
2552 |
+ AVMEDIA_TYPE_AUDIO, |
|
2553 | 2553 |
CODEC_ID_MP3ON4, |
2554 | 2554 |
sizeof(MP3On4DecodeContext), |
2555 | 2555 |
decode_init_mp3on4, |
... | ... |
@@ -3771,7 +3771,7 @@ int dct_quantize_c(MpegEncContext *s, |
3771 | 3771 |
|
3772 | 3772 |
AVCodec h263_encoder = { |
3773 | 3773 |
"h263", |
3774 |
- CODEC_TYPE_VIDEO, |
|
3774 |
+ AVMEDIA_TYPE_VIDEO, |
|
3775 | 3775 |
CODEC_ID_H263, |
3776 | 3776 |
sizeof(MpegEncContext), |
3777 | 3777 |
MPV_encode_init, |
... | ... |
@@ -3783,7 +3783,7 @@ AVCodec h263_encoder = { |
3783 | 3783 |
|
3784 | 3784 |
AVCodec h263p_encoder = { |
3785 | 3785 |
"h263p", |
3786 |
- CODEC_TYPE_VIDEO, |
|
3786 |
+ AVMEDIA_TYPE_VIDEO, |
|
3787 | 3787 |
CODEC_ID_H263P, |
3788 | 3788 |
sizeof(MpegEncContext), |
3789 | 3789 |
MPV_encode_init, |
... | ... |
@@ -3795,7 +3795,7 @@ AVCodec h263p_encoder = { |
3795 | 3795 |
|
3796 | 3796 |
AVCodec msmpeg4v1_encoder = { |
3797 | 3797 |
"msmpeg4v1", |
3798 |
- CODEC_TYPE_VIDEO, |
|
3798 |
+ AVMEDIA_TYPE_VIDEO, |
|
3799 | 3799 |
CODEC_ID_MSMPEG4V1, |
3800 | 3800 |
sizeof(MpegEncContext), |
3801 | 3801 |
MPV_encode_init, |
... | ... |
@@ -3807,7 +3807,7 @@ AVCodec msmpeg4v1_encoder = { |
3807 | 3807 |
|
3808 | 3808 |
AVCodec msmpeg4v2_encoder = { |
3809 | 3809 |
"msmpeg4v2", |
3810 |
- CODEC_TYPE_VIDEO, |
|
3810 |
+ AVMEDIA_TYPE_VIDEO, |
|
3811 | 3811 |
CODEC_ID_MSMPEG4V2, |
3812 | 3812 |
sizeof(MpegEncContext), |
3813 | 3813 |
MPV_encode_init, |
... | ... |
@@ -3819,7 +3819,7 @@ AVCodec msmpeg4v2_encoder = { |
3819 | 3819 |
|
3820 | 3820 |
AVCodec msmpeg4v3_encoder = { |
3821 | 3821 |
"msmpeg4", |
3822 |
- CODEC_TYPE_VIDEO, |
|
3822 |
+ AVMEDIA_TYPE_VIDEO, |
|
3823 | 3823 |
CODEC_ID_MSMPEG4V3, |
3824 | 3824 |
sizeof(MpegEncContext), |
3825 | 3825 |
MPV_encode_init, |
... | ... |
@@ -3831,7 +3831,7 @@ AVCodec msmpeg4v3_encoder = { |
3831 | 3831 |
|
3832 | 3832 |
AVCodec wmv1_encoder = { |
3833 | 3833 |
"wmv1", |
3834 |
- CODEC_TYPE_VIDEO, |
|
3834 |
+ AVMEDIA_TYPE_VIDEO, |
|
3835 | 3835 |
CODEC_ID_WMV1, |
3836 | 3836 |
sizeof(MpegEncContext), |
3837 | 3837 |
MPV_encode_init, |
... | ... |
@@ -1921,7 +1921,7 @@ int ff_msmpeg4_decode_motion(MpegEncContext * s, |
1921 | 1921 |
|
1922 | 1922 |
AVCodec msmpeg4v1_decoder = { |
1923 | 1923 |
"msmpeg4v1", |
1924 |
- CODEC_TYPE_VIDEO, |
|
1924 |
+ AVMEDIA_TYPE_VIDEO, |
|
1925 | 1925 |
CODEC_ID_MSMPEG4V1, |
1926 | 1926 |
sizeof(MpegEncContext), |
1927 | 1927 |
ff_msmpeg4_decode_init, |
... | ... |
@@ -1935,7 +1935,7 @@ AVCodec msmpeg4v1_decoder = { |
1935 | 1935 |
|
1936 | 1936 |
AVCodec msmpeg4v2_decoder = { |
1937 | 1937 |
"msmpeg4v2", |
1938 |
- CODEC_TYPE_VIDEO, |
|
1938 |
+ AVMEDIA_TYPE_VIDEO, |
|
1939 | 1939 |
CODEC_ID_MSMPEG4V2, |
1940 | 1940 |
sizeof(MpegEncContext), |
1941 | 1941 |
ff_msmpeg4_decode_init, |
... | ... |
@@ -1949,7 +1949,7 @@ AVCodec msmpeg4v2_decoder = { |
1949 | 1949 |
|
1950 | 1950 |
AVCodec msmpeg4v3_decoder = { |
1951 | 1951 |
"msmpeg4", |
1952 |
- CODEC_TYPE_VIDEO, |
|
1952 |
+ AVMEDIA_TYPE_VIDEO, |
|
1953 | 1953 |
CODEC_ID_MSMPEG4V3, |
1954 | 1954 |
sizeof(MpegEncContext), |
1955 | 1955 |
ff_msmpeg4_decode_init, |
... | ... |
@@ -1963,7 +1963,7 @@ AVCodec msmpeg4v3_decoder = { |
1963 | 1963 |
|
1964 | 1964 |
AVCodec wmv1_decoder = { |
1965 | 1965 |
"wmv1", |
1966 |
- CODEC_TYPE_VIDEO, |
|
1966 |
+ AVMEDIA_TYPE_VIDEO, |
|
1967 | 1967 |
CODEC_ID_WMV1, |
1968 | 1968 |
sizeof(MpegEncContext), |
1969 | 1969 |
ff_msmpeg4_decode_init, |
... | ... |
@@ -384,7 +384,7 @@ static int encode_frame(AVCodecContext *avctx, uint8_t *frame, int buf_size, voi |
384 | 384 |
|
385 | 385 |
AVCodec nellymoser_encoder = { |
386 | 386 |
.name = "nellymoser", |
387 |
- .type = CODEC_TYPE_AUDIO, |
|
387 |
+ .type = AVMEDIA_TYPE_AUDIO, |
|
388 | 388 |
.id = CODEC_ID_NELLYMOSER, |
389 | 389 |
.priv_data_size = sizeof(NellyMoserEncodeContext), |
390 | 390 |
.init = encode_init, |
... | ... |
@@ -423,18 +423,18 @@ static const AVOption options[]={ |
423 | 423 |
|
424 | 424 |
static const AVClass av_codec_context_class = { "AVCodecContext", context_to_name, options }; |
425 | 425 |
|
426 |
-void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type){ |
|
426 |
+void avcodec_get_context_defaults2(AVCodecContext *s, enum AVMediaType codec_type){ |
|
427 | 427 |
int flags=0; |
428 | 428 |
memset(s, 0, sizeof(AVCodecContext)); |
429 | 429 |
|
430 | 430 |
s->av_class= &av_codec_context_class; |
431 | 431 |
|
432 | 432 |
s->codec_type = codec_type; |
433 |
- if(codec_type == CODEC_TYPE_AUDIO) |
|
433 |
+ if(codec_type == AVMEDIA_TYPE_AUDIO) |
|
434 | 434 |
flags= AV_OPT_FLAG_AUDIO_PARAM; |
435 |
- else if(codec_type == CODEC_TYPE_VIDEO) |
|
435 |
+ else if(codec_type == AVMEDIA_TYPE_VIDEO) |
|
436 | 436 |
flags= AV_OPT_FLAG_VIDEO_PARAM; |
437 |
- else if(codec_type == CODEC_TYPE_SUBTITLE) |
|
437 |
+ else if(codec_type == AVMEDIA_TYPE_SUBTITLE) |
|
438 | 438 |
flags= AV_OPT_FLAG_SUBTITLE_PARAM; |
439 | 439 |
av_opt_set_defaults2(s, flags, flags); |
440 | 440 |
|
... | ... |
@@ -453,7 +453,7 @@ void avcodec_get_context_defaults2(AVCodecContext *s, enum CodecType codec_type) |
453 | 453 |
s->reordered_opaque= AV_NOPTS_VALUE; |
454 | 454 |
} |
455 | 455 |
|
456 |
-AVCodecContext *avcodec_alloc_context2(enum CodecType codec_type){ |
|
456 |
+AVCodecContext *avcodec_alloc_context2(enum AVMediaType codec_type){ |
|
457 | 457 |
AVCodecContext *avctx= av_malloc(sizeof(AVCodecContext)); |
458 | 458 |
|
459 | 459 |
if(avctx==NULL) return NULL; |
... | ... |
@@ -464,10 +464,10 @@ AVCodecContext *avcodec_alloc_context2(enum CodecType codec_type){ |
464 | 464 |
} |
465 | 465 |
|
466 | 466 |
void avcodec_get_context_defaults(AVCodecContext *s){ |
467 |
- avcodec_get_context_defaults2(s, CODEC_TYPE_UNKNOWN); |
|
467 |
+ avcodec_get_context_defaults2(s, AVMEDIA_TYPE_UNKNOWN); |
|
468 | 468 |
} |
469 | 469 |
|
470 | 470 |
AVCodecContext *avcodec_alloc_context(void){ |
471 |
- return avcodec_alloc_context2(CODEC_TYPE_UNKNOWN); |
|
471 |
+ return avcodec_alloc_context2(AVMEDIA_TYPE_UNKNOWN); |
|
472 | 472 |
} |
473 | 473 |
|
... | ... |
@@ -516,7 +516,7 @@ static int pcm_decode_frame(AVCodecContext *avctx, |
516 | 516 |
#define PCM_ENCODER(id,sample_fmt_,name,long_name_) \ |
517 | 517 |
AVCodec name ## _encoder = { \ |
518 | 518 |
#name, \ |
519 |
- CODEC_TYPE_AUDIO, \ |
|
519 |
+ AVMEDIA_TYPE_AUDIO, \ |
|
520 | 520 |
id, \ |
521 | 521 |
0, \ |
522 | 522 |
pcm_encode_init, \ |
... | ... |
@@ -534,7 +534,7 @@ AVCodec name ## _encoder = { \ |
534 | 534 |
#define PCM_DECODER(id,sample_fmt_,name,long_name_) \ |
535 | 535 |
AVCodec name ## _decoder = { \ |
536 | 536 |
#name, \ |
537 |
- CODEC_TYPE_AUDIO, \ |
|
537 |
+ AVMEDIA_TYPE_AUDIO, \ |
|
538 | 538 |
id, \ |
539 | 539 |
sizeof(PCMDecode), \ |
540 | 540 |
pcm_decode_init, \ |
... | ... |
@@ -454,7 +454,7 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, |
454 | 454 |
|
455 | 455 |
AVCodec pgssub_decoder = { |
456 | 456 |
"pgssub", |
457 |
- CODEC_TYPE_SUBTITLE, |
|
457 |
+ AVMEDIA_TYPE_SUBTITLE, |
|
458 | 458 |
CODEC_ID_HDMV_PGS_SUBTITLE, |
459 | 459 |
sizeof(PGSSubContext), |
460 | 460 |
init_decoder, |
... | ... |
@@ -190,7 +190,7 @@ static int pnm_decode_frame(AVCodecContext *avctx, void *data, |
190 | 190 |
#if CONFIG_PGM_DECODER |
191 | 191 |
AVCodec pgm_decoder = { |
192 | 192 |
"pgm", |
193 |
- CODEC_TYPE_VIDEO, |
|
193 |
+ AVMEDIA_TYPE_VIDEO, |
|
194 | 194 |
CODEC_ID_PGM, |
195 | 195 |
sizeof(PNMContext), |
196 | 196 |
ff_pnm_init, |
... | ... |
@@ -206,7 +206,7 @@ AVCodec pgm_decoder = { |
206 | 206 |
#if CONFIG_PGMYUV_DECODER |
207 | 207 |
AVCodec pgmyuv_decoder = { |
208 | 208 |
"pgmyuv", |
209 |
- CODEC_TYPE_VIDEO, |
|
209 |
+ AVMEDIA_TYPE_VIDEO, |
|
210 | 210 |
CODEC_ID_PGMYUV, |
211 | 211 |
sizeof(PNMContext), |
212 | 212 |
ff_pnm_init, |
... | ... |
@@ -222,7 +222,7 @@ AVCodec pgmyuv_decoder = { |
222 | 222 |
#if CONFIG_PPM_DECODER |
223 | 223 |
AVCodec ppm_decoder = { |
224 | 224 |
"ppm", |
225 |
- CODEC_TYPE_VIDEO, |
|
225 |
+ AVMEDIA_TYPE_VIDEO, |
|
226 | 226 |
CODEC_ID_PPM, |
227 | 227 |
sizeof(PNMContext), |
228 | 228 |
ff_pnm_init, |
... | ... |
@@ -238,7 +238,7 @@ AVCodec ppm_decoder = { |
238 | 238 |
#if CONFIG_PBM_DECODER |
239 | 239 |
AVCodec pbm_decoder = { |
240 | 240 |
"pbm", |
241 |
- CODEC_TYPE_VIDEO, |
|
241 |
+ AVMEDIA_TYPE_VIDEO, |
|
242 | 242 |
CODEC_ID_PBM, |
243 | 243 |
sizeof(PNMContext), |
244 | 244 |
ff_pnm_init, |
... | ... |
@@ -254,7 +254,7 @@ AVCodec pbm_decoder = { |
254 | 254 |
#if CONFIG_PAM_DECODER |
255 | 255 |
AVCodec pam_decoder = { |
256 | 256 |
"pam", |
257 |
- CODEC_TYPE_VIDEO, |
|
257 |
+ AVMEDIA_TYPE_VIDEO, |
|
258 | 258 |
CODEC_ID_PAM, |
259 | 259 |
sizeof(PNMContext), |
260 | 260 |
ff_pnm_init, |
... | ... |
@@ -115,7 +115,7 @@ static int pnm_encode_frame(AVCodecContext *avctx, unsigned char *outbuf, |
115 | 115 |
#if CONFIG_PGM_ENCODER |
116 | 116 |
AVCodec pgm_encoder = { |
117 | 117 |
"pgm", |
118 |
- CODEC_TYPE_VIDEO, |
|
118 |
+ AVMEDIA_TYPE_VIDEO, |
|
119 | 119 |
CODEC_ID_PGM, |
120 | 120 |
sizeof(PNMContext), |
121 | 121 |
ff_pnm_init, |
... | ... |
@@ -128,7 +128,7 @@ AVCodec pgm_encoder = { |
128 | 128 |
#if CONFIG_PGMYUV_ENCODER |
129 | 129 |
AVCodec pgmyuv_encoder = { |
130 | 130 |
"pgmyuv", |
131 |
- CODEC_TYPE_VIDEO, |
|
131 |
+ AVMEDIA_TYPE_VIDEO, |
|
132 | 132 |
CODEC_ID_PGMYUV, |
133 | 133 |
sizeof(PNMContext), |
134 | 134 |
ff_pnm_init, |
... | ... |
@@ -141,7 +141,7 @@ AVCodec pgmyuv_encoder = { |
141 | 141 |
#if CONFIG_PPM_ENCODER |
142 | 142 |
AVCodec ppm_encoder = { |
143 | 143 |
"ppm", |
144 |
- CODEC_TYPE_VIDEO, |
|
144 |
+ AVMEDIA_TYPE_VIDEO, |
|
145 | 145 |
CODEC_ID_PPM, |
146 | 146 |
sizeof(PNMContext), |
147 | 147 |
ff_pnm_init, |
... | ... |
@@ -154,7 +154,7 @@ AVCodec ppm_encoder = { |
154 | 154 |
#if CONFIG_PBM_ENCODER |
155 | 155 |
AVCodec pbm_encoder = { |
156 | 156 |
"pbm", |
157 |
- CODEC_TYPE_VIDEO, |
|
157 |
+ AVMEDIA_TYPE_VIDEO, |
|
158 | 158 |
CODEC_ID_PBM, |
159 | 159 |
sizeof(PNMContext), |
160 | 160 |
ff_pnm_init, |
... | ... |
@@ -1974,7 +1974,7 @@ static int qdm2_decode_frame(AVCodecContext *avctx, |
1974 | 1974 |
AVCodec qdm2_decoder = |
1975 | 1975 |
{ |
1976 | 1976 |
.name = "qdm2", |
1977 |
- .type = CODEC_TYPE_AUDIO, |
|
1977 |
+ .type = AVMEDIA_TYPE_AUDIO, |
|
1978 | 1978 |
.id = CODEC_ID_QDM2, |
1979 | 1979 |
.priv_data_size = sizeof(QDM2Context), |
1980 | 1980 |
.init = qdm2_decode_init, |
... | ... |
@@ -708,7 +708,7 @@ static int rv10_decode_frame(AVCodecContext *avctx, |
708 | 708 |
|
709 | 709 |
AVCodec rv10_decoder = { |
710 | 710 |
"rv10", |
711 |
- CODEC_TYPE_VIDEO, |
|
711 |
+ AVMEDIA_TYPE_VIDEO, |
|
712 | 712 |
CODEC_ID_RV10, |
713 | 713 |
sizeof(MpegEncContext), |
714 | 714 |
rv10_decode_init, |
... | ... |
@@ -722,7 +722,7 @@ AVCodec rv10_decoder = { |
722 | 722 |
|
723 | 723 |
AVCodec rv20_decoder = { |
724 | 724 |
"rv20", |
725 |
- CODEC_TYPE_VIDEO, |
|
725 |
+ AVMEDIA_TYPE_VIDEO, |
|
726 | 726 |
CODEC_ID_RV20, |
727 | 727 |
sizeof(MpegEncContext), |
728 | 728 |
rv10_decode_init, |
... | ... |
@@ -691,7 +691,7 @@ static int smka_decode_frame(AVCodecContext *avctx, void *data, int *data_size, |
691 | 691 |
|
692 | 692 |
AVCodec smacker_decoder = { |
693 | 693 |
"smackvid", |
694 |
- CODEC_TYPE_VIDEO, |
|
694 |
+ AVMEDIA_TYPE_VIDEO, |
|
695 | 695 |
CODEC_ID_SMACKVIDEO, |
696 | 696 |
sizeof(SmackVContext), |
697 | 697 |
decode_init, |
... | ... |
@@ -704,7 +704,7 @@ AVCodec smacker_decoder = { |
704 | 704 |
|
705 | 705 |
AVCodec smackaud_decoder = { |
706 | 706 |
"smackaud", |
707 |
- CODEC_TYPE_AUDIO, |
|
707 |
+ AVMEDIA_TYPE_AUDIO, |
|
708 | 708 |
CODEC_ID_SMACKAUDIO, |
709 | 709 |
0, |
710 | 710 |
smka_decode_init, |
... | ... |
@@ -2237,7 +2237,7 @@ static av_cold int decode_end(AVCodecContext *avctx) |
2237 | 2237 |
|
2238 | 2238 |
AVCodec snow_decoder = { |
2239 | 2239 |
"snow", |
2240 |
- CODEC_TYPE_VIDEO, |
|
2240 |
+ AVMEDIA_TYPE_VIDEO, |
|
2241 | 2241 |
CODEC_ID_SNOW, |
2242 | 2242 |
sizeof(SnowContext), |
2243 | 2243 |
decode_init, |
... | ... |
@@ -3988,7 +3988,7 @@ static av_cold int encode_end(AVCodecContext *avctx) |
3988 | 3988 |
|
3989 | 3989 |
AVCodec snow_encoder = { |
3990 | 3990 |
"snow", |
3991 |
- CODEC_TYPE_VIDEO, |
|
3991 |
+ AVMEDIA_TYPE_VIDEO, |
|
3992 | 3992 |
CODEC_ID_SNOW, |
3993 | 3993 |
sizeof(SnowContext), |
3994 | 3994 |
encode_init, |
... | ... |
@@ -937,7 +937,7 @@ static int sonic_decode_frame(AVCodecContext *avctx, |
937 | 937 |
|
938 | 938 |
AVCodec sonic_decoder = { |
939 | 939 |
"sonic", |
940 |
- CODEC_TYPE_AUDIO, |
|
940 |
+ AVMEDIA_TYPE_AUDIO, |
|
941 | 941 |
CODEC_ID_SONIC, |
942 | 942 |
sizeof(SonicContext), |
943 | 943 |
sonic_decode_init, |
... | ... |
@@ -951,7 +951,7 @@ AVCodec sonic_decoder = { |
951 | 951 |
#if CONFIG_SONIC_ENCODER |
952 | 952 |
AVCodec sonic_encoder = { |
953 | 953 |
"sonic", |
954 |
- CODEC_TYPE_AUDIO, |
|
954 |
+ AVMEDIA_TYPE_AUDIO, |
|
955 | 955 |
CODEC_ID_SONIC, |
956 | 956 |
sizeof(SonicContext), |
957 | 957 |
sonic_encode_init, |
... | ... |
@@ -965,7 +965,7 @@ AVCodec sonic_encoder = { |
965 | 965 |
#if CONFIG_SONIC_LS_ENCODER |
966 | 966 |
AVCodec sonic_ls_encoder = { |
967 | 967 |
"sonicls", |
968 |
- CODEC_TYPE_AUDIO, |
|
968 |
+ AVMEDIA_TYPE_AUDIO, |
|
969 | 969 |
CODEC_ID_SONIC_LS, |
970 | 970 |
sizeof(SonicContext), |
971 | 971 |
sonic_encode_init, |
... | ... |
@@ -195,7 +195,7 @@ static int sp5x_decode_frame(AVCodecContext *avctx, |
195 | 195 |
|
196 | 196 |
AVCodec sp5x_decoder = { |
197 | 197 |
"sp5x", |
198 |
- CODEC_TYPE_VIDEO, |
|
198 |
+ AVMEDIA_TYPE_VIDEO, |
|
199 | 199 |
CODEC_ID_SP5X, |
200 | 200 |
sizeof(MJpegDecodeContext), |
201 | 201 |
ff_mjpeg_decode_init, |
... | ... |
@@ -209,7 +209,7 @@ AVCodec sp5x_decoder = { |
209 | 209 |
|
210 | 210 |
AVCodec amv_decoder = { |
211 | 211 |
"amv", |
212 |
- CODEC_TYPE_VIDEO, |
|
212 |
+ AVMEDIA_TYPE_VIDEO, |
|
213 | 213 |
CODEC_ID_AMV, |
214 | 214 |
sizeof(MJpegDecodeContext), |
215 | 215 |
ff_mjpeg_decode_init, |
... | ... |
@@ -153,7 +153,7 @@ static av_cold int targa_encode_init(AVCodecContext *avctx) |
153 | 153 |
|
154 | 154 |
AVCodec targa_encoder = { |
155 | 155 |
.name = "targa", |
156 |
- .type = CODEC_TYPE_VIDEO, |
|
156 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
157 | 157 |
.id = CODEC_ID_TARGA, |
158 | 158 |
.priv_data_size = sizeof(TargaContext), |
159 | 159 |
.init = targa_encode_init, |
... | ... |
@@ -221,7 +221,7 @@ static av_cold int seqvideo_decode_end(AVCodecContext *avctx) |
221 | 221 |
|
222 | 222 |
AVCodec tiertexseqvideo_decoder = { |
223 | 223 |
"tiertexseqvideo", |
224 |
- CODEC_TYPE_VIDEO, |
|
224 |
+ AVMEDIA_TYPE_VIDEO, |
|
225 | 225 |
CODEC_ID_TIERTEXSEQVIDEO, |
226 | 226 |
sizeof(SeqVideoContext), |
227 | 227 |
seqvideo_decode_init, |
... | ... |
@@ -100,7 +100,7 @@ static av_cold int tmv_decode_close(AVCodecContext *avctx) |
100 | 100 |
|
101 | 101 |
AVCodec tmv_decoder = { |
102 | 102 |
.name = "tmv", |
103 |
- .type = CODEC_TYPE_VIDEO, |
|
103 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
104 | 104 |
.id = CODEC_ID_TMV, |
105 | 105 |
.priv_data_size = sizeof(TMVContext), |
106 | 106 |
.close = tmv_decode_close, |
... | ... |
@@ -892,7 +892,7 @@ static av_cold int truemotion1_decode_end(AVCodecContext *avctx) |
892 | 892 |
|
893 | 893 |
AVCodec truemotion1_decoder = { |
894 | 894 |
"truemotion1", |
895 |
- CODEC_TYPE_VIDEO, |
|
895 |
+ AVMEDIA_TYPE_VIDEO, |
|
896 | 896 |
CODEC_ID_TRUEMOTION1, |
897 | 897 |
sizeof(TrueMotion1Context), |
898 | 898 |
truemotion1_decode_init, |
... | ... |
@@ -497,7 +497,7 @@ int attribute_align_arg avcodec_open(AVCodecContext *avctx, AVCodec *codec) |
497 | 497 |
} |
498 | 498 |
|
499 | 499 |
avctx->codec = codec; |
500 |
- if ((avctx->codec_type == CODEC_TYPE_UNKNOWN || avctx->codec_type == codec->type) && |
|
500 |
+ if ((avctx->codec_type == AVMEDIA_TYPE_UNKNOWN || avctx->codec_type == codec->type) && |
|
501 | 501 |
avctx->codec_id == CODEC_ID_NONE) { |
502 | 502 |
avctx->codec_type = codec->type; |
503 | 503 |
avctx->codec_id = codec->id; |
... | ... |
@@ -775,20 +775,20 @@ static int get_bit_rate(AVCodecContext *ctx) |
775 | 775 |
int bits_per_sample; |
776 | 776 |
|
777 | 777 |
switch(ctx->codec_type) { |
778 |
- case CODEC_TYPE_VIDEO: |
|
778 |
+ case AVMEDIA_TYPE_VIDEO: |
|
779 | 779 |
bit_rate = ctx->bit_rate; |
780 | 780 |
break; |
781 |
- case CODEC_TYPE_AUDIO: |
|
781 |
+ case AVMEDIA_TYPE_AUDIO: |
|
782 | 782 |
bits_per_sample = av_get_bits_per_sample(ctx->codec_id); |
783 | 783 |
bit_rate = bits_per_sample ? ctx->sample_rate * ctx->channels * bits_per_sample : ctx->bit_rate; |
784 | 784 |
break; |
785 |
- case CODEC_TYPE_DATA: |
|
785 |
+ case AVMEDIA_TYPE_DATA: |
|
786 | 786 |
bit_rate = ctx->bit_rate; |
787 | 787 |
break; |
788 |
- case CODEC_TYPE_SUBTITLE: |
|
788 |
+ case AVMEDIA_TYPE_SUBTITLE: |
|
789 | 789 |
bit_rate = ctx->bit_rate; |
790 | 790 |
break; |
791 |
- case CODEC_TYPE_ATTACHMENT: |
|
791 |
+ case AVMEDIA_TYPE_ATTACHMENT: |
|
792 | 792 |
bit_rate = ctx->bit_rate; |
793 | 793 |
break; |
794 | 794 |
default: |
... | ... |
@@ -836,7 +836,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) |
836 | 836 |
} |
837 | 837 |
|
838 | 838 |
switch(enc->codec_type) { |
839 |
- case CODEC_TYPE_VIDEO: |
|
839 |
+ case AVMEDIA_TYPE_VIDEO: |
|
840 | 840 |
snprintf(buf, buf_size, |
841 | 841 |
"Video: %s%s", |
842 | 842 |
codec_name, enc->mb_decision ? " (hq)" : ""); |
... | ... |
@@ -871,7 +871,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) |
871 | 871 |
", q=%d-%d", enc->qmin, enc->qmax); |
872 | 872 |
} |
873 | 873 |
break; |
874 |
- case CODEC_TYPE_AUDIO: |
|
874 |
+ case AVMEDIA_TYPE_AUDIO: |
|
875 | 875 |
snprintf(buf, buf_size, |
876 | 876 |
"Audio: %s", |
877 | 877 |
codec_name); |
... | ... |
@@ -886,13 +886,13 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) |
886 | 886 |
", %s", avcodec_get_sample_fmt_name(enc->sample_fmt)); |
887 | 887 |
} |
888 | 888 |
break; |
889 |
- case CODEC_TYPE_DATA: |
|
889 |
+ case AVMEDIA_TYPE_DATA: |
|
890 | 890 |
snprintf(buf, buf_size, "Data: %s", codec_name); |
891 | 891 |
break; |
892 |
- case CODEC_TYPE_SUBTITLE: |
|
892 |
+ case AVMEDIA_TYPE_SUBTITLE: |
|
893 | 893 |
snprintf(buf, buf_size, "Subtitle: %s", codec_name); |
894 | 894 |
break; |
895 |
- case CODEC_TYPE_ATTACHMENT: |
|
895 |
+ case AVMEDIA_TYPE_ATTACHMENT: |
|
896 | 896 |
snprintf(buf, buf_size, "Attachment: %s", codec_name); |
897 | 897 |
break; |
898 | 898 |
default: |
... | ... |
@@ -336,7 +336,7 @@ static int decode_slice(AVCodecContext *avctx, |
336 | 336 |
|
337 | 337 |
AVHWAccel h264_vaapi_hwaccel = { |
338 | 338 |
.name = "h264_vaapi", |
339 |
- .type = CODEC_TYPE_VIDEO, |
|
339 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
340 | 340 |
.id = CODEC_ID_H264, |
341 | 341 |
.pix_fmt = PIX_FMT_VAAPI_VLD, |
342 | 342 |
.capabilities = 0, |
... | ... |
@@ -140,7 +140,7 @@ static int vaapi_mpeg2_decode_slice(AVCodecContext *avctx, const uint8_t *buffer |
140 | 140 |
|
141 | 141 |
AVHWAccel mpeg2_vaapi_hwaccel = { |
142 | 142 |
.name = "mpeg2_vaapi", |
143 |
- .type = CODEC_TYPE_VIDEO, |
|
143 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
144 | 144 |
.id = CODEC_ID_MPEG2VIDEO, |
145 | 145 |
.pix_fmt = PIX_FMT_VAAPI_VLD, |
146 | 146 |
.capabilities = 0, |
... | ... |
@@ -151,7 +151,7 @@ static int vaapi_mpeg4_decode_slice(AVCodecContext *avctx, const uint8_t *buffer |
151 | 151 |
#if CONFIG_MPEG4_VAAPI_HWACCEL |
152 | 152 |
AVHWAccel mpeg4_vaapi_hwaccel = { |
153 | 153 |
.name = "mpeg4_vaapi", |
154 |
- .type = CODEC_TYPE_VIDEO, |
|
154 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
155 | 155 |
.id = CODEC_ID_MPEG4, |
156 | 156 |
.pix_fmt = PIX_FMT_VAAPI_VLD, |
157 | 157 |
.capabilities = 0, |
... | ... |
@@ -165,7 +165,7 @@ AVHWAccel mpeg4_vaapi_hwaccel = { |
165 | 165 |
#if CONFIG_H263_VAAPI_HWACCEL |
166 | 166 |
AVHWAccel h263_vaapi_hwaccel = { |
167 | 167 |
.name = "h263_vaapi", |
168 |
- .type = CODEC_TYPE_VIDEO, |
|
168 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
169 | 169 |
.id = CODEC_ID_H263, |
170 | 170 |
.pix_fmt = PIX_FMT_VAAPI_VLD, |
171 | 171 |
.capabilities = 0, |
... | ... |
@@ -328,7 +328,7 @@ static int vaapi_vc1_decode_slice(AVCodecContext *avctx, const uint8_t *buffer, |
328 | 328 |
#if CONFIG_WMV3_VAAPI_HWACCEL |
329 | 329 |
AVHWAccel wmv3_vaapi_hwaccel = { |
330 | 330 |
.name = "wmv3_vaapi", |
331 |
- .type = CODEC_TYPE_VIDEO, |
|
331 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
332 | 332 |
.id = CODEC_ID_WMV3, |
333 | 333 |
.pix_fmt = PIX_FMT_VAAPI_VLD, |
334 | 334 |
.capabilities = 0, |
... | ... |
@@ -341,7 +341,7 @@ AVHWAccel wmv3_vaapi_hwaccel = { |
341 | 341 |
|
342 | 342 |
AVHWAccel vc1_vaapi_hwaccel = { |
343 | 343 |
.name = "vc1_vaapi", |
344 |
- .type = CODEC_TYPE_VIDEO, |
|
344 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
345 | 345 |
.id = CODEC_ID_VC1, |
346 | 346 |
.pix_fmt = PIX_FMT_VAAPI_VLD, |
347 | 347 |
.capabilities = 0, |
... | ... |
@@ -3319,7 +3319,7 @@ static av_cold int vc1_decode_end(AVCodecContext *avctx) |
3319 | 3319 |
|
3320 | 3320 |
AVCodec vc1_decoder = { |
3321 | 3321 |
"vc1", |
3322 |
- CODEC_TYPE_VIDEO, |
|
3322 |
+ AVMEDIA_TYPE_VIDEO, |
|
3323 | 3323 |
CODEC_ID_VC1, |
3324 | 3324 |
sizeof(VC1Context), |
3325 | 3325 |
vc1_decode_init, |
... | ... |
@@ -3335,7 +3335,7 @@ AVCodec vc1_decoder = { |
3335 | 3335 |
#if CONFIG_WMV3_DECODER |
3336 | 3336 |
AVCodec wmv3_decoder = { |
3337 | 3337 |
"wmv3", |
3338 |
- CODEC_TYPE_VIDEO, |
|
3338 |
+ AVMEDIA_TYPE_VIDEO, |
|
3339 | 3339 |
CODEC_ID_WMV3, |
3340 | 3340 |
sizeof(VC1Context), |
3341 | 3341 |
vc1_decode_init, |
... | ... |
@@ -3352,7 +3352,7 @@ AVCodec wmv3_decoder = { |
3352 | 3352 |
#if CONFIG_WMV3_VDPAU_DECODER |
3353 | 3353 |
AVCodec wmv3_vdpau_decoder = { |
3354 | 3354 |
"wmv3_vdpau", |
3355 |
- CODEC_TYPE_VIDEO, |
|
3355 |
+ AVMEDIA_TYPE_VIDEO, |
|
3356 | 3356 |
CODEC_ID_WMV3, |
3357 | 3357 |
sizeof(VC1Context), |
3358 | 3358 |
vc1_decode_init, |
... | ... |
@@ -3369,7 +3369,7 @@ AVCodec wmv3_vdpau_decoder = { |
3369 | 3369 |
#if CONFIG_VC1_VDPAU_DECODER |
3370 | 3370 |
AVCodec vc1_vdpau_decoder = { |
3371 | 3371 |
"vc1_vdpau", |
3372 |
- CODEC_TYPE_VIDEO, |
|
3372 |
+ AVMEDIA_TYPE_VIDEO, |
|
3373 | 3373 |
CODEC_ID_VC1, |
3374 | 3374 |
sizeof(VC1Context), |
3375 | 3375 |
vc1_decode_init, |
... | ... |
@@ -178,7 +178,7 @@ static av_cold int encode_init(AVCodecContext *avctx){ |
178 | 178 |
|
179 | 179 |
AVCodec vcr1_decoder = { |
180 | 180 |
"vcr1", |
181 |
- CODEC_TYPE_VIDEO, |
|
181 |
+ AVMEDIA_TYPE_VIDEO, |
|
182 | 182 |
CODEC_ID_VCR1, |
183 | 183 |
sizeof(VCR1Context), |
184 | 184 |
decode_init, |
... | ... |
@@ -192,7 +192,7 @@ AVCodec vcr1_decoder = { |
192 | 192 |
#if CONFIG_VCR1_ENCODER |
193 | 193 |
AVCodec vcr1_encoder = { |
194 | 194 |
"vcr1", |
195 |
- CODEC_TYPE_VIDEO, |
|
195 |
+ AVMEDIA_TYPE_VIDEO, |
|
196 | 196 |
CODEC_ID_VCR1, |
197 | 197 |
sizeof(VCR1Context), |
198 | 198 |
encode_init, |
... | ... |
@@ -567,7 +567,7 @@ static int vmdaudio_decode_frame(AVCodecContext *avctx, |
567 | 567 |
|
568 | 568 |
AVCodec vmdvideo_decoder = { |
569 | 569 |
"vmdvideo", |
570 |
- CODEC_TYPE_VIDEO, |
|
570 |
+ AVMEDIA_TYPE_VIDEO, |
|
571 | 571 |
CODEC_ID_VMDVIDEO, |
572 | 572 |
sizeof(VmdVideoContext), |
573 | 573 |
vmdvideo_decode_init, |
... | ... |
@@ -580,7 +580,7 @@ AVCodec vmdvideo_decoder = { |
580 | 580 |
|
581 | 581 |
AVCodec vmdaudio_decoder = { |
582 | 582 |
"vmdaudio", |
583 |
- CODEC_TYPE_AUDIO, |
|
583 |
+ AVMEDIA_TYPE_AUDIO, |
|
584 | 584 |
CODEC_ID_VMDAUDIO, |
585 | 585 |
sizeof(VmdAudioContext), |
586 | 586 |
vmdaudio_decode_init, |
... | ... |
@@ -1645,7 +1645,7 @@ static av_cold int vorbis_decode_close(AVCodecContext *avccontext) |
1645 | 1645 |
|
1646 | 1646 |
AVCodec vorbis_decoder = { |
1647 | 1647 |
"vorbis", |
1648 |
- CODEC_TYPE_AUDIO, |
|
1648 |
+ AVMEDIA_TYPE_AUDIO, |
|
1649 | 1649 |
CODEC_ID_VORBIS, |
1650 | 1650 |
sizeof(vorbis_context), |
1651 | 1651 |
vorbis_decode_init, |
... | ... |
@@ -1093,7 +1093,7 @@ static av_cold int vorbis_encode_close(AVCodecContext *avccontext) |
1093 | 1093 |
|
1094 | 1094 |
AVCodec vorbis_encoder = { |
1095 | 1095 |
"vorbis", |
1096 |
- CODEC_TYPE_AUDIO, |
|
1096 |
+ AVMEDIA_TYPE_AUDIO, |
|
1097 | 1097 |
CODEC_ID_VORBIS, |
1098 | 1098 |
sizeof(vorbis_enc_context), |
1099 | 1099 |
vorbis_encode_init, |
... | ... |
@@ -2191,7 +2191,7 @@ static av_cold int theora_decode_init(AVCodecContext *avctx) |
2191 | 2191 |
|
2192 | 2192 |
AVCodec theora_decoder = { |
2193 | 2193 |
"theora", |
2194 |
- CODEC_TYPE_VIDEO, |
|
2194 |
+ AVMEDIA_TYPE_VIDEO, |
|
2195 | 2195 |
CODEC_ID_THEORA, |
2196 | 2196 |
sizeof(Vp3DecodeContext), |
2197 | 2197 |
theora_decode_init, |
... | ... |
@@ -2206,7 +2206,7 @@ AVCodec theora_decoder = { |
2206 | 2206 |
|
2207 | 2207 |
AVCodec vp3_decoder = { |
2208 | 2208 |
"vp3", |
2209 |
- CODEC_TYPE_VIDEO, |
|
2209 |
+ AVMEDIA_TYPE_VIDEO, |
|
2210 | 2210 |
CODEC_ID_VP3, |
2211 | 2211 |
sizeof(Vp3DecodeContext), |
2212 | 2212 |
vp3_decode_init, |
... | ... |
@@ -621,7 +621,7 @@ static av_cold int vp6_decode_free(AVCodecContext *avctx) |
621 | 621 |
|
622 | 622 |
AVCodec vp6_decoder = { |
623 | 623 |
"vp6", |
624 |
- CODEC_TYPE_VIDEO, |
|
624 |
+ AVMEDIA_TYPE_VIDEO, |
|
625 | 625 |
CODEC_ID_VP6, |
626 | 626 |
sizeof(VP56Context), |
627 | 627 |
vp6_decode_init, |
... | ... |
@@ -635,7 +635,7 @@ AVCodec vp6_decoder = { |
635 | 635 |
/* flash version, not flipped upside-down */ |
636 | 636 |
AVCodec vp6f_decoder = { |
637 | 637 |
"vp6f", |
638 |
- CODEC_TYPE_VIDEO, |
|
638 |
+ AVMEDIA_TYPE_VIDEO, |
|
639 | 639 |
CODEC_ID_VP6F, |
640 | 640 |
sizeof(VP56Context), |
641 | 641 |
vp6_decode_init, |
... | ... |
@@ -649,7 +649,7 @@ AVCodec vp6f_decoder = { |
649 | 649 |
/* flash version, not flipped upside-down, with alpha channel */ |
650 | 650 |
AVCodec vp6a_decoder = { |
651 | 651 |
"vp6a", |
652 |
- CODEC_TYPE_VIDEO, |
|
652 |
+ AVMEDIA_TYPE_VIDEO, |
|
653 | 653 |
CODEC_ID_VP6A, |
654 | 654 |
sizeof(VP56Context), |
655 | 655 |
vp6_decode_init, |
... | ... |
@@ -942,7 +942,7 @@ static av_cold void flush(AVCodecContext *avctx) |
942 | 942 |
AVCodec wmav1_decoder = |
943 | 943 |
{ |
944 | 944 |
"wmav1", |
945 |
- CODEC_TYPE_AUDIO, |
|
945 |
+ AVMEDIA_TYPE_AUDIO, |
|
946 | 946 |
CODEC_ID_WMAV1, |
947 | 947 |
sizeof(WMACodecContext), |
948 | 948 |
wma_decode_init, |
... | ... |
@@ -956,7 +956,7 @@ AVCodec wmav1_decoder = |
956 | 956 |
AVCodec wmav2_decoder = |
957 | 957 |
{ |
958 | 958 |
"wmav2", |
959 |
- CODEC_TYPE_AUDIO, |
|
959 |
+ AVMEDIA_TYPE_AUDIO, |
|
960 | 960 |
CODEC_ID_WMAV2, |
961 | 961 |
sizeof(WMACodecContext), |
962 | 962 |
wma_decode_init, |
... | ... |
@@ -386,7 +386,7 @@ static int encode_superframe(AVCodecContext *avctx, |
386 | 386 |
AVCodec wmav1_encoder = |
387 | 387 |
{ |
388 | 388 |
"wmav1", |
389 |
- CODEC_TYPE_AUDIO, |
|
389 |
+ AVMEDIA_TYPE_AUDIO, |
|
390 | 390 |
CODEC_ID_WMAV1, |
391 | 391 |
sizeof(WMACodecContext), |
392 | 392 |
encode_init, |
... | ... |
@@ -399,7 +399,7 @@ AVCodec wmav1_encoder = |
399 | 399 |
AVCodec wmav2_encoder = |
400 | 400 |
{ |
401 | 401 |
"wmav2", |
402 |
- CODEC_TYPE_AUDIO, |
|
402 |
+ AVMEDIA_TYPE_AUDIO, |
|
403 | 403 |
CODEC_ID_WMAV2, |
404 | 404 |
sizeof(WMACodecContext), |
405 | 405 |
encode_init, |
... | ... |
@@ -1555,7 +1555,7 @@ static av_cold void wmavoice_flush(AVCodecContext *ctx) |
1555 | 1555 |
|
1556 | 1556 |
AVCodec wmavoice_decoder = { |
1557 | 1557 |
"wmavoice", |
1558 |
- CODEC_TYPE_AUDIO, |
|
1558 |
+ AVMEDIA_TYPE_AUDIO, |
|
1559 | 1559 |
CODEC_ID_WMAVOICE, |
1560 | 1560 |
sizeof(WMAVoiceContext), |
1561 | 1561 |
wmavoice_decode_init, |
... | ... |
@@ -417,7 +417,7 @@ static av_cold int xan_decode_end(AVCodecContext *avctx) |
417 | 417 |
|
418 | 418 |
AVCodec xan_wc3_decoder = { |
419 | 419 |
"xan_wc3", |
420 |
- CODEC_TYPE_VIDEO, |
|
420 |
+ AVMEDIA_TYPE_VIDEO, |
|
421 | 421 |
CODEC_ID_XAN_WC3, |
422 | 422 |
sizeof(XanContext), |
423 | 423 |
xan_decode_init, |
... | ... |
@@ -431,7 +431,7 @@ AVCodec xan_wc3_decoder = { |
431 | 431 |
/* |
432 | 432 |
AVCodec xan_wc4_decoder = { |
433 | 433 |
"xan_wc4", |
434 |
- CODEC_TYPE_VIDEO, |
|
434 |
+ AVMEDIA_TYPE_VIDEO, |
|
435 | 435 |
CODEC_ID_XAN_WC4, |
436 | 436 |
sizeof(XanContext), |
437 | 437 |
xan_decode_init, |
... | ... |
@@ -111,7 +111,7 @@ static av_cold int audio_read_header(AVFormatContext *s1, |
111 | 111 |
} |
112 | 112 |
|
113 | 113 |
/* take real parameters */ |
114 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
114 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
115 | 115 |
st->codec->codec_id = codec_id; |
116 | 116 |
st->codec->sample_rate = sample_rate; |
117 | 117 |
st->codec->channels = ap->channels; |
... | ... |
@@ -269,7 +269,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) |
269 | 269 |
s->frame_rate_base = frame_rate_base; |
270 | 270 |
s->per_frame = ((uint64_t)1000000 * s->frame_rate_base) / s->frame_rate; |
271 | 271 |
|
272 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
272 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
273 | 273 |
st->codec->pix_fmt = PIX_FMT_YUV420P; |
274 | 274 |
st->codec->codec_id = CODEC_ID_RAWVIDEO; |
275 | 275 |
st->codec->width = width; |
... | ... |
@@ -237,7 +237,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param |
237 | 237 |
return AVERROR(ENOMEM); |
238 | 238 |
} |
239 | 239 |
|
240 |
- stream->codec->codec_type = CODEC_TYPE_AUDIO; |
|
240 |
+ stream->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
241 | 241 |
#if HAVE_BIGENDIAN |
242 | 242 |
stream->codec->codec_id = CODEC_ID_PCM_F32BE; |
243 | 243 |
#else |
... | ... |
@@ -117,7 +117,7 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap, |
117 | 117 |
if (!vst) |
118 | 118 |
goto out; |
119 | 119 |
av_set_pts_info(vst, 64, 1, 1000); |
120 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
120 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
121 | 121 |
vst->codec->codec_id = CODEC_ID_RAWVIDEO; |
122 | 122 |
vst->codec->time_base.den = fps->frame_rate; |
123 | 123 |
vst->codec->time_base.num = 1000; |
... | ... |
@@ -232,7 +232,7 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap) |
232 | 232 |
} |
233 | 233 |
|
234 | 234 |
/* take real parameters */ |
235 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
235 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
236 | 236 |
st->codec->codec_id = s->codec_id; |
237 | 237 |
st->codec->sample_rate = s->sample_rate; |
238 | 238 |
st->codec->channels = s->channels; |
... | ... |
@@ -242,7 +242,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) |
242 | 242 |
|
243 | 243 |
s->fd = video_fd; |
244 | 244 |
|
245 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
245 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
246 | 246 |
st->codec->codec_id = CODEC_ID_RAWVIDEO; |
247 | 247 |
st->codec->width = s->video_win.width; |
248 | 248 |
st->codec->height = s->video_win.height; |
... | ... |
@@ -646,7 +646,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap) |
646 | 646 |
} |
647 | 647 |
s->top_field_first = first_field(s->fd); |
648 | 648 |
|
649 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
649 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
650 | 650 |
st->codec->codec_id = codec_id; |
651 | 651 |
st->codec->width = width; |
652 | 652 |
st->codec->height = height; |
... | ... |
@@ -353,7 +353,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap) |
353 | 353 |
|
354 | 354 |
codec = st->codec; |
355 | 355 |
codec->time_base = ap->time_base; |
356 |
- codec->codec_type = CODEC_TYPE_VIDEO; |
|
356 |
+ codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
357 | 357 |
codec->width = width; |
358 | 358 |
codec->height = height; |
359 | 359 |
codec->pix_fmt = vfw_pixfmt(biCompression, biBitCount); |
... | ... |
@@ -226,7 +226,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap) |
226 | 226 |
x11grab->image = image; |
227 | 227 |
x11grab->use_shm = use_shm; |
228 | 228 |
|
229 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
229 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
230 | 230 |
st->codec->codec_id = CODEC_ID_RAWVIDEO; |
231 | 231 |
st->codec->width = ap->width; |
232 | 232 |
st->codec->height = ap->height; |
... | ... |
@@ -280,7 +280,7 @@ struct AVFilterPad |
280 | 280 |
* AVFilterPad type. Only video supported now, hopefully someone will |
281 | 281 |
* add audio in the future. |
282 | 282 |
*/ |
283 |
- enum CodecType type; |
|
283 |
+ enum AVMediaType type; |
|
284 | 284 |
|
285 | 285 |
/** |
286 | 286 |
* Minimum required permissions on incoming buffers. Any buffer with |
... | ... |
@@ -86,7 +86,7 @@ AVFilter avfilter_vf_aspect = { |
86 | 86 |
.priv_size = sizeof(AspectContext), |
87 | 87 |
|
88 | 88 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
89 |
- .type = CODEC_TYPE_VIDEO, |
|
89 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
90 | 90 |
.config_props = frameaspect_config_props, |
91 | 91 |
.get_video_buffer = avfilter_null_get_video_buffer, |
92 | 92 |
.start_frame = start_frame, |
... | ... |
@@ -94,7 +94,7 @@ AVFilter avfilter_vf_aspect = { |
94 | 94 |
{ .name = NULL}}, |
95 | 95 |
|
96 | 96 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
97 |
- .type = CODEC_TYPE_VIDEO, }, |
|
97 |
+ .type = AVMEDIA_TYPE_VIDEO, }, |
|
98 | 98 |
{ .name = NULL}}, |
99 | 99 |
}; |
100 | 100 |
#endif /* CONFIG_ASPECT_FILTER */ |
... | ... |
@@ -109,14 +109,14 @@ AVFilter avfilter_vf_pixelaspect = { |
109 | 109 |
.priv_size = sizeof(AspectContext), |
110 | 110 |
|
111 | 111 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
112 |
- .type = CODEC_TYPE_VIDEO, |
|
112 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
113 | 113 |
.get_video_buffer = avfilter_null_get_video_buffer, |
114 | 114 |
.start_frame = start_frame, |
115 | 115 |
.end_frame = avfilter_null_end_frame }, |
116 | 116 |
{ .name = NULL}}, |
117 | 117 |
|
118 | 118 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
119 |
- .type = CODEC_TYPE_VIDEO, }, |
|
119 |
+ .type = AVMEDIA_TYPE_VIDEO, }, |
|
120 | 120 |
{ .name = NULL}}, |
121 | 121 |
}; |
122 | 122 |
#endif /* CONFIG_PIXELASPECT_FILTER */ |
... | ... |
@@ -214,14 +214,14 @@ AVFilter avfilter_vf_crop = { |
214 | 214 |
.init = init, |
215 | 215 |
|
216 | 216 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
217 |
- .type = CODEC_TYPE_VIDEO, |
|
217 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
218 | 218 |
.start_frame = start_frame, |
219 | 219 |
.draw_slice = draw_slice, |
220 | 220 |
.get_video_buffer = avfilter_null_get_video_buffer, |
221 | 221 |
.config_props = config_input, }, |
222 | 222 |
{ .name = NULL}}, |
223 | 223 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
224 |
- .type = CODEC_TYPE_VIDEO, |
|
224 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
225 | 225 |
.config_props = config_output, }, |
226 | 226 |
{ .name = NULL}}, |
227 | 227 |
}; |
... | ... |
@@ -103,14 +103,14 @@ AVFilter avfilter_vf_format = { |
103 | 103 |
.priv_size = sizeof(FormatContext), |
104 | 104 |
|
105 | 105 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
106 |
- .type = CODEC_TYPE_VIDEO, |
|
106 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
107 | 107 |
.get_video_buffer= avfilter_null_get_video_buffer, |
108 | 108 |
.start_frame = avfilter_null_start_frame, |
109 | 109 |
.draw_slice = avfilter_null_draw_slice, |
110 | 110 |
.end_frame = avfilter_null_end_frame, }, |
111 | 111 |
{ .name = NULL}}, |
112 | 112 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
113 |
- .type = CODEC_TYPE_VIDEO }, |
|
113 |
+ .type = AVMEDIA_TYPE_VIDEO }, |
|
114 | 114 |
{ .name = NULL}}, |
115 | 115 |
}; |
116 | 116 |
#endif /* CONFIG_FORMAT_FILTER */ |
... | ... |
@@ -133,14 +133,14 @@ AVFilter avfilter_vf_noformat = { |
133 | 133 |
.priv_size = sizeof(FormatContext), |
134 | 134 |
|
135 | 135 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
136 |
- .type = CODEC_TYPE_VIDEO, |
|
136 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
137 | 137 |
.get_video_buffer= avfilter_null_get_video_buffer, |
138 | 138 |
.start_frame = avfilter_null_start_frame, |
139 | 139 |
.draw_slice = avfilter_null_draw_slice, |
140 | 140 |
.end_frame = avfilter_null_end_frame, }, |
141 | 141 |
{ .name = NULL}}, |
142 | 142 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
143 |
- .type = CODEC_TYPE_VIDEO }, |
|
143 |
+ .type = AVMEDIA_TYPE_VIDEO }, |
|
144 | 144 |
{ .name = NULL}}, |
145 | 145 |
}; |
146 | 146 |
#endif /* CONFIG_NOFORMAT_FILTER */ |
... | ... |
@@ -30,13 +30,13 @@ AVFilter avfilter_vf_null = { |
30 | 30 |
.priv_size = 0, |
31 | 31 |
|
32 | 32 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
33 |
- .type = CODEC_TYPE_VIDEO, |
|
33 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
34 | 34 |
.get_video_buffer = avfilter_null_get_video_buffer, |
35 | 35 |
.start_frame = avfilter_null_start_frame, |
36 | 36 |
.end_frame = avfilter_null_end_frame }, |
37 | 37 |
{ .name = NULL}}, |
38 | 38 |
|
39 | 39 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
40 |
- .type = CODEC_TYPE_VIDEO, }, |
|
40 |
+ .type = AVMEDIA_TYPE_VIDEO, }, |
|
41 | 41 |
{ .name = NULL}}, |
42 | 42 |
}; |
... | ... |
@@ -197,13 +197,13 @@ AVFilter avfilter_vf_scale = { |
197 | 197 |
.priv_size = sizeof(ScaleContext), |
198 | 198 |
|
199 | 199 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
200 |
- .type = CODEC_TYPE_VIDEO, |
|
200 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
201 | 201 |
.start_frame = start_frame, |
202 | 202 |
.draw_slice = draw_slice, |
203 | 203 |
.min_perms = AV_PERM_READ, }, |
204 | 204 |
{ .name = NULL}}, |
205 | 205 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
206 |
- .type = CODEC_TYPE_VIDEO, |
|
206 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
207 | 207 |
.config_props = config_props, }, |
208 | 208 |
{ .name = NULL}}, |
209 | 209 |
}; |
... | ... |
@@ -104,7 +104,7 @@ AVFilter avfilter_vf_slicify = { |
104 | 104 |
.priv_size = sizeof(SliceContext), |
105 | 105 |
|
106 | 106 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
107 |
- .type = CODEC_TYPE_VIDEO, |
|
107 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
108 | 108 |
.get_video_buffer = avfilter_null_get_video_buffer, |
109 | 109 |
.start_frame = start_frame, |
110 | 110 |
.draw_slice = draw_slice, |
... | ... |
@@ -112,6 +112,6 @@ AVFilter avfilter_vf_slicify = { |
112 | 112 |
.end_frame = avfilter_null_end_frame, }, |
113 | 113 |
{ .name = NULL}}, |
114 | 114 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
115 |
- .type = CODEC_TYPE_VIDEO, }, |
|
115 |
+ .type = AVMEDIA_TYPE_VIDEO, }, |
|
116 | 116 |
{ .name = NULL}}, |
117 | 117 |
}; |
... | ... |
@@ -91,7 +91,7 @@ AVFilter avfilter_vf_vflip = { |
91 | 91 |
.priv_size = sizeof(FlipContext), |
92 | 92 |
|
93 | 93 |
.inputs = (AVFilterPad[]) {{ .name = "default", |
94 |
- .type = CODEC_TYPE_VIDEO, |
|
94 |
+ .type = AVMEDIA_TYPE_VIDEO, |
|
95 | 95 |
.get_video_buffer = get_video_buffer, |
96 | 96 |
.start_frame = start_frame, |
97 | 97 |
.draw_slice = draw_slice, |
... | ... |
@@ -99,6 +99,6 @@ AVFilter avfilter_vf_vflip = { |
99 | 99 |
.config_props = config_input, }, |
100 | 100 |
{ .name = NULL}}, |
101 | 101 |
.outputs = (AVFilterPad[]) {{ .name = "default", |
102 |
- .type = CODEC_TYPE_VIDEO, }, |
|
102 |
+ .type = AVMEDIA_TYPE_VIDEO, }, |
|
103 | 103 |
{ .name = NULL}}, |
104 | 104 |
}; |
... | ... |
@@ -149,7 +149,7 @@ static int fourxm_read_header(AVFormatContext *s, |
149 | 149 |
|
150 | 150 |
fourxm->video_stream_index = st->index; |
151 | 151 |
|
152 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
152 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
153 | 153 |
st->codec->codec_id = CODEC_ID_4XM; |
154 | 154 |
st->codec->extradata_size = 4; |
155 | 155 |
st->codec->extradata = av_malloc(4); |
... | ... |
@@ -198,7 +198,7 @@ static int fourxm_read_header(AVFormatContext *s, |
198 | 198 |
|
199 | 199 |
fourxm->tracks[current_track].stream_index = st->index; |
200 | 200 |
|
201 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
201 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
202 | 202 |
st->codec->codec_tag = 0; |
203 | 203 |
st->codec->channels = fourxm->tracks[current_track].channels; |
204 | 204 |
st->codec->sample_rate = fourxm->tracks[current_track].sample_rate; |
... | ... |
@@ -71,7 +71,7 @@ static int aea_read_header(AVFormatContext *s, |
71 | 71 |
url_fskip(s->pb, 1783); |
72 | 72 |
|
73 | 73 |
|
74 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
74 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
75 | 75 |
st->codec->codec_id = CODEC_ID_ATRAC1; |
76 | 76 |
st->codec->sample_rate = 44100; |
77 | 77 |
st->codec->bit_rate = 292000; |
... | ... |
@@ -92,7 +92,7 @@ static unsigned int get_aiff_header(ByteIOContext *pb, AVCodecContext *codec, |
92 | 92 |
|
93 | 93 |
if (size & 1) |
94 | 94 |
size++; |
95 |
- codec->codec_type = CODEC_TYPE_AUDIO; |
|
95 |
+ codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
96 | 96 |
codec->channels = get_be16(pb); |
97 | 97 |
num_frames = get_be32(pb); |
98 | 98 |
codec->bits_per_coded_sample = get_be16(pb); |
... | ... |
@@ -108,7 +108,7 @@ static int amr_read_header(AVFormatContext *s, |
108 | 108 |
st->codec->sample_rate = 8000; |
109 | 109 |
} |
110 | 110 |
st->codec->channels = 1; |
111 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
111 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
112 | 112 |
av_set_pts_info(st, 64, 1, st->codec->sample_rate); |
113 | 113 |
|
114 | 114 |
return 0; |
... | ... |
@@ -100,7 +100,7 @@ static int read_header(AVFormatContext *s, |
100 | 100 |
st = av_new_stream(s, 0); |
101 | 101 |
if (!st) |
102 | 102 |
return AVERROR(ENOMEM); |
103 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
103 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
104 | 104 |
st->codec->codec_id = CODEC_ID_ANM; |
105 | 105 |
st->codec->codec_tag = 0; /* no fourcc */ |
106 | 106 |
st->codec->width = get_le16(pb); |
... | ... |
@@ -43,7 +43,7 @@ static int apc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
43 | 43 |
if (!st) |
44 | 44 |
return AVERROR(ENOMEM); |
45 | 45 |
|
46 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
46 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
47 | 47 |
st->codec->codec_id = CODEC_ID_ADPCM_IMA_WS; |
48 | 48 |
|
49 | 49 |
get_le32(pb); /* number of samples */ |
... | ... |
@@ -301,7 +301,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap) |
301 | 301 |
|
302 | 302 |
total_blocks = (ape->totalframes == 0) ? 0 : ((ape->totalframes - 1) * ape->blocksperframe) + ape->finalframeblocks; |
303 | 303 |
|
304 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
304 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
305 | 305 |
st->codec->codec_id = CODEC_ID_APE; |
306 | 306 |
st->codec->codec_tag = MKTAG('A', 'P', 'E', ' '); |
307 | 307 |
st->codec->channels = ape->channels; |
... | ... |
@@ -236,7 +236,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
236 | 236 |
asf->hdr.max_bitrate = get_le32(pb); |
237 | 237 |
s->packet_size = asf->hdr.max_pktsize; |
238 | 238 |
} else if (!guidcmp(&g, &ff_asf_stream_header)) { |
239 |
- enum CodecType type; |
|
239 |
+ enum AVMediaType type; |
|
240 | 240 |
int type_specific_size, sizeX; |
241 | 241 |
uint64_t total_size; |
242 | 242 |
unsigned int tag1; |
... | ... |
@@ -265,14 +265,14 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
265 | 265 |
|
266 | 266 |
test_for_ext_stream_audio = 0; |
267 | 267 |
if (!guidcmp(&g, &ff_asf_audio_stream)) { |
268 |
- type = CODEC_TYPE_AUDIO; |
|
268 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
269 | 269 |
} else if (!guidcmp(&g, &ff_asf_video_stream)) { |
270 |
- type = CODEC_TYPE_VIDEO; |
|
270 |
+ type = AVMEDIA_TYPE_VIDEO; |
|
271 | 271 |
} else if (!guidcmp(&g, &ff_asf_command_stream)) { |
272 |
- type = CODEC_TYPE_DATA; |
|
272 |
+ type = AVMEDIA_TYPE_DATA; |
|
273 | 273 |
} else if (!guidcmp(&g, &ff_asf_ext_stream_embed_stream_header)) { |
274 | 274 |
test_for_ext_stream_audio = 1; |
275 |
- type = CODEC_TYPE_UNKNOWN; |
|
275 |
+ type = AVMEDIA_TYPE_UNKNOWN; |
|
276 | 276 |
} else { |
277 | 277 |
return -1; |
278 | 278 |
} |
... | ... |
@@ -289,7 +289,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
289 | 289 |
if (test_for_ext_stream_audio) { |
290 | 290 |
get_guid(pb, &g); |
291 | 291 |
if (!guidcmp(&g, &ff_asf_ext_stream_audio_stream)) { |
292 |
- type = CODEC_TYPE_AUDIO; |
|
292 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
293 | 293 |
is_dvr_ms_audio=1; |
294 | 294 |
get_guid(pb, &g); |
295 | 295 |
get_le32(pb); |
... | ... |
@@ -301,7 +301,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
301 | 301 |
} |
302 | 302 |
|
303 | 303 |
st->codec->codec_type = type; |
304 |
- if (type == CODEC_TYPE_AUDIO) { |
|
304 |
+ if (type == AVMEDIA_TYPE_AUDIO) { |
|
305 | 305 |
ff_get_wav_header(pb, st->codec, type_specific_size); |
306 | 306 |
if (is_dvr_ms_audio) { |
307 | 307 |
// codec_id and codec_tag are unreliable in dvr_ms |
... | ... |
@@ -351,7 +351,7 @@ static int asf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
351 | 351 |
st->codec->frame_size = 1; |
352 | 352 |
break; |
353 | 353 |
} |
354 |
- } else if (type == CODEC_TYPE_VIDEO) { |
|
354 |
+ } else if (type == AVMEDIA_TYPE_VIDEO) { |
|
355 | 355 |
get_le32(pb); |
356 | 356 |
get_le32(pb); |
357 | 357 |
get_byte(pb); |
... | ... |
@@ -889,8 +889,8 @@ static int ff_asf_parse_packet(AVFormatContext *s, ByteIOContext *pb, AVPacket * |
889 | 889 |
asf_st->packet_pos= asf->packet_pos; |
890 | 890 |
//printf("new packet: stream:%d key:%d packet_key:%d audio:%d size:%d\n", |
891 | 891 |
//asf->stream_index, asf->packet_key_frame, asf_st->pkt.flags & PKT_FLAG_KEY, |
892 |
-//s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO, asf->packet_obj_size); |
|
893 |
- if (s->streams[asf->stream_index]->codec->codec_type == CODEC_TYPE_AUDIO) |
|
892 |
+//s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO, asf->packet_obj_size); |
|
893 |
+ if (s->streams[asf->stream_index]->codec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
894 | 894 |
asf->packet_key_frame = 1; |
895 | 895 |
if (asf->packet_key_frame) |
896 | 896 |
asf_st->pkt.flags |= PKT_FLAG_KEY; |
... | ... |
@@ -375,13 +375,13 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data |
375 | 375 |
|
376 | 376 |
|
377 | 377 |
switch(enc->codec_type) { |
378 |
- case CODEC_TYPE_AUDIO: |
|
378 |
+ case AVMEDIA_TYPE_AUDIO: |
|
379 | 379 |
wav_extra_size = 0; |
380 | 380 |
extra_size = 18 + wav_extra_size; |
381 | 381 |
extra_size2 = 8; |
382 | 382 |
break; |
383 | 383 |
default: |
384 |
- case CODEC_TYPE_VIDEO: |
|
384 |
+ case AVMEDIA_TYPE_VIDEO: |
|
385 | 385 |
wav_extra_size = enc->extradata_size; |
386 | 386 |
extra_size = 0x33 + wav_extra_size; |
387 | 387 |
extra_size2 = 0; |
... | ... |
@@ -389,7 +389,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data |
389 | 389 |
} |
390 | 390 |
|
391 | 391 |
hpos = put_header(pb, &ff_asf_stream_header); |
392 |
- if (enc->codec_type == CODEC_TYPE_AUDIO) { |
|
392 |
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
393 | 393 |
put_guid(pb, &ff_asf_audio_stream); |
394 | 394 |
put_guid(pb, &ff_asf_audio_conceal_spread); |
395 | 395 |
} else { |
... | ... |
@@ -403,7 +403,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data |
403 | 403 |
put_le16(pb, n + 1); /* stream number */ |
404 | 404 |
put_le32(pb, 0); /* ??? */ |
405 | 405 |
|
406 |
- if (enc->codec_type == CODEC_TYPE_AUDIO) { |
|
406 |
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
407 | 407 |
/* WAVEFORMATEX header */ |
408 | 408 |
int wavsize = ff_put_wav_header(pb, enc); |
409 | 409 |
if ((enc->codec_id != CODEC_ID_MP3) && (enc->codec_id != CODEC_ID_MP2) && (enc->codec_id != CODEC_ID_ADPCM_IMA_WAV) && (enc->extradata_size==0)) { |
... | ... |
@@ -457,9 +457,9 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data |
457 | 457 |
enc = s->streams[n]->codec; |
458 | 458 |
p = avcodec_find_encoder(enc->codec_id); |
459 | 459 |
|
460 |
- if(enc->codec_type == CODEC_TYPE_AUDIO) |
|
460 |
+ if(enc->codec_type == AVMEDIA_TYPE_AUDIO) |
|
461 | 461 |
put_le16(pb, 2); |
462 |
- else if(enc->codec_type == CODEC_TYPE_VIDEO) |
|
462 |
+ else if(enc->codec_type == AVMEDIA_TYPE_VIDEO) |
|
463 | 463 |
put_le16(pb, 1); |
464 | 464 |
else |
465 | 465 |
put_le16(pb, -1); |
... | ... |
@@ -483,7 +483,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data |
483 | 483 |
|
484 | 484 |
|
485 | 485 |
/* id */ |
486 |
- if (enc->codec_type == CODEC_TYPE_AUDIO) { |
|
486 |
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
487 | 487 |
put_le16(pb, 2); |
488 | 488 |
put_le16(pb, enc->codec_tag); |
489 | 489 |
} else { |
... | ... |
@@ -722,7 +722,7 @@ static void put_frame( |
722 | 722 |
// multi payloads |
723 | 723 |
frag_len1 = asf->packet_size_left - PAYLOAD_HEADER_SIZE_MULTIPLE_PAYLOADS - PACKET_HEADER_MIN_SIZE - 1; |
724 | 724 |
|
725 |
- if(frag_len1 < payload_len && avst->codec->codec_type == CODEC_TYPE_AUDIO){ |
|
725 |
+ if(frag_len1 < payload_len && avst->codec->codec_type == AVMEDIA_TYPE_AUDIO){ |
|
726 | 726 |
flush_packet(s); |
727 | 727 |
continue; |
728 | 728 |
} |
... | ... |
@@ -770,7 +770,7 @@ static int asf_write_packet(AVFormatContext *s, AVPacket *pkt) |
770 | 770 |
codec = s->streams[pkt->stream_index]->codec; |
771 | 771 |
stream = &asf->streams[pkt->stream_index]; |
772 | 772 |
|
773 |
- if(codec->codec_type == CODEC_TYPE_AUDIO) |
|
773 |
+ if(codec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
774 | 774 |
flags &= ~PKT_FLAG_KEY; |
775 | 775 |
|
776 | 776 |
pts = (pkt->pts != AV_NOPTS_VALUE) ? pkt->pts : pkt->dts; |
... | ... |
@@ -99,7 +99,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) |
99 | 99 |
if (!st) |
100 | 100 |
return -1; |
101 | 101 |
av_set_pts_info(st, 64, 1, 100); |
102 |
- st->codec->codec_type = CODEC_TYPE_SUBTITLE; |
|
102 |
+ st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; |
|
103 | 103 |
st->codec->codec_id= CODEC_ID_SSA; |
104 | 104 |
|
105 | 105 |
header_remaining= INT_MAX; |
... | ... |
@@ -148,7 +148,7 @@ static int au_read_header(AVFormatContext *s, |
148 | 148 |
st = av_new_stream(s, 0); |
149 | 149 |
if (!st) |
150 | 150 |
return -1; |
151 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
151 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
152 | 152 |
st->codec->codec_tag = id; |
153 | 153 |
st->codec->codec_id = codec; |
154 | 154 |
st->codec->channels = channels; |
... | ... |
@@ -32,7 +32,7 @@ void ff_audio_interleave_close(AVFormatContext *s) |
32 | 32 |
AVStream *st = s->streams[i]; |
33 | 33 |
AudioInterleaveContext *aic = st->priv_data; |
34 | 34 |
|
35 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) |
|
35 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
36 | 36 |
av_fifo_free(aic->fifo); |
37 | 37 |
} |
38 | 38 |
} |
... | ... |
@@ -50,7 +50,7 @@ int ff_audio_interleave_init(AVFormatContext *s, |
50 | 50 |
AVStream *st = s->streams[i]; |
51 | 51 |
AudioInterleaveContext *aic = st->priv_data; |
52 | 52 |
|
53 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
53 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
54 | 54 |
aic->sample_size = (st->codec->channels * |
55 | 55 |
av_get_bits_per_sample(st->codec->codec_id)) / 8; |
56 | 56 |
if (!aic->sample_size) { |
... | ... |
@@ -103,7 +103,7 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt |
103 | 103 |
if (pkt) { |
104 | 104 |
AVStream *st = s->streams[pkt->stream_index]; |
105 | 105 |
AudioInterleaveContext *aic = st->priv_data; |
106 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
106 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
107 | 107 |
unsigned new_size = av_fifo_size(aic->fifo) + pkt->size; |
108 | 108 |
if (new_size > aic->fifo_size) { |
109 | 109 |
if (av_fifo_realloc2(aic->fifo, new_size) < 0) |
... | ... |
@@ -122,7 +122,7 @@ int ff_audio_rechunk_interleave(AVFormatContext *s, AVPacket *out, AVPacket *pkt |
122 | 122 |
|
123 | 123 |
for (i = 0; i < s->nb_streams; i++) { |
124 | 124 |
AVStream *st = s->streams[i]; |
125 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
125 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
126 | 126 |
AVPacket new_pkt; |
127 | 127 |
while (ff_interleave_new_audio_packet(s, &new_pkt, i, flush)) |
128 | 128 |
ff_interleave_add_packet(s, &new_pkt, compare_ts); |
... | ... |
@@ -804,7 +804,7 @@ AVOutputFormat *av_guess_format(const char *short_name, |
804 | 804 |
*/ |
805 | 805 |
enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, |
806 | 806 |
const char *filename, const char *mime_type, |
807 |
- enum CodecType type); |
|
807 |
+ enum AVMediaType type); |
|
808 | 808 |
|
809 | 809 |
/** |
810 | 810 |
* Sends a nice hexadecimal dump of a buffer to the specified file stream. |
... | ... |
@@ -442,19 +442,19 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
442 | 442 |
|
443 | 443 |
switch(tag1) { |
444 | 444 |
case MKTAG('v', 'i', 'd', 's'): |
445 |
- codec_type = CODEC_TYPE_VIDEO; |
|
445 |
+ codec_type = AVMEDIA_TYPE_VIDEO; |
|
446 | 446 |
|
447 | 447 |
ast->sample_size = 0; |
448 | 448 |
break; |
449 | 449 |
case MKTAG('a', 'u', 'd', 's'): |
450 |
- codec_type = CODEC_TYPE_AUDIO; |
|
450 |
+ codec_type = AVMEDIA_TYPE_AUDIO; |
|
451 | 451 |
break; |
452 | 452 |
case MKTAG('t', 'x', 't', 's'): |
453 | 453 |
//FIXME |
454 |
- codec_type = CODEC_TYPE_DATA; //CODEC_TYPE_SUB ? FIXME |
|
454 |
+ codec_type = AVMEDIA_TYPE_DATA; //AVMEDIA_TYPE_SUB ? FIXME |
|
455 | 455 |
break; |
456 | 456 |
case MKTAG('d', 'a', 't', 's'): |
457 |
- codec_type = CODEC_TYPE_DATA; |
|
457 |
+ codec_type = AVMEDIA_TYPE_DATA; |
|
458 | 458 |
break; |
459 | 459 |
default: |
460 | 460 |
av_log(s, AV_LOG_ERROR, "unknown stream type %X\n", tag1); |
... | ... |
@@ -475,11 +475,11 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
475 | 475 |
size = FFMIN(size, list_end - cur_pos); |
476 | 476 |
st = s->streams[stream_index]; |
477 | 477 |
switch(codec_type) { |
478 |
- case CODEC_TYPE_VIDEO: |
|
478 |
+ case AVMEDIA_TYPE_VIDEO: |
|
479 | 479 |
if(amv_file_format){ |
480 | 480 |
st->codec->width=avih_width; |
481 | 481 |
st->codec->height=avih_height; |
482 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
482 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
483 | 483 |
st->codec->codec_id = CODEC_ID_AMV; |
484 | 484 |
url_fskip(pb, size); |
485 | 485 |
break; |
... | ... |
@@ -497,7 +497,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
497 | 497 |
get_le32(pb); /* ClrImportant */ |
498 | 498 |
|
499 | 499 |
if (tag1 == MKTAG('D', 'X', 'S', 'B') || tag1 == MKTAG('D','X','S','A')) { |
500 |
- st->codec->codec_type = CODEC_TYPE_SUBTITLE; |
|
500 |
+ st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; |
|
501 | 501 |
st->codec->codec_tag = tag1; |
502 | 502 |
st->codec->codec_id = CODEC_ID_XSUB; |
503 | 503 |
break; |
... | ... |
@@ -534,7 +534,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
534 | 534 |
#ifdef DEBUG |
535 | 535 |
print_tag("video", tag1, 0); |
536 | 536 |
#endif |
537 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
537 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
538 | 538 |
st->codec->codec_tag = tag1; |
539 | 539 |
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag1); |
540 | 540 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; // This is needed to get the pict type which is necessary for generating correct pts. |
... | ... |
@@ -554,7 +554,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
554 | 554 |
|
555 | 555 |
// url_fskip(pb, size - 5 * 4); |
556 | 556 |
break; |
557 |
- case CODEC_TYPE_AUDIO: |
|
557 |
+ case AVMEDIA_TYPE_AUDIO: |
|
558 | 558 |
ff_get_wav_header(pb, st->codec, size); |
559 | 559 |
if(ast->sample_size && st->codec->block_align && ast->sample_size != st->codec->block_align){ |
560 | 560 |
av_log(s, AV_LOG_WARNING, "sample size (%d) != block align (%d)\n", ast->sample_size, st->codec->block_align); |
... | ... |
@@ -580,7 +580,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap) |
580 | 580 |
st->codec->codec_id = CODEC_ID_ADPCM_IMA_AMV; |
581 | 581 |
break; |
582 | 582 |
default: |
583 |
- st->codec->codec_type = CODEC_TYPE_DATA; |
|
583 |
+ st->codec->codec_type = AVMEDIA_TYPE_DATA; |
|
584 | 584 |
st->codec->codec_id= CODEC_ID_NONE; |
585 | 585 |
st->codec->codec_tag= 0; |
586 | 586 |
url_fskip(pb, size); |
... | ... |
@@ -787,7 +787,7 @@ resync: |
787 | 787 |
//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); |
788 | 788 |
pkt->stream_index = avi->stream_index; |
789 | 789 |
|
790 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
790 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
791 | 791 |
AVIndexEntry *e; |
792 | 792 |
int index; |
793 | 793 |
assert(st->index_entries); |
... | ... |
@@ -871,8 +871,8 @@ resync: |
871 | 871 |
//workaround for broken small-file-bug402.avi |
872 | 872 |
if( d[2] == 'w' && d[3] == 'b' |
873 | 873 |
&& n==0 |
874 |
- && st ->codec->codec_type == CODEC_TYPE_VIDEO |
|
875 |
- && st1->codec->codec_type == CODEC_TYPE_AUDIO |
|
874 |
+ && st ->codec->codec_type == AVMEDIA_TYPE_VIDEO |
|
875 |
+ && st1->codec->codec_type == AVMEDIA_TYPE_AUDIO |
|
876 | 876 |
&& ast->prefix == 'd'*256+'c' |
877 | 877 |
&& (d[2]*256+d[3] == ast1->prefix || !ast1->prefix_count) |
878 | 878 |
){ |
... | ... |
@@ -83,14 +83,14 @@ static int64_t avi_start_new_riff(AVFormatContext *s, ByteIOContext *pb, |
83 | 83 |
return loff; |
84 | 84 |
} |
85 | 85 |
|
86 |
-static char* avi_stream2fourcc(char* tag, int index, enum CodecType type) |
|
86 |
+static char* avi_stream2fourcc(char* tag, int index, enum AVMediaType type) |
|
87 | 87 |
{ |
88 | 88 |
tag[0] = '0'; |
89 | 89 |
tag[1] = '0' + index; |
90 |
- if (type == CODEC_TYPE_VIDEO) { |
|
90 |
+ if (type == AVMEDIA_TYPE_VIDEO) { |
|
91 | 91 |
tag[2] = 'd'; |
92 | 92 |
tag[3] = 'c'; |
93 |
- } else if (type == CODEC_TYPE_SUBTITLE) { |
|
93 |
+ } else if (type == AVMEDIA_TYPE_SUBTITLE) { |
|
94 | 94 |
// note: this is not an official code |
95 | 95 |
tag[2] = 's'; |
96 | 96 |
tag[3] = 'b'; |
... | ... |
@@ -136,7 +136,7 @@ static int avi_write_counters(AVFormatContext* s, int riff_id) |
136 | 136 |
} else { |
137 | 137 |
put_le32(pb, avist->audio_strm_length / au_ssize); |
138 | 138 |
} |
139 |
- if(stream->codec_type == CODEC_TYPE_VIDEO) |
|
139 |
+ if(stream->codec_type == AVMEDIA_TYPE_VIDEO) |
|
140 | 140 |
nb_frames = FFMAX(nb_frames, avist->packet_count); |
141 | 141 |
} |
142 | 142 |
if(riff_id == 1) { |
... | ... |
@@ -177,7 +177,7 @@ static int avi_write_header(AVFormatContext *s) |
177 | 177 |
for(n=0;n<s->nb_streams;n++) { |
178 | 178 |
stream = s->streams[n]->codec; |
179 | 179 |
bitrate += stream->bit_rate; |
180 |
- if (stream->codec_type == CODEC_TYPE_VIDEO) |
|
180 |
+ if (stream->codec_type == AVMEDIA_TYPE_VIDEO) |
|
181 | 181 |
video_enc = stream; |
182 | 182 |
} |
183 | 183 |
|
... | ... |
@@ -222,16 +222,16 @@ static int avi_write_header(AVFormatContext *s) |
222 | 222 |
/* stream generic header */ |
223 | 223 |
strh = ff_start_tag(pb, "strh"); |
224 | 224 |
switch(stream->codec_type) { |
225 |
- case CODEC_TYPE_SUBTITLE: |
|
225 |
+ case AVMEDIA_TYPE_SUBTITLE: |
|
226 | 226 |
// XSUB subtitles behave like video tracks, other subtitles |
227 | 227 |
// are not (yet) supported. |
228 | 228 |
if (stream->codec_id != CODEC_ID_XSUB) break; |
229 |
- case CODEC_TYPE_VIDEO: put_tag(pb, "vids"); break; |
|
230 |
- case CODEC_TYPE_AUDIO: put_tag(pb, "auds"); break; |
|
231 |
-// case CODEC_TYPE_TEXT : put_tag(pb, "txts"); break; |
|
232 |
- case CODEC_TYPE_DATA : put_tag(pb, "dats"); break; |
|
229 |
+ case AVMEDIA_TYPE_VIDEO: put_tag(pb, "vids"); break; |
|
230 |
+ case AVMEDIA_TYPE_AUDIO: put_tag(pb, "auds"); break; |
|
231 |
+// case AVMEDIA_TYPE_TEXT : put_tag(pb, "txts"); break; |
|
232 |
+ case AVMEDIA_TYPE_DATA : put_tag(pb, "dats"); break; |
|
233 | 233 |
} |
234 |
- if(stream->codec_type == CODEC_TYPE_VIDEO || |
|
234 |
+ if(stream->codec_type == AVMEDIA_TYPE_VIDEO || |
|
235 | 235 |
stream->codec_id == CODEC_ID_XSUB) |
236 | 236 |
put_le32(pb, stream->codec_tag); |
237 | 237 |
else |
... | ... |
@@ -255,9 +255,9 @@ static int avi_write_header(AVFormatContext *s) |
255 | 255 |
put_le32(pb, 0); /* length, XXX: filled later */ |
256 | 256 |
|
257 | 257 |
/* suggested buffer size */ //FIXME set at the end to largest chunk |
258 |
- if(stream->codec_type == CODEC_TYPE_VIDEO) |
|
258 |
+ if(stream->codec_type == AVMEDIA_TYPE_VIDEO) |
|
259 | 259 |
put_le32(pb, 1024 * 1024); |
260 |
- else if(stream->codec_type == CODEC_TYPE_AUDIO) |
|
260 |
+ else if(stream->codec_type == AVMEDIA_TYPE_AUDIO) |
|
261 | 261 |
put_le32(pb, 12 * 1024); |
262 | 262 |
else |
263 | 263 |
put_le32(pb, 0); |
... | ... |
@@ -268,17 +268,17 @@ static int avi_write_header(AVFormatContext *s) |
268 | 268 |
put_le16(pb, stream->height); |
269 | 269 |
ff_end_tag(pb, strh); |
270 | 270 |
|
271 |
- if(stream->codec_type != CODEC_TYPE_DATA){ |
|
271 |
+ if(stream->codec_type != AVMEDIA_TYPE_DATA){ |
|
272 | 272 |
strf = ff_start_tag(pb, "strf"); |
273 | 273 |
switch(stream->codec_type) { |
274 |
- case CODEC_TYPE_SUBTITLE: |
|
274 |
+ case AVMEDIA_TYPE_SUBTITLE: |
|
275 | 275 |
// XSUB subtitles behave like video tracks, other subtitles |
276 | 276 |
// are not (yet) supported. |
277 | 277 |
if (stream->codec_id != CODEC_ID_XSUB) break; |
278 |
- case CODEC_TYPE_VIDEO: |
|
278 |
+ case AVMEDIA_TYPE_VIDEO: |
|
279 | 279 |
ff_put_bmp_header(pb, stream, ff_codec_bmp_tags, 0); |
280 | 280 |
break; |
281 |
- case CODEC_TYPE_AUDIO: |
|
281 |
+ case AVMEDIA_TYPE_AUDIO: |
|
282 | 282 |
if (ff_put_wav_header(pb, stream) < 0) { |
283 | 283 |
return -1; |
284 | 284 |
} |
... | ... |
@@ -322,7 +322,7 @@ static int avi_write_header(AVFormatContext *s) |
322 | 322 |
ff_end_tag(pb, avist->indexes.indx_start); |
323 | 323 |
} |
324 | 324 |
|
325 |
- if( stream->codec_type == CODEC_TYPE_VIDEO |
|
325 |
+ if( stream->codec_type == AVMEDIA_TYPE_VIDEO |
|
326 | 326 |
&& s->streams[i]->sample_aspect_ratio.num>0 |
327 | 327 |
&& s->streams[i]->sample_aspect_ratio.den>0){ |
328 | 328 |
int vprp= ff_start_tag(pb, "vprp"); |
... | ... |
@@ -542,7 +542,7 @@ static int avi_write_packet(AVFormatContext *s, AVPacket *pkt) |
542 | 542 |
avi_stream2fourcc(&tag[0], stream_index, enc->codec_type); |
543 | 543 |
if(pkt->flags&PKT_FLAG_KEY) |
544 | 544 |
flags = 0x10; |
545 |
- if (enc->codec_type == CODEC_TYPE_AUDIO) { |
|
545 |
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
546 | 546 |
avist->audio_strm_length += size; |
547 | 547 |
} |
548 | 548 |
|
... | ... |
@@ -603,7 +603,7 @@ static int avi_write_trailer(AVFormatContext *s) |
603 | 603 |
AVCodecContext *stream = s->streams[n]->codec; |
604 | 604 |
AVIStream *avist= s->streams[n]->priv_data; |
605 | 605 |
|
606 |
- if (stream->codec_type == CODEC_TYPE_VIDEO) { |
|
606 |
+ if (stream->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
607 | 607 |
if (nb_frames < avist->packet_count) |
608 | 608 |
nb_frames = avist->packet_count; |
609 | 609 |
} else { |
... | ... |
@@ -85,7 +85,7 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) |
85 | 85 |
continue; |
86 | 86 |
|
87 | 87 |
st = av_new_stream(s, id); |
88 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
88 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
89 | 89 |
|
90 | 90 |
st->codec->block_align = wvfmt.nBlockAlign; |
91 | 91 |
st->codec->channels = wvfmt.nChannels; |
... | ... |
@@ -111,7 +111,7 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap) |
111 | 111 |
continue; |
112 | 112 |
|
113 | 113 |
st = av_new_stream(s, id); |
114 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
114 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
115 | 115 |
st->r_frame_rate.num = stream->info.dwRate; |
116 | 116 |
st->r_frame_rate.den = stream->info.dwScale; |
117 | 117 |
|
... | ... |
@@ -178,7 +178,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) |
178 | 178 |
avs->st_video = av_new_stream(s, AVS_VIDEO); |
179 | 179 |
if (avs->st_video == NULL) |
180 | 180 |
return AVERROR(ENOMEM); |
181 |
- avs->st_video->codec->codec_type = CODEC_TYPE_VIDEO; |
|
181 |
+ avs->st_video->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
182 | 182 |
avs->st_video->codec->codec_id = CODEC_ID_AVS; |
183 | 183 |
avs->st_video->codec->width = avs->width; |
184 | 184 |
avs->st_video->codec->height = avs->height; |
... | ... |
@@ -195,7 +195,7 @@ static int avs_read_packet(AVFormatContext * s, AVPacket * pkt) |
195 | 195 |
avs->st_audio = av_new_stream(s, AVS_AUDIO); |
196 | 196 |
if (avs->st_audio == NULL) |
197 | 197 |
return AVERROR(ENOMEM); |
198 |
- avs->st_audio->codec->codec_type = CODEC_TYPE_AUDIO; |
|
198 |
+ avs->st_audio->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
199 | 199 |
} |
200 | 200 |
avs->remaining_audio_size = size - 4; |
201 | 201 |
size = avs_read_audio_packet(s, pkt); |
... | ... |
@@ -74,7 +74,7 @@ static int vid_read_header(AVFormatContext *s, |
74 | 74 |
if (!stream) |
75 | 75 |
return AVERROR(ENOMEM); |
76 | 76 |
av_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps |
77 |
- stream->codec->codec_type = CODEC_TYPE_VIDEO; |
|
77 |
+ stream->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
78 | 78 |
stream->codec->codec_id = CODEC_ID_BETHSOFTVID; |
79 | 79 |
stream->codec->width = get_le16(pb); |
80 | 80 |
stream->codec->height = get_le16(pb); |
... | ... |
@@ -86,7 +86,7 @@ static int vid_read_header(AVFormatContext *s, |
86 | 86 |
stream = av_new_stream(s, 0); |
87 | 87 |
if (!stream) |
88 | 88 |
return AVERROR(ENOMEM); |
89 |
- stream->codec->codec_type = CODEC_TYPE_AUDIO; |
|
89 |
+ stream->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
90 | 90 |
stream->codec->codec_id = CODEC_ID_PCM_U8; |
91 | 91 |
stream->codec->channels = 1; |
92 | 92 |
stream->codec->sample_rate = 11025; |
... | ... |
@@ -87,12 +87,12 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap) |
87 | 87 |
|
88 | 88 |
/* Set up the video codec... */ |
89 | 89 |
av_set_pts_info(vstream, 32, 1, fps); |
90 |
- vstream->codec->codec_type = CODEC_TYPE_VIDEO; |
|
90 |
+ vstream->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
91 | 91 |
vstream->codec->codec_id = CODEC_ID_BFI; |
92 | 92 |
vstream->codec->pix_fmt = PIX_FMT_PAL8; |
93 | 93 |
|
94 | 94 |
/* Set up the audio codec now... */ |
95 |
- astream->codec->codec_type = CODEC_TYPE_AUDIO; |
|
95 |
+ astream->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
96 | 96 |
astream->codec->codec_id = CODEC_ID_PCM_U8; |
97 | 97 |
astream->codec->channels = 1; |
98 | 98 |
astream->codec->bits_per_coded_sample = 8; |
... | ... |
@@ -111,7 +111,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) |
111 | 111 |
} |
112 | 112 |
av_set_pts_info(vst, 64, fps_den, fps_num); |
113 | 113 |
|
114 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
114 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
115 | 115 |
vst->codec->codec_id = CODEC_ID_BINKVIDEO; |
116 | 116 |
vst->codec->extradata = av_mallocz(4 + FF_INPUT_BUFFER_PADDING_SIZE); |
117 | 117 |
vst->codec->extradata_size = 4; |
... | ... |
@@ -133,7 +133,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) |
133 | 133 |
ast = av_new_stream(s, 1); |
134 | 134 |
if (!ast) |
135 | 135 |
return AVERROR(ENOMEM); |
136 |
- ast->codec->codec_type = CODEC_TYPE_AUDIO; |
|
136 |
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
137 | 137 |
ast->codec->codec_tag = 0; |
138 | 138 |
ast->codec->sample_rate = get_le16(pb); |
139 | 139 |
av_set_pts_info(ast, 64, 1, ast->codec->sample_rate); |
... | ... |
@@ -83,7 +83,7 @@ static int read_header(AVFormatContext *s, |
83 | 83 |
if (!video) |
84 | 84 |
return AVERROR(ENOMEM); |
85 | 85 |
|
86 |
- video->codec->codec_type = CODEC_TYPE_VIDEO; |
|
86 |
+ video->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
87 | 87 |
video->codec->codec_id = CODEC_ID_C93; |
88 | 88 |
video->codec->width = 320; |
89 | 89 |
video->codec->height = 192; |
... | ... |
@@ -120,7 +120,7 @@ static int read_packet(AVFormatContext *s, AVPacket *pkt) |
120 | 120 |
c93->audio = av_new_stream(s, 1); |
121 | 121 |
if (!c93->audio) |
122 | 122 |
return AVERROR(ENOMEM); |
123 |
- c93->audio->codec->codec_type = CODEC_TYPE_AUDIO; |
|
123 |
+ c93->audio->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
124 | 124 |
} |
125 | 125 |
url_fskip(pb, 26); /* VOC header */ |
126 | 126 |
ret = voc_get_packet(s, pkt, c93->audio, datasize - 26); |
... | ... |
@@ -64,7 +64,7 @@ static int read_desc_chunk(AVFormatContext *s) |
64 | 64 |
return AVERROR_NOMEM; |
65 | 65 |
|
66 | 66 |
/* parse format description */ |
67 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
67 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
68 | 68 |
st->codec->sample_rate = av_int2dbl(get_be64(pb)); |
69 | 69 |
st->codec->codec_tag = get_be32(pb); |
70 | 70 |
flags = get_be32(pb); |
... | ... |
@@ -32,7 +32,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) |
32 | 32 |
if (!vst) |
33 | 33 |
return AVERROR(ENOMEM); |
34 | 34 |
|
35 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
35 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
36 | 36 |
vst->codec->codec_id = CODEC_ID_CDGRAPHICS; |
37 | 37 |
|
38 | 38 |
/// 75 sectors/sec * 4 packets/sector = 300 packets/sec |
... | ... |
@@ -24,7 +24,7 @@ static int daud_header(AVFormatContext *s, AVFormatParameters *ap) { |
24 | 24 |
AVStream *st = av_new_stream(s, 0); |
25 | 25 |
if (!st) |
26 | 26 |
return AVERROR(ENOMEM); |
27 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
27 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
28 | 28 |
st->codec->codec_id = CODEC_ID_PCM_S24DAUD; |
29 | 29 |
st->codec->codec_tag = MKTAG('d', 'a', 'u', 'd'); |
30 | 30 |
st->codec->channels = 6; |
... | ... |
@@ -113,7 +113,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) |
113 | 113 |
|
114 | 114 |
av_set_pts_info(st, 32, 1, 12); |
115 | 115 |
cin->video_stream_index = st->index; |
116 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
116 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
117 | 117 |
st->codec->codec_id = CODEC_ID_DSICINVIDEO; |
118 | 118 |
st->codec->codec_tag = 0; /* no fourcc */ |
119 | 119 |
st->codec->width = hdr->video_frame_width; |
... | ... |
@@ -126,7 +126,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap) |
126 | 126 |
|
127 | 127 |
av_set_pts_info(st, 32, 1, 22050); |
128 | 128 |
cin->audio_stream_index = st->index; |
129 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
129 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
130 | 130 |
st->codec->codec_id = CODEC_ID_DSICINAUDIO; |
131 | 131 |
st->codec->codec_tag = 0; /* no tag */ |
132 | 132 |
st->codec->channels = 1; |
... | ... |
@@ -214,7 +214,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame) |
214 | 214 |
if (!c->ast[i]) |
215 | 215 |
break; |
216 | 216 |
av_set_pts_info(c->ast[i], 64, 1, 30000); |
217 |
- c->ast[i]->codec->codec_type = CODEC_TYPE_AUDIO; |
|
217 |
+ c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
218 | 218 |
c->ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE; |
219 | 219 |
|
220 | 220 |
av_init_packet(&c->audio_pkt[i]); |
... | ... |
@@ -290,7 +290,7 @@ DVDemuxContext* dv_init_demux(AVFormatContext *s) |
290 | 290 |
c->frames = 0; |
291 | 291 |
c->abytes = 0; |
292 | 292 |
|
293 |
- c->vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
293 |
+ c->vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
294 | 294 |
c->vst->codec->codec_id = CODEC_ID_DVVIDEO; |
295 | 295 |
c->vst->codec->bit_rate = 25000000; |
296 | 296 |
c->vst->start_time = 0; |
... | ... |
@@ -239,7 +239,7 @@ int dv_assemble_frame(DVMuxContext *c, AVStream* st, |
239 | 239 |
reqasize = 4 * dv_audio_frame_size(c->sys, c->frames); |
240 | 240 |
|
241 | 241 |
switch (st->codec->codec_type) { |
242 |
- case CODEC_TYPE_VIDEO: |
|
242 |
+ case AVMEDIA_TYPE_VIDEO: |
|
243 | 243 |
/* FIXME: we have to have more sensible approach than this one */ |
244 | 244 |
if (c->has_video) |
245 | 245 |
av_log(st->codec, AV_LOG_ERROR, "Can't process DV frame #%d. Insufficient audio data or severe sync problem.\n", c->frames); |
... | ... |
@@ -247,7 +247,7 @@ int dv_assemble_frame(DVMuxContext *c, AVStream* st, |
247 | 247 |
memcpy(*frame, data, c->sys->frame_size); |
248 | 248 |
c->has_video = 1; |
249 | 249 |
break; |
250 |
- case CODEC_TYPE_AUDIO: |
|
250 |
+ case AVMEDIA_TYPE_AUDIO: |
|
251 | 251 |
for (i = 0; i < c->n_ast && st != c->ast[i]; i++); |
252 | 252 |
|
253 | 253 |
/* FIXME: we have to have more sensible approach than this one */ |
... | ... |
@@ -299,11 +299,11 @@ DVMuxContext* dv_init_mux(AVFormatContext* s) |
299 | 299 |
/* We have to sort out where audio and where video stream is */ |
300 | 300 |
for (i=0; i<s->nb_streams; i++) { |
301 | 301 |
switch (s->streams[i]->codec->codec_type) { |
302 |
- case CODEC_TYPE_VIDEO: |
|
302 |
+ case AVMEDIA_TYPE_VIDEO: |
|
303 | 303 |
if (vst) return NULL; |
304 | 304 |
vst = s->streams[i]; |
305 | 305 |
break; |
306 |
- case CODEC_TYPE_AUDIO: |
|
306 |
+ case AVMEDIA_TYPE_AUDIO: |
|
307 | 307 |
if (c->n_ast > 1) return NULL; |
308 | 308 |
c->ast[c->n_ast++] = s->streams[i]; |
309 | 309 |
break; |
... | ... |
@@ -119,7 +119,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap) |
119 | 119 |
} |
120 | 120 |
|
121 | 121 |
/* now we are ready: build format streams */ |
122 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
122 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
123 | 123 |
st->codec->codec_id = CODEC_ID_DXA; |
124 | 124 |
st->codec->width = w; |
125 | 125 |
st->codec->height = h; |
... | ... |
@@ -67,7 +67,7 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap) |
67 | 67 |
st = av_new_stream(s, 0); |
68 | 68 |
if (!st) |
69 | 69 |
return AVERROR(ENOMEM); |
70 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
70 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
71 | 71 |
st->codec->codec_tag = 0; /* no fourcc */ |
72 | 72 |
st->codec->codec_id = CODEC_ID_ADPCM_EA_XAS; |
73 | 73 |
st->codec->channels = cdata->channels; |
... | ... |
@@ -414,7 +414,7 @@ static int ea_read_header(AVFormatContext *s, |
414 | 414 |
if (!st) |
415 | 415 |
return AVERROR(ENOMEM); |
416 | 416 |
ea->video_stream_index = st->index; |
417 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
417 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
418 | 418 |
st->codec->codec_id = ea->video_codec; |
419 | 419 |
st->codec->codec_tag = 0; /* no fourcc */ |
420 | 420 |
st->codec->time_base = ea->time_base; |
... | ... |
@@ -428,7 +428,7 @@ static int ea_read_header(AVFormatContext *s, |
428 | 428 |
if (!st) |
429 | 429 |
return AVERROR(ENOMEM); |
430 | 430 |
av_set_pts_info(st, 33, 1, ea->sample_rate); |
431 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
431 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
432 | 432 |
st->codec->codec_id = ea->audio_codec; |
433 | 433 |
st->codec->codec_tag = 0; /* no tag */ |
434 | 434 |
st->codec->channels = ea->num_channels; |
... | ... |
@@ -301,7 +301,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) |
301 | 301 |
codec->debug = get_be32(pb); |
302 | 302 |
/* specific info */ |
303 | 303 |
switch(codec->codec_type) { |
304 |
- case CODEC_TYPE_VIDEO: |
|
304 |
+ case AVMEDIA_TYPE_VIDEO: |
|
305 | 305 |
codec->time_base.num = get_be32(pb); |
306 | 306 |
codec->time_base.den = get_be32(pb); |
307 | 307 |
codec->width = get_be16(pb); |
... | ... |
@@ -350,7 +350,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) |
350 | 350 |
codec->refs = get_be32(pb); |
351 | 351 |
codec->directpred = get_be32(pb); |
352 | 352 |
break; |
353 |
- case CODEC_TYPE_AUDIO: |
|
353 |
+ case AVMEDIA_TYPE_AUDIO: |
|
354 | 354 |
codec->sample_rate = get_be32(pb); |
355 | 355 |
codec->channels = get_le16(pb); |
356 | 356 |
codec->frame_size = get_le16(pb); |
... | ... |
@@ -119,7 +119,7 @@ static int ffm_write_header(AVFormatContext *s) |
119 | 119 |
put_be32(pb, codec->debug); |
120 | 120 |
/* specific info */ |
121 | 121 |
switch(codec->codec_type) { |
122 |
- case CODEC_TYPE_VIDEO: |
|
122 |
+ case AVMEDIA_TYPE_VIDEO: |
|
123 | 123 |
put_be32(pb, codec->time_base.num); |
124 | 124 |
put_be32(pb, codec->time_base.den); |
125 | 125 |
put_be16(pb, codec->width); |
... | ... |
@@ -168,7 +168,7 @@ static int ffm_write_header(AVFormatContext *s) |
168 | 168 |
put_be32(pb, codec->refs); |
169 | 169 |
put_be32(pb, codec->directpred); |
170 | 170 |
break; |
171 |
- case CODEC_TYPE_AUDIO: |
|
171 |
+ case AVMEDIA_TYPE_AUDIO: |
|
172 | 172 |
put_be32(pb, codec->sample_rate); |
173 | 173 |
put_le16(pb, codec->channels); |
174 | 174 |
put_le16(pb, codec->frame_size); |
... | ... |
@@ -60,7 +60,7 @@ static int read_header(AVFormatContext *s, |
60 | 60 |
} |
61 | 61 |
|
62 | 62 |
url_fskip(pb, 2); |
63 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
63 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
64 | 64 |
st->codec->codec_id = CODEC_ID_RAWVIDEO; |
65 | 65 |
st->codec->pix_fmt = PIX_FMT_RGBA; |
66 | 66 |
st->codec->codec_tag = 0; /* no fourcc */ |
... | ... |
@@ -36,7 +36,7 @@ static int flac_read_header(AVFormatContext *s, |
36 | 36 |
AVStream *st = av_new_stream(s, 0); |
37 | 37 |
if (!st) |
38 | 38 |
return AVERROR(ENOMEM); |
39 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
39 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
40 | 40 |
st->codec->codec_id = CODEC_ID_FLAC; |
41 | 41 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
42 | 42 |
/* the parameters will be extracted from the compressed bitstream */ |
... | ... |
@@ -103,7 +103,7 @@ static int flic_read_header(AVFormatContext *s, |
103 | 103 |
if (!st) |
104 | 104 |
return AVERROR(ENOMEM); |
105 | 105 |
flic->video_stream_index = st->index; |
106 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
106 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
107 | 107 |
st->codec->codec_id = CODEC_ID_FLIC; |
108 | 108 |
st->codec->codec_tag = 0; /* no fourcc */ |
109 | 109 |
st->codec->width = AV_RL16(&header[0x08]); |
... | ... |
@@ -221,8 +221,8 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos) { |
221 | 221 |
//find the streams now so that amf_parse_object doesn't need to do the lookup every time it is called. |
222 | 222 |
for(i = 0; i < s->nb_streams; i++) { |
223 | 223 |
stream = s->streams[i]; |
224 |
- if (stream->codec->codec_type == CODEC_TYPE_AUDIO) astream = stream; |
|
225 |
- else if(stream->codec->codec_type == CODEC_TYPE_VIDEO) vstream = stream; |
|
224 |
+ if (stream->codec->codec_type == AVMEDIA_TYPE_AUDIO) astream = stream; |
|
225 |
+ else if(stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) vstream = stream; |
|
226 | 226 |
} |
227 | 227 |
|
228 | 228 |
//parse the second object (we want a mixed array) |
... | ... |
@@ -236,7 +236,7 @@ static AVStream *create_stream(AVFormatContext *s, int is_audio){ |
236 | 236 |
AVStream *st = av_new_stream(s, is_audio); |
237 | 237 |
if (!st) |
238 | 238 |
return NULL; |
239 |
- st->codec->codec_type = is_audio ? CODEC_TYPE_AUDIO : CODEC_TYPE_VIDEO; |
|
239 |
+ st->codec->codec_type = is_audio ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO; |
|
240 | 240 |
av_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */ |
241 | 241 |
return st; |
242 | 242 |
} |
... | ... |
@@ -166,7 +166,7 @@ static int flv_write_header(AVFormatContext *s) |
166 | 166 |
|
167 | 167 |
for(i=0; i<s->nb_streams; i++){ |
168 | 168 |
AVCodecContext *enc = s->streams[i]->codec; |
169 |
- if (enc->codec_type == CODEC_TYPE_VIDEO) { |
|
169 |
+ if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
170 | 170 |
if (s->streams[i]->r_frame_rate.den && s->streams[i]->r_frame_rate.num) { |
171 | 171 |
framerate = av_q2d(s->streams[i]->r_frame_rate); |
172 | 172 |
} else { |
... | ... |
@@ -275,7 +275,7 @@ static int flv_write_header(AVFormatContext *s) |
275 | 275 |
AVCodecContext *enc = s->streams[i]->codec; |
276 | 276 |
if (enc->codec_id == CODEC_ID_AAC || enc->codec_id == CODEC_ID_H264) { |
277 | 277 |
int64_t pos; |
278 |
- put_byte(pb, enc->codec_type == CODEC_TYPE_VIDEO ? |
|
278 |
+ put_byte(pb, enc->codec_type == AVMEDIA_TYPE_VIDEO ? |
|
279 | 279 |
FLV_TAG_TYPE_VIDEO : FLV_TAG_TYPE_AUDIO); |
280 | 280 |
put_be24(pb, 0); // size patched later |
281 | 281 |
put_be24(pb, 0); // ts |
... | ... |
@@ -342,7 +342,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) |
342 | 342 |
else |
343 | 343 |
flags_size= 1; |
344 | 344 |
|
345 |
- if (enc->codec_type == CODEC_TYPE_VIDEO) { |
|
345 |
+ if (enc->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
346 | 346 |
put_byte(pb, FLV_TAG_TYPE_VIDEO); |
347 | 347 |
|
348 | 348 |
flags = enc->codec_tag; |
... | ... |
@@ -353,7 +353,7 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) |
353 | 353 |
|
354 | 354 |
flags |= pkt->flags & PKT_FLAG_KEY ? FLV_FRAME_KEY : FLV_FRAME_INTER; |
355 | 355 |
} else { |
356 |
- assert(enc->codec_type == CODEC_TYPE_AUDIO); |
|
356 |
+ assert(enc->codec_type == AVMEDIA_TYPE_AUDIO); |
|
357 | 357 |
flags = get_audio_flags(enc); |
358 | 358 |
|
359 | 359 |
assert(size); |
... | ... |
@@ -266,7 +266,7 @@ static int gif_write_header(AVFormatContext *s) |
266 | 266 |
video_enc = NULL; |
267 | 267 |
for(i=0;i<s->nb_streams;i++) { |
268 | 268 |
enc = s->streams[i]->codec; |
269 |
- if (enc->codec_type != CODEC_TYPE_AUDIO) |
|
269 |
+ if (enc->codec_type != AVMEDIA_TYPE_AUDIO) |
|
270 | 270 |
video_enc = enc; |
271 | 271 |
} |
272 | 272 |
|
... | ... |
@@ -329,7 +329,7 @@ static int gif_write_video(AVFormatContext *s, |
329 | 329 |
static int gif_write_packet(AVFormatContext *s, AVPacket *pkt) |
330 | 330 |
{ |
331 | 331 |
AVCodecContext *codec = s->streams[pkt->stream_index]->codec; |
332 |
- if (codec->codec_type == CODEC_TYPE_AUDIO) |
|
332 |
+ if (codec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
333 | 333 |
return 0; /* just ignore audio */ |
334 | 334 |
else |
335 | 335 |
return gif_write_video(s, codec, pkt->data, pkt->size); |
... | ... |
@@ -87,34 +87,34 @@ static int get_sindex(AVFormatContext *s, int id, int format) { |
87 | 87 |
switch (format) { |
88 | 88 |
case 3: |
89 | 89 |
case 4: |
90 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
90 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
91 | 91 |
st->codec->codec_id = CODEC_ID_MJPEG; |
92 | 92 |
break; |
93 | 93 |
case 13: |
94 | 94 |
case 15: |
95 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
95 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
96 | 96 |
st->codec->codec_id = CODEC_ID_DVVIDEO; |
97 | 97 |
break; |
98 | 98 |
case 14: |
99 | 99 |
case 16: |
100 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
100 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
101 | 101 |
st->codec->codec_id = CODEC_ID_DVVIDEO; |
102 | 102 |
break; |
103 | 103 |
case 11: |
104 | 104 |
case 12: |
105 | 105 |
case 20: |
106 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
106 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
107 | 107 |
st->codec->codec_id = CODEC_ID_MPEG2VIDEO; |
108 | 108 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; //get keyframe flag etc. |
109 | 109 |
break; |
110 | 110 |
case 22: |
111 | 111 |
case 23: |
112 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
112 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
113 | 113 |
st->codec->codec_id = CODEC_ID_MPEG1VIDEO; |
114 | 114 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; //get keyframe flag etc. |
115 | 115 |
break; |
116 | 116 |
case 9: |
117 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
117 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
118 | 118 |
st->codec->codec_id = CODEC_ID_PCM_S24LE; |
119 | 119 |
st->codec->channels = 1; |
120 | 120 |
st->codec->sample_rate = 48000; |
... | ... |
@@ -123,7 +123,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { |
123 | 123 |
st->codec->bits_per_coded_sample = 24; |
124 | 124 |
break; |
125 | 125 |
case 10: |
126 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
126 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
127 | 127 |
st->codec->codec_id = CODEC_ID_PCM_S16LE; |
128 | 128 |
st->codec->channels = 1; |
129 | 129 |
st->codec->sample_rate = 48000; |
... | ... |
@@ -132,7 +132,7 @@ static int get_sindex(AVFormatContext *s, int id, int format) { |
132 | 132 |
st->codec->bits_per_coded_sample = 16; |
133 | 133 |
break; |
134 | 134 |
case 17: |
135 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
135 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
136 | 136 |
st->codec->codec_id = CODEC_ID_AC3; |
137 | 137 |
st->codec->channels = 2; |
138 | 138 |
st->codec->sample_rate = 48000; |
... | ... |
@@ -141,11 +141,11 @@ static int get_sindex(AVFormatContext *s, int id, int format) { |
141 | 141 |
case 7: |
142 | 142 |
case 8: |
143 | 143 |
case 24: |
144 |
- st->codec->codec_type = CODEC_TYPE_DATA; |
|
144 |
+ st->codec->codec_type = AVMEDIA_TYPE_DATA; |
|
145 | 145 |
st->codec->codec_id = CODEC_ID_NONE; |
146 | 146 |
break; |
147 | 147 |
default: |
148 |
- st->codec->codec_type = CODEC_TYPE_UNKNOWN; |
|
148 |
+ st->codec->codec_type = AVMEDIA_TYPE_UNKNOWN; |
|
149 | 149 |
st->codec->codec_id = CODEC_ID_NONE; |
150 | 150 |
break; |
151 | 151 |
} |
... | ... |
@@ -644,7 +644,7 @@ static int gxf_write_header(AVFormatContext *s) |
644 | 644 |
st->priv_data = sc; |
645 | 645 |
|
646 | 646 |
sc->media_type = ff_codec_get_tag(gxf_media_types, st->codec->codec_id); |
647 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
647 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
648 | 648 |
if (st->codec->codec_id != CODEC_ID_PCM_S16LE) { |
649 | 649 |
av_log(s, AV_LOG_ERROR, "only 16 BIT PCM LE allowed for now\n"); |
650 | 650 |
return -1; |
... | ... |
@@ -667,7 +667,7 @@ static int gxf_write_header(AVFormatContext *s) |
667 | 667 |
gxf->audio_tracks++; |
668 | 668 |
gxf->flags |= 0x04000000; /* audio is 16 bit pcm */ |
669 | 669 |
media_info = 'A'; |
670 |
- } else if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
670 |
+ } else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
671 | 671 |
if (i != 0) { |
672 | 672 |
av_log(s, AV_LOG_ERROR, "video stream must be the first track\n"); |
673 | 673 |
return -1; |
... | ... |
@@ -811,7 +811,7 @@ static int gxf_write_media_preamble(AVFormatContext *s, AVPacket *pkt, int size) |
811 | 811 |
/* If the video is frame-encoded, the frame numbers shall be represented by |
812 | 812 |
* even field numbers. |
813 | 813 |
* see SMPTE360M-2004 6.4.2.1.3 Media field number */ |
814 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
814 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
815 | 815 |
field_nb = gxf->nb_fields; |
816 | 816 |
} else { |
817 | 817 |
field_nb = av_rescale_rnd(pkt->dts, gxf->time_base.den, |
... | ... |
@@ -821,7 +821,7 @@ static int gxf_write_media_preamble(AVFormatContext *s, AVPacket *pkt, int size) |
821 | 821 |
put_byte(pb, sc->media_type); |
822 | 822 |
put_byte(pb, st->index); |
823 | 823 |
put_be32(pb, field_nb); |
824 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
824 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
825 | 825 |
put_be16(pb, 0); |
826 | 826 |
put_be16(pb, size / 2); |
827 | 827 |
} else if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO) { |
... | ... |
@@ -859,13 +859,13 @@ static int gxf_write_packet(AVFormatContext *s, AVPacket *pkt) |
859 | 859 |
gxf_write_packet_header(pb, PKT_MEDIA); |
860 | 860 |
if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO && pkt->size % 4) /* MPEG-2 frames must be padded */ |
861 | 861 |
padding = 4 - pkt->size % 4; |
862 |
- else if (st->codec->codec_type == CODEC_TYPE_AUDIO) |
|
862 |
+ else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
863 | 863 |
padding = GXF_AUDIO_PACKET_SIZE - pkt->size; |
864 | 864 |
gxf_write_media_preamble(s, pkt, pkt->size + padding); |
865 | 865 |
put_buffer(pb, pkt->data, pkt->size); |
866 | 866 |
gxf_write_padding(pb, padding); |
867 | 867 |
|
868 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
868 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
869 | 869 |
if (!(gxf->flt_entries_nb % 500)) { |
870 | 870 |
gxf->flt_entries = av_realloc(gxf->flt_entries, |
871 | 871 |
(gxf->flt_entries_nb+500)*sizeof(*gxf->flt_entries)); |
... | ... |
@@ -901,7 +901,7 @@ static int gxf_compare_field_nb(AVFormatContext *s, AVPacket *next, AVPacket *cu |
901 | 901 |
for (i = 0; i < 2; i++) { |
902 | 902 |
AVStream *st = s->streams[pkt[i]->stream_index]; |
903 | 903 |
sc[i] = st->priv_data; |
904 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
904 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
905 | 905 |
field_nb[i] = av_rescale_rnd(pkt[i]->dts, gxf->time_base.den, |
906 | 906 |
(int64_t)48000*gxf->time_base.num, AV_ROUND_UP); |
907 | 907 |
field_nb[i] &= ~1; // compare against even field number because audio must be before video |
... | ... |
@@ -915,7 +915,7 @@ static int gxf_compare_field_nb(AVFormatContext *s, AVPacket *next, AVPacket *cu |
915 | 915 |
|
916 | 916 |
static int gxf_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *pkt, int flush) |
917 | 917 |
{ |
918 |
- if (pkt && s->streams[pkt->stream_index]->codec->codec_type == CODEC_TYPE_VIDEO) |
|
918 |
+ if (pkt && s->streams[pkt->stream_index]->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
919 | 919 |
pkt->duration = 2; // enforce 2 fields |
920 | 920 |
return ff_audio_rechunk_interleave(s, out, pkt, flush, |
921 | 921 |
av_interleave_packet_per_dts, gxf_compare_field_nb); |
... | ... |
@@ -160,7 +160,7 @@ static int idcin_read_header(AVFormatContext *s, |
160 | 160 |
return AVERROR(ENOMEM); |
161 | 161 |
av_set_pts_info(st, 33, 1, IDCIN_FPS); |
162 | 162 |
idcin->video_stream_index = st->index; |
163 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
163 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
164 | 164 |
st->codec->codec_id = CODEC_ID_IDCIN; |
165 | 165 |
st->codec->codec_tag = 0; /* no fourcc */ |
166 | 166 |
st->codec->width = width; |
... | ... |
@@ -183,7 +183,7 @@ static int idcin_read_header(AVFormatContext *s, |
183 | 183 |
return AVERROR(ENOMEM); |
184 | 184 |
av_set_pts_info(st, 33, 1, IDCIN_FPS); |
185 | 185 |
idcin->audio_stream_index = st->index; |
186 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
186 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
187 | 187 |
st->codec->codec_tag = 1; |
188 | 188 |
st->codec->channels = channels; |
189 | 189 |
st->codec->sample_rate = sample_rate; |
... | ... |
@@ -89,7 +89,7 @@ static int roq_read_header(AVFormatContext *s, |
89 | 89 |
return AVERROR(ENOMEM); |
90 | 90 |
av_set_pts_info(st, 63, 1, framerate); |
91 | 91 |
roq->video_stream_index = st->index; |
92 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
92 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
93 | 93 |
st->codec->codec_id = CODEC_ID_ROQ; |
94 | 94 |
st->codec->codec_tag = 0; /* no fourcc */ |
95 | 95 |
|
... | ... |
@@ -171,7 +171,7 @@ static int roq_read_packet(AVFormatContext *s, |
171 | 171 |
return AVERROR(ENOMEM); |
172 | 172 |
av_set_pts_info(st, 32, 1, RoQ_AUDIO_SAMPLE_RATE); |
173 | 173 |
roq->audio_stream_index = st->index; |
174 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
174 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
175 | 175 |
st->codec->codec_id = CODEC_ID_ROQ_DPCM; |
176 | 176 |
st->codec->codec_tag = 0; /* no tag */ |
177 | 177 |
st->codec->channels = roq->audio_channels = chunk_type == RoQ_SOUND_STEREO ? 2 : 1; |
... | ... |
@@ -119,7 +119,7 @@ static int iff_read_header(AVFormatContext *s, |
119 | 119 |
|
120 | 120 |
switch(chunk_id) { |
121 | 121 |
case ID_VHDR: |
122 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
122 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
123 | 123 |
url_fskip(pb, 12); |
124 | 124 |
st->codec->sample_rate = get_be16(pb); |
125 | 125 |
url_fskip(pb, 1); |
... | ... |
@@ -146,7 +146,7 @@ static int iff_read_header(AVFormatContext *s, |
146 | 146 |
break; |
147 | 147 |
|
148 | 148 |
case ID_BMHD: |
149 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
149 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
150 | 150 |
st->codec->width = get_be16(pb); |
151 | 151 |
st->codec->height = get_be16(pb); |
152 | 152 |
url_fskip(pb, 4); // x, y offset |
... | ... |
@@ -175,7 +175,7 @@ static int iff_read_header(AVFormatContext *s, |
175 | 175 |
} |
176 | 176 |
|
177 | 177 |
switch(st->codec->codec_type) { |
178 |
- case CODEC_TYPE_AUDIO: |
|
178 |
+ case AVMEDIA_TYPE_AUDIO: |
|
179 | 179 |
av_set_pts_info(st, 32, 1, st->codec->sample_rate); |
180 | 180 |
|
181 | 181 |
switch(compression) { |
... | ... |
@@ -198,7 +198,7 @@ static int iff_read_header(AVFormatContext *s, |
198 | 198 |
st->codec->block_align = st->codec->channels * st->codec->bits_per_coded_sample; |
199 | 199 |
break; |
200 | 200 |
|
201 |
- case CODEC_TYPE_VIDEO: |
|
201 |
+ case AVMEDIA_TYPE_VIDEO: |
|
202 | 202 |
switch (compression) { |
203 | 203 |
case BITMAP_RAW: |
204 | 204 |
if (st->codec->codec_tag == ID_ILBM) { |
... | ... |
@@ -256,7 +256,7 @@ static int iff_read_packet(AVFormatContext *s, |
256 | 256 |
st->codec->extradata_size = 0; |
257 | 257 |
|
258 | 258 |
ret = get_buffer(pb, pkt->data, iff->body_size); |
259 |
- } else if (s->streams[0]->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
259 |
+ } else if (s->streams[0]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
260 | 260 |
ret = av_get_packet(pb, pkt, iff->body_size); |
261 | 261 |
} else { |
262 | 262 |
ret = av_get_packet(pb, pkt, PACKET_SIZE); |
... | ... |
@@ -265,13 +265,13 @@ static int iff_read_packet(AVFormatContext *s, |
265 | 265 |
if(iff->sent_bytes == 0) |
266 | 266 |
pkt->flags |= PKT_FLAG_KEY; |
267 | 267 |
|
268 |
- if(s->streams[0]->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
268 |
+ if(s->streams[0]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
269 | 269 |
iff->sent_bytes += PACKET_SIZE; |
270 | 270 |
} else { |
271 | 271 |
iff->sent_bytes = iff->body_size; |
272 | 272 |
} |
273 | 273 |
pkt->stream_index = 0; |
274 |
- if(s->streams[0]->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
274 |
+ if(s->streams[0]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
275 | 275 |
pkt->pts = iff->audio_frame_count; |
276 | 276 |
iff->audio_frame_count += ret / s->streams[0]->codec->channels; |
277 | 277 |
} |
... | ... |
@@ -233,16 +233,16 @@ static int img_read_header(AVFormatContext *s1, AVFormatParameters *ap) |
233 | 233 |
} |
234 | 234 |
|
235 | 235 |
if(s1->video_codec_id){ |
236 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
236 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
237 | 237 |
st->codec->codec_id = s1->video_codec_id; |
238 | 238 |
}else if(s1->audio_codec_id){ |
239 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
239 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
240 | 240 |
st->codec->codec_id = s1->audio_codec_id; |
241 | 241 |
}else{ |
242 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
242 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
243 | 243 |
st->codec->codec_id = av_str2id(img_tags, s->path); |
244 | 244 |
} |
245 |
- if(st->codec->codec_type == CODEC_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE) |
|
245 |
+ if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO && ap->pix_fmt != PIX_FMT_NONE) |
|
246 | 246 |
st->codec->pix_fmt = ap->pix_fmt; |
247 | 247 |
|
248 | 248 |
return 0; |
... | ... |
@@ -566,7 +566,7 @@ static int ipmovie_read_header(AVFormatContext *s, |
566 | 566 |
return AVERROR(ENOMEM); |
567 | 567 |
av_set_pts_info(st, 63, 1, 1000000); |
568 | 568 |
ipmovie->video_stream_index = st->index; |
569 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
569 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
570 | 570 |
st->codec->codec_id = CODEC_ID_INTERPLAY_VIDEO; |
571 | 571 |
st->codec->codec_tag = 0; /* no fourcc */ |
572 | 572 |
st->codec->width = ipmovie->video_width; |
... | ... |
@@ -582,7 +582,7 @@ static int ipmovie_read_header(AVFormatContext *s, |
582 | 582 |
return AVERROR(ENOMEM); |
583 | 583 |
av_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate); |
584 | 584 |
ipmovie->audio_stream_index = st->index; |
585 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
585 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
586 | 586 |
st->codec->codec_id = ipmovie->audio_type; |
587 | 587 |
st->codec->codec_tag = 0; /* no tag */ |
588 | 588 |
st->codec->channels = ipmovie->audio_channels; |
... | ... |
@@ -92,7 +92,7 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap) |
92 | 92 |
st = av_new_stream(s, 0); |
93 | 93 |
if (!st) |
94 | 94 |
return AVERROR(ENOMEM); |
95 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
95 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
96 | 96 |
st->codec->codec_id = CODEC_ID_ADPCM_IMA_ISS; |
97 | 97 |
st->codec->channels = stereo ? 2 : 1; |
98 | 98 |
st->codec->sample_rate = 44100; |
... | ... |
@@ -44,7 +44,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) |
44 | 44 |
if (!st) |
45 | 45 |
return AVERROR(ENOMEM); |
46 | 46 |
|
47 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
47 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
48 | 48 |
st->codec->codec_id = CODEC_ID_MPEG4; |
49 | 49 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
50 | 50 |
av_set_pts_info(st, 64, 1, 90000); |
... | ... |
@@ -77,14 +77,14 @@ static int nut_write_header(AVFormatContext * avf) { |
77 | 77 |
int fourcc = 0; |
78 | 78 |
int num, denom, ssize; |
79 | 79 |
|
80 |
- s[i].type = codec->codec_type == CODEC_TYPE_VIDEO ? NUT_VIDEO_CLASS : NUT_AUDIO_CLASS; |
|
80 |
+ s[i].type = codec->codec_type == AVMEDIA_TYPE_VIDEO ? NUT_VIDEO_CLASS : NUT_AUDIO_CLASS; |
|
81 | 81 |
|
82 | 82 |
if (codec->codec_tag) fourcc = codec->codec_tag; |
83 | 83 |
else fourcc = ff_codec_get_tag(nut_tags, codec->codec_id); |
84 | 84 |
|
85 | 85 |
if (!fourcc) { |
86 |
- if (codec->codec_type == CODEC_TYPE_VIDEO) fourcc = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id); |
|
87 |
- if (codec->codec_type == CODEC_TYPE_AUDIO) fourcc = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id); |
|
86 |
+ if (codec->codec_type == AVMEDIA_TYPE_VIDEO) fourcc = ff_codec_get_tag(ff_codec_bmp_tags, codec->codec_id); |
|
87 |
+ if (codec->codec_type == AVMEDIA_TYPE_AUDIO) fourcc = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id); |
|
88 | 88 |
} |
89 | 89 |
|
90 | 90 |
s[i].fourcc_len = 4; |
... | ... |
@@ -102,7 +102,7 @@ static int nut_write_header(AVFormatContext * avf) { |
102 | 102 |
s[i].codec_specific_len = codec->extradata_size; |
103 | 103 |
s[i].codec_specific = codec->extradata; |
104 | 104 |
|
105 |
- if (codec->codec_type == CODEC_TYPE_VIDEO) { |
|
105 |
+ if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
106 | 106 |
s[i].width = codec->width; |
107 | 107 |
s[i].height = codec->height; |
108 | 108 |
s[i].sample_width = 0; |
... | ... |
@@ -234,14 +234,14 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) { |
234 | 234 |
|
235 | 235 |
switch(s[i].type) { |
236 | 236 |
case NUT_AUDIO_CLASS: |
237 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
237 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
238 | 238 |
if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, st->codec->codec_tag); |
239 | 239 |
|
240 | 240 |
st->codec->channels = s[i].channel_count; |
241 | 241 |
st->codec->sample_rate = s[i].samplerate_num / s[i].samplerate_denom; |
242 | 242 |
break; |
243 | 243 |
case NUT_VIDEO_CLASS: |
244 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
244 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
245 | 245 |
if (st->codec->codec_id == CODEC_ID_NONE) st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, st->codec->codec_tag); |
246 | 246 |
|
247 | 247 |
st->codec->width = s[i].width; |
... | ... |
@@ -62,14 +62,14 @@ static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) { |
62 | 62 |
|
63 | 63 |
if (!(st = av_new_stream(s, 0))) |
64 | 64 |
return AVERROR(ENOMEM); |
65 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
65 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
66 | 66 |
st->codec->codec_id = CODEC_ID_MPEG4; |
67 | 67 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; |
68 | 68 |
av_set_pts_info(st, 64, 1001, 30000); |
69 | 69 |
|
70 | 70 |
if (!(st = av_new_stream(s, 1))) |
71 | 71 |
return AVERROR(ENOMEM); |
72 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
72 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
73 | 73 |
st->codec->codec_id = CODEC_ID_MP2; |
74 | 74 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; |
75 | 75 |
|
... | ... |
@@ -1378,7 +1378,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) |
1378 | 1378 |
} |
1379 | 1379 |
|
1380 | 1380 |
if (track->type == MATROSKA_TRACK_TYPE_VIDEO) { |
1381 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
1381 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
1382 | 1382 |
st->codec->codec_tag = track->video.fourcc; |
1383 | 1383 |
st->codec->width = track->video.pixel_width; |
1384 | 1384 |
st->codec->height = track->video.pixel_height; |
... | ... |
@@ -1390,11 +1390,11 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) |
1390 | 1390 |
if (st->codec->codec_id != CODEC_ID_H264) |
1391 | 1391 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; |
1392 | 1392 |
} else if (track->type == MATROSKA_TRACK_TYPE_AUDIO) { |
1393 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
1393 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
1394 | 1394 |
st->codec->sample_rate = track->audio.out_samplerate; |
1395 | 1395 |
st->codec->channels = track->audio.channels; |
1396 | 1396 |
} else if (track->type == MATROSKA_TRACK_TYPE_SUBTITLE) { |
1397 |
- st->codec->codec_type = CODEC_TYPE_SUBTITLE; |
|
1397 |
+ st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; |
|
1398 | 1398 |
} |
1399 | 1399 |
} |
1400 | 1400 |
|
... | ... |
@@ -1409,7 +1409,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap) |
1409 | 1409 |
break; |
1410 | 1410 |
av_metadata_set(&st->metadata, "filename",attachements[j].filename); |
1411 | 1411 |
st->codec->codec_id = CODEC_ID_NONE; |
1412 |
- st->codec->codec_type = CODEC_TYPE_ATTACHMENT; |
|
1412 |
+ st->codec->codec_type = AVMEDIA_TYPE_ATTACHMENT; |
|
1413 | 1413 |
st->codec->extradata = av_malloc(attachements[j].bin.size); |
1414 | 1414 |
if(st->codec->extradata == NULL) |
1415 | 1415 |
break; |
... | ... |
@@ -475,7 +475,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, ByteIOContext *pb, AVCodec |
475 | 475 |
ret = ff_isom_write_avcc(dyn_cp, codec->extradata, codec->extradata_size); |
476 | 476 |
else if (codec->extradata_size) |
477 | 477 |
put_buffer(dyn_cp, codec->extradata, codec->extradata_size); |
478 |
- } else if (codec->codec_type == CODEC_TYPE_VIDEO) { |
|
478 |
+ } else if (codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
479 | 479 |
if (qt_id) { |
480 | 480 |
if (!codec->codec_tag) |
481 | 481 |
codec->codec_tag = ff_codec_get_tag(codec_movvideo_tags, codec->codec_id); |
... | ... |
@@ -492,7 +492,7 @@ static int mkv_write_codecprivate(AVFormatContext *s, ByteIOContext *pb, AVCodec |
492 | 492 |
ff_put_bmp_header(dyn_cp, codec, ff_codec_bmp_tags, 0); |
493 | 493 |
} |
494 | 494 |
|
495 |
- } else if (codec->codec_type == CODEC_TYPE_AUDIO) { |
|
495 |
+ } else if (codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
496 | 496 |
unsigned int tag; |
497 | 497 |
tag = ff_codec_get_tag(ff_codec_wav_tags, codec->codec_id); |
498 | 498 |
if (!tag) { |
... | ... |
@@ -565,7 +565,7 @@ static int mkv_write_tracks(AVFormatContext *s) |
565 | 565 |
} |
566 | 566 |
|
567 | 567 |
switch (codec->codec_type) { |
568 |
- case CODEC_TYPE_VIDEO: |
|
568 |
+ case AVMEDIA_TYPE_VIDEO: |
|
569 | 569 |
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO); |
570 | 570 |
|
571 | 571 |
if (!native_id && |
... | ... |
@@ -596,7 +596,7 @@ static int mkv_write_tracks(AVFormatContext *s) |
596 | 596 |
end_ebml_master(pb, subinfo); |
597 | 597 |
break; |
598 | 598 |
|
599 |
- case CODEC_TYPE_AUDIO: |
|
599 |
+ case AVMEDIA_TYPE_AUDIO: |
|
600 | 600 |
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_AUDIO); |
601 | 601 |
|
602 | 602 |
if (!native_id) |
... | ... |
@@ -613,7 +613,7 @@ static int mkv_write_tracks(AVFormatContext *s) |
613 | 613 |
end_ebml_master(pb, subinfo); |
614 | 614 |
break; |
615 | 615 |
|
616 |
- case CODEC_TYPE_SUBTITLE: |
|
616 |
+ case AVMEDIA_TYPE_SUBTITLE: |
|
617 | 617 |
put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_SUBTITLE); |
618 | 618 |
break; |
619 | 619 |
default: |
... | ... |
@@ -893,7 +893,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) |
893 | 893 |
av_md5_update(mkv->md5_ctx, pkt->data, FFMIN(200, pkt->size)); |
894 | 894 |
} |
895 | 895 |
|
896 |
- if (codec->codec_type != CODEC_TYPE_SUBTITLE) { |
|
896 |
+ if (codec->codec_type != AVMEDIA_TYPE_SUBTITLE) { |
|
897 | 897 |
mkv_write_block(s, pb, MATROSKA_ID_SIMPLEBLOCK, pkt, keyframe << 7); |
898 | 898 |
} else if (codec->codec_id == CODEC_ID_SSA) { |
899 | 899 |
duration = mkv_write_ass_blocks(s, pb, pkt); |
... | ... |
@@ -905,7 +905,7 @@ static int mkv_write_packet(AVFormatContext *s, AVPacket *pkt) |
905 | 905 |
end_ebml_master(pb, blockgroup); |
906 | 906 |
} |
907 | 907 |
|
908 |
- if (codec->codec_type == CODEC_TYPE_VIDEO && keyframe) { |
|
908 |
+ if (codec->codec_type == AVMEDIA_TYPE_VIDEO && keyframe) { |
|
909 | 909 |
ret = mkv_add_cuepoint(mkv->cues, pkt->stream_index, ts, mkv->cluster_pos); |
910 | 910 |
if (ret < 0) return ret; |
911 | 911 |
} |
... | ... |
@@ -108,7 +108,7 @@ static int read_header(AVFormatContext *s, |
108 | 108 |
st = av_new_stream(s, 0); |
109 | 109 |
if (!st) |
110 | 110 |
return AVERROR(ENOMEM); |
111 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
111 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
112 | 112 |
st->codec->codec_id = CODEC_ID_MMVIDEO; |
113 | 113 |
st->codec->codec_tag = 0; /* no fourcc */ |
114 | 114 |
st->codec->width = width; |
... | ... |
@@ -120,7 +120,7 @@ static int read_header(AVFormatContext *s, |
120 | 120 |
st = av_new_stream(s, 0); |
121 | 121 |
if (!st) |
122 | 122 |
return AVERROR(ENOMEM); |
123 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
123 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
124 | 124 |
st->codec->codec_tag = 0; /* no fourcc */ |
125 | 125 |
st->codec->codec_id = CODEC_ID_PCM_U8; |
126 | 126 |
st->codec->channels = 1; |
... | ... |
@@ -244,7 +244,7 @@ static int mmf_read_header(AVFormatContext *s, |
244 | 244 |
if (!st) |
245 | 245 |
return AVERROR(ENOMEM); |
246 | 246 |
|
247 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
247 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
248 | 248 |
st->codec->codec_id = CODEC_ID_ADPCM_YAMAHA; |
249 | 249 |
st->codec->sample_rate = rate; |
250 | 250 |
st->codec->channels = 1; |
... | ... |
@@ -411,13 +411,13 @@ static int mov_read_hdlr(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
411 | 411 |
dprintf(c->fc, "stype= %.4s\n", (char*)&type); |
412 | 412 |
|
413 | 413 |
if (type == MKTAG('v','i','d','e')) |
414 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
414 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
415 | 415 |
else if(type == MKTAG('s','o','u','n')) |
416 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
416 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
417 | 417 |
else if(type == MKTAG('m','1','a',' ')) |
418 | 418 |
st->codec->codec_id = CODEC_ID_MP2; |
419 | 419 |
else if(type == MKTAG('s','u','b','p')) |
420 |
- st->codec->codec_type = CODEC_TYPE_SUBTITLE; |
|
420 |
+ st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; |
|
421 | 421 |
|
422 | 422 |
get_be32(pb); /* component manufacture */ |
423 | 423 |
get_be32(pb); /* component flags */ |
... | ... |
@@ -933,19 +933,19 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
933 | 933 |
if (id<=0 && ((format&0xFFFF) == 'm'+('s'<<8) || (format&0xFFFF) == 'T'+('S'<<8))) |
934 | 934 |
id = ff_codec_get_id(ff_codec_wav_tags, bswap_32(format)&0xFFFF); |
935 | 935 |
|
936 |
- if (st->codec->codec_type != CODEC_TYPE_VIDEO && id > 0) { |
|
937 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
938 |
- } else if (st->codec->codec_type != CODEC_TYPE_AUDIO && /* do not overwrite codec type */ |
|
936 |
+ if (st->codec->codec_type != AVMEDIA_TYPE_VIDEO && id > 0) { |
|
937 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
938 |
+ } else if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO && /* do not overwrite codec type */ |
|
939 | 939 |
format && format != MKTAG('m','p','4','s')) { /* skip old asf mpeg4 tag */ |
940 | 940 |
id = ff_codec_get_id(codec_movvideo_tags, format); |
941 | 941 |
if (id <= 0) |
942 | 942 |
id = ff_codec_get_id(ff_codec_bmp_tags, format); |
943 | 943 |
if (id > 0) |
944 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
945 |
- else if(st->codec->codec_type == CODEC_TYPE_DATA){ |
|
944 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
945 |
+ else if(st->codec->codec_type == AVMEDIA_TYPE_DATA){ |
|
946 | 946 |
id = ff_codec_get_id(ff_codec_movsubtitle_tags, format); |
947 | 947 |
if(id > 0) |
948 |
- st->codec->codec_type = CODEC_TYPE_SUBTITLE; |
|
948 |
+ st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; |
|
949 | 949 |
} |
950 | 950 |
} |
951 | 951 |
|
... | ... |
@@ -953,7 +953,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
953 | 953 |
(format >> 0) & 0xff, (format >> 8) & 0xff, (format >> 16) & 0xff, |
954 | 954 |
(format >> 24) & 0xff, st->codec->codec_type); |
955 | 955 |
|
956 |
- if(st->codec->codec_type==CODEC_TYPE_VIDEO) { |
|
956 |
+ if(st->codec->codec_type==AVMEDIA_TYPE_VIDEO) { |
|
957 | 957 |
unsigned int color_depth, len; |
958 | 958 |
int color_greyscale; |
959 | 959 |
|
... | ... |
@@ -1057,7 +1057,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
1057 | 1057 |
} |
1058 | 1058 |
st->codec->palctrl->palette_changed = 1; |
1059 | 1059 |
} |
1060 |
- } else if(st->codec->codec_type==CODEC_TYPE_AUDIO) { |
|
1060 |
+ } else if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO) { |
|
1061 | 1061 |
int bits_per_sample, flags; |
1062 | 1062 |
uint16_t version = get_be16(pb); |
1063 | 1063 |
|
... | ... |
@@ -1137,7 +1137,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
1137 | 1137 |
st->codec->bits_per_coded_sample = bits_per_sample; |
1138 | 1138 |
sc->sample_size = (bits_per_sample >> 3) * st->codec->channels; |
1139 | 1139 |
} |
1140 |
- } else if(st->codec->codec_type==CODEC_TYPE_SUBTITLE){ |
|
1140 |
+ } else if(st->codec->codec_type==AVMEDIA_TYPE_SUBTITLE){ |
|
1141 | 1141 |
// ttxt stsd contains display flags, justification, background |
1142 | 1142 |
// color, fonts, and default styles, so fake an atom to read it |
1143 | 1143 |
MOVAtom fake_atom = { .size = size - (url_ftell(pb) - start_pos) }; |
... | ... |
@@ -1159,7 +1159,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
1159 | 1159 |
url_fskip(pb, a.size); |
1160 | 1160 |
} |
1161 | 1161 |
|
1162 |
- if(st->codec->codec_type==CODEC_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) |
|
1162 |
+ if(st->codec->codec_type==AVMEDIA_TYPE_AUDIO && st->codec->sample_rate==0 && sc->time_scale>1) |
|
1163 | 1163 |
st->codec->sample_rate= sc->time_scale; |
1164 | 1164 |
|
1165 | 1165 |
/* special codec parameters handling */ |
... | ... |
@@ -1196,7 +1196,7 @@ static int mov_read_stsd(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
1196 | 1196 |
break; |
1197 | 1197 |
case CODEC_ID_MP2: |
1198 | 1198 |
case CODEC_ID_MP3: |
1199 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; /* force type after stsd for m1a hdlr */ |
|
1199 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; /* force type after stsd for m1a hdlr */ |
|
1200 | 1200 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
1201 | 1201 |
break; |
1202 | 1202 |
case CODEC_ID_GSM: |
... | ... |
@@ -1490,7 +1490,7 @@ static void mov_build_index(MOVContext *mov, AVStream *st) |
1490 | 1490 |
} |
1491 | 1491 |
|
1492 | 1492 |
/* only use old uncompressed audio chunk demuxing when stts specifies it */ |
1493 |
- if (!(st->codec->codec_type == CODEC_TYPE_AUDIO && |
|
1493 |
+ if (!(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && |
|
1494 | 1494 |
sc->stts_count == 1 && sc->stts_data[0].duration == 1)) { |
1495 | 1495 |
unsigned int current_sample = 0; |
1496 | 1496 |
unsigned int stts_sample = 0; |
... | ... |
@@ -1698,7 +1698,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
1698 | 1698 |
if (!sc) return AVERROR(ENOMEM); |
1699 | 1699 |
|
1700 | 1700 |
st->priv_data = sc; |
1701 |
- st->codec->codec_type = CODEC_TYPE_DATA; |
|
1701 |
+ st->codec->codec_type = AVMEDIA_TYPE_DATA; |
|
1702 | 1702 |
sc->ffindex = st->index; |
1703 | 1703 |
|
1704 | 1704 |
if ((ret = mov_read_default(c, pb, atom)) < 0) |
... | ... |
@@ -1721,7 +1721,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
1721 | 1721 |
|
1722 | 1722 |
av_set_pts_info(st, 64, 1, sc->time_scale); |
1723 | 1723 |
|
1724 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO && |
|
1724 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && |
|
1725 | 1725 |
!st->codec->frame_size && sc->stts_count == 1) { |
1726 | 1726 |
st->codec->frame_size = av_rescale(sc->stts_data[0].duration, |
1727 | 1727 |
st->codec->sample_rate, sc->time_scale); |
... | ... |
@@ -1741,7 +1741,7 @@ static int mov_read_trak(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
1741 | 1741 |
} else |
1742 | 1742 |
sc->pb = c->fc->pb; |
1743 | 1743 |
|
1744 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
1744 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
1745 | 1745 |
if (st->codec->width != sc->width || st->codec->height != sc->height) { |
1746 | 1746 |
AVRational r = av_d2q(((double)st->codec->height * sc->width) / |
1747 | 1747 |
((double)st->codec->width * sc->height), INT_MAX); |
... | ... |
@@ -2004,7 +2004,7 @@ static int mov_read_trun(MOVContext *c, ByteIOContext *pb, MOVAtom atom) |
2004 | 2004 |
sc->ctts_data[sc->ctts_count].duration = get_be32(pb); |
2005 | 2005 |
sc->ctts_count++; |
2006 | 2006 |
} |
2007 |
- if ((keyframe = st->codec->codec_type == CODEC_TYPE_AUDIO || |
|
2007 |
+ if ((keyframe = st->codec->codec_type == AVMEDIA_TYPE_AUDIO || |
|
2008 | 2008 |
(flags & 0x004 && !i && !sample_flags) || sample_flags & 0x2000000)) |
2009 | 2009 |
distance = 0; |
2010 | 2010 |
av_add_index_entry(st, offset, dts, sample_size, distance, |
... | ... |
@@ -333,7 +333,7 @@ static int mov_write_esds_tag(ByteIOContext *pb, MOVTrack *track) // Basic |
333 | 333 |
|
334 | 334 |
// the following fields is made of 6 bits to identify the streamtype (4 for video, 5 for audio) |
335 | 335 |
// plus 1 bit to indicate upstream and 1 bit set to 1 (reserved) |
336 |
- if(track->enc->codec_type == CODEC_TYPE_AUDIO) |
|
336 |
+ if(track->enc->codec_type == AVMEDIA_TYPE_AUDIO) |
|
337 | 337 |
put_byte(pb, 0x15); // flags (= Audiostream) |
338 | 338 |
else |
339 | 339 |
put_byte(pb, 0x11); // flags (= Visualstream) |
... | ... |
@@ -620,8 +620,8 @@ static int mp4_get_codec_tag(AVFormatContext *s, MOVTrack *track) |
620 | 620 |
else if (track->enc->codec_id == CODEC_ID_AC3) tag = MKTAG('a','c','-','3'); |
621 | 621 |
else if (track->enc->codec_id == CODEC_ID_DIRAC) tag = MKTAG('d','r','a','c'); |
622 | 622 |
else if (track->enc->codec_id == CODEC_ID_MOV_TEXT) tag = MKTAG('t','x','3','g'); |
623 |
- else if (track->enc->codec_type == CODEC_TYPE_VIDEO) tag = MKTAG('m','p','4','v'); |
|
624 |
- else if (track->enc->codec_type == CODEC_TYPE_AUDIO) tag = MKTAG('m','p','4','a'); |
|
623 |
+ else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) tag = MKTAG('m','p','4','v'); |
|
624 |
+ else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) tag = MKTAG('m','p','4','a'); |
|
625 | 625 |
|
626 | 626 |
return tag; |
627 | 627 |
} |
... | ... |
@@ -642,7 +642,7 @@ static int ipod_get_codec_tag(AVFormatContext *s, MOVTrack *track) |
642 | 642 |
int tag = track->enc->codec_tag; |
643 | 643 |
|
644 | 644 |
// keep original tag for subs, ipod supports both formats |
645 |
- if (!(track->enc->codec_type == CODEC_TYPE_SUBTITLE && |
|
645 |
+ if (!(track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE && |
|
646 | 646 |
(tag == MKTAG('t','x','3','g') || |
647 | 647 |
tag == MKTAG('t','e','x','t')))) |
648 | 648 |
tag = ff_codec_get_tag(codec_ipod_tags, track->enc->codec_id); |
... | ... |
@@ -714,7 +714,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track) |
714 | 714 |
tag = mov_get_dv_codec_tag(s, track); |
715 | 715 |
else if (track->enc->codec_id == CODEC_ID_RAWVIDEO) |
716 | 716 |
tag = mov_get_rawvideo_codec_tag(s, track); |
717 |
- else if (track->enc->codec_type == CODEC_TYPE_VIDEO) { |
|
717 |
+ else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
718 | 718 |
tag = ff_codec_get_tag(codec_movvideo_tags, track->enc->codec_id); |
719 | 719 |
if (!tag) { // if no mac fcc found, try with Microsoft tags |
720 | 720 |
tag = ff_codec_get_tag(ff_codec_bmp_tags, track->enc->codec_id); |
... | ... |
@@ -722,7 +722,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track) |
722 | 722 |
av_log(s, AV_LOG_INFO, "Warning, using MS style video codec tag, " |
723 | 723 |
"the file may be unplayable!\n"); |
724 | 724 |
} |
725 |
- } else if (track->enc->codec_type == CODEC_TYPE_AUDIO) { |
|
725 |
+ } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
726 | 726 |
tag = ff_codec_get_tag(codec_movaudio_tags, track->enc->codec_id); |
727 | 727 |
if (!tag) { // if no mac fcc found, try with Microsoft tags |
728 | 728 |
int ms_tag = ff_codec_get_tag(ff_codec_wav_tags, track->enc->codec_id); |
... | ... |
@@ -732,7 +732,7 @@ static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track) |
732 | 732 |
"the file may be unplayable!\n"); |
733 | 733 |
} |
734 | 734 |
} |
735 |
- } else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) |
|
735 |
+ } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) |
|
736 | 736 |
tag = ff_codec_get_tag(ff_codec_movsubtitle_tags, track->enc->codec_id); |
737 | 737 |
} |
738 | 738 |
|
... | ... |
@@ -868,11 +868,11 @@ static int mov_write_stsd_tag(ByteIOContext *pb, MOVTrack *track) |
868 | 868 |
put_tag(pb, "stsd"); |
869 | 869 |
put_be32(pb, 0); /* version & flags */ |
870 | 870 |
put_be32(pb, 1); /* entry count */ |
871 |
- if (track->enc->codec_type == CODEC_TYPE_VIDEO) |
|
871 |
+ if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) |
|
872 | 872 |
mov_write_video_tag(pb, track); |
873 |
- else if (track->enc->codec_type == CODEC_TYPE_AUDIO) |
|
873 |
+ else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) |
|
874 | 874 |
mov_write_audio_tag(pb, track); |
875 |
- else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) |
|
875 |
+ else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) |
|
876 | 876 |
mov_write_subtitle_tag(pb, track); |
877 | 877 |
return updateSize(pb, pos); |
878 | 878 |
} |
... | ... |
@@ -918,7 +918,7 @@ static int mov_write_stts_tag(ByteIOContext *pb, MOVTrack *track) |
918 | 918 |
uint32_t atom_size; |
919 | 919 |
int i; |
920 | 920 |
|
921 |
- if (track->enc->codec_type == CODEC_TYPE_AUDIO && !track->audio_vbr) { |
|
921 |
+ if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO && !track->audio_vbr) { |
|
922 | 922 |
stts_entries = av_malloc(sizeof(*stts_entries)); /* one entry */ |
923 | 923 |
stts_entries[0].count = track->sampleCount; |
924 | 924 |
stts_entries[0].duration = 1; |
... | ... |
@@ -973,12 +973,12 @@ static int mov_write_stbl_tag(ByteIOContext *pb, MOVTrack *track) |
973 | 973 |
put_tag(pb, "stbl"); |
974 | 974 |
mov_write_stsd_tag(pb, track); |
975 | 975 |
mov_write_stts_tag(pb, track); |
976 |
- if (track->enc->codec_type == CODEC_TYPE_VIDEO && |
|
976 |
+ if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && |
|
977 | 977 |
track->hasKeyframes && track->hasKeyframes < track->entry) |
978 | 978 |
mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE); |
979 | 979 |
if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS) |
980 | 980 |
mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE); |
981 |
- if (track->enc->codec_type == CODEC_TYPE_VIDEO && |
|
981 |
+ if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO && |
|
982 | 982 |
track->flags & MOV_TRACK_CTTS) |
983 | 983 |
mov_write_ctts_tag(pb, track); |
984 | 984 |
mov_write_stsc_tag(pb, track); |
... | ... |
@@ -1050,13 +1050,13 @@ static int mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track) |
1050 | 1050 |
descr = "DataHandler"; |
1051 | 1051 |
} else { |
1052 | 1052 |
hdlr = (track->mode == MODE_MOV) ? "mhlr" : "\0\0\0\0"; |
1053 |
- if (track->enc->codec_type == CODEC_TYPE_VIDEO) { |
|
1053 |
+ if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
1054 | 1054 |
hdlr_type = "vide"; |
1055 | 1055 |
descr = "VideoHandler"; |
1056 |
- } else if (track->enc->codec_type == CODEC_TYPE_AUDIO) { |
|
1056 |
+ } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
1057 | 1057 |
hdlr_type = "soun"; |
1058 | 1058 |
descr = "SoundHandler"; |
1059 |
- } else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) { |
|
1059 |
+ } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { |
|
1060 | 1060 |
if (track->tag == MKTAG('t','x','3','g')) hdlr_type = "sbtl"; |
1061 | 1061 |
else hdlr_type = "text"; |
1062 | 1062 |
descr = "SubtitleHandler"; |
... | ... |
@@ -1084,11 +1084,11 @@ static int mov_write_minf_tag(ByteIOContext *pb, MOVTrack *track) |
1084 | 1084 |
int64_t pos = url_ftell(pb); |
1085 | 1085 |
put_be32(pb, 0); /* size */ |
1086 | 1086 |
put_tag(pb, "minf"); |
1087 |
- if(track->enc->codec_type == CODEC_TYPE_VIDEO) |
|
1087 |
+ if(track->enc->codec_type == AVMEDIA_TYPE_VIDEO) |
|
1088 | 1088 |
mov_write_vmhd_tag(pb); |
1089 |
- else if (track->enc->codec_type == CODEC_TYPE_AUDIO) |
|
1089 |
+ else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) |
|
1090 | 1090 |
mov_write_smhd_tag(pb); |
1091 |
- else if (track->enc->codec_type == CODEC_TYPE_SUBTITLE) { |
|
1091 |
+ else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { |
|
1092 | 1092 |
if (track->tag == MKTAG('t','e','x','t')) mov_write_gmhd_tag(pb); |
1093 | 1093 |
else mov_write_nmhd_tag(pb); |
1094 | 1094 |
} |
... | ... |
@@ -1165,7 +1165,7 @@ static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st) |
1165 | 1165 |
put_be32(pb, 0); /* reserved */ |
1166 | 1166 |
put_be32(pb, 0x0); /* reserved (Layer & Alternate group) */ |
1167 | 1167 |
/* Volume, only for audio */ |
1168 |
- if(track->enc->codec_type == CODEC_TYPE_AUDIO) |
|
1168 |
+ if(track->enc->codec_type == AVMEDIA_TYPE_AUDIO) |
|
1169 | 1169 |
put_be16(pb, 0x0100); |
1170 | 1170 |
else |
1171 | 1171 |
put_be16(pb, 0); |
... | ... |
@@ -1183,8 +1183,8 @@ static int mov_write_tkhd_tag(ByteIOContext *pb, MOVTrack *track, AVStream *st) |
1183 | 1183 |
put_be32(pb, 0x40000000); /* reserved */ |
1184 | 1184 |
|
1185 | 1185 |
/* Track width and height, for visual only */ |
1186 |
- if(track->enc->codec_type == CODEC_TYPE_VIDEO || |
|
1187 |
- track->enc->codec_type == CODEC_TYPE_SUBTITLE) { |
|
1186 |
+ if(track->enc->codec_type == AVMEDIA_TYPE_VIDEO || |
|
1187 |
+ track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { |
|
1188 | 1188 |
double sample_aspect_ratio = av_q2d(st->sample_aspect_ratio); |
1189 | 1189 |
if(!sample_aspect_ratio || track->height != track->enc->height) |
1190 | 1190 |
sample_aspect_ratio = 1; |
... | ... |
@@ -1671,7 +1671,7 @@ static int mov_write_ftyp_tag(ByteIOContext *pb, AVFormatContext *s) |
1671 | 1671 |
|
1672 | 1672 |
for (i = 0; i < s->nb_streams; i++) { |
1673 | 1673 |
AVStream *st = s->streams[i]; |
1674 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) |
|
1674 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
1675 | 1675 |
has_video = 1; |
1676 | 1676 |
if (st->codec->codec_id == CODEC_ID_H264) |
1677 | 1677 |
has_h264 = 1; |
... | ... |
@@ -1829,7 +1829,7 @@ static int mov_write_header(AVFormatContext *s) |
1829 | 1829 |
"codec not currently supported in container\n", i); |
1830 | 1830 |
goto error; |
1831 | 1831 |
} |
1832 |
- if(st->codec->codec_type == CODEC_TYPE_VIDEO){ |
|
1832 |
+ if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ |
|
1833 | 1833 |
if (track->tag == MKTAG('m','x','3','p') || track->tag == MKTAG('m','x','3','n') || |
1834 | 1834 |
track->tag == MKTAG('m','x','4','p') || track->tag == MKTAG('m','x','4','n') || |
1835 | 1835 |
track->tag == MKTAG('m','x','5','p') || track->tag == MKTAG('m','x','5','n')) { |
... | ... |
@@ -1845,7 +1845,7 @@ static int mov_write_header(AVFormatContext *s) |
1845 | 1845 |
"WARNING codec timebase is very high. If duration is too long,\n" |
1846 | 1846 |
"file may not be playable by quicktime. Specify a shorter timebase\n" |
1847 | 1847 |
"or choose different container.\n"); |
1848 |
- }else if(st->codec->codec_type == CODEC_TYPE_AUDIO){ |
|
1848 |
+ }else if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO){ |
|
1849 | 1849 |
track->timescale = st->codec->sample_rate; |
1850 | 1850 |
if(!st->codec->frame_size && !av_get_bits_per_sample(st->codec->codec_id)) { |
1851 | 1851 |
av_log(s, AV_LOG_ERROR, "track %d: codec frame size is not set\n", i); |
... | ... |
@@ -1868,7 +1868,7 @@ static int mov_write_header(AVFormatContext *s) |
1868 | 1868 |
goto error; |
1869 | 1869 |
} |
1870 | 1870 |
} |
1871 |
- }else if(st->codec->codec_type == CODEC_TYPE_SUBTITLE){ |
|
1871 |
+ }else if(st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE){ |
|
1872 | 1872 |
track->timescale = st->codec->time_base.den; |
1873 | 1873 |
} |
1874 | 1874 |
if (!track->height) |
... | ... |
@@ -140,7 +140,7 @@ static int mp3_read_header(AVFormatContext *s, |
140 | 140 |
if (!st) |
141 | 141 |
return AVERROR(ENOMEM); |
142 | 142 |
|
143 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
143 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
144 | 144 |
st->codec->codec_id = CODEC_ID_MP3; |
145 | 145 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
146 | 146 |
st->start_time = 0; |
... | ... |
@@ -104,7 +104,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
104 | 104 |
st = av_new_stream(s, 0); |
105 | 105 |
if (!st) |
106 | 106 |
return AVERROR(ENOMEM); |
107 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
107 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
108 | 108 |
st->codec->codec_id = CODEC_ID_MUSEPACK7; |
109 | 109 |
st->codec->channels = 2; |
110 | 110 |
st->codec->bits_per_coded_sample = 16; |
... | ... |
@@ -224,7 +224,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap) |
224 | 224 |
st = av_new_stream(s, 0); |
225 | 225 |
if (!st) |
226 | 226 |
return AVERROR(ENOMEM); |
227 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
227 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
228 | 228 |
st->codec->codec_id = CODEC_ID_MUSEPACK8; |
229 | 229 |
st->codec->bits_per_coded_sample = 16; |
230 | 230 |
|
... | ... |
@@ -417,7 +417,7 @@ static int mpegps_read_packet(AVFormatContext *s, |
417 | 417 |
AVStream *st; |
418 | 418 |
int len, startcode, i, es_type; |
419 | 419 |
enum CodecID codec_id = CODEC_ID_NONE; |
420 |
- enum CodecType type; |
|
420 |
+ enum AVMediaType type; |
|
421 | 421 |
int64_t pts, dts, dummy_pos; //dummy_pos is needed for the index building to work |
422 | 422 |
uint8_t av_uninit(dvdaudio_substream_type); |
423 | 423 |
|
... | ... |
@@ -443,26 +443,26 @@ static int mpegps_read_packet(AVFormatContext *s, |
443 | 443 |
if(es_type > 0 && es_type != STREAM_TYPE_PRIVATE_DATA){ |
444 | 444 |
if(es_type == STREAM_TYPE_VIDEO_MPEG1){ |
445 | 445 |
codec_id = CODEC_ID_MPEG2VIDEO; |
446 |
- type = CODEC_TYPE_VIDEO; |
|
446 |
+ type = AVMEDIA_TYPE_VIDEO; |
|
447 | 447 |
} else if(es_type == STREAM_TYPE_VIDEO_MPEG2){ |
448 | 448 |
codec_id = CODEC_ID_MPEG2VIDEO; |
449 |
- type = CODEC_TYPE_VIDEO; |
|
449 |
+ type = AVMEDIA_TYPE_VIDEO; |
|
450 | 450 |
} else if(es_type == STREAM_TYPE_AUDIO_MPEG1 || |
451 | 451 |
es_type == STREAM_TYPE_AUDIO_MPEG2){ |
452 | 452 |
codec_id = CODEC_ID_MP3; |
453 |
- type = CODEC_TYPE_AUDIO; |
|
453 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
454 | 454 |
} else if(es_type == STREAM_TYPE_AUDIO_AAC){ |
455 | 455 |
codec_id = CODEC_ID_AAC; |
456 |
- type = CODEC_TYPE_AUDIO; |
|
456 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
457 | 457 |
} else if(es_type == STREAM_TYPE_VIDEO_MPEG4){ |
458 | 458 |
codec_id = CODEC_ID_MPEG4; |
459 |
- type = CODEC_TYPE_VIDEO; |
|
459 |
+ type = AVMEDIA_TYPE_VIDEO; |
|
460 | 460 |
} else if(es_type == STREAM_TYPE_VIDEO_H264){ |
461 | 461 |
codec_id = CODEC_ID_H264; |
462 |
- type = CODEC_TYPE_VIDEO; |
|
462 |
+ type = AVMEDIA_TYPE_VIDEO; |
|
463 | 463 |
} else if(es_type == STREAM_TYPE_AUDIO_AC3){ |
464 | 464 |
codec_id = CODEC_ID_AC3; |
465 |
- type = CODEC_TYPE_AUDIO; |
|
465 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
466 | 466 |
} else { |
467 | 467 |
goto skip; |
468 | 468 |
} |
... | ... |
@@ -475,38 +475,38 @@ static int mpegps_read_packet(AVFormatContext *s, |
475 | 475 |
codec_id = CODEC_ID_CAVS; |
476 | 476 |
else |
477 | 477 |
codec_id = CODEC_ID_PROBE; |
478 |
- type = CODEC_TYPE_VIDEO; |
|
478 |
+ type = AVMEDIA_TYPE_VIDEO; |
|
479 | 479 |
} else if (startcode >= 0x1c0 && startcode <= 0x1df) { |
480 |
- type = CODEC_TYPE_AUDIO; |
|
480 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
481 | 481 |
codec_id = m->sofdec > 0 ? CODEC_ID_ADPCM_ADX : CODEC_ID_MP2; |
482 | 482 |
} else if (startcode >= 0x80 && startcode <= 0x87) { |
483 |
- type = CODEC_TYPE_AUDIO; |
|
483 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
484 | 484 |
codec_id = CODEC_ID_AC3; |
485 | 485 |
} else if ( ( startcode >= 0x88 && startcode <= 0x8f) |
486 | 486 |
||( startcode >= 0x98 && startcode <= 0x9f)) { |
487 | 487 |
/* 0x90 - 0x97 is reserved for SDDS in DVD specs */ |
488 |
- type = CODEC_TYPE_AUDIO; |
|
488 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
489 | 489 |
codec_id = CODEC_ID_DTS; |
490 | 490 |
} else if (startcode >= 0xa0 && startcode <= 0xaf) { |
491 |
- type = CODEC_TYPE_AUDIO; |
|
491 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
492 | 492 |
/* 16 bit form will be handled as CODEC_ID_PCM_S16BE */ |
493 | 493 |
codec_id = CODEC_ID_PCM_DVD; |
494 | 494 |
} else if (startcode >= 0xb0 && startcode <= 0xbf) { |
495 |
- type = CODEC_TYPE_AUDIO; |
|
495 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
496 | 496 |
codec_id = CODEC_ID_TRUEHD; |
497 | 497 |
} else if (startcode >= 0xc0 && startcode <= 0xcf) { |
498 | 498 |
/* Used for both AC-3 and E-AC-3 in EVOB files */ |
499 |
- type = CODEC_TYPE_AUDIO; |
|
499 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
500 | 500 |
codec_id = CODEC_ID_AC3; |
501 | 501 |
} else if (startcode >= 0x20 && startcode <= 0x3f) { |
502 |
- type = CODEC_TYPE_SUBTITLE; |
|
502 |
+ type = AVMEDIA_TYPE_SUBTITLE; |
|
503 | 503 |
codec_id = CODEC_ID_DVD_SUBTITLE; |
504 | 504 |
} else if (startcode >= 0xfd55 && startcode <= 0xfd5f) { |
505 |
- type = CODEC_TYPE_VIDEO; |
|
505 |
+ type = AVMEDIA_TYPE_VIDEO; |
|
506 | 506 |
codec_id = CODEC_ID_VC1; |
507 | 507 |
} else if (startcode == 0x1bd) { |
508 | 508 |
// check dvd audio substream type |
509 |
- type = CODEC_TYPE_AUDIO; |
|
509 |
+ type = AVMEDIA_TYPE_AUDIO; |
|
510 | 510 |
switch(dvdaudio_substream_type & 0xe0) { |
511 | 511 |
case 0xa0: codec_id = CODEC_ID_PCM_DVD; |
512 | 512 |
break; |
... | ... |
@@ -335,7 +335,7 @@ static int mpeg_mux_init(AVFormatContext *ctx) |
335 | 335 |
av_set_pts_info(st, 64, 1, 90000); |
336 | 336 |
|
337 | 337 |
switch(st->codec->codec_type) { |
338 |
- case CODEC_TYPE_AUDIO: |
|
338 |
+ case AVMEDIA_TYPE_AUDIO: |
|
339 | 339 |
if (st->codec->codec_id == CODEC_ID_AC3) { |
340 | 340 |
stream->id = ac3_id++; |
341 | 341 |
} else if (st->codec->codec_id == CODEC_ID_DTS) { |
... | ... |
@@ -363,7 +363,7 @@ static int mpeg_mux_init(AVFormatContext *ctx) |
363 | 363 |
stream->max_buffer_size = 4 * 1024; |
364 | 364 |
s->audio_bound++; |
365 | 365 |
break; |
366 |
- case CODEC_TYPE_VIDEO: |
|
366 |
+ case AVMEDIA_TYPE_VIDEO: |
|
367 | 367 |
stream->id = mpv_id++; |
368 | 368 |
if (st->codec->rc_buffer_size) |
369 | 369 |
stream->max_buffer_size = 6*1024 + st->codec->rc_buffer_size/8; |
... | ... |
@@ -379,7 +379,7 @@ static int mpeg_mux_init(AVFormatContext *ctx) |
379 | 379 |
#endif |
380 | 380 |
s->video_bound++; |
381 | 381 |
break; |
382 |
- case CODEC_TYPE_SUBTITLE: |
|
382 |
+ case AVMEDIA_TYPE_SUBTITLE: |
|
383 | 383 |
stream->id = mps_id++; |
384 | 384 |
stream->max_buffer_size = 16 * 1024; |
385 | 385 |
break; |
... | ... |
@@ -1046,7 +1046,7 @@ retry: |
1046 | 1046 |
/* for subtitle, a single PES packet must be generated, |
1047 | 1047 |
so we flush after every single subtitle packet */ |
1048 | 1048 |
if(s->packet_size > avail_data && !flush |
1049 |
- && st->codec->codec_type != CODEC_TYPE_SUBTITLE) |
|
1049 |
+ && st->codec->codec_type != AVMEDIA_TYPE_SUBTITLE) |
|
1050 | 1050 |
return 0; |
1051 | 1051 |
if(avail_data==0) |
1052 | 1052 |
continue; |
... | ... |
@@ -1156,7 +1156,7 @@ static int mpeg_mux_write_packet(AVFormatContext *ctx, AVPacket *pkt) |
1156 | 1156 |
int64_t pts, dts; |
1157 | 1157 |
PacketDesc *pkt_desc; |
1158 | 1158 |
const int preload= av_rescale(ctx->preload, 90000, AV_TIME_BASE); |
1159 |
- const int is_iframe = st->codec->codec_type == CODEC_TYPE_VIDEO && (pkt->flags & PKT_FLAG_KEY); |
|
1159 |
+ const int is_iframe = st->codec->codec_type == AVMEDIA_TYPE_VIDEO && (pkt->flags & PKT_FLAG_KEY); |
|
1160 | 1160 |
|
1161 | 1161 |
pts= pkt->pts; |
1162 | 1162 |
dts= pkt->dts; |
... | ... |
@@ -486,54 +486,54 @@ static int parse_section_header(SectionHeader *h, |
486 | 486 |
|
487 | 487 |
typedef struct { |
488 | 488 |
uint32_t stream_type; |
489 |
- enum CodecType codec_type; |
|
489 |
+ enum AVMediaType codec_type; |
|
490 | 490 |
enum CodecID codec_id; |
491 | 491 |
} StreamType; |
492 | 492 |
|
493 | 493 |
static const StreamType ISO_types[] = { |
494 |
- { 0x01, CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO }, |
|
495 |
- { 0x02, CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO }, |
|
496 |
- { 0x03, CODEC_TYPE_AUDIO, CODEC_ID_MP3 }, |
|
497 |
- { 0x04, CODEC_TYPE_AUDIO, CODEC_ID_MP3 }, |
|
498 |
- { 0x0f, CODEC_TYPE_AUDIO, CODEC_ID_AAC }, |
|
499 |
- { 0x10, CODEC_TYPE_VIDEO, CODEC_ID_MPEG4 }, |
|
500 |
- { 0x11, CODEC_TYPE_AUDIO, CODEC_ID_AAC }, /* LATM syntax */ |
|
501 |
- { 0x1b, CODEC_TYPE_VIDEO, CODEC_ID_H264 }, |
|
502 |
- { 0xd1, CODEC_TYPE_VIDEO, CODEC_ID_DIRAC }, |
|
503 |
- { 0xea, CODEC_TYPE_VIDEO, CODEC_ID_VC1 }, |
|
494 |
+ { 0x01, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO }, |
|
495 |
+ { 0x02, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO }, |
|
496 |
+ { 0x03, AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3 }, |
|
497 |
+ { 0x04, AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3 }, |
|
498 |
+ { 0x0f, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC }, |
|
499 |
+ { 0x10, AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4 }, |
|
500 |
+ { 0x11, AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC }, /* LATM syntax */ |
|
501 |
+ { 0x1b, AVMEDIA_TYPE_VIDEO, CODEC_ID_H264 }, |
|
502 |
+ { 0xd1, AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC }, |
|
503 |
+ { 0xea, AVMEDIA_TYPE_VIDEO, CODEC_ID_VC1 }, |
|
504 | 504 |
{ 0 }, |
505 | 505 |
}; |
506 | 506 |
|
507 | 507 |
static const StreamType HDMV_types[] = { |
508 |
- { 0x80, CODEC_TYPE_AUDIO, CODEC_ID_PCM_BLURAY }, |
|
509 |
- { 0x81, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, |
|
510 |
- { 0x82, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, |
|
511 |
- { 0x83, CODEC_TYPE_AUDIO, CODEC_ID_TRUEHD }, |
|
512 |
- { 0x84, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 }, |
|
513 |
- { 0x90, CODEC_TYPE_SUBTITLE, CODEC_ID_HDMV_PGS_SUBTITLE }, |
|
508 |
+ { 0x80, AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_BLURAY }, |
|
509 |
+ { 0x81, AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, |
|
510 |
+ { 0x82, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, |
|
511 |
+ { 0x83, AVMEDIA_TYPE_AUDIO, CODEC_ID_TRUEHD }, |
|
512 |
+ { 0x84, AVMEDIA_TYPE_AUDIO, CODEC_ID_EAC3 }, |
|
513 |
+ { 0x90, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_HDMV_PGS_SUBTITLE }, |
|
514 | 514 |
{ 0 }, |
515 | 515 |
}; |
516 | 516 |
|
517 | 517 |
/* ATSC ? */ |
518 | 518 |
static const StreamType MISC_types[] = { |
519 |
- { 0x81, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, |
|
520 |
- { 0x8a, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, |
|
519 |
+ { 0x81, AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, |
|
520 |
+ { 0x8a, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, |
|
521 | 521 |
{ 0 }, |
522 | 522 |
}; |
523 | 523 |
|
524 | 524 |
static const StreamType REGD_types[] = { |
525 |
- { MKTAG('d','r','a','c'), CODEC_TYPE_VIDEO, CODEC_ID_DIRAC }, |
|
526 |
- { MKTAG('A','C','-','3'), CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, |
|
525 |
+ { MKTAG('d','r','a','c'), AVMEDIA_TYPE_VIDEO, CODEC_ID_DIRAC }, |
|
526 |
+ { MKTAG('A','C','-','3'), AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, |
|
527 | 527 |
{ 0 }, |
528 | 528 |
}; |
529 | 529 |
|
530 | 530 |
/* descriptor present */ |
531 | 531 |
static const StreamType DESC_types[] = { |
532 |
- { 0x6a, CODEC_TYPE_AUDIO, CODEC_ID_AC3 }, /* AC-3 descriptor */ |
|
533 |
- { 0x7a, CODEC_TYPE_AUDIO, CODEC_ID_EAC3 }, /* E-AC-3 descriptor */ |
|
534 |
- { 0x7b, CODEC_TYPE_AUDIO, CODEC_ID_DTS }, |
|
535 |
- { 0x56, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_TELETEXT }, |
|
536 |
- { 0x59, CODEC_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */ |
|
532 |
+ { 0x6a, AVMEDIA_TYPE_AUDIO, CODEC_ID_AC3 }, /* AC-3 descriptor */ |
|
533 |
+ { 0x7a, AVMEDIA_TYPE_AUDIO, CODEC_ID_EAC3 }, /* E-AC-3 descriptor */ |
|
534 |
+ { 0x7b, AVMEDIA_TYPE_AUDIO, CODEC_ID_DTS }, |
|
535 |
+ { 0x56, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_TELETEXT }, |
|
536 |
+ { 0x59, AVMEDIA_TYPE_SUBTITLE, CODEC_ID_DVB_SUBTITLE }, /* subtitling descriptor */ |
|
537 | 537 |
{ 0 }, |
538 | 538 |
}; |
539 | 539 |
|
... | ... |
@@ -554,7 +554,7 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, |
554 | 554 |
{ |
555 | 555 |
av_set_pts_info(st, 33, 1, 90000); |
556 | 556 |
st->priv_data = pes; |
557 |
- st->codec->codec_type = CODEC_TYPE_DATA; |
|
557 |
+ st->codec->codec_type = AVMEDIA_TYPE_DATA; |
|
558 | 558 |
st->codec->codec_id = CODEC_ID_NONE; |
559 | 559 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
560 | 560 |
pes->st = st; |
... | ... |
@@ -588,7 +588,7 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes, |
588 | 588 |
|
589 | 589 |
av_set_pts_info(sub_st, 33, 1, 90000); |
590 | 590 |
sub_st->priv_data = sub_pes; |
591 |
- sub_st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
591 |
+ sub_st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
592 | 592 |
sub_st->codec->codec_id = CODEC_ID_AC3; |
593 | 593 |
sub_st->need_parsing = AVSTREAM_PARSE_FULL; |
594 | 594 |
sub_pes->sub_st = pes->sub_st = sub_st; |
... | ... |
@@ -1394,7 +1394,7 @@ static int mpegts_read_header(AVFormatContext *s, |
1394 | 1394 |
if (!st) |
1395 | 1395 |
goto fail; |
1396 | 1396 |
av_set_pts_info(st, 60, 1, 27000000); |
1397 |
- st->codec->codec_type = CODEC_TYPE_DATA; |
|
1397 |
+ st->codec->codec_type = AVMEDIA_TYPE_DATA; |
|
1398 | 1398 |
st->codec->codec_id = CODEC_ID_MPEG2TS; |
1399 | 1399 |
|
1400 | 1400 |
/* we iterate until we find two PCRs to estimate the bitrate */ |
... | ... |
@@ -255,7 +255,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) |
255 | 255 |
|
256 | 256 |
/* write optional descriptors here */ |
257 | 257 |
switch(st->codec->codec_type) { |
258 |
- case CODEC_TYPE_AUDIO: |
|
258 |
+ case AVMEDIA_TYPE_AUDIO: |
|
259 | 259 |
if (lang && strlen(lang->value) == 3) { |
260 | 260 |
*q++ = 0x0a; /* ISO 639 language descriptor */ |
261 | 261 |
*q++ = 4; |
... | ... |
@@ -265,7 +265,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) |
265 | 265 |
*q++ = 0; /* undefined type */ |
266 | 266 |
} |
267 | 267 |
break; |
268 |
- case CODEC_TYPE_SUBTITLE: |
|
268 |
+ case AVMEDIA_TYPE_SUBTITLE: |
|
269 | 269 |
{ |
270 | 270 |
const char *language; |
271 | 271 |
language = lang && strlen(lang->value)==3 ? lang->value : "eng"; |
... | ... |
@@ -279,7 +279,7 @@ static void mpegts_write_pmt(AVFormatContext *s, MpegTSService *service) |
279 | 279 |
put16(&q, 1); /* ancillary page id */ |
280 | 280 |
} |
281 | 281 |
break; |
282 |
- case CODEC_TYPE_VIDEO: |
|
282 |
+ case AVMEDIA_TYPE_VIDEO: |
|
283 | 283 |
if (stream_type == STREAM_TYPE_VIDEO_DIRAC) { |
284 | 284 |
*q++ = 0x05; /*MPEG-2 registration descriptor*/ |
285 | 285 |
*q++ = 4; |
... | ... |
@@ -424,7 +424,7 @@ static int mpegts_write_header(AVFormatContext *s) |
424 | 424 |
ts_st->first_pts_check = 1; |
425 | 425 |
ts_st->cc = 15; |
426 | 426 |
/* update PCR pid by using the first video stream */ |
427 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO && |
|
427 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && |
|
428 | 428 |
service->pcr_pid == 0x1fff) { |
429 | 429 |
service->pcr_pid = ts_st->pid; |
430 | 430 |
pcr_st = st; |
... | ... |
@@ -462,7 +462,7 @@ static int mpegts_write_header(AVFormatContext *s) |
462 | 462 |
/* Arbitrary values, PAT/PMT could be written on key frames */ |
463 | 463 |
ts->sdt_packet_period = 200; |
464 | 464 |
ts->pat_packet_period = 40; |
465 |
- if (pcr_st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
465 |
+ if (pcr_st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
466 | 466 |
if (!pcr_st->codec->frame_size) { |
467 | 467 |
av_log(s, AV_LOG_WARNING, "frame size not set\n"); |
468 | 468 |
service->pcr_packet_period = |
... | ... |
@@ -661,18 +661,18 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, |
661 | 661 |
*q++ = 0x00; |
662 | 662 |
*q++ = 0x01; |
663 | 663 |
private_code = 0; |
664 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
664 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
665 | 665 |
if (st->codec->codec_id == CODEC_ID_DIRAC) { |
666 | 666 |
*q++ = 0xfd; |
667 | 667 |
} else |
668 | 668 |
*q++ = 0xe0; |
669 |
- } else if (st->codec->codec_type == CODEC_TYPE_AUDIO && |
|
669 |
+ } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && |
|
670 | 670 |
(st->codec->codec_id == CODEC_ID_MP2 || |
671 | 671 |
st->codec->codec_id == CODEC_ID_MP3)) { |
672 | 672 |
*q++ = 0xc0; |
673 | 673 |
} else { |
674 | 674 |
*q++ = 0xbd; |
675 |
- if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) { |
|
675 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) { |
|
676 | 676 |
private_code = 0x20; |
677 | 677 |
} |
678 | 678 |
} |
... | ... |
@@ -686,7 +686,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, |
686 | 686 |
header_len += 5; |
687 | 687 |
flags |= 0x40; |
688 | 688 |
} |
689 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO && |
|
689 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && |
|
690 | 690 |
st->codec->codec_id == CODEC_ID_DIRAC) { |
691 | 691 |
/* set PES_extension_flag */ |
692 | 692 |
pes_extension = 1; |
... | ... |
@@ -708,7 +708,7 @@ static void mpegts_write_pes(AVFormatContext *s, AVStream *st, |
708 | 708 |
*q++ = len; |
709 | 709 |
val = 0x80; |
710 | 710 |
/* data alignment indicator is required for subtitle data */ |
711 |
- if (st->codec->codec_type == CODEC_TYPE_SUBTITLE) |
|
711 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_SUBTITLE) |
|
712 | 712 |
val |= 0x04; |
713 | 713 |
*q++ = val; |
714 | 714 |
*q++ = flags; |
... | ... |
@@ -848,7 +848,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt) |
848 | 848 |
} |
849 | 849 |
} |
850 | 850 |
|
851 |
- if (st->codec->codec_type != CODEC_TYPE_AUDIO) { |
|
851 |
+ if (st->codec->codec_type != AVMEDIA_TYPE_AUDIO) { |
|
852 | 852 |
// for video and subtitle, write a single pes packet |
853 | 853 |
mpegts_write_pes(s, st, buf, size, pts, dts); |
854 | 854 |
av_free(data); |
... | ... |
@@ -80,7 +80,7 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap) |
80 | 80 |
return AVERROR_NOMEM; |
81 | 81 |
|
82 | 82 |
codec = st->codec; |
83 |
- codec->codec_type = CODEC_TYPE_VIDEO; |
|
83 |
+ codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
84 | 84 |
codec->codec_id = CODEC_ID_MIMIC; |
85 | 85 |
codec->codec_tag = MKTAG('M', 'L', '2', '0'); |
86 | 86 |
|
... | ... |
@@ -123,7 +123,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) |
123 | 123 |
return AVERROR(ENOMEM); |
124 | 124 |
|
125 | 125 |
av_set_pts_info(st, 64, 1, mtv->video_fps); |
126 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
126 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
127 | 127 |
st->codec->codec_id = CODEC_ID_RAWVIDEO; |
128 | 128 |
st->codec->codec_tag = MKTAG('R', 'G', 'B', mtv->img_bpp); |
129 | 129 |
st->codec->width = mtv->img_width; |
... | ... |
@@ -140,7 +140,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap) |
140 | 140 |
return AVERROR(ENOMEM); |
141 | 141 |
|
142 | 142 |
av_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE); |
143 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
143 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
144 | 144 |
st->codec->codec_id = CODEC_ID_MP3; |
145 | 145 |
st->codec->bit_rate = mtv->audio_br; |
146 | 146 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
... | ... |
@@ -77,14 +77,14 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap) |
77 | 77 |
} |
78 | 78 |
|
79 | 79 |
av_set_pts_info(ast, 64, 1, ast->codec->sample_rate); |
80 |
- ast->codec->codec_type = CODEC_TYPE_AUDIO; |
|
80 |
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
81 | 81 |
ast->codec->codec_id = CODEC_ID_PCM_U8; |
82 | 82 |
ast->codec->channels = 1; |
83 | 83 |
ast->codec->bits_per_coded_sample = 8; |
84 | 84 |
ast->codec->bit_rate = ast->codec->sample_rate * 8; |
85 | 85 |
|
86 | 86 |
av_set_pts_info(vst, 64, msecs_per_frame, 1000000); |
87 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
87 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
88 | 88 |
vst->codec->codec_id = CODEC_ID_MOTIONPIXELS; |
89 | 89 |
|
90 | 90 |
mvi->get_int = (vst->codec->width * vst->codec->height < (1 << 16)) ? get_le16 : get_le24; |
... | ... |
@@ -25,9 +25,9 @@ |
25 | 25 |
* SMPTE RP224 http://www.smpte-ra.org/mdd/index.html |
26 | 26 |
*/ |
27 | 27 |
const MXFCodecUL ff_mxf_data_definition_uls[] = { |
28 |
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x01,0x00,0x00,0x00 }, 13, CODEC_TYPE_VIDEO }, |
|
29 |
- { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x02,0x00,0x00,0x00 }, 13, CODEC_TYPE_AUDIO }, |
|
30 |
- { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, CODEC_TYPE_DATA }, |
|
28 |
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x01,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_VIDEO }, |
|
29 |
+ { { 0x06,0x0E,0x2B,0x34,0x04,0x01,0x01,0x01,0x01,0x03,0x02,0x02,0x02,0x00,0x00,0x00 }, 13, AVMEDIA_TYPE_AUDIO }, |
|
30 |
+ { { 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 }, 0, AVMEDIA_TYPE_DATA }, |
|
31 | 31 |
}; |
32 | 32 |
|
33 | 33 |
const MXFCodecUL ff_mxf_codec_uls[] = { |
... | ... |
@@ -795,7 +795,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) |
795 | 795 |
st->codec->extradata = descriptor->extradata; |
796 | 796 |
st->codec->extradata_size = descriptor->extradata_size; |
797 | 797 |
} |
798 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
798 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
799 | 799 |
container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); |
800 | 800 |
if (st->codec->codec_id == CODEC_ID_NONE) |
801 | 801 |
st->codec->codec_id = container_ul->id; |
... | ... |
@@ -803,7 +803,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) |
803 | 803 |
st->codec->height = descriptor->height; |
804 | 804 |
st->codec->bits_per_coded_sample = descriptor->bits_per_sample; /* Uncompressed */ |
805 | 805 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; |
806 |
- } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
806 |
+ } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
807 | 807 |
container_ul = mxf_get_codec_ul(mxf_essence_container_uls, essence_container_ul); |
808 | 808 |
if (st->codec->codec_id == CODEC_ID_NONE) |
809 | 809 |
st->codec->codec_id = container_ul->id; |
... | ... |
@@ -825,7 +825,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf) |
825 | 825 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
826 | 826 |
} |
827 | 827 |
} |
828 |
- if (st->codec->codec_type != CODEC_TYPE_DATA && (*essence_container_ul)[15] > 0x01) { |
|
828 |
+ if (st->codec->codec_type != AVMEDIA_TYPE_DATA && (*essence_container_ul)[15] > 0x01) { |
|
829 | 829 |
av_log(mxf->fc, AV_LOG_WARNING, "only frame wrapped mappings are correctly supported\n"); |
830 | 830 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
831 | 831 |
} |
... | ... |
@@ -1415,7 +1415,7 @@ static int mxf_write_header(AVFormatContext *s) |
1415 | 1415 |
return AVERROR(ENOMEM); |
1416 | 1416 |
st->priv_data = sc; |
1417 | 1417 |
|
1418 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
1418 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
1419 | 1419 |
if (i != 0) { |
1420 | 1420 |
av_log(s, AV_LOG_ERROR, "video stream must be first track\n"); |
1421 | 1421 |
return -1; |
... | ... |
@@ -1455,7 +1455,7 @@ static int mxf_write_header(AVFormatContext *s) |
1455 | 1455 |
mxf->edit_unit_byte_count += 16 + 4 + 4 + samples_per_frame[0]*8*4; |
1456 | 1456 |
mxf->edit_unit_byte_count += klv_fill_size(mxf->edit_unit_byte_count); |
1457 | 1457 |
} |
1458 |
- } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
1458 |
+ } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
1459 | 1459 |
if (st->codec->sample_rate != 48000) { |
1460 | 1460 |
av_log(s, AV_LOG_ERROR, "only 48khz is implemented\n"); |
1461 | 1461 |
return -1; |
... | ... |
@@ -1717,7 +1717,7 @@ static int mxf_write_packet(AVFormatContext *s, AVPacket *pkt) |
1717 | 1717 |
mxf_write_klv_fill(s); |
1718 | 1718 |
put_buffer(pb, sc->track_essence_element_key, 16); // write key |
1719 | 1719 |
if (s->oformat == &mxf_d10_muxer) { |
1720 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) |
|
1720 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
1721 | 1721 |
mxf_write_d10_video_packet(s, st, pkt); |
1722 | 1722 |
else |
1723 | 1723 |
mxf_write_d10_audio_packet(s, st, pkt); |
... | ... |
@@ -50,7 +50,7 @@ static int nc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
50 | 50 |
if (!st) |
51 | 51 |
return AVERROR(ENOMEM); |
52 | 52 |
|
53 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
53 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
54 | 54 |
st->codec->codec_id = CODEC_ID_MPEG4; |
55 | 55 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
56 | 56 |
|
... | ... |
@@ -456,7 +456,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) |
456 | 456 |
if (!nst) |
457 | 457 |
goto fail; |
458 | 458 |
st->priv_data = nst; |
459 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
459 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
460 | 460 |
st->codec->codec_tag = vtag; |
461 | 461 |
st->codec->codec_id = ff_codec_get_id(nsv_codec_video_tags, vtag); |
462 | 462 |
st->codec->width = vwidth; |
... | ... |
@@ -487,7 +487,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap) |
487 | 487 |
if (!nst) |
488 | 488 |
goto fail; |
489 | 489 |
st->priv_data = nst; |
490 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
490 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
491 | 491 |
st->codec->codec_tag = atag; |
492 | 492 |
st->codec->codec_id = ff_codec_get_id(nsv_codec_audio_tags, atag); |
493 | 493 |
|
... | ... |
@@ -315,19 +315,19 @@ static int decode_stream_header(NUTContext *nut){ |
315 | 315 |
switch(class) |
316 | 316 |
{ |
317 | 317 |
case 0: |
318 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
318 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
319 | 319 |
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tmp); |
320 | 320 |
break; |
321 | 321 |
case 1: |
322 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
322 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
323 | 323 |
st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, tmp); |
324 | 324 |
break; |
325 | 325 |
case 2: |
326 |
- st->codec->codec_type = CODEC_TYPE_SUBTITLE; |
|
326 |
+ st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; |
|
327 | 327 |
st->codec->codec_id = ff_codec_get_id(ff_nut_subtitle_tags, tmp); |
328 | 328 |
break; |
329 | 329 |
case 3: |
330 |
- st->codec->codec_type = CODEC_TYPE_DATA; |
|
330 |
+ st->codec->codec_type = AVMEDIA_TYPE_DATA; |
|
331 | 331 |
break; |
332 | 332 |
default: |
333 | 333 |
av_log(s, AV_LOG_ERROR, "unknown stream class (%d)\n", class); |
... | ... |
@@ -349,7 +349,7 @@ static int decode_stream_header(NUTContext *nut){ |
349 | 349 |
get_buffer(bc, st->codec->extradata, st->codec->extradata_size); |
350 | 350 |
} |
351 | 351 |
|
352 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO){ |
|
352 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ |
|
353 | 353 |
GET_V(st->codec->width , tmp > 0) |
354 | 354 |
GET_V(st->codec->height, tmp > 0) |
355 | 355 |
st->sample_aspect_ratio.num= ff_get_v(bc); |
... | ... |
@@ -359,7 +359,7 @@ static int decode_stream_header(NUTContext *nut){ |
359 | 359 |
return -1; |
360 | 360 |
} |
361 | 361 |
ff_get_v(bc); /* csp type */ |
362 |
- }else if (st->codec->codec_type == CODEC_TYPE_AUDIO){ |
|
362 |
+ }else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO){ |
|
363 | 363 |
GET_V(st->codec->sample_rate , tmp > 0) |
364 | 364 |
ff_get_v(bc); // samplerate_den |
365 | 365 |
GET_V(st->codec->channels, tmp > 0) |
... | ... |
@@ -152,7 +152,7 @@ static void build_frame_code(AVFormatContext *s){ |
152 | 152 |
int start2= start + (end-start)*stream_id / s->nb_streams; |
153 | 153 |
int end2 = start + (end-start)*(stream_id+1) / s->nb_streams; |
154 | 154 |
AVCodecContext *codec = s->streams[stream_id]->codec; |
155 |
- int is_audio= codec->codec_type == CODEC_TYPE_AUDIO; |
|
155 |
+ int is_audio= codec->codec_type == AVMEDIA_TYPE_AUDIO; |
|
156 | 156 |
int intra_only= /*codec->intra_only || */is_audio; |
157 | 157 |
int pred_count; |
158 | 158 |
|
... | ... |
@@ -394,9 +394,9 @@ static int write_streamheader(NUTContext *nut, ByteIOContext *bc, AVStream *st, |
394 | 394 |
AVCodecContext *codec = st->codec; |
395 | 395 |
put_v(bc, i); |
396 | 396 |
switch(codec->codec_type){ |
397 |
- case CODEC_TYPE_VIDEO: put_v(bc, 0); break; |
|
398 |
- case CODEC_TYPE_AUDIO: put_v(bc, 1); break; |
|
399 |
- case CODEC_TYPE_SUBTITLE: put_v(bc, 2); break; |
|
397 |
+ case AVMEDIA_TYPE_VIDEO: put_v(bc, 0); break; |
|
398 |
+ case AVMEDIA_TYPE_AUDIO: put_v(bc, 1); break; |
|
399 |
+ case AVMEDIA_TYPE_SUBTITLE: put_v(bc, 2); break; |
|
400 | 400 |
default : put_v(bc, 3); break; |
401 | 401 |
} |
402 | 402 |
put_v(bc, 4); |
... | ... |
@@ -415,12 +415,12 @@ static int write_streamheader(NUTContext *nut, ByteIOContext *bc, AVStream *st, |
415 | 415 |
put_buffer(bc, codec->extradata, codec->extradata_size); |
416 | 416 |
|
417 | 417 |
switch(codec->codec_type){ |
418 |
- case CODEC_TYPE_AUDIO: |
|
418 |
+ case AVMEDIA_TYPE_AUDIO: |
|
419 | 419 |
put_v(bc, codec->sample_rate); |
420 | 420 |
put_v(bc, 1); |
421 | 421 |
put_v(bc, codec->channels); |
422 | 422 |
break; |
423 |
- case CODEC_TYPE_VIDEO: |
|
423 |
+ case AVMEDIA_TYPE_VIDEO: |
|
424 | 424 |
put_v(bc, codec->width); |
425 | 425 |
put_v(bc, codec->height); |
426 | 426 |
|
... | ... |
@@ -155,7 +155,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { |
155 | 155 |
vst = av_new_stream(s, ctx->v_id); |
156 | 156 |
if (!vst) |
157 | 157 |
return AVERROR(ENOMEM); |
158 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
158 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
159 | 159 |
vst->codec->codec_id = CODEC_ID_NUV; |
160 | 160 |
vst->codec->width = width; |
161 | 161 |
vst->codec->height = height; |
... | ... |
@@ -171,7 +171,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) { |
171 | 171 |
ast = av_new_stream(s, ctx->a_id); |
172 | 172 |
if (!ast) |
173 | 173 |
return AVERROR(ENOMEM); |
174 |
- ast->codec->codec_type = CODEC_TYPE_AUDIO; |
|
174 |
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
175 | 175 |
ast->codec->codec_id = CODEC_ID_PCM_S16LE; |
176 | 176 |
ast->codec->channels = 2; |
177 | 177 |
ast->codec->sample_rate = 44100; |
... | ... |
@@ -612,7 +612,7 @@ static int ogg_read_seek(AVFormatContext *s, int stream_index, int64_t timestamp |
612 | 612 |
|
613 | 613 |
// Try seeking to a keyframe first. If this fails (very possible), |
614 | 614 |
// av_seek_frame will fall back to ignoring keyframes |
615 |
- if (s->streams[stream_index]->codec->codec_type == CODEC_TYPE_VIDEO |
|
615 |
+ if (s->streams[stream_index]->codec->codec_type == AVMEDIA_TYPE_VIDEO |
|
616 | 616 |
&& !(flags & AVSEEK_FLAG_ANY)) |
617 | 617 |
os->keyframe_seek = 1; |
618 | 618 |
|
... | ... |
@@ -178,9 +178,9 @@ static int ogg_write_header(AVFormatContext *s) |
178 | 178 |
int i, j; |
179 | 179 |
for (i = 0; i < s->nb_streams; i++) { |
180 | 180 |
AVStream *st = s->streams[i]; |
181 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) |
|
181 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
182 | 182 |
av_set_pts_info(st, 64, 1, st->codec->sample_rate); |
183 |
- else if (st->codec->codec_type == CODEC_TYPE_VIDEO) |
|
183 |
+ else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
184 | 184 |
av_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den); |
185 | 185 |
if (st->codec->codec_id != CODEC_ID_VORBIS && |
186 | 186 |
st->codec->codec_id != CODEC_ID_THEORA && |
... | ... |
@@ -39,7 +39,7 @@ static int dirac_header(AVFormatContext *s, int idx) |
39 | 39 |
if (ff_dirac_parse_sequence_header(st->codec, &gb, &source) < 0) |
40 | 40 |
return -1; |
41 | 41 |
|
42 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
42 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
43 | 43 |
st->codec->codec_id = CODEC_ID_DIRAC; |
44 | 44 |
// dirac in ogg always stores timestamps as though the video were interlaced |
45 | 45 |
st->time_base = (AVRational){st->codec->time_base.num, 2*st->codec->time_base.den}; |
... | ... |
@@ -77,7 +77,7 @@ static int old_dirac_header(AVFormatContext *s, int idx) |
77 | 77 |
if (buf[0] != 'K') |
78 | 78 |
return 0; |
79 | 79 |
|
80 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
80 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
81 | 81 |
st->codec->codec_id = CODEC_ID_DIRAC; |
82 | 82 |
st->time_base.den = AV_RB32(buf+8); |
83 | 83 |
st->time_base.num = AV_RB32(buf+12); |
... | ... |
@@ -57,7 +57,7 @@ flac_header (AVFormatContext * s, int idx) |
57 | 57 |
|
58 | 58 |
ff_flac_parse_streaminfo(st->codec, &si, streaminfo_start); |
59 | 59 |
|
60 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
60 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
61 | 61 |
st->codec->codec_id = CODEC_ID_FLAC; |
62 | 62 |
|
63 | 63 |
st->codec->extradata = |
... | ... |
@@ -78,7 +78,7 @@ static int |
78 | 78 |
old_flac_header (AVFormatContext * s, int idx) |
79 | 79 |
{ |
80 | 80 |
AVStream *st = s->streams[idx]; |
81 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
81 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
82 | 82 |
st->codec->codec_id = CODEC_ID_FLAC; |
83 | 83 |
|
84 | 84 |
return 0; |
... | ... |
@@ -49,19 +49,19 @@ ogm_header(AVFormatContext *s, int idx) |
49 | 49 |
|
50 | 50 |
if(*p == 'v'){ |
51 | 51 |
int tag; |
52 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
52 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
53 | 53 |
p += 8; |
54 | 54 |
tag = bytestream_get_le32(&p); |
55 | 55 |
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, tag); |
56 | 56 |
st->codec->codec_tag = tag; |
57 | 57 |
} else if (*p == 't') { |
58 |
- st->codec->codec_type = CODEC_TYPE_SUBTITLE; |
|
58 |
+ st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE; |
|
59 | 59 |
st->codec->codec_id = CODEC_ID_TEXT; |
60 | 60 |
p += 12; |
61 | 61 |
} else { |
62 | 62 |
uint8_t acid[5]; |
63 | 63 |
int cid; |
64 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
64 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
65 | 65 |
p += 8; |
66 | 66 |
bytestream_get_buffer(&p, acid, 4); |
67 | 67 |
acid[4] = 0; |
... | ... |
@@ -78,7 +78,7 @@ ogm_header(AVFormatContext *s, int idx) |
78 | 78 |
|
79 | 79 |
p += 8; /* buffersize + bits_per_sample */ |
80 | 80 |
|
81 |
- if(st->codec->codec_type == CODEC_TYPE_VIDEO){ |
|
81 |
+ if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ |
|
82 | 82 |
st->codec->width = bytestream_get_le32(&p); |
83 | 83 |
st->codec->height = bytestream_get_le32(&p); |
84 | 84 |
st->codec->time_base.den = spu * 10000000; |
... | ... |
@@ -117,14 +117,14 @@ ogm_dshow_header(AVFormatContext *s, int idx) |
117 | 117 |
t = AV_RL32(p + 96); |
118 | 118 |
|
119 | 119 |
if(t == 0x05589f80){ |
120 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
120 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
121 | 121 |
st->codec->codec_id = ff_codec_get_id(ff_codec_bmp_tags, AV_RL32(p + 68)); |
122 | 122 |
st->codec->time_base.den = 10000000; |
123 | 123 |
st->codec->time_base.num = AV_RL64(p + 164); |
124 | 124 |
st->codec->width = AV_RL32(p + 176); |
125 | 125 |
st->codec->height = AV_RL32(p + 180); |
126 | 126 |
} else if(t == 0x05589f81){ |
127 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
127 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
128 | 128 |
st->codec->codec_id = ff_codec_get_id(ff_codec_wav_tags, AV_RL16(p + 124)); |
129 | 129 |
st->codec->channels = AV_RL16(p + 126); |
130 | 130 |
st->codec->sample_rate = AV_RL32(p + 128); |
... | ... |
@@ -33,7 +33,7 @@ static int skeleton_header(AVFormatContext *s, int idx) |
33 | 33 |
int target_idx, start_time; |
34 | 34 |
|
35 | 35 |
strcpy(st->codec->codec_name, "skeleton"); |
36 |
- st->codec->codec_type = CODEC_TYPE_DATA; |
|
36 |
+ st->codec->codec_type = AVMEDIA_TYPE_DATA; |
|
37 | 37 |
|
38 | 38 |
if (os->psize < 8) |
39 | 39 |
return -1; |
... | ... |
@@ -52,7 +52,7 @@ static int speex_header(AVFormatContext *s, int idx) { |
52 | 52 |
|
53 | 53 |
if (spxp->seq == 0) { |
54 | 54 |
int frames_per_packet; |
55 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
55 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
56 | 56 |
st->codec->codec_id = CODEC_ID_SPEEX; |
57 | 57 |
|
58 | 58 |
st->codec->sample_rate = AV_RL32(p + 36); |
... | ... |
@@ -104,7 +104,7 @@ theora_header (AVFormatContext * s, int idx) |
104 | 104 |
thp->gpshift = get_bits(&gb, 5); |
105 | 105 |
thp->gpmask = (1 << thp->gpshift) - 1; |
106 | 106 |
|
107 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
107 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
108 | 108 |
st->codec->codec_id = CODEC_ID_THEORA; |
109 | 109 |
st->need_parsing = AVSTREAM_PARSE_HEADERS; |
110 | 110 |
|
... | ... |
@@ -237,7 +237,7 @@ vorbis_header (AVFormatContext * s, int idx) |
237 | 237 |
if (bytestream_get_byte(&p) != 1) /* framing_flag */ |
238 | 238 |
return -1; |
239 | 239 |
|
240 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
240 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
241 | 241 |
st->codec->codec_id = CODEC_ID_VORBIS; |
242 | 242 |
|
243 | 243 |
st->time_base.num = 1; |
... | ... |
@@ -112,7 +112,7 @@ static int oma_read_header(AVFormatContext *s, |
112 | 112 |
return AVERROR(ENOMEM); |
113 | 113 |
|
114 | 114 |
st->start_time = 0; |
115 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
115 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
116 | 116 |
st->codec->codec_tag = buf[32]; |
117 | 117 |
st->codec->codec_id = ff_codec_get_id(codec_oma_tags, st->codec->codec_tag); |
118 | 118 |
|
... | ... |
@@ -65,7 +65,7 @@ static AVStream *add_audio_stream(AVFormatContext *oc, enum CodecID codec_id) |
65 | 65 |
|
66 | 66 |
c = st->codec; |
67 | 67 |
c->codec_id = codec_id; |
68 |
- c->codec_type = CODEC_TYPE_AUDIO; |
|
68 |
+ c->codec_type = AVMEDIA_TYPE_AUDIO; |
|
69 | 69 |
|
70 | 70 |
/* put sample parameters */ |
71 | 71 |
c->bit_rate = 64000; |
... | ... |
@@ -199,7 +199,7 @@ static AVStream *add_video_stream(AVFormatContext *oc, enum CodecID codec_id) |
199 | 199 |
|
200 | 200 |
c = st->codec; |
201 | 201 |
c->codec_id = codec_id; |
202 |
- c->codec_type = CODEC_TYPE_VIDEO; |
|
202 |
+ c->codec_type = AVMEDIA_TYPE_VIDEO; |
|
203 | 203 |
|
204 | 204 |
/* put sample parameters */ |
205 | 205 |
c->bit_rate = 400000; |
... | ... |
@@ -169,7 +169,7 @@ static int str_read_packet(AVFormatContext *s, |
169 | 169 |
|
170 | 170 |
str->channels[channel].video_stream_index = st->index; |
171 | 171 |
|
172 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
172 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
173 | 173 |
st->codec->codec_id = CODEC_ID_MDEC; |
174 | 174 |
st->codec->codec_tag = 0; /* no fourcc */ |
175 | 175 |
st->codec->width = AV_RL16(§or[0x28]); |
... | ... |
@@ -216,7 +216,7 @@ static int str_read_packet(AVFormatContext *s, |
216 | 216 |
|
217 | 217 |
str->channels[channel].audio_stream_index = st->index; |
218 | 218 |
|
219 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
219 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
220 | 220 |
st->codec->codec_id = CODEC_ID_ADPCM_XA; |
221 | 221 |
st->codec->codec_tag = 0; /* no fourcc */ |
222 | 222 |
st->codec->channels = (fmt&1)?2:1; |
... | ... |
@@ -45,7 +45,7 @@ static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) { |
45 | 45 |
|
46 | 46 |
if (!(st = av_new_stream(s, 0))) |
47 | 47 |
return AVERROR(ENOMEM); |
48 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
48 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
49 | 49 |
st->codec->codec_id = CODEC_ID_MPEG2VIDEO; |
50 | 50 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
51 | 51 |
av_set_pts_info(st, 32, 1, 90000); |
... | ... |
@@ -53,7 +53,7 @@ static int pva_read_header(AVFormatContext *s, AVFormatParameters *ap) { |
53 | 53 |
|
54 | 54 |
if (!(st = av_new_stream(s, 1))) |
55 | 55 |
return AVERROR(ENOMEM); |
56 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
56 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
57 | 57 |
st->codec->codec_id = CODEC_ID_MP2; |
58 | 58 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
59 | 59 |
av_set_pts_info(st, 33, 1, 90000); |
... | ... |
@@ -95,7 +95,7 @@ static int qcp_read_header(AVFormatContext *s, AVFormatParameters *ap) |
95 | 95 |
s->file_size = get_le32(pb) + 8; |
96 | 96 |
url_fskip(pb, 8 + 4 + 1 + 1); // "QLCMfmt " + chunk-size + major-version + minor-version |
97 | 97 |
|
98 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
98 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
99 | 99 |
st->codec->channels = 1; |
100 | 100 |
get_buffer(pb, buf, 16); |
101 | 101 |
if (is_qcelp_13k_guid(buf)) { |
... | ... |
@@ -56,7 +56,7 @@ static int r3d_read_red1(AVFormatContext *s) |
56 | 56 |
|
57 | 57 |
if (!st) |
58 | 58 |
return AVERROR(ENOMEM); |
59 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
59 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
60 | 60 |
st->codec->codec_id = CODEC_ID_JPEG2000; |
61 | 61 |
|
62 | 62 |
tmp = get_byte(s->pb); // major version |
... | ... |
@@ -89,7 +89,7 @@ static int r3d_read_red1(AVFormatContext *s) |
89 | 89 |
AVStream *ast = av_new_stream(s, 1); |
90 | 90 |
if (!ast) |
91 | 91 |
return AVERROR(ENOMEM); |
92 |
- ast->codec->codec_type = CODEC_TYPE_AUDIO; |
|
92 |
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
93 | 93 |
ast->codec->codec_id = CODEC_ID_PCM_S32BE; |
94 | 94 |
ast->codec->channels = tmp; |
95 | 95 |
av_set_pts_info(ast, 32, 1, st->time_base.den); |
... | ... |
@@ -74,14 +74,14 @@ static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) |
74 | 74 |
|
75 | 75 |
id = s->iformat->value; |
76 | 76 |
if (id == CODEC_ID_RAWVIDEO) { |
77 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
77 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
78 | 78 |
} else { |
79 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
79 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
80 | 80 |
} |
81 | 81 |
st->codec->codec_id = id; |
82 | 82 |
|
83 | 83 |
switch(st->codec->codec_type) { |
84 |
- case CODEC_TYPE_AUDIO: |
|
84 |
+ case AVMEDIA_TYPE_AUDIO: |
|
85 | 85 |
st->codec->sample_rate = ap->sample_rate; |
86 | 86 |
if(ap->channels) st->codec->channels = ap->channels; |
87 | 87 |
else st->codec->channels = 1; |
... | ... |
@@ -90,7 +90,7 @@ static int raw_read_header(AVFormatContext *s, AVFormatParameters *ap) |
90 | 90 |
st->codec->block_align = st->codec->bits_per_coded_sample*st->codec->channels/8; |
91 | 91 |
av_set_pts_info(st, 64, 1, st->codec->sample_rate); |
92 | 92 |
break; |
93 |
- case CODEC_TYPE_VIDEO: |
|
93 |
+ case AVMEDIA_TYPE_VIDEO: |
|
94 | 94 |
if(ap->time_base.num) |
95 | 95 |
av_set_pts_info(st, 64, ap->time_base.num, ap->time_base.den); |
96 | 96 |
else |
... | ... |
@@ -253,7 +253,7 @@ static int audio_read_header(AVFormatContext *s, |
253 | 253 |
AVStream *st = av_new_stream(s, 0); |
254 | 254 |
if (!st) |
255 | 255 |
return AVERROR(ENOMEM); |
256 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
256 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
257 | 257 |
st->codec->codec_id = s->iformat->value; |
258 | 258 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
259 | 259 |
/* the parameters will be extracted from the compressed bitstream */ |
... | ... |
@@ -271,7 +271,7 @@ static int video_read_header(AVFormatContext *s, |
271 | 271 |
if (!st) |
272 | 272 |
return AVERROR(ENOMEM); |
273 | 273 |
|
274 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
274 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
275 | 275 |
st->codec->codec_id = s->iformat->value; |
276 | 276 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
277 | 277 |
|
... | ... |
@@ -700,7 +700,7 @@ static int adts_aac_read_header(AVFormatContext *s, |
700 | 700 |
if (!st) |
701 | 701 |
return AVERROR(ENOMEM); |
702 | 702 |
|
703 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
703 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
704 | 704 |
st->codec->codec_id = s->iformat->value; |
705 | 705 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
706 | 706 |
|
... | ... |
@@ -546,10 +546,10 @@ static RTPDynamicProtocolHandler ff_rdt_ ## n ## _handler = { \ |
546 | 546 |
.parse_packet = rdt_parse_packet \ |
547 | 547 |
}; |
548 | 548 |
|
549 |
-RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live", CODEC_TYPE_VIDEO); |
|
550 |
-RDT_HANDLER(live_audio, "x-pn-multirate-realaudio-live", CODEC_TYPE_AUDIO); |
|
551 |
-RDT_HANDLER(video, "x-pn-realvideo", CODEC_TYPE_VIDEO); |
|
552 |
-RDT_HANDLER(audio, "x-pn-realaudio", CODEC_TYPE_AUDIO); |
|
549 |
+RDT_HANDLER(live_video, "x-pn-multirate-realvideo-live", AVMEDIA_TYPE_VIDEO); |
|
550 |
+RDT_HANDLER(live_audio, "x-pn-multirate-realaudio-live", AVMEDIA_TYPE_AUDIO); |
|
551 |
+RDT_HANDLER(video, "x-pn-realvideo", AVMEDIA_TYPE_VIDEO); |
|
552 |
+RDT_HANDLER(audio, "x-pn-realaudio", AVMEDIA_TYPE_AUDIO); |
|
553 | 553 |
|
554 | 554 |
void av_register_rdt_dynamic_payload_handlers(void) |
555 | 555 |
{ |
... | ... |
@@ -461,7 +461,7 @@ void ff_get_wav_header(ByteIOContext *pb, AVCodecContext *codec, int size) |
461 | 461 |
int id; |
462 | 462 |
|
463 | 463 |
id = get_le16(pb); |
464 |
- codec->codec_type = CODEC_TYPE_AUDIO; |
|
464 |
+ codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
465 | 465 |
codec->codec_tag = id; |
466 | 466 |
codec->channels = get_le16(pb); |
467 | 467 |
codec->sample_rate = get_le32(pb); |
... | ... |
@@ -527,8 +527,8 @@ void ff_parse_specific_params(AVCodecContext *stream, int *au_rate, int *au_ssiz |
527 | 527 |
if(stream->frame_size && stream->sample_rate){ |
528 | 528 |
*au_scale=stream->frame_size; |
529 | 529 |
*au_rate= stream->sample_rate; |
530 |
- }else if(stream->codec_type == CODEC_TYPE_VIDEO || |
|
531 |
- stream->codec_type == CODEC_TYPE_SUBTITLE){ |
|
530 |
+ }else if(stream->codec_type == AVMEDIA_TYPE_VIDEO || |
|
531 |
+ stream->codec_type == AVMEDIA_TYPE_SUBTITLE){ |
|
532 | 532 |
*au_scale= stream->time_base.num; |
533 | 533 |
*au_rate = stream->time_base.den; |
534 | 534 |
}else{ |
... | ... |
@@ -116,7 +116,7 @@ static av_cold int rl2_read_header(AVFormatContext *s, |
116 | 116 |
if(!st) |
117 | 117 |
return AVERROR(ENOMEM); |
118 | 118 |
|
119 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
119 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
120 | 120 |
st->codec->codec_id = CODEC_ID_RL2; |
121 | 121 |
st->codec->codec_tag = 0; /* no fourcc */ |
122 | 122 |
st->codec->width = 320; |
... | ... |
@@ -145,7 +145,7 @@ static av_cold int rl2_read_header(AVFormatContext *s, |
145 | 145 |
st = av_new_stream(s, 0); |
146 | 146 |
if (!st) |
147 | 147 |
return AVERROR(ENOMEM); |
148 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
148 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
149 | 149 |
st->codec->codec_id = CODEC_ID_PCM_U8; |
150 | 150 |
st->codec->codec_tag = 1; |
151 | 151 |
st->codec->channels = channels; |
... | ... |
@@ -161,7 +161,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb, |
161 | 161 |
url_fskip(pb, header_size + startpos - url_ftell(pb)); |
162 | 162 |
st->codec->sample_rate = 8000; |
163 | 163 |
st->codec->channels = 1; |
164 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
164 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
165 | 165 |
st->codec->codec_id = CODEC_ID_RA_144; |
166 | 166 |
} else { |
167 | 167 |
int flavor, sub_packet_h, coded_framesize, sub_packet_size; |
... | ... |
@@ -195,7 +195,7 @@ static int rm_read_audio_stream_info(AVFormatContext *s, ByteIOContext *pb, |
195 | 195 |
get_str8(pb, buf, sizeof(buf)); /* desc */ |
196 | 196 |
get_str8(pb, buf, sizeof(buf)); /* desc */ |
197 | 197 |
} |
198 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
198 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
199 | 199 |
st->codec->codec_tag = AV_RL32(buf); |
200 | 200 |
st->codec->codec_id = ff_codec_get_id(rm_codec_tags, st->codec->codec_tag); |
201 | 201 |
switch (st->codec->codec_id) { |
... | ... |
@@ -316,7 +316,7 @@ ff_rm_read_mdpr_codecdata (AVFormatContext *s, ByteIOContext *pb, |
316 | 316 |
st->codec->height = get_be16(pb); |
317 | 317 |
st->codec->time_base.num= 1; |
318 | 318 |
fps= get_be16(pb); |
319 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
319 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
320 | 320 |
get_be32(pb); |
321 | 321 |
fps2= get_be16(pb); |
322 | 322 |
get_be16(pb); |
... | ... |
@@ -479,7 +479,7 @@ static int rm_read_header(AVFormatContext *s, AVFormatParameters *ap) |
479 | 479 |
st->duration = duration; |
480 | 480 |
get_str8(pb, buf, sizeof(buf)); /* desc */ |
481 | 481 |
get_str8(pb, buf, sizeof(buf)); /* mimetype */ |
482 |
- st->codec->codec_type = CODEC_TYPE_DATA; |
|
482 |
+ st->codec->codec_type = AVMEDIA_TYPE_DATA; |
|
483 | 483 |
st->priv_data = ff_rm_alloc_rmstream(); |
484 | 484 |
if (ff_rm_read_mdpr_codecdata(s, s->pb, st, st->priv_data, |
485 | 485 |
get_be32(pb)) < 0) |
... | ... |
@@ -725,11 +725,11 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, |
725 | 725 |
{ |
726 | 726 |
RMDemuxContext *rm = s->priv_data; |
727 | 727 |
|
728 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
728 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
729 | 729 |
rm->current_stream= st->id; |
730 | 730 |
if(rm_assemble_video_frame(s, pb, rm, ast, pkt, len, seq)) |
731 | 731 |
return -1; //got partial frame |
732 |
- } else if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
732 |
+ } else if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
733 | 733 |
if ((st->codec->codec_id == CODEC_ID_RA_288) || |
734 | 734 |
(st->codec->codec_id == CODEC_ID_COOK) || |
735 | 735 |
(st->codec->codec_id == CODEC_ID_ATRAC3) || |
... | ... |
@@ -790,7 +790,7 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, |
790 | 790 |
pkt->stream_index = st->index; |
791 | 791 |
|
792 | 792 |
#if 0 |
793 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
793 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
794 | 794 |
if(st->codec->codec_id == CODEC_ID_RV20){ |
795 | 795 |
int seq= 128*(pkt->data[2]&0x7F) + (pkt->data[3]>>1); |
796 | 796 |
av_log(s, AV_LOG_DEBUG, "%d %"PRId64" %d\n", *timestamp, *timestamp*512LL/25, seq); |
... | ... |
@@ -806,7 +806,7 @@ ff_rm_parse_packet (AVFormatContext *s, ByteIOContext *pb, |
806 | 806 |
if (flags & 2) |
807 | 807 |
pkt->flags |= PKT_FLAG_KEY; |
808 | 808 |
|
809 |
- return st->codec->codec_type == CODEC_TYPE_AUDIO ? rm->audio_pkt_cnt : 0; |
|
809 |
+ return st->codec->codec_type == AVMEDIA_TYPE_AUDIO ? rm->audio_pkt_cnt : 0; |
|
810 | 810 |
} |
811 | 811 |
|
812 | 812 |
int |
... | ... |
@@ -932,7 +932,7 @@ static int64_t rm_read_dts(AVFormatContext *s, int stream_index, |
932 | 932 |
return AV_NOPTS_VALUE; |
933 | 933 |
|
934 | 934 |
st = s->streams[stream_index2]; |
935 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
935 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
936 | 936 |
h= get_byte(s->pb); len--; |
937 | 937 |
if(!(h & 0x40)){ |
938 | 938 |
seq = get_byte(s->pb); len--; |
... | ... |
@@ -141,7 +141,7 @@ static void rv10_write_header(AVFormatContext *ctx, |
141 | 141 |
|
142 | 142 |
stream = &rm->streams[i]; |
143 | 143 |
|
144 |
- if (stream->enc->codec_type == CODEC_TYPE_AUDIO) { |
|
144 |
+ if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
145 | 145 |
desc = "The Audio Stream"; |
146 | 146 |
mimetype = "audio/x-pn-realaudio"; |
147 | 147 |
codec_data_size = 73; |
... | ... |
@@ -177,7 +177,7 @@ static void rv10_write_header(AVFormatContext *ctx, |
177 | 177 |
put_str8(s, mimetype); |
178 | 178 |
put_be32(s, codec_data_size); |
179 | 179 |
|
180 |
- if (stream->enc->codec_type == CODEC_TYPE_AUDIO) { |
|
180 |
+ if (stream->enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
181 | 181 |
int coded_frame_size, fscode, sample_rate; |
182 | 182 |
sample_rate = stream->enc->sample_rate; |
183 | 183 |
coded_frame_size = (stream->enc->bit_rate * |
... | ... |
@@ -309,7 +309,7 @@ static int rm_write_header(AVFormatContext *s) |
309 | 309 |
stream->enc = codec; |
310 | 310 |
|
311 | 311 |
switch(codec->codec_type) { |
312 |
- case CODEC_TYPE_AUDIO: |
|
312 |
+ case AVMEDIA_TYPE_AUDIO: |
|
313 | 313 |
rm->audio_stream = stream; |
314 | 314 |
stream->frame_rate = (float)codec->sample_rate / (float)codec->frame_size; |
315 | 315 |
/* XXX: dummy values */ |
... | ... |
@@ -317,7 +317,7 @@ static int rm_write_header(AVFormatContext *s) |
317 | 317 |
stream->nb_packets = 0; |
318 | 318 |
stream->total_frames = stream->nb_packets; |
319 | 319 |
break; |
320 |
- case CODEC_TYPE_VIDEO: |
|
320 |
+ case AVMEDIA_TYPE_VIDEO: |
|
321 | 321 |
rm->video_stream = stream; |
322 | 322 |
stream->frame_rate = (float)codec->time_base.den / (float)codec->time_base.num; |
323 | 323 |
/* XXX: dummy values */ |
... | ... |
@@ -408,7 +408,7 @@ static int rm_write_video(AVFormatContext *s, const uint8_t *buf, int size, int |
408 | 408 |
static int rm_write_packet(AVFormatContext *s, AVPacket *pkt) |
409 | 409 |
{ |
410 | 410 |
if (s->streams[pkt->stream_index]->codec->codec_type == |
411 |
- CODEC_TYPE_AUDIO) |
|
411 |
+ AVMEDIA_TYPE_AUDIO) |
|
412 | 412 |
return rm_write_audio(s, pkt->data, pkt->size, pkt->flags); |
413 | 413 |
else |
414 | 414 |
return rm_write_video(s, pkt->data, pkt->size, pkt->flags); |
... | ... |
@@ -141,7 +141,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) |
141 | 141 |
vst = av_new_stream(s, 0); |
142 | 142 |
if (!vst) |
143 | 143 |
return AVERROR(ENOMEM); |
144 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
144 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
145 | 145 |
vst->codec->codec_tag = read_line_and_int(pb, &error); // video format |
146 | 146 |
vst->codec->width = read_line_and_int(pb, &error); // video width |
147 | 147 |
vst->codec->height = read_line_and_int(pb, &error); // video height |
... | ... |
@@ -183,7 +183,7 @@ static int rpl_read_header(AVFormatContext *s, AVFormatParameters *ap) |
183 | 183 |
ast = av_new_stream(s, 0); |
184 | 184 |
if (!ast) |
185 | 185 |
return AVERROR(ENOMEM); |
186 |
- ast->codec->codec_type = CODEC_TYPE_AUDIO; |
|
186 |
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
187 | 187 |
ast->codec->codec_tag = audio_format; |
188 | 188 |
ast->codec->sample_rate = read_line_and_int(pb, &error); // audio bitrate |
189 | 189 |
ast->codec->channels = read_line_and_int(pb, &error); // number of audio channels |
... | ... |
@@ -295,7 +295,7 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) |
295 | 295 |
if (url_fseek(pb, index_entry->pos, SEEK_SET) < 0) |
296 | 296 |
return AVERROR(EIO); |
297 | 297 |
|
298 |
- if (stream->codec->codec_type == CODEC_TYPE_VIDEO && |
|
298 |
+ if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO && |
|
299 | 299 |
stream->codec->codec_tag == 124) { |
300 | 300 |
// We have to split Escape 124 frames because there are |
301 | 301 |
// multiple frames per chunk in Escape 124 samples. |
... | ... |
@@ -327,7 +327,7 @@ static int rpl_read_packet(AVFormatContext *s, AVPacket *pkt) |
327 | 327 |
return AVERROR(EIO); |
328 | 328 |
} |
329 | 329 |
|
330 |
- if (stream->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
330 |
+ if (stream->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
331 | 331 |
// frames_per_chunk should always be one here; the header |
332 | 332 |
// parsing will warn if it isn't. |
333 | 333 |
pkt->duration = rpl->frames_per_chunk; |
... | ... |
@@ -35,39 +35,39 @@ static const struct |
35 | 35 |
{ |
36 | 36 |
int pt; |
37 | 37 |
const char enc_name[6]; |
38 |
- enum CodecType codec_type; |
|
38 |
+ enum AVMediaType codec_type; |
|
39 | 39 |
enum CodecID codec_id; |
40 | 40 |
int clock_rate; |
41 | 41 |
int audio_channels; |
42 | 42 |
} AVRtpPayloadTypes[]= |
43 | 43 |
{ |
44 |
- {0, "PCMU", CODEC_TYPE_AUDIO, CODEC_ID_PCM_MULAW, 8000, 1}, |
|
45 |
- {3, "GSM", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
46 |
- {4, "G723", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
47 |
- {5, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
48 |
- {6, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 16000, 1}, |
|
49 |
- {7, "LPC", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
50 |
- {8, "PCMA", CODEC_TYPE_AUDIO, CODEC_ID_PCM_ALAW, 8000, 1}, |
|
51 |
- {9, "G722", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
52 |
- {10, "L16", CODEC_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 2}, |
|
53 |
- {11, "L16", CODEC_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 1}, |
|
54 |
- {12, "QCELP", CODEC_TYPE_AUDIO, CODEC_ID_QCELP, 8000, 1}, |
|
55 |
- {13, "CN", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
56 |
- {14, "MPA", CODEC_TYPE_AUDIO, CODEC_ID_MP2, -1, -1}, |
|
57 |
- {14, "MPA", CODEC_TYPE_AUDIO, CODEC_ID_MP3, -1, -1}, |
|
58 |
- {15, "G728", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
59 |
- {16, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 11025, 1}, |
|
60 |
- {17, "DVI4", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 22050, 1}, |
|
61 |
- {18, "G729", CODEC_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
62 |
- {25, "CelB", CODEC_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, |
|
63 |
- {26, "JPEG", CODEC_TYPE_VIDEO, CODEC_ID_MJPEG, 90000, -1}, |
|
64 |
- {28, "nv", CODEC_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, |
|
65 |
- {31, "H261", CODEC_TYPE_VIDEO, CODEC_ID_H261, 90000, -1}, |
|
66 |
- {32, "MPV", CODEC_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, 90000, -1}, |
|
67 |
- {32, "MPV", CODEC_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, 90000, -1}, |
|
68 |
- {33, "MP2T", CODEC_TYPE_DATA, CODEC_ID_MPEG2TS, 90000, -1}, |
|
69 |
- {34, "H263", CODEC_TYPE_VIDEO, CODEC_ID_H263, 90000, -1}, |
|
70 |
- {-1, "", CODEC_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1} |
|
44 |
+ {0, "PCMU", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_MULAW, 8000, 1}, |
|
45 |
+ {3, "GSM", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
46 |
+ {4, "G723", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
47 |
+ {5, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
48 |
+ {6, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 16000, 1}, |
|
49 |
+ {7, "LPC", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
50 |
+ {8, "PCMA", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_ALAW, 8000, 1}, |
|
51 |
+ {9, "G722", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
52 |
+ {10, "L16", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 2}, |
|
53 |
+ {11, "L16", AVMEDIA_TYPE_AUDIO, CODEC_ID_PCM_S16BE, 44100, 1}, |
|
54 |
+ {12, "QCELP", AVMEDIA_TYPE_AUDIO, CODEC_ID_QCELP, 8000, 1}, |
|
55 |
+ {13, "CN", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
56 |
+ {14, "MPA", AVMEDIA_TYPE_AUDIO, CODEC_ID_MP2, -1, -1}, |
|
57 |
+ {14, "MPA", AVMEDIA_TYPE_AUDIO, CODEC_ID_MP3, -1, -1}, |
|
58 |
+ {15, "G728", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
59 |
+ {16, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 11025, 1}, |
|
60 |
+ {17, "DVI4", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 22050, 1}, |
|
61 |
+ {18, "G729", AVMEDIA_TYPE_AUDIO, CODEC_ID_NONE, 8000, 1}, |
|
62 |
+ {25, "CelB", AVMEDIA_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, |
|
63 |
+ {26, "JPEG", AVMEDIA_TYPE_VIDEO, CODEC_ID_MJPEG, 90000, -1}, |
|
64 |
+ {28, "nv", AVMEDIA_TYPE_VIDEO, CODEC_ID_NONE, 90000, -1}, |
|
65 |
+ {31, "H261", AVMEDIA_TYPE_VIDEO, CODEC_ID_H261, 90000, -1}, |
|
66 |
+ {32, "MPV", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG1VIDEO, 90000, -1}, |
|
67 |
+ {32, "MPV", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG2VIDEO, 90000, -1}, |
|
68 |
+ {33, "MP2T", AVMEDIA_TYPE_DATA, CODEC_ID_MPEG2TS, 90000, -1}, |
|
69 |
+ {34, "H263", AVMEDIA_TYPE_VIDEO, CODEC_ID_H263, 90000, -1}, |
|
70 |
+ {-1, "", AVMEDIA_TYPE_UNKNOWN, CODEC_ID_NONE, -1, -1} |
|
71 | 71 |
}; |
72 | 72 |
|
73 | 73 |
int ff_rtp_get_codec_info(AVCodecContext *codec, int payload_type) |
... | ... |
@@ -118,7 +118,7 @@ const char *ff_rtp_enc_name(int payload_type) |
118 | 118 |
return ""; |
119 | 119 |
} |
120 | 120 |
|
121 |
-enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type) |
|
121 |
+enum CodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type) |
|
122 | 122 |
{ |
123 | 123 |
int i; |
124 | 124 |
|
... | ... |
@@ -66,7 +66,7 @@ const char *ff_rtp_enc_name(int payload_type); |
66 | 66 |
* @return In case of unknown encoding name, CODEC_ID_NONE is returned; |
67 | 67 |
* otherwise, the codec id is returned |
68 | 68 |
*/ |
69 |
-enum CodecID ff_rtp_codec_id(const char *buf, enum CodecType codec_type); |
|
69 |
+enum CodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type); |
|
70 | 70 |
|
71 | 71 |
#define RTP_PT_PRIVATE 96 |
72 | 72 |
#define RTP_VERSION 2 |
... | ... |
@@ -51,8 +51,8 @@ |
51 | 51 |
/* statistics functions */ |
52 | 52 |
RTPDynamicProtocolHandler *RTPFirstDynamicPayloadHandler= NULL; |
53 | 53 |
|
54 |
-static RTPDynamicProtocolHandler mp4v_es_handler= {"MP4V-ES", CODEC_TYPE_VIDEO, CODEC_ID_MPEG4}; |
|
55 |
-static RTPDynamicProtocolHandler mpeg4_generic_handler= {"mpeg4-generic", CODEC_TYPE_AUDIO, CODEC_ID_AAC}; |
|
54 |
+static RTPDynamicProtocolHandler mp4v_es_handler= {"MP4V-ES", AVMEDIA_TYPE_VIDEO, CODEC_ID_MPEG4}; |
|
55 |
+static RTPDynamicProtocolHandler mpeg4_generic_handler= {"mpeg4-generic", AVMEDIA_TYPE_AUDIO, CODEC_ID_AAC}; |
|
56 | 56 |
|
57 | 57 |
void ff_register_dynamic_payload_handler(RTPDynamicProtocolHandler *handler) |
58 | 58 |
{ |
... | ... |
@@ -350,7 +350,7 @@ RTPDemuxContext *rtp_parse_open(AVFormatContext *s1, AVStream *st, URLContext *r |
350 | 350 |
st->need_parsing = AVSTREAM_PARSE_FULL; |
351 | 351 |
break; |
352 | 352 |
default: |
353 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
353 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
354 | 354 |
av_set_pts_info(st, 32, 1, st->codec->sample_rate); |
355 | 355 |
} |
356 | 356 |
break; |
... | ... |
@@ -132,7 +132,7 @@ typedef int (*DynamicPayloadPacketHandlerProc) (AVFormatContext *ctx, |
132 | 132 |
struct RTPDynamicProtocolHandler_s { |
133 | 133 |
// fields from AVRtpDynamicPayloadType_s |
134 | 134 |
const char enc_name[50]; /* XXX: still why 50 ? ;-) */ |
135 |
- enum CodecType codec_type; |
|
135 |
+ enum AVMediaType codec_type; |
|
136 | 136 |
enum CodecID codec_id; |
137 | 137 |
|
138 | 138 |
// may be null |
... | ... |
@@ -170,7 +170,7 @@ static int amr_parse_sdp_line(AVFormatContext *s, int st_index, |
170 | 170 |
|
171 | 171 |
RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = { |
172 | 172 |
.enc_name = "AMR", |
173 |
- .codec_type = CODEC_TYPE_AUDIO, |
|
173 |
+ .codec_type = AVMEDIA_TYPE_AUDIO, |
|
174 | 174 |
.codec_id = CODEC_ID_AMR_NB, |
175 | 175 |
.parse_sdp_a_line = amr_parse_sdp_line, |
176 | 176 |
.parse_packet = amr_handle_packet, |
... | ... |
@@ -178,7 +178,7 @@ RTPDynamicProtocolHandler ff_amr_nb_dynamic_handler = { |
178 | 178 |
|
179 | 179 |
RTPDynamicProtocolHandler ff_amr_wb_dynamic_handler = { |
180 | 180 |
.enc_name = "AMR-WB", |
181 |
- .codec_type = CODEC_TYPE_AUDIO, |
|
181 |
+ .codec_type = AVMEDIA_TYPE_AUDIO, |
|
182 | 182 |
.codec_id = CODEC_ID_AMR_WB, |
183 | 183 |
.parse_sdp_a_line = amr_parse_sdp_line, |
184 | 184 |
.parse_packet = amr_handle_packet, |
... | ... |
@@ -277,5 +277,5 @@ RTPDynamicProtocolHandler ff_ms_rtp_ ## n ## _handler = { \ |
277 | 277 |
.parse_packet = asfrtp_parse_packet, \ |
278 | 278 |
}; |
279 | 279 |
|
280 |
-RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", CODEC_TYPE_VIDEO); |
|
281 |
-RTP_ASF_HANDLER(asf_pfa, "x-asf-pf", CODEC_TYPE_AUDIO); |
|
280 |
+RTP_ASF_HANDLER(asf_pfv, "x-asf-pf", AVMEDIA_TYPE_VIDEO); |
|
281 |
+RTP_ASF_HANDLER(asf_pfa, "x-asf-pf", AVMEDIA_TYPE_AUDIO); |
... | ... |
@@ -94,14 +94,14 @@ static int h263_handle_packet(AVFormatContext *ctx, |
94 | 94 |
|
95 | 95 |
RTPDynamicProtocolHandler ff_h263_1998_dynamic_handler = { |
96 | 96 |
.enc_name = "H263-1998", |
97 |
- .codec_type = CODEC_TYPE_VIDEO, |
|
97 |
+ .codec_type = AVMEDIA_TYPE_VIDEO, |
|
98 | 98 |
.codec_id = CODEC_ID_H263, |
99 | 99 |
.parse_packet = h263_handle_packet, |
100 | 100 |
}; |
101 | 101 |
|
102 | 102 |
RTPDynamicProtocolHandler ff_h263_2000_dynamic_handler = { |
103 | 103 |
.enc_name = "H263-2000", |
104 |
- .codec_type = CODEC_TYPE_VIDEO, |
|
104 |
+ .codec_type = AVMEDIA_TYPE_VIDEO, |
|
105 | 105 |
.codec_id = CODEC_ID_H263, |
106 | 106 |
.parse_packet = h263_handle_packet, |
107 | 107 |
}; |
... | ... |
@@ -411,7 +411,7 @@ This is the structure for expanding on the dynamic rtp protocols (makes everythi |
411 | 411 |
*/ |
412 | 412 |
RTPDynamicProtocolHandler ff_h264_dynamic_handler = { |
413 | 413 |
.enc_name = "H264", |
414 |
- .codec_type = CODEC_TYPE_VIDEO, |
|
414 |
+ .codec_type = AVMEDIA_TYPE_VIDEO, |
|
415 | 415 |
.codec_id = CODEC_ID_H264, |
416 | 416 |
.parse_sdp_a_line = parse_h264_sdp_line, |
417 | 417 |
.open = h264_new_context, |
... | ... |
@@ -378,7 +378,7 @@ static int theora_parse_sdp_line(AVFormatContext *s, int st_index, |
378 | 378 |
|
379 | 379 |
RTPDynamicProtocolHandler ff_theora_dynamic_handler = { |
380 | 380 |
.enc_name = "theora", |
381 |
- .codec_type = CODEC_TYPE_VIDEO, |
|
381 |
+ .codec_type = AVMEDIA_TYPE_VIDEO, |
|
382 | 382 |
.codec_id = CODEC_ID_THEORA, |
383 | 383 |
.parse_sdp_a_line = theora_parse_sdp_line, |
384 | 384 |
.open = theora_new_context, |
... | ... |
@@ -209,7 +209,7 @@ vorbis_handle_packet(AVFormatContext * ctx, |
209 | 209 |
|
210 | 210 |
RTPDynamicProtocolHandler ff_vorbis_dynamic_handler = { |
211 | 211 |
.enc_name = "vorbis", |
212 |
- .codec_type = CODEC_TYPE_AUDIO, |
|
212 |
+ .codec_type = AVMEDIA_TYPE_AUDIO, |
|
213 | 213 |
.codec_id = CODEC_ID_VORBIS, |
214 | 214 |
.parse_sdp_a_line = NULL, |
215 | 215 |
.open = vorbis_new_context, |
... | ... |
@@ -78,7 +78,7 @@ static int rtp_write_header(AVFormatContext *s1) |
78 | 78 |
|
79 | 79 |
s->payload_type = ff_rtp_get_payload_type(st->codec); |
80 | 80 |
if (s->payload_type < 0) |
81 |
- s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == CODEC_TYPE_AUDIO); |
|
81 |
+ s->payload_type = RTP_PT_PRIVATE + (st->codec->codec_type == AVMEDIA_TYPE_AUDIO); |
|
82 | 82 |
|
83 | 83 |
s->base_timestamp = ff_random_get_seed(); |
84 | 84 |
s->timestamp = s->base_timestamp; |
... | ... |
@@ -102,14 +102,14 @@ static int rtp_write_header(AVFormatContext *s1) |
102 | 102 |
|
103 | 103 |
s->max_frames_per_packet = 0; |
104 | 104 |
if (s1->max_delay) { |
105 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
105 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
106 | 106 |
if (st->codec->frame_size == 0) { |
107 | 107 |
av_log(s1, AV_LOG_ERROR, "Cannot respect max delay: frame size = 0\n"); |
108 | 108 |
} else { |
109 | 109 |
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); |
110 | 110 |
} |
111 | 111 |
} |
112 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
112 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
113 | 113 |
/* FIXME: We should round down here... */ |
114 | 114 |
s->max_frames_per_packet = av_rescale_q(s1->max_delay, (AVRational){1, 1000000}, st->codec->time_base); |
115 | 115 |
} |
... | ... |
@@ -151,7 +151,7 @@ static int rtp_write_header(AVFormatContext *s1) |
151 | 151 |
case CODEC_ID_AAC: |
152 | 152 |
s->num_frames = 0; |
153 | 153 |
default: |
154 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
154 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
155 | 155 |
av_set_pts_info(st, 32, 1, st->codec->sample_rate); |
156 | 156 |
} |
157 | 157 |
s->buf_ptr = s->buf; |
... | ... |
@@ -141,7 +141,7 @@ static int sdp_parse_rtpmap(AVFormatContext *s, |
141 | 141 |
get_word_sep(buf, sizeof(buf), "/", &p); |
142 | 142 |
i = atoi(buf); |
143 | 143 |
switch (codec->codec_type) { |
144 |
- case CODEC_TYPE_AUDIO: |
|
144 |
+ case AVMEDIA_TYPE_AUDIO: |
|
145 | 145 |
av_log(s, AV_LOG_DEBUG, "audio codec set to: %s\n", c_name); |
146 | 146 |
codec->sample_rate = RTSP_DEFAULT_AUDIO_SAMPLERATE; |
147 | 147 |
codec->channels = RTSP_DEFAULT_NB_AUDIO_CHANNELS; |
... | ... |
@@ -161,7 +161,7 @@ static int sdp_parse_rtpmap(AVFormatContext *s, |
161 | 161 |
av_log(s, AV_LOG_DEBUG, "audio channels set to: %i\n", |
162 | 162 |
codec->channels); |
163 | 163 |
break; |
164 |
- case CODEC_TYPE_VIDEO: |
|
164 |
+ case AVMEDIA_TYPE_VIDEO: |
|
165 | 165 |
av_log(s, AV_LOG_DEBUG, "video codec set to: %s\n", c_name); |
166 | 166 |
break; |
167 | 167 |
default: |
... | ... |
@@ -343,7 +343,7 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, |
343 | 343 |
RTSPState *rt = s->priv_data; |
344 | 344 |
char buf1[64], st_type[64]; |
345 | 345 |
const char *p; |
346 |
- enum CodecType codec_type; |
|
346 |
+ enum AVMediaType codec_type; |
|
347 | 347 |
int payload_type, i; |
348 | 348 |
AVStream *st; |
349 | 349 |
RTSPStream *rtsp_st; |
... | ... |
@@ -396,11 +396,11 @@ static void sdp_parse_line(AVFormatContext *s, SDPParseState *s1, |
396 | 396 |
s1->skip_media = 0; |
397 | 397 |
get_word(st_type, sizeof(st_type), &p); |
398 | 398 |
if (!strcmp(st_type, "audio")) { |
399 |
- codec_type = CODEC_TYPE_AUDIO; |
|
399 |
+ codec_type = AVMEDIA_TYPE_AUDIO; |
|
400 | 400 |
} else if (!strcmp(st_type, "video")) { |
401 |
- codec_type = CODEC_TYPE_VIDEO; |
|
401 |
+ codec_type = AVMEDIA_TYPE_VIDEO; |
|
402 | 402 |
} else if (!strcmp(st_type, "application")) { |
403 |
- codec_type = CODEC_TYPE_DATA; |
|
403 |
+ codec_type = AVMEDIA_TYPE_DATA; |
|
404 | 404 |
} else { |
405 | 405 |
s1->skip_media = 1; |
406 | 406 |
return; |
... | ... |
@@ -1181,7 +1181,7 @@ static int make_setup_request(AVFormatContext *s, const char *host, int port, |
1181 | 1181 |
* will return an error. Therefore, we skip those streams. */ |
1182 | 1182 |
if (rt->server_type == RTSP_SERVER_WMS && |
1183 | 1183 |
s->streams[rtsp_st->stream_index]->codec->codec_type == |
1184 |
- CODEC_TYPE_DATA) |
|
1184 |
+ AVMEDIA_TYPE_DATA) |
|
1185 | 1185 |
continue; |
1186 | 1186 |
snprintf(transport, sizeof(transport) - 1, |
1187 | 1187 |
"%s/TCP;", trans_pref); |
... | ... |
@@ -301,13 +301,13 @@ static void sdp_write_media(char *buff, int size, AVCodecContext *c, const char |
301 | 301 |
|
302 | 302 |
payload_type = ff_rtp_get_payload_type(c); |
303 | 303 |
if (payload_type < 0) { |
304 |
- payload_type = RTP_PT_PRIVATE + (c->codec_type == CODEC_TYPE_AUDIO); |
|
304 |
+ payload_type = RTP_PT_PRIVATE + (c->codec_type == AVMEDIA_TYPE_AUDIO); |
|
305 | 305 |
} |
306 | 306 |
|
307 | 307 |
switch (c->codec_type) { |
308 |
- case CODEC_TYPE_VIDEO : type = "video" ; break; |
|
309 |
- case CODEC_TYPE_AUDIO : type = "audio" ; break; |
|
310 |
- case CODEC_TYPE_SUBTITLE: type = "text" ; break; |
|
308 |
+ case AVMEDIA_TYPE_VIDEO : type = "video" ; break; |
|
309 |
+ case AVMEDIA_TYPE_AUDIO : type = "audio" ; break; |
|
310 |
+ case AVMEDIA_TYPE_SUBTITLE: type = "text" ; break; |
|
311 | 311 |
default : type = "application"; break; |
312 | 312 |
} |
313 | 313 |
|
... | ... |
@@ -133,7 +133,7 @@ static int film_read_header(AVFormatContext *s, |
133 | 133 |
if (!st) |
134 | 134 |
return AVERROR(ENOMEM); |
135 | 135 |
film->video_stream_index = st->index; |
136 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
136 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
137 | 137 |
st->codec->codec_id = film->video_type; |
138 | 138 |
st->codec->codec_tag = 0; /* no fourcc */ |
139 | 139 |
st->codec->width = AV_RB32(&scratch[16]); |
... | ... |
@@ -145,7 +145,7 @@ static int film_read_header(AVFormatContext *s, |
145 | 145 |
if (!st) |
146 | 146 |
return AVERROR(ENOMEM); |
147 | 147 |
film->audio_stream_index = st->index; |
148 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
148 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
149 | 149 |
st->codec->codec_id = film->audio_type; |
150 | 150 |
st->codec->codec_tag = 1; |
151 | 151 |
st->codec->channels = film->audio_channels; |
... | ... |
@@ -109,7 +109,7 @@ static int vmd_read_header(AVFormatContext *s, |
109 | 109 |
return AVERROR(ENOMEM); |
110 | 110 |
av_set_pts_info(vst, 33, 1, 10); |
111 | 111 |
vmd->video_stream_index = vst->index; |
112 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
112 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
113 | 113 |
vst->codec->codec_id = vmd->is_indeo3 ? CODEC_ID_INDEO3 : CODEC_ID_VMDVIDEO; |
114 | 114 |
vst->codec->codec_tag = 0; /* no fourcc */ |
115 | 115 |
vst->codec->width = AV_RL16(&vmd->vmd_header[12]); |
... | ... |
@@ -129,7 +129,7 @@ static int vmd_read_header(AVFormatContext *s, |
129 | 129 |
if (!st) |
130 | 130 |
return AVERROR(ENOMEM); |
131 | 131 |
vmd->audio_stream_index = st->index; |
132 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
132 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
133 | 133 |
st->codec->codec_id = CODEC_ID_VMDAUDIO; |
134 | 134 |
st->codec->codec_tag = 0; /* no fourcc */ |
135 | 135 |
st->codec->channels = (vmd->vmd_header[811] & 0x80) ? 2 : 1; |
... | ... |
@@ -74,7 +74,7 @@ static int create_audio_stream(AVFormatContext *s, SIFFContext *c) |
74 | 74 |
ast = av_new_stream(s, 0); |
75 | 75 |
if (!ast) |
76 | 76 |
return -1; |
77 |
- ast->codec->codec_type = CODEC_TYPE_AUDIO; |
|
77 |
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
78 | 78 |
ast->codec->codec_id = CODEC_ID_PCM_U8; |
79 | 79 |
ast->codec->channels = 1; |
80 | 80 |
ast->codec->bits_per_coded_sample = c->bits; |
... | ... |
@@ -118,7 +118,7 @@ static int siff_parse_vbv1(AVFormatContext *s, SIFFContext *c, ByteIOContext *pb |
118 | 118 |
st = av_new_stream(s, 0); |
119 | 119 |
if (!st) |
120 | 120 |
return -1; |
121 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
121 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
122 | 122 |
st->codec->codec_id = CODEC_ID_VB; |
123 | 123 |
st->codec->codec_tag = MKTAG('V', 'B', 'V', '1'); |
124 | 124 |
st->codec->width = width; |
... | ... |
@@ -158,7 +158,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) |
158 | 158 |
st->codec->width = smk->width; |
159 | 159 |
st->codec->height = smk->height; |
160 | 160 |
st->codec->pix_fmt = PIX_FMT_PAL8; |
161 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
161 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
162 | 162 |
st->codec->codec_id = CODEC_ID_SMACKVIDEO; |
163 | 163 |
st->codec->codec_tag = smk->magic; |
164 | 164 |
/* Smacker uses 100000 as internal timebase */ |
... | ... |
@@ -176,7 +176,7 @@ static int smacker_read_header(AVFormatContext *s, AVFormatParameters *ap) |
176 | 176 |
if(smk->rates[i] & 0xFFFFFF){ |
177 | 177 |
ast[i] = av_new_stream(s, 0); |
178 | 178 |
smk->indexes[i] = ast[i]->index; |
179 |
- ast[i]->codec->codec_type = CODEC_TYPE_AUDIO; |
|
179 |
+ ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
180 | 180 |
if (smk->rates[i] & SMK_AUD_BINKAUD) { |
181 | 181 |
ast[i]->codec->codec_id = CODEC_ID_BINKAUDIO_RDFT; |
182 | 182 |
} else if (smk->rates[i] & SMK_AUD_USEDCT) { |
... | ... |
@@ -114,7 +114,7 @@ static int sol_read_header(AVFormatContext *s, |
114 | 114 |
st = av_new_stream(s, 0); |
115 | 115 |
if (!st) |
116 | 116 |
return -1; |
117 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
117 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
118 | 118 |
st->codec->codec_tag = id; |
119 | 119 |
st->codec->codec_id = codec; |
120 | 120 |
st->codec->channels = channels; |
... | ... |
@@ -53,7 +53,7 @@ static int sox_read_header(AVFormatContext *s, |
53 | 53 |
if (!st) |
54 | 54 |
return AVERROR(ENOMEM); |
55 | 55 |
|
56 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
56 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
57 | 57 |
|
58 | 58 |
if (get_le32(pb) == SOX_TAG) { |
59 | 59 |
st->codec->codec_id = CODEC_ID_PCM_S32LE; |
... | ... |
@@ -97,7 +97,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) |
97 | 97 |
|
98 | 98 |
for (i=0; i<s->nb_streams; i++) { |
99 | 99 |
st = s->streams[i]; |
100 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO && st->id == ch_id) |
|
100 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) |
|
101 | 101 |
goto skip; |
102 | 102 |
} |
103 | 103 |
|
... | ... |
@@ -109,7 +109,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) |
109 | 109 |
vst = av_new_stream(s, ch_id); |
110 | 110 |
if (!vst) |
111 | 111 |
return -1; |
112 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
112 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
113 | 113 |
vst->codec->codec_id = ff_codec_get_id(swf_codec_tags, get_byte(pb)); |
114 | 114 |
av_set_pts_info(vst, 16, 256, swf->frame_rate); |
115 | 115 |
vst->codec->time_base = (AVRational){ 256, swf->frame_rate }; |
... | ... |
@@ -120,7 +120,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) |
120 | 120 |
|
121 | 121 |
for (i=0; i<s->nb_streams; i++) { |
122 | 122 |
st = s->streams[i]; |
123 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO && st->id == -1) |
|
123 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) |
|
124 | 124 |
goto skip; |
125 | 125 |
} |
126 | 126 |
|
... | ... |
@@ -131,7 +131,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) |
131 | 131 |
if (!ast) |
132 | 132 |
return -1; |
133 | 133 |
ast->codec->channels = 1 + (v&1); |
134 |
- ast->codec->codec_type = CODEC_TYPE_AUDIO; |
|
134 |
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
135 | 135 |
ast->codec->codec_id = ff_codec_get_id(swf_audio_codec_tags, (v>>4) & 15); |
136 | 136 |
ast->need_parsing = AVSTREAM_PARSE_FULL; |
137 | 137 |
sample_rate_code= (v>>2) & 3; |
... | ... |
@@ -145,7 +145,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) |
145 | 145 |
len -= 2; |
146 | 146 |
for(i=0; i<s->nb_streams; i++) { |
147 | 147 |
st = s->streams[i]; |
148 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO && st->id == ch_id) { |
|
148 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->id == ch_id) { |
|
149 | 149 |
frame = get_le16(pb); |
150 | 150 |
av_get_packet(pb, pkt, len-2); |
151 | 151 |
pkt->pos = pos; |
... | ... |
@@ -157,7 +157,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) |
157 | 157 |
} else if (tag == TAG_STREAMBLOCK) { |
158 | 158 |
for (i = 0; i < s->nb_streams; i++) { |
159 | 159 |
st = s->streams[i]; |
160 |
- if (st->codec->codec_type == CODEC_TYPE_AUDIO && st->id == -1) { |
|
160 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO && st->id == -1) { |
|
161 | 161 |
if (st->codec->codec_id == CODEC_ID_MP3) { |
162 | 162 |
url_fskip(pb, 4); |
163 | 163 |
av_get_packet(pb, pkt, len-4); |
... | ... |
@@ -179,7 +179,7 @@ static int swf_read_packet(AVFormatContext *s, AVPacket *pkt) |
179 | 179 |
vst = av_new_stream(s, -2); /* -2 to avoid clash with video stream and audio stream */ |
180 | 180 |
if (!vst) |
181 | 181 |
return -1; |
182 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
182 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
183 | 183 |
vst->codec->codec_id = CODEC_ID_MJPEG; |
184 | 184 |
av_set_pts_info(vst, 64, 256, swf->frame_rate); |
185 | 185 |
vst->codec->time_base = (AVRational){ 256, swf->frame_rate }; |
... | ... |
@@ -185,7 +185,7 @@ static int swf_write_header(AVFormatContext *s) |
185 | 185 |
|
186 | 186 |
for(i=0;i<s->nb_streams;i++) { |
187 | 187 |
AVCodecContext *enc = s->streams[i]->codec; |
188 |
- if (enc->codec_type == CODEC_TYPE_AUDIO) { |
|
188 |
+ if (enc->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
189 | 189 |
if (enc->codec_id == CODEC_ID_MP3) { |
190 | 190 |
if (!enc->frame_size) { |
191 | 191 |
av_log(s, AV_LOG_ERROR, "audio frame size not set\n"); |
... | ... |
@@ -464,7 +464,7 @@ static int swf_write_audio(AVFormatContext *s, |
464 | 464 |
static int swf_write_packet(AVFormatContext *s, AVPacket *pkt) |
465 | 465 |
{ |
466 | 466 |
AVCodecContext *codec = s->streams[pkt->stream_index]->codec; |
467 |
- if (codec->codec_type == CODEC_TYPE_AUDIO) |
|
467 |
+ if (codec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
468 | 468 |
return swf_write_audio(s, codec, pkt->data, pkt->size); |
469 | 469 |
else |
470 | 470 |
return swf_write_video(s, codec, pkt->data, pkt->size); |
... | ... |
@@ -480,7 +480,7 @@ static int swf_write_trailer(AVFormatContext *s) |
480 | 480 |
video_enc = NULL; |
481 | 481 |
for(i=0;i<s->nb_streams;i++) { |
482 | 482 |
enc = s->streams[i]->codec; |
483 |
- if (enc->codec_type == CODEC_TYPE_VIDEO) |
|
483 |
+ if (enc->codec_type == AVMEDIA_TYPE_VIDEO) |
|
484 | 484 |
video_enc = enc; |
485 | 485 |
else |
486 | 486 |
av_fifo_free(swf->audio_fifo); |
... | ... |
@@ -100,7 +100,7 @@ static int thp_read_header(AVFormatContext *s, |
100 | 100 |
/* The denominator and numerator are switched because 1/fps |
101 | 101 |
is required. */ |
102 | 102 |
av_set_pts_info(st, 64, thp->fps.den, thp->fps.num); |
103 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
103 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
104 | 104 |
st->codec->codec_id = CODEC_ID_THP; |
105 | 105 |
st->codec->codec_tag = 0; /* no fourcc */ |
106 | 106 |
st->codec->width = get_be32(pb); |
... | ... |
@@ -120,7 +120,7 @@ static int thp_read_header(AVFormatContext *s, |
120 | 120 |
if (!st) |
121 | 121 |
return AVERROR(ENOMEM); |
122 | 122 |
|
123 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
123 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
124 | 124 |
st->codec->codec_id = CODEC_ID_ADPCM_THP; |
125 | 125 |
st->codec->codec_tag = 0; /* no fourcc */ |
126 | 126 |
st->codec->channels = get_be32(pb); /* numChannels. */ |
... | ... |
@@ -212,7 +212,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) |
212 | 212 |
|
213 | 213 |
av_set_pts_info(st, 32, 1, SEQ_FRAME_RATE); |
214 | 214 |
seq->video_stream_index = st->index; |
215 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
215 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
216 | 216 |
st->codec->codec_id = CODEC_ID_TIERTEXSEQVIDEO; |
217 | 217 |
st->codec->codec_tag = 0; /* no fourcc */ |
218 | 218 |
st->codec->width = SEQ_FRAME_W; |
... | ... |
@@ -225,7 +225,7 @@ static int seq_read_header(AVFormatContext *s, AVFormatParameters *ap) |
225 | 225 |
|
226 | 226 |
av_set_pts_info(st, 32, 1, SEQ_SAMPLE_RATE); |
227 | 227 |
seq->audio_stream_index = st->index; |
228 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
228 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
229 | 229 |
st->codec->codec_id = CODEC_ID_PCM_S16BE; |
230 | 230 |
st->codec->codec_tag = 0; /* no tag */ |
231 | 231 |
st->codec->channels = 1; |
... | ... |
@@ -109,7 +109,7 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap) |
109 | 109 |
return -1; |
110 | 110 |
} |
111 | 111 |
|
112 |
- ast->codec->codec_type = CODEC_TYPE_AUDIO; |
|
112 |
+ ast->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
113 | 113 |
ast->codec->codec_id = CODEC_ID_PCM_U8; |
114 | 114 |
ast->codec->channels = features & TMV_STEREO ? 2 : 1; |
115 | 115 |
ast->codec->bits_per_coded_sample = 8; |
... | ... |
@@ -121,7 +121,7 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap) |
121 | 121 |
fps.den = tmv->audio_chunk_size; |
122 | 122 |
av_reduce(&fps.num, &fps.den, fps.num, fps.den, 0xFFFFFFFFLL); |
123 | 123 |
|
124 |
- vst->codec->codec_type = CODEC_TYPE_VIDEO; |
|
124 |
+ vst->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
125 | 125 |
vst->codec->codec_id = CODEC_ID_TMV; |
126 | 126 |
vst->codec->pix_fmt = PIX_FMT_PAL8; |
127 | 127 |
vst->codec->width = char_cols * 8; |
... | ... |
@@ -101,7 +101,7 @@ static int tta_read_header(AVFormatContext *s, AVFormatParameters *ap) |
101 | 101 |
} |
102 | 102 |
url_fskip(s->pb, 4); // seektable crc |
103 | 103 |
|
104 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
104 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
105 | 105 |
st->codec->codec_id = CODEC_ID_TTA; |
106 | 106 |
st->codec->channels = channels; |
107 | 107 |
st->codec->sample_rate = samplerate; |
... | ... |
@@ -43,7 +43,7 @@ static int txd_read_header(AVFormatContext *s, AVFormatParameters *ap) { |
43 | 43 |
st = av_new_stream(s, 0); |
44 | 44 |
if (!st) |
45 | 45 |
return AVERROR(ENOMEM); |
46 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
46 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
47 | 47 |
st->codec->codec_id = CODEC_ID_TXD; |
48 | 48 |
st->codec->time_base.den = 5; |
49 | 49 |
st->codec->time_base.num = 1; |
... | ... |
@@ -254,8 +254,8 @@ AVOutputFormat *guess_stream_format(const char *short_name, const char *filename |
254 | 254 |
#endif |
255 | 255 |
|
256 | 256 |
enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, |
257 |
- const char *filename, const char *mime_type, enum CodecType type){ |
|
258 |
- if(type == CODEC_TYPE_VIDEO){ |
|
257 |
+ const char *filename, const char *mime_type, enum AVMediaType type){ |
|
258 |
+ if(type == AVMEDIA_TYPE_VIDEO){ |
|
259 | 259 |
enum CodecID codec_id= CODEC_ID_NONE; |
260 | 260 |
|
261 | 261 |
#if CONFIG_IMAGE2_MUXER |
... | ... |
@@ -266,7 +266,7 @@ enum CodecID av_guess_codec(AVOutputFormat *fmt, const char *short_name, |
266 | 266 |
if(codec_id == CODEC_ID_NONE) |
267 | 267 |
codec_id= fmt->video_codec; |
268 | 268 |
return codec_id; |
269 |
- }else if(type == CODEC_TYPE_AUDIO) |
|
269 |
+ }else if(type == AVMEDIA_TYPE_AUDIO) |
|
270 | 270 |
return fmt->audio_codec; |
271 | 271 |
else |
272 | 272 |
return CODEC_ID_NONE; |
... | ... |
@@ -351,25 +351,25 @@ static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st, AVProbeDa |
351 | 351 |
pd->buf_size, MAX_PROBE_PACKETS - st->probe_packets, fmt->name, score); |
352 | 352 |
if (!strcmp(fmt->name, "mp3")) { |
353 | 353 |
st->codec->codec_id = CODEC_ID_MP3; |
354 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
354 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
355 | 355 |
} else if (!strcmp(fmt->name, "ac3")) { |
356 | 356 |
st->codec->codec_id = CODEC_ID_AC3; |
357 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
357 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
358 | 358 |
} else if (!strcmp(fmt->name, "eac3")) { |
359 | 359 |
st->codec->codec_id = CODEC_ID_EAC3; |
360 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
360 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
361 | 361 |
} else if (!strcmp(fmt->name, "mpegvideo")) { |
362 | 362 |
st->codec->codec_id = CODEC_ID_MPEG2VIDEO; |
363 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
363 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
364 | 364 |
} else if (!strcmp(fmt->name, "m4v")) { |
365 | 365 |
st->codec->codec_id = CODEC_ID_MPEG4; |
366 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
366 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
367 | 367 |
} else if (!strcmp(fmt->name, "h264")) { |
368 | 368 |
st->codec->codec_id = CODEC_ID_H264; |
369 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
369 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
370 | 370 |
} else if (!strcmp(fmt->name, "dts")) { |
371 | 371 |
st->codec->codec_id = CODEC_ID_DTS; |
372 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
372 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
373 | 373 |
} |
374 | 374 |
} |
375 | 375 |
return !!fmt; |
... | ... |
@@ -646,13 +646,13 @@ int av_read_packet(AVFormatContext *s, AVPacket *pkt) |
646 | 646 |
st= s->streams[pkt->stream_index]; |
647 | 647 |
|
648 | 648 |
switch(st->codec->codec_type){ |
649 |
- case CODEC_TYPE_VIDEO: |
|
649 |
+ case AVMEDIA_TYPE_VIDEO: |
|
650 | 650 |
if(s->video_codec_id) st->codec->codec_id= s->video_codec_id; |
651 | 651 |
break; |
652 |
- case CODEC_TYPE_AUDIO: |
|
652 |
+ case AVMEDIA_TYPE_AUDIO: |
|
653 | 653 |
if(s->audio_codec_id) st->codec->codec_id= s->audio_codec_id; |
654 | 654 |
break; |
655 |
- case CODEC_TYPE_SUBTITLE: |
|
655 |
+ case AVMEDIA_TYPE_SUBTITLE: |
|
656 | 656 |
if(s->subtitle_codec_id)st->codec->codec_id= s->subtitle_codec_id; |
657 | 657 |
break; |
658 | 658 |
} |
... | ... |
@@ -729,7 +729,7 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st, |
729 | 729 |
*pnum = 0; |
730 | 730 |
*pden = 0; |
731 | 731 |
switch(st->codec->codec_type) { |
732 |
- case CODEC_TYPE_VIDEO: |
|
732 |
+ case AVMEDIA_TYPE_VIDEO: |
|
733 | 733 |
if(st->time_base.num*1000LL > st->time_base.den){ |
734 | 734 |
*pnum = st->time_base.num; |
735 | 735 |
*pden = st->time_base.den; |
... | ... |
@@ -741,7 +741,7 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st, |
741 | 741 |
} |
742 | 742 |
} |
743 | 743 |
break; |
744 |
- case CODEC_TYPE_AUDIO: |
|
744 |
+ case AVMEDIA_TYPE_AUDIO: |
|
745 | 745 |
frame_size = get_audio_frame_size(st->codec, pkt->size); |
746 | 746 |
if (frame_size < 0) |
747 | 747 |
break; |
... | ... |
@@ -754,9 +754,9 @@ static void compute_frame_duration(int *pnum, int *pden, AVStream *st, |
754 | 754 |
} |
755 | 755 |
|
756 | 756 |
static int is_intra_only(AVCodecContext *enc){ |
757 |
- if(enc->codec_type == CODEC_TYPE_AUDIO){ |
|
757 |
+ if(enc->codec_type == AVMEDIA_TYPE_AUDIO){ |
|
758 | 758 |
return 1; |
759 |
- }else if(enc->codec_type == CODEC_TYPE_VIDEO){ |
|
759 |
+ }else if(enc->codec_type == AVMEDIA_TYPE_VIDEO){ |
|
760 | 760 |
switch(enc->codec_id){ |
761 | 761 |
case CODEC_ID_MJPEG: |
762 | 762 |
case CODEC_ID_MJPEGB: |
... | ... |
@@ -1223,10 +1223,10 @@ int av_find_default_stream_index(AVFormatContext *s) |
1223 | 1223 |
return -1; |
1224 | 1224 |
for(i = 0; i < s->nb_streams; i++) { |
1225 | 1225 |
st = s->streams[i]; |
1226 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
1226 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
1227 | 1227 |
return i; |
1228 | 1228 |
} |
1229 |
- if (first_audio_index < 0 && st->codec->codec_type == CODEC_TYPE_AUDIO) |
|
1229 |
+ if (first_audio_index < 0 && st->codec->codec_type == AVMEDIA_TYPE_AUDIO) |
|
1230 | 1230 |
first_audio_index = i; |
1231 | 1231 |
} |
1232 | 1232 |
return first_audio_index >= 0 ? first_audio_index : 0; |
... | ... |
@@ -1953,7 +1953,7 @@ static int has_codec_parameters(AVCodecContext *enc) |
1953 | 1953 |
{ |
1954 | 1954 |
int val; |
1955 | 1955 |
switch(enc->codec_type) { |
1956 |
- case CODEC_TYPE_AUDIO: |
|
1956 |
+ case AVMEDIA_TYPE_AUDIO: |
|
1957 | 1957 |
val = enc->sample_rate && enc->channels && enc->sample_fmt != SAMPLE_FMT_NONE; |
1958 | 1958 |
if(!enc->frame_size && |
1959 | 1959 |
(enc->codec_id == CODEC_ID_VORBIS || |
... | ... |
@@ -1964,7 +1964,7 @@ static int has_codec_parameters(AVCodecContext *enc) |
1964 | 1964 |
enc->codec_id == CODEC_ID_SPEEX)) |
1965 | 1965 |
return 0; |
1966 | 1966 |
break; |
1967 |
- case CODEC_TYPE_VIDEO: |
|
1967 |
+ case AVMEDIA_TYPE_VIDEO: |
|
1968 | 1968 |
val = enc->width && enc->pix_fmt != PIX_FMT_NONE; |
1969 | 1969 |
break; |
1970 | 1970 |
default: |
... | ... |
@@ -1992,12 +1992,12 @@ static int try_decode_frame(AVStream *st, AVPacket *avpkt) |
1992 | 1992 |
|
1993 | 1993 |
if(!has_codec_parameters(st->codec)){ |
1994 | 1994 |
switch(st->codec->codec_type) { |
1995 |
- case CODEC_TYPE_VIDEO: |
|
1995 |
+ case AVMEDIA_TYPE_VIDEO: |
|
1996 | 1996 |
avcodec_get_frame_defaults(&picture); |
1997 | 1997 |
ret = avcodec_decode_video2(st->codec, &picture, |
1998 | 1998 |
&got_picture, avpkt); |
1999 | 1999 |
break; |
2000 |
- case CODEC_TYPE_AUDIO: |
|
2000 |
+ case AVMEDIA_TYPE_AUDIO: |
|
2001 | 2001 |
data_size = FFMAX(avpkt->size, AVCODEC_MAX_AUDIO_FRAME_SIZE); |
2002 | 2002 |
samples = av_malloc(data_size); |
2003 | 2003 |
if (!samples) |
... | ... |
@@ -2129,7 +2129,7 @@ int av_find_stream_info(AVFormatContext *ic) |
2129 | 2129 |
st->codec->frame_size = 0; |
2130 | 2130 |
st->codec->channels = 0; |
2131 | 2131 |
} |
2132 |
- if(st->codec->codec_type == CODEC_TYPE_VIDEO){ |
|
2132 |
+ if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ |
|
2133 | 2133 |
/* if(!st->time_base.num) |
2134 | 2134 |
st->time_base= */ |
2135 | 2135 |
if(!st->codec->time_base.num) |
... | ... |
@@ -2171,7 +2171,7 @@ int av_find_stream_info(AVFormatContext *ic) |
2171 | 2171 |
break; |
2172 | 2172 |
/* variable fps and no guess at the real fps */ |
2173 | 2173 |
if( tb_unreliable(st->codec) && !(st->r_frame_rate.num && st->avg_frame_rate.num) |
2174 |
- && duration_count[i]<20 && st->codec->codec_type == CODEC_TYPE_VIDEO) |
|
2174 |
+ && duration_count[i]<20 && st->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
2175 | 2175 |
break; |
2176 | 2176 |
if(st->parser && st->parser->parser->split && !st->codec->extradata) |
2177 | 2177 |
break; |
... | ... |
@@ -2243,7 +2243,7 @@ int av_find_stream_info(AVFormatContext *ic) |
2243 | 2243 |
if(pkt->dts != AV_NOPTS_VALUE && last != AV_NOPTS_VALUE && duration>0){ |
2244 | 2244 |
double dur= duration * av_q2d(st->time_base); |
2245 | 2245 |
|
2246 |
-// if(st->codec->codec_type == CODEC_TYPE_VIDEO) |
|
2246 |
+// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
2247 | 2247 |
// av_log(NULL, AV_LOG_ERROR, "%f\n", dur); |
2248 | 2248 |
if(duration_count[index] < 2) |
2249 | 2249 |
memset(duration_error[index], 0, sizeof(*duration_error)); |
... | ... |
@@ -2293,7 +2293,7 @@ int av_find_stream_info(AVFormatContext *ic) |
2293 | 2293 |
av_reduce(&st->avg_frame_rate.num, &st->avg_frame_rate.den, |
2294 | 2294 |
(st->codec_info_nb_frames-2)*(int64_t)st->time_base.den, |
2295 | 2295 |
codec_info_duration[i] *(int64_t)st->time_base.num, 60000); |
2296 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
2296 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
2297 | 2297 |
if(st->codec->codec_id == CODEC_ID_RAWVIDEO && !st->codec->codec_tag && !st->codec->bits_per_coded_sample) |
2298 | 2298 |
st->codec->codec_tag= avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt); |
2299 | 2299 |
|
... | ... |
@@ -2312,7 +2312,7 @@ int av_find_stream_info(AVFormatContext *ic) |
2312 | 2312 |
|
2313 | 2313 |
for(j=1; j<MAX_STD_TIMEBASES; j++){ |
2314 | 2314 |
double error= duration_error[i][j] * get_std_framerate(j); |
2315 |
-// if(st->codec->codec_type == CODEC_TYPE_VIDEO) |
|
2315 |
+// if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO) |
|
2316 | 2316 |
// av_log(NULL, AV_LOG_ERROR, "%f %f\n", get_std_framerate(j) / 12.0/1001, error); |
2317 | 2317 |
if(error < best_error){ |
2318 | 2318 |
best_error= error; |
... | ... |
@@ -2334,7 +2334,7 @@ int av_find_stream_info(AVFormatContext *ic) |
2334 | 2334 |
st->r_frame_rate.den = st->time_base.num; |
2335 | 2335 |
} |
2336 | 2336 |
} |
2337 |
- }else if(st->codec->codec_type == CODEC_TYPE_AUDIO) { |
|
2337 |
+ }else if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO) { |
|
2338 | 2338 |
if(!st->codec->bits_per_coded_sample) |
2339 | 2339 |
st->codec->bits_per_coded_sample= av_get_bits_per_sample(st->codec->codec_id); |
2340 | 2340 |
} |
... | ... |
@@ -2348,7 +2348,7 @@ int av_find_stream_info(AVFormatContext *ic) |
2348 | 2348 |
/* correct DTS for B-frame streams with no timestamps */ |
2349 | 2349 |
for(i=0;i<ic->nb_streams;i++) { |
2350 | 2350 |
st = ic->streams[i]; |
2351 |
- if (st->codec->codec_type == CODEC_TYPE_VIDEO) { |
|
2351 |
+ if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) { |
|
2352 | 2352 |
if(b-frames){ |
2353 | 2353 |
ppktl = &ic->packet_buffer; |
2354 | 2354 |
while(ppkt1){ |
... | ... |
@@ -2581,7 +2581,7 @@ int av_write_header(AVFormatContext *s) |
2581 | 2581 |
st = s->streams[i]; |
2582 | 2582 |
|
2583 | 2583 |
switch (st->codec->codec_type) { |
2584 |
- case CODEC_TYPE_AUDIO: |
|
2584 |
+ case AVMEDIA_TYPE_AUDIO: |
|
2585 | 2585 |
if(st->codec->sample_rate<=0){ |
2586 | 2586 |
av_log(s, AV_LOG_ERROR, "sample rate not set\n"); |
2587 | 2587 |
return -1; |
... | ... |
@@ -2590,7 +2590,7 @@ int av_write_header(AVFormatContext *s) |
2590 | 2590 |
st->codec->block_align = st->codec->channels * |
2591 | 2591 |
av_get_bits_per_sample(st->codec->codec_id) >> 3; |
2592 | 2592 |
break; |
2593 |
- case CODEC_TYPE_VIDEO: |
|
2593 |
+ case AVMEDIA_TYPE_VIDEO: |
|
2594 | 2594 |
if(st->codec->time_base.num<=0 || st->codec->time_base.den<=0){ //FIXME audio too? |
2595 | 2595 |
av_log(s, AV_LOG_ERROR, "time base not set\n"); |
2596 | 2596 |
return -1; |
... | ... |
@@ -2658,10 +2658,10 @@ int av_write_header(AVFormatContext *s) |
2658 | 2658 |
st = s->streams[i]; |
2659 | 2659 |
|
2660 | 2660 |
switch (st->codec->codec_type) { |
2661 |
- case CODEC_TYPE_AUDIO: |
|
2661 |
+ case AVMEDIA_TYPE_AUDIO: |
|
2662 | 2662 |
den = (int64_t)st->time_base.num * st->codec->sample_rate; |
2663 | 2663 |
break; |
2664 |
- case CODEC_TYPE_VIDEO: |
|
2664 |
+ case AVMEDIA_TYPE_VIDEO: |
|
2665 | 2665 |
den = (int64_t)st->time_base.num * st->codec->time_base.den; |
2666 | 2666 |
break; |
2667 | 2667 |
default: |
... | ... |
@@ -2732,7 +2732,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){ |
2732 | 2732 |
|
2733 | 2733 |
/* update pts */ |
2734 | 2734 |
switch (st->codec->codec_type) { |
2735 |
- case CODEC_TYPE_AUDIO: |
|
2735 |
+ case AVMEDIA_TYPE_AUDIO: |
|
2736 | 2736 |
frame_size = get_audio_frame_size(st->codec, pkt->size); |
2737 | 2737 |
|
2738 | 2738 |
/* HACK/FIXME, we skip the initial 0 size packets as they are most |
... | ... |
@@ -2742,7 +2742,7 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){ |
2742 | 2742 |
av_frac_add(&st->pts, (int64_t)st->time_base.den * frame_size); |
2743 | 2743 |
} |
2744 | 2744 |
break; |
2745 |
- case CODEC_TYPE_VIDEO: |
|
2745 |
+ case AVMEDIA_TYPE_VIDEO: |
|
2746 | 2746 |
av_frac_add(&st->pts, (int64_t)st->time_base.den * st->codec->time_base.num); |
2747 | 2747 |
break; |
2748 | 2748 |
default: |
... | ... |
@@ -2859,7 +2859,7 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){ |
2859 | 2859 |
AVStream *st= s->streams[ pkt->stream_index]; |
2860 | 2860 |
|
2861 | 2861 |
//FIXME/XXX/HACK drop zero sized packets |
2862 |
- if(st->codec->codec_type == CODEC_TYPE_AUDIO && pkt->size==0) |
|
2862 |
+ if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->size==0) |
|
2863 | 2863 |
return 0; |
2864 | 2864 |
|
2865 | 2865 |
//av_log(NULL, AV_LOG_DEBUG, "av_interleaved_write_frame %d %"PRId64" %"PRId64"\n", pkt->size, pkt->dts, pkt->pts); |
... | ... |
@@ -2999,7 +2999,7 @@ static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_out |
2999 | 2999 |
st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, |
3000 | 3000 |
display_aspect_ratio.num, display_aspect_ratio.den); |
3001 | 3001 |
} |
3002 |
- if(st->codec->codec_type == CODEC_TYPE_VIDEO){ |
|
3002 |
+ if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ |
|
3003 | 3003 |
if(st->avg_frame_rate.den && st->avg_frame_rate.num) |
3004 | 3004 |
print_fps(av_q2d(st->avg_frame_rate), "fps"); |
3005 | 3005 |
if(st->r_frame_rate.den && st->r_frame_rate.num) |
... | ... |
@@ -58,7 +58,7 @@ static int vc1t_read_header(AVFormatContext *s, |
58 | 58 |
if (!st) |
59 | 59 |
return -1; |
60 | 60 |
|
61 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
61 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
62 | 62 |
st->codec->codec_id = CODEC_ID_WMV3; |
63 | 63 |
|
64 | 64 |
st->codec->extradata = av_malloc(VC1_EXTRADATA_SIZE); |
... | ... |
@@ -54,7 +54,7 @@ static int voc_read_header(AVFormatContext *s, AVFormatParameters *ap) |
54 | 54 |
st = av_new_stream(s, 0); |
55 | 55 |
if (!st) |
56 | 56 |
return AVERROR(ENOMEM); |
57 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
57 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
58 | 58 |
|
59 | 59 |
voc->remaining_size = 0; |
60 | 60 |
return 0; |
... | ... |
@@ -33,7 +33,7 @@ static int voc_write_header(AVFormatContext *s) |
33 | 33 |
const int version = 0x0114; |
34 | 34 |
|
35 | 35 |
if (s->nb_streams != 1 |
36 |
- || s->streams[0]->codec->codec_type != CODEC_TYPE_AUDIO) |
|
36 |
+ || s->streams[0]->codec->codec_type != AVMEDIA_TYPE_AUDIO) |
|
37 | 37 |
return AVERROR_PATCHWELCOME; |
38 | 38 |
|
39 | 39 |
put_buffer(pb, ff_voc_magic, sizeof(ff_voc_magic) - 1); |
... | ... |
@@ -76,7 +76,7 @@ static int vqf_read_header(AVFormatContext *s, AVFormatParameters *ap) |
76 | 76 |
|
77 | 77 |
header_size = get_be32(s->pb); |
78 | 78 |
|
79 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
79 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
80 | 80 |
st->codec->codec_id = CODEC_ID_TWINVQ; |
81 | 81 |
st->start_time = 0; |
82 | 82 |
|
... | ... |
@@ -243,7 +243,7 @@ static int wc3_read_header(AVFormatContext *s, |
243 | 243 |
return AVERROR(ENOMEM); |
244 | 244 |
av_set_pts_info(st, 33, 1, WC3_FRAME_FPS); |
245 | 245 |
wc3->video_stream_index = st->index; |
246 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
246 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
247 | 247 |
st->codec->codec_id = CODEC_ID_XAN_WC3; |
248 | 248 |
st->codec->codec_tag = 0; /* no fourcc */ |
249 | 249 |
st->codec->width = wc3->width; |
... | ... |
@@ -257,7 +257,7 @@ static int wc3_read_header(AVFormatContext *s, |
257 | 257 |
return AVERROR(ENOMEM); |
258 | 258 |
av_set_pts_info(st, 33, 1, WC3_FRAME_FPS); |
259 | 259 |
wc3->audio_stream_index = st->index; |
260 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
260 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
261 | 261 |
st->codec->codec_id = CODEC_ID_PCM_S16LE; |
262 | 262 |
st->codec->codec_tag = 1; |
263 | 263 |
st->codec->channels = WC3_AUDIO_CHANNELS; |
... | ... |
@@ -148,7 +148,7 @@ static int wsaud_read_header(AVFormatContext *s, |
148 | 148 |
if (!st) |
149 | 149 |
return AVERROR(ENOMEM); |
150 | 150 |
av_set_pts_info(st, 33, 1, wsaud->audio_samplerate); |
151 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
151 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
152 | 152 |
st->codec->codec_id = wsaud->audio_type; |
153 | 153 |
st->codec->codec_tag = 0; /* no tag */ |
154 | 154 |
st->codec->channels = wsaud->audio_channels; |
... | ... |
@@ -226,7 +226,7 @@ static int wsvqa_read_header(AVFormatContext *s, |
226 | 226 |
return AVERROR(ENOMEM); |
227 | 227 |
av_set_pts_info(st, 33, 1, VQA_FRAMERATE); |
228 | 228 |
wsvqa->video_stream_index = st->index; |
229 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
229 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
230 | 230 |
st->codec->codec_id = CODEC_ID_WS_VQA; |
231 | 231 |
st->codec->codec_tag = 0; /* no fourcc */ |
232 | 232 |
|
... | ... |
@@ -251,7 +251,7 @@ static int wsvqa_read_header(AVFormatContext *s, |
251 | 251 |
if (!st) |
252 | 252 |
return AVERROR(ENOMEM); |
253 | 253 |
av_set_pts_info(st, 33, 1, VQA_FRAMERATE); |
254 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
254 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
255 | 255 |
if (AV_RL16(&header[0]) == 1) |
256 | 256 |
st->codec->codec_id = CODEC_ID_WESTWOOD_SND1; |
257 | 257 |
else |
... | ... |
@@ -162,7 +162,7 @@ static int wv_read_header(AVFormatContext *s, |
162 | 162 |
st = av_new_stream(s, 0); |
163 | 163 |
if (!st) |
164 | 164 |
return -1; |
165 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
165 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
166 | 166 |
st->codec->codec_id = CODEC_ID_WAVPACK; |
167 | 167 |
st->codec->channels = wc->chan; |
168 | 168 |
st->codec->sample_rate = wc->rate; |
... | ... |
@@ -74,7 +74,7 @@ static int xa_read_header(AVFormatContext *s, |
74 | 74 |
if (!st) |
75 | 75 |
return AVERROR(ENOMEM); |
76 | 76 |
|
77 |
- st->codec->codec_type = CODEC_TYPE_AUDIO; |
|
77 |
+ st->codec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
78 | 78 |
st->codec->codec_id = CODEC_ID_ADPCM_EA_MAXIS_XA; |
79 | 79 |
url_fskip(pb, 4); /* Skip the XA ID */ |
80 | 80 |
xa->out_size = get_le32(pb); |
... | ... |
@@ -71,14 +71,14 @@ static int yop_read_header(AVFormatContext *s, AVFormatParameters *ap) |
71 | 71 |
|
72 | 72 |
// Audio |
73 | 73 |
audio_dec = audio_stream->codec; |
74 |
- audio_dec->codec_type = CODEC_TYPE_AUDIO; |
|
74 |
+ audio_dec->codec_type = AVMEDIA_TYPE_AUDIO; |
|
75 | 75 |
audio_dec->codec_id = CODEC_ID_ADPCM_IMA_WS; |
76 | 76 |
audio_dec->channels = 1; |
77 | 77 |
audio_dec->sample_rate = 22050; |
78 | 78 |
|
79 | 79 |
// Video |
80 | 80 |
video_dec = video_stream->codec; |
81 |
- video_dec->codec_type = CODEC_TYPE_VIDEO; |
|
81 |
+ video_dec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
82 | 82 |
video_dec->codec_id = CODEC_ID_YOP; |
83 | 83 |
|
84 | 84 |
url_fskip(pb, 6); |
... | ... |
@@ -335,7 +335,7 @@ static int yuv4_read_header(AVFormatContext *s, AVFormatParameters *ap) |
335 | 335 |
av_reduce(&raten, &rated, raten, rated, (1UL<<31)-1); |
336 | 336 |
av_set_pts_info(st, 64, rated, raten); |
337 | 337 |
st->codec->pix_fmt = pix_fmt; |
338 |
- st->codec->codec_type = CODEC_TYPE_VIDEO; |
|
338 |
+ st->codec->codec_type = AVMEDIA_TYPE_VIDEO; |
|
339 | 339 |
st->codec->codec_id = CODEC_ID_RAWVIDEO; |
340 | 340 |
st->sample_aspect_ratio= (AVRational){aspectn, aspectd}; |
341 | 341 |
st->codec->chroma_sample_location = chroma_sample_location; |