Commit 2a81f4bd authored by Anssi Hannula's avatar Anssi Hannula Committed by Carl Eugen Hoyos

Show profile in avcodec_string().

Patch by Anssi Hannula, anssi d hannula a iki d fi

Originally committed as revision 26264 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 82dadb90
...@@ -871,6 +871,7 @@ size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_ta ...@@ -871,6 +871,7 @@ size_t av_get_codec_tag_string(char *buf, size_t buf_size, unsigned int codec_ta
void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
{ {
const char *codec_name; const char *codec_name;
const char *profile = NULL;
AVCodec *p; AVCodec *p;
char buf1[32]; char buf1[32];
int bitrate; int bitrate;
...@@ -883,6 +884,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) ...@@ -883,6 +884,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
if (p) { if (p) {
codec_name = p->name; codec_name = p->name;
profile = av_get_profile_name(p, enc->profile);
} else if (enc->codec_id == CODEC_ID_MPEG2TS) { } else if (enc->codec_id == CODEC_ID_MPEG2TS) {
/* fake mpeg2 transport stream codec (currently not /* fake mpeg2 transport stream codec (currently not
registered) */ registered) */
...@@ -902,6 +904,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) ...@@ -902,6 +904,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf, buf_size, snprintf(buf, buf_size,
"Video: %s%s", "Video: %s%s",
codec_name, enc->mb_decision ? " (hq)" : ""); codec_name, enc->mb_decision ? " (hq)" : "");
if (profile)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
" (%s)", profile);
if (enc->pix_fmt != PIX_FMT_NONE) { if (enc->pix_fmt != PIX_FMT_NONE) {
snprintf(buf + strlen(buf), buf_size - strlen(buf), snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s", ", %s",
...@@ -937,6 +942,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) ...@@ -937,6 +942,9 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
snprintf(buf, buf_size, snprintf(buf, buf_size,
"Audio: %s", "Audio: %s",
codec_name); codec_name);
if (profile)
snprintf(buf + strlen(buf), buf_size - strlen(buf),
" (%s)", profile);
if (enc->sample_rate) { if (enc->sample_rate) {
snprintf(buf + strlen(buf), buf_size - strlen(buf), snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %d Hz", enc->sample_rate); ", %d Hz", enc->sample_rate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment