diff options
Diffstat (limited to 'video/out/vo.h')
-rw-r--r-- | video/out/vo.h | 67 |
1 files changed, 37 insertions, 30 deletions
diff --git a/video/out/vo.h b/video/out/vo.h index 3328ab2626..3eb9f940ea 100644 --- a/video/out/vo.h +++ b/video/out/vo.h @@ -36,6 +36,8 @@ enum mp_voctrl { /* signal a device reset seek */ VOCTRL_RESET = 1, + /* Handle input and redraw events, called by vo_check_events() */ + VOCTRL_CHECK_EVENTS, /* used to switch to fullscreen */ VOCTRL_FULLSCREEN, /* signal a device pause */ @@ -45,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 @@ -58,18 +60,25 @@ enum mp_voctrl { VOCTRL_ONTOP, VOCTRL_BORDER, + VOCTRL_UPDATE_WINDOW_TITLE, // char* + + VOCTRL_SET_CURSOR_VISIBILITY, // bool* + + VOCTRL_KILL_SCREENSAVER, + VOCTRL_RESTORE_SCREENSAVER, VOCTRL_SET_DEINTERLACE, VOCTRL_GET_DEINTERLACE, VOCTRL_UPDATE_SCREENINFO, + VOCTRL_WINDOW_TO_OSD_COORDS, // float[2] (x/y) - 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 @@ -103,8 +112,8 @@ struct voctrl_screenshot_args { bool has_osd; }; -#define VO_TRUE 1 -#define VO_FALSE 0 +#define VO_TRUE true +#define VO_FALSE false #define VO_ERROR -1 #define VO_NOTAVAIL -2 #define VO_NOTIMPL -3 @@ -131,6 +140,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 @@ -156,26 +166,33 @@ 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); void (*draw_image)(struct vo *vo, struct mp_image *mpi); - void (*draw_image_pts)(struct vo *vo, struct mp_image *mpi, double pts); /* * Get extra frames from the VO, such as those added by VDPAU @@ -192,15 +209,13 @@ struct vo_driver { /* * Blit/Flip buffer to the screen. Must be called after each frame! + * pts_us is the frame presentation time, linked to mp_time_us(). + * pts_us is 0 if the frame should be presented immediately. + * duration is estimated time in us until the next frame is shown. + * duration is -1 if it is unknown or unset. */ void (*flip_page)(struct vo *vo); - void (*flip_page_timed)(struct vo *vo, unsigned int pts_us, int duration); - - /* - * This func is called after every frames to handle keyboard and - * other events. It's called in PAUSE mode too! - */ - void (*check_events)(struct vo *vo); + void (*flip_page_timed)(struct vo *vo, int64_t pts_us, int duration); /* * Closes driver. Should restore the original state of the system. @@ -240,9 +255,6 @@ struct vo { double flip_queue_offset; // queue flip events at most this much in advance - unsigned int next_wakeup_time; // deadline for next vo_check_events() call, - // in GetTimerMS() units (set by VO) - const struct vo_driver *driver; void *priv; struct mp_vo_opts *opts; @@ -250,7 +262,6 @@ struct vo { struct vo_w32_state *w32; struct vo_cocoa_state *cocoa; struct vo_wayland_state *wayland; - struct mp_fifo *key_fifo; struct encode_lavc_context *encode_lavc_ctx; struct input_ctx *input_ctx; int event_fd; // check_events() should be called when this has input @@ -279,12 +290,9 @@ struct vo { }; 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); @@ -297,7 +305,6 @@ void vo_new_frame_imminent(struct vo *vo); void vo_draw_osd(struct vo *vo, struct osd_state *osd); void vo_flip_page(struct vo *vo, unsigned int pts_us, int duration); void vo_check_events(struct vo *vo); -unsigned int vo_get_sleep_time(struct vo *vo); void vo_seek_reset(struct vo *vo); void vo_destroy(struct vo *vo); |