mirror of
https://github.com/mpv-player/mpv
synced 2025-01-03 13:32:16 +00:00
mp_image: slightly better image params verbose info
This commit is contained in:
parent
4136531343
commit
e9792326e3
@ -96,6 +96,8 @@ extern const char *const mp_stereo3d_names[MP_STEREO3D_COUNT];
|
||||
|
||||
#define MP_STEREO3D_NAME(x) \
|
||||
((x) >= 0 && (x) < MP_STEREO3D_COUNT ? (char *)mp_stereo3d_names[(x)] : NULL)
|
||||
#define MP_STEREO3D_NAME_DEF(x, def) \
|
||||
(MP_STEREO3D_NAME(x) ? MP_STEREO3D_NAME(x) : (def))
|
||||
|
||||
struct mp_csp_details {
|
||||
enum mp_csp format;
|
||||
|
@ -465,11 +465,16 @@ char *mp_image_params_to_str_buf(char *b, size_t bs,
|
||||
mp_snprintf_cat(b, bs, " %s", mp_imgfmt_to_name(p->imgfmt));
|
||||
mp_snprintf_cat(b, bs, " %s/%s", mp_csp_names[p->colorspace],
|
||||
mp_csp_levels_names[p->colorlevels]);
|
||||
mp_snprintf_cat(b, bs, " CL=%d", (int)p->chroma_location);
|
||||
mp_snprintf_cat(b, bs, " CL=%s", mp_chroma_names[p->chroma_location]);
|
||||
if (p->outputlevels)
|
||||
mp_snprintf_cat(b, bs, " out=%s", mp_csp_levels_names[p->outputlevels]);
|
||||
if (p->rotate)
|
||||
mp_snprintf_cat(b, bs, " rot=%d", p->rotate);
|
||||
if (p->stereo_in > 0 || p->stereo_out > 0) {
|
||||
mp_snprintf_cat(b, bs, " stereo=%s/%s",
|
||||
MP_STEREO3D_NAME_DEF(p->stereo_in, "?"),
|
||||
MP_STEREO3D_NAME_DEF(p->stereo_out, "?"));
|
||||
}
|
||||
} else {
|
||||
snprintf(b, bs, "???");
|
||||
}
|
||||
|
@ -144,7 +144,7 @@ void mp_image_params_guess_csp(struct mp_image_params *params);
|
||||
|
||||
char *mp_image_params_to_str_buf(char *b, size_t bs,
|
||||
const struct mp_image_params *p);
|
||||
#define mp_image_params_to_str(p) mp_image_params_to_str_buf((char[64]){0}, 64, p)
|
||||
#define mp_image_params_to_str(p) mp_image_params_to_str_buf((char[80]){0}, 80, p)
|
||||
|
||||
bool mp_image_params_valid(const struct mp_image_params *p);
|
||||
bool mp_image_params_equal(const struct mp_image_params *p1,
|
||||
|
Loading…
Reference in New Issue
Block a user