"user interface" functions */
| 3011 | |
| 3012 | /* "user interface" functions */ |
| 3013 | static void dump_stream_format(AVFormatContext *ic, int i, int index, int is_output) |
| 3014 | { |
| 3015 | char buf[256]; |
| 3016 | int flags = (is_output ? ic->oformat->flags : ic->iformat->flags); |
| 3017 | AVStream *st = ic->streams[i]; |
| 3018 | int g = av_gcd(st->time_base.num, st->time_base.den); |
| 3019 | AVMetadataTag *lang = av_metadata_get(st->metadata, "language", NULL, 0); |
| 3020 | avcodec_string(buf, sizeof(buf), st->codec, is_output); |
| 3021 | av_log(NULL, AV_LOG_INFO, " Stream #%d.%d", index, i); |
| 3022 | /* the pid is an important information, so we display it */ |
| 3023 | /* XXX: add a generic system */ |
| 3024 | if (flags & AVFMT_SHOW_IDS) |
| 3025 | av_log(NULL, AV_LOG_INFO, "[0x%x]", st->id); |
| 3026 | if (lang) |
| 3027 | av_log(NULL, AV_LOG_INFO, "(%s)", lang->value); |
| 3028 | av_log(NULL, AV_LOG_DEBUG, ", %d, %d/%d", st->codec_info_nb_frames, st->time_base.num/g, st->time_base.den/g); |
| 3029 | av_log(NULL, AV_LOG_INFO, ": %s", buf); |
| 3030 | if (st->sample_aspect_ratio.num && // default |
| 3031 | av_cmp_q(st->sample_aspect_ratio, st->codec->sample_aspect_ratio)) { |
| 3032 | AVRational display_aspect_ratio; |
| 3033 | av_reduce(&display_aspect_ratio.num, &display_aspect_ratio.den, |
| 3034 | st->codec->width*st->sample_aspect_ratio.num, |
| 3035 | st->codec->height*st->sample_aspect_ratio.den, |
| 3036 | 1024*1024); |
| 3037 | av_log(NULL, AV_LOG_INFO, ", PAR %d:%d DAR %d:%d", |
| 3038 | st->sample_aspect_ratio.num, st->sample_aspect_ratio.den, |
| 3039 | display_aspect_ratio.num, display_aspect_ratio.den); |
| 3040 | } |
| 3041 | if(st->codec->codec_type == AVMEDIA_TYPE_VIDEO){ |
| 3042 | if(st->avg_frame_rate.den && st->avg_frame_rate.num) |
| 3043 | print_fps(av_q2d(st->avg_frame_rate), "fps"); |
| 3044 | if(st->r_frame_rate.den && st->r_frame_rate.num) |
| 3045 | print_fps(av_q2d(st->r_frame_rate), "tbr"); |
| 3046 | if(st->time_base.den && st->time_base.num) |
| 3047 | print_fps(1/av_q2d(st->time_base), "tbn"); |
| 3048 | if(st->codec->time_base.den && st->codec->time_base.num) |
| 3049 | print_fps(1/av_q2d(st->codec->time_base), "tbc"); |
| 3050 | } |
| 3051 | av_log(NULL, AV_LOG_INFO, "\n"); |
| 3052 | dump_metadata(NULL, st->metadata, " "); |
| 3053 | } |
| 3054 | |
| 3055 | void dump_format(AVFormatContext *ic, |
| 3056 | int index, |
no test coverage detected