Define AVMediaType enum, and use it instead of enum CodecType, which

is deprecated and will be dropped at the next major bump.

Originally committed as revision 22735 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Stefano Sabatini
2010-03-30 23:30:55 +00:00
parent ca6e7708b4
commit 72415b2adb
383 changed files with 1041 additions and 1029 deletions

View File

@@ -101,14 +101,14 @@ static char *time_value_string(char *buf, int buf_size, int64_t val, const AVRat
return buf;
}
static const char *codec_type_string(enum CodecType codec_type)
static const char *media_type_string(enum AVMediaType media_type)
{
switch (codec_type) {
case CODEC_TYPE_VIDEO: return "video";
case CODEC_TYPE_AUDIO: return "audio";
case CODEC_TYPE_DATA: return "data";
case CODEC_TYPE_SUBTITLE: return "subtitle";
case CODEC_TYPE_ATTACHMENT: return "attachment";
switch (media_type) {
case AVMEDIA_TYPE_VIDEO: return "video";
case AVMEDIA_TYPE_AUDIO: return "audio";
case AVMEDIA_TYPE_DATA: return "data";
case AVMEDIA_TYPE_SUBTITLE: return "subtitle";
case AVMEDIA_TYPE_ATTACHMENT: return "attachment";
default: return "unknown";
}
}
@@ -134,7 +134,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
printf("codec_name=unknown\n");
}
printf("codec_type=%s\n", codec_type_string(dec_ctx->codec_type));
printf("codec_type=%s\n", media_type_string(dec_ctx->codec_type));
printf("codec_time_base=%d/%d\n", dec_ctx->time_base.num, dec_ctx->time_base.den);
/* print AVI/FourCC tag */
@@ -150,7 +150,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
printf("\ncodec_tag=0x%04x\n", dec_ctx->codec_tag);
switch (dec_ctx->codec_type) {
case CODEC_TYPE_VIDEO:
case AVMEDIA_TYPE_VIDEO:
printf("width=%d\n", dec_ctx->width);
printf("height=%d\n", dec_ctx->height);
printf("has_b_frames=%d\n", dec_ctx->has_b_frames);
@@ -162,7 +162,7 @@ static void show_stream(AVFormatContext *fmt_ctx, int stream_idx)
av_pix_fmt_descriptors[dec_ctx->pix_fmt].name : "unknown");
break;
case CODEC_TYPE_AUDIO:
case AVMEDIA_TYPE_AUDIO:
printf("sample_rate=%s\n", value_string(val_str, sizeof(val_str),
dec_ctx->sample_rate,
unit_hertz_str));