summaryrefslogtreecommitdiffstats
path: root/video/filter/vf.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-08 01:35:44 +0200
committerwm4 <wm4@nowhere>2013-06-28 20:34:46 +0200
commit3382a6f6e48c7e093c2b7e0e4a0e28b60a084358 (patch)
treecc50df6d6ae5ffa6b1f7d3eb4e816a3afcfd1641 /video/filter/vf.h
parent823e0c511bea235be06d5e2037ef9d0b345d9405 (diff)
downloadmpv-3382a6f6e48c7e093c2b7e0e4a0e28b60a084358.tar.bz2
mpv-3382a6f6e48c7e093c2b7e0e4a0e28b60a084358.tar.xz
video: add a new method to configure filters and VOs
The filter chain and the video ouputs have config() functions. They are strictly limited to transfering the video size and format. Other parameters (like color levels) have to be transferred separately. Improve upon this by introducing a separate set of reconfig() functions, which use mp_image_params to carry format parameters. This struct contains all image format related parameters from config(), plus additional parameters such as colorspace. Change vf_rotate to use it, as well as vo_opengl. vf_rotate is just an example/test case, but vo_opengl will need it later. The intention is also to get rid of VOCTRL_SET_YUV_COLORSPACE. This information is now handed to the VOs via reconfig(). The getter, VOCTRL_GET_YUV_COLORSPACE, will still be needed though.
Diffstat (limited to 'video/filter/vf.h')
-rw-r--r--video/filter/vf.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/video/filter/vf.h b/video/filter/vf.h
index fd0118e152..638fc30a61 100644
--- a/video/filter/vf.h
+++ b/video/filter/vf.h
@@ -36,21 +36,28 @@ typedef struct vf_info {
const char *author;
const char *comment;
int (*vf_open)(struct vf_instance *vf, char *args);
- // Ptr to a struct dscribing the options
+ // Ptr to a struct describing the options
const void *opts;
} vf_info_t;
struct vf_format {
int configured;
- int w, h, dw, dh, flags, fmt;
+ struct mp_image_params params;
+ int flags;
};
typedef struct vf_instance {
const vf_info_t *info;
- // funcs:
+
int (*config)(struct vf_instance *vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt);
+
+ // Alternative to config() (can pass more image parameters)
+ // Note: the callee is allowed to write *params.
+ int (*reconfig)(struct vf_instance *vf, struct mp_image_params *params,
+ int flags);
+
int (*control)(struct vf_instance *vf, int request, void *data);
int (*query_format)(struct vf_instance *vf, unsigned int fmt);
@@ -131,6 +138,9 @@ int vf_next_config(struct vf_instance *vf,
int vf_next_control(struct vf_instance *vf, int request, void *data);
int vf_next_query_format(struct vf_instance *vf, unsigned int fmt);
+int vf_next_reconfig(struct vf_instance *vf, struct mp_image_params *params,
+ int flags);
+
struct m_obj_settings;
vf_instance_t *append_filters(vf_instance_t *last,
struct m_obj_settings *vf_settings);
@@ -140,9 +150,8 @@ vf_instance_t *vf_find_by_label(vf_instance_t *chain, const char *label);
void vf_uninit_filter(vf_instance_t *vf);
void vf_uninit_filter_chain(vf_instance_t *vf);
-int vf_config_wrapper(struct vf_instance *vf,
- int width, int height, int d_width, int d_height,
- unsigned int flags, unsigned int outfmt);
+int vf_reconfig_wrapper(struct vf_instance *vf, struct mp_image_params *params,
+ int flags);
void vf_print_filter_chain(int msglevel, struct vf_instance *vf);
void vf_rescale_dsize(int *d_width, int *d_height, int old_w, int old_h,