Merge commit '41e86146e7
'
* commit '41e86146e7
':
dump: print detailed color space information
full color triplets are only printed if they are not all equal, otherwise
they are printed as before
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
af28960412
1 changed files with 22 additions and 7 deletions
|
@ -2986,7 +2986,6 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
|
||||||
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] = "(";
|
char detail[256] = "(";
|
||||||
const char *colorspace_name;
|
|
||||||
|
|
||||||
av_strlcat(buf, separator, buf_size);
|
av_strlcat(buf, separator, buf_size);
|
||||||
|
|
||||||
|
@ -2997,12 +2996,28 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
|
||||||
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)
|
||||||
av_strlcatf(detail, sizeof(detail), "%d bpc, ", enc->bits_per_raw_sample);
|
av_strlcatf(detail, sizeof(detail), "%d bpc, ", enc->bits_per_raw_sample);
|
||||||
if (enc->color_range != AVCOL_RANGE_UNSPECIFIED)
|
if (enc->color_range != AVCOL_RANGE_UNSPECIFIED)
|
||||||
av_strlcatf(detail, sizeof(detail),
|
av_strlcatf(detail, sizeof(detail), "%s, ",
|
||||||
enc->color_range == AVCOL_RANGE_MPEG ? "tv, ": "pc, ");
|
av_color_range_name(enc->color_range));
|
||||||
|
|
||||||
colorspace_name = av_get_colorspace_name(enc->colorspace);
|
if (enc->colorspace != AVCOL_SPC_UNSPECIFIED ||
|
||||||
if (colorspace_name)
|
enc->color_primaries != AVCOL_PRI_UNSPECIFIED ||
|
||||||
av_strlcatf(detail, sizeof(detail), "%s, ", colorspace_name);
|
enc->color_trc != AVCOL_TRC_UNSPECIFIED) {
|
||||||
|
if (enc->colorspace != enc->color_primaries ||
|
||||||
|
enc->colorspace != enc->color_trc) {
|
||||||
|
new_line = 1;
|
||||||
|
av_strlcatf(detail, sizeof(detail), "%s/%s/%s, ",
|
||||||
|
av_color_space_name(enc->colorspace),
|
||||||
|
av_color_primaries_name(enc->color_primaries),
|
||||||
|
av_color_transfer_name(enc->color_trc));
|
||||||
|
} else
|
||||||
|
av_strlcatf(detail, sizeof(detail), "%s, ",
|
||||||
|
av_get_colorspace_name(enc->colorspace));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (av_log_get_level() >= AV_LOG_DEBUG &&
|
||||||
|
enc->chroma_sample_location != AVCHROMA_LOC_UNSPECIFIED)
|
||||||
|
av_strlcatf(detail, sizeof(detail), "%s, ",
|
||||||
|
av_chroma_location_name(enc->chroma_sample_location));
|
||||||
|
|
||||||
if (strlen(detail) > 1) {
|
if (strlen(detail) > 1) {
|
||||||
detail[strlen(detail) - 2] = 0;
|
detail[strlen(detail) - 2] = 0;
|
||||||
|
@ -3011,7 +3026,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (enc->width) {
|
if (enc->width) {
|
||||||
av_strlcat(buf, new_line ? "\n " : ", ", buf_size);
|
av_strlcat(buf, new_line ? separator : ", ", buf_size);
|
||||||
|
|
||||||
snprintf(buf + strlen(buf), buf_size - strlen(buf),
|
snprintf(buf + strlen(buf), buf_size - strlen(buf),
|
||||||
"%dx%d",
|
"%dx%d",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue