summaryrefslogtreecommitdiffstats
path: root/video/filter
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-11-12 19:19:16 +0100
committerwm4 <wm4@nowhere>2014-11-12 19:30:59 +0100
commit41365313433875b0ac2f1fa0e6d14ffa4f5e4e8d (patch)
tree9e14faf39d8ec96e828c142b44eb72cef892b727 /video/filter
parent509997ec129dc68466dc14abfc5e3e1b26e1279e (diff)
downloadmpv-41365313433875b0ac2f1fa0e6d14ffa4f5e4e8d.tar.bz2
mpv-41365313433875b0ac2f1fa0e6d14ffa4f5e4e8d.tar.xz
video: move formatting of image parameters to separate function
Diffstat (limited to 'video/filter')
-rw-r--r--video/filter/vf.c23
1 files changed, 2 insertions, 21 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c
index 8fd2da5e88..bf3f73c0e6 100644
--- a/video/filter/vf.c
+++ b/video/filter/vf.c
@@ -230,25 +230,6 @@ static int vf_default_query_format(struct vf_instance *vf, unsigned int fmt)
return vf_next_query_format(vf, fmt);
}
-static void fmt_cat(char *b, size_t bs, struct mp_image_params *p)
-{
- if (p && p->imgfmt) {
- mp_snprintf_cat(b, bs, "%dx%d", p->w, p->h);
- if (p->w != p->d_w || p->h != p->d_h)
- mp_snprintf_cat(b, bs, "->%dx%d", p->d_w, p->d_h);
- 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);
- 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);
- } else {
- mp_snprintf_cat(b, bs, "???");
- }
-}
-
void vf_print_filter_chain(struct vf_chain *c, int msglevel,
struct vf_instance *vf)
{
@@ -257,13 +238,13 @@ void vf_print_filter_chain(struct vf_chain *c, int msglevel,
char b[128] = {0};
- fmt_cat(b, sizeof(b), &c->input_params);
+ mp_snprintf_cat(b, sizeof(b), "%s", mp_image_params_to_str(&c->input_params));
mp_msg(c->log, msglevel, " [vd] %s\n", b);
for (vf_instance_t *f = c->first; f; f = f->next) {
b[0] = '\0';
mp_snprintf_cat(b, sizeof(b), " [%s] ", f->info->name);
- fmt_cat(b, sizeof(b), &f->fmt_out);
+ mp_snprintf_cat(b, sizeof(b), "%s", mp_image_params_to_str(&f->fmt_out));
if (f->autoinserted)
mp_snprintf_cat(b, sizeof(b), " [a]");
if (f == vf)