summaryrefslogtreecommitdiffstats
path: root/video/out/vo.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/out/vo.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/out/vo.h')
-rw-r--r--video/out/vo.h37
1 files changed, 22 insertions, 15 deletions
diff --git a/video/out/vo.h b/video/out/vo.h
index df16a01d0e..9f4d2a9060 100644
--- a/video/out/vo.h
+++ b/video/out/vo.h
@@ -47,8 +47,8 @@ enum mp_voctrl {
VOCTRL_GET_PANSCAN,
VOCTRL_SET_PANSCAN,
- VOCTRL_SET_EQUALIZER, // struct voctrl_set_equalizer_args
- VOCTRL_GET_EQUALIZER, // struct voctrl_get_equalizer_args
+ VOCTRL_SET_EQUALIZER, // struct voctrl_set_equalizer_args*
+ VOCTRL_GET_EQUALIZER, // struct voctrl_get_equalizer_args*
/* for vdpau hardware decoding */
VOCTRL_HWDEC_DECODER_RENDER, // pointer to hw state
@@ -62,7 +62,7 @@ enum mp_voctrl {
VOCTRL_BORDER,
VOCTRL_UPDATE_WINDOW_TITLE, // char*
- VOCTRL_SET_CURSOR_VISIBILITY, // bool
+ VOCTRL_SET_CURSOR_VISIBILITY, // bool*
VOCTRL_KILL_SCREENSAVER,
VOCTRL_RESTORE_SCREENSAVER,
@@ -72,12 +72,12 @@ enum mp_voctrl {
VOCTRL_UPDATE_SCREENINFO,
- VOCTRL_SET_YUV_COLORSPACE, // struct mp_csp_details
- VOCTRL_GET_YUV_COLORSPACE, // struct mp_csp_details
+ VOCTRL_SET_YUV_COLORSPACE, // struct mp_csp_details*
+ VOCTRL_GET_YUV_COLORSPACE, // struct mp_csp_details*
- VOCTRL_SCREENSHOT, // struct voctrl_screenshot_args
+ VOCTRL_SCREENSHOT, // struct voctrl_screenshot_args*
- VOCTRL_SET_COMMAND_LINE, // char*
+ VOCTRL_SET_COMMAND_LINE, // char**
};
// VOCTRL_SET_EQUALIZER
@@ -139,6 +139,7 @@ typedef struct vo_info_s
struct vo;
struct osd_state;
struct mp_image;
+struct mp_image_params;
struct vo_driver {
// Driver buffers or adds (deinterlace) frames and will keep track
@@ -164,20 +165,28 @@ struct vo_driver {
int (*query_format)(struct vo *vo, uint32_t format);
/*
- * Initialize (means CONFIGURE) the display driver.
- * params:
+ * Initialize or reconfigure the display driver.
* width,height: image source size
- * d_width,d_height: size of the requested window size, just a hint
- * fullscreen: flag, 0=windowd 1=fullscreen, just a hint
+ * d_width,d_height: requested window size, just a hint
+ * flags: combination of VOFLAG_ values
* title: window title, if available
* format: fourcc of pixel format
* returns : zero on successful initialization, non-zero on error.
*/
int (*config)(struct vo *vo, uint32_t width, uint32_t height,
- uint32_t d_width, uint32_t d_height, uint32_t fullscreen,
+ uint32_t d_width, uint32_t d_height, uint32_t flags,
uint32_t format);
/*
+ * Initialize or reconfigure the display driver. Alternative to config(),
+ * and can carry more image parameters.
+ * params: video parameters, like pixel format and frame size
+ * flags: combination of VOFLAG_ values
+ * returns: < 0 on error, >= 0 on success
+ */
+ int (*reconfig)(struct vo *vo, struct mp_image_params *params, int flags);
+
+ /*
* Control interface
*/
int (*control)(struct vo *vo, uint32_t request, void *data);
@@ -284,9 +293,7 @@ struct vo *init_best_video_out(struct mp_vo_opts *opts,
struct mp_fifo *key_fifo,
struct input_ctx *input_ctx,
struct encode_lavc_context *encode_lavc_ctx);
-int vo_config(struct vo *vo, uint32_t width, uint32_t height,
- uint32_t d_width, uint32_t d_height, uint32_t flags,
- uint32_t format);
+int vo_reconfig(struct vo *vo, struct mp_image_params *p, int flags);
void list_video_out(void);
int vo_control(struct vo *vo, uint32_t request, void *data);