Commit 336982a0 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/utils: avcodec_string: make the colorspace printing code more extendible.

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 4fa00c56
...@@ -2591,13 +2591,17 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) ...@@ -2591,13 +2591,17 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
switch (enc->codec_type) { switch (enc->codec_type) {
case AVMEDIA_TYPE_VIDEO: case AVMEDIA_TYPE_VIDEO:
if (enc->pix_fmt != AV_PIX_FMT_NONE) { if (enc->pix_fmt != AV_PIX_FMT_NONE) {
char detail[256] = "(";
snprintf(buf + strlen(buf), buf_size - strlen(buf), snprintf(buf + strlen(buf), buf_size - strlen(buf),
", %s", ", %s",
av_get_pix_fmt_name(enc->pix_fmt)); av_get_pix_fmt_name(enc->pix_fmt));
if (enc->bits_per_raw_sample && if (enc->bits_per_raw_sample &&
enc->bits_per_raw_sample <= av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth_minus1) enc->bits_per_raw_sample <= av_pix_fmt_desc_get(enc->pix_fmt)->comp[0].depth_minus1)
snprintf(buf + strlen(buf), buf_size - strlen(buf), av_strlcatf(detail, sizeof(detail), "%d bpc, ", enc->bits_per_raw_sample);
" (%d bpc)", enc->bits_per_raw_sample); if (strlen(detail) > 1) {
detail[strlen(detail) - 2] = 0;
av_strlcatf(buf, buf_size, "%s)", detail);
}
} }
if (enc->width) { if (enc->width) {
snprintf(buf + strlen(buf), buf_size - strlen(buf), snprintf(buf + strlen(buf), buf_size - strlen(buf),
......
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