diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-20 07:36:34 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-23 13:41:07 +0300 |
commit | acf319b3edea4d8dd0fe338778e08e0d99dc49bb (patch) | |
tree | 8beb60e04061fd392637dfa9859a379e2c96f5c8 /libvo | |
parent | d283d5236ab36bc55c73de4e152dabea7098f850 (diff) | |
download | mpv-acf319b3edea4d8dd0fe338778e08e0d99dc49bb.tar.bz2 mpv-acf319b3edea4d8dd0fe338778e08e0d99dc49bb.tar.xz |
Create a struct for X11 state
Will be used for common data between X11 VOs. The main reasons for
making it a separate struct rather than extra fields in the main VO
struct are that some field definitions need X headers and that the code
keeps basic X state such as the display connection over opening and
closing of individual VOs.
Diffstat (limited to 'libvo')
-rw-r--r-- | libvo/video_out.c | 9 | ||||
-rw-r--r-- | libvo/video_out.h | 3 | ||||
-rw-r--r-- | libvo/x11_common.c | 4 | ||||
-rw-r--r-- | libvo/x11_common.h | 5 |
4 files changed, 17 insertions, 4 deletions
diff --git a/libvo/video_out.c b/libvo/video_out.c index abbaaae7ef..3a6b57347a 100644 --- a/libvo/video_out.c +++ b/libvo/video_out.c @@ -20,6 +20,9 @@ #include "help_mp.h" #include "osdep/shmem.h" +#ifdef HAVE_X11 +#include "x11_common.h" +#endif //int vo_flags=0; @@ -298,7 +301,7 @@ void list_video_out(void) mp_msg(MSGT_GLOBAL, MSGL_INFO,"\n"); } -struct vo *init_best_video_out(struct MPOpts *opts) +struct vo *init_best_video_out(struct MPOpts *opts, struct vo_x11_state *x11) { char **vo_list = opts->video_driver_list; int i; @@ -321,7 +324,7 @@ struct vo *init_best_video_out(struct MPOpts *opts) const vo_info_t *info = video_driver->info; if (!strcmp(info->short_name, name)) { // name matches, try it - *vo = (struct vo){.opts = opts}; + *vo = (struct vo){.opts = opts, .x11 = x11}; vo->driver = video_driver; if (!vo_preinit(vo, vo_subdevice)) { free(name); @@ -339,7 +342,7 @@ struct vo *init_best_video_out(struct MPOpts *opts) vo_subdevice = NULL; for (i = 0; video_out_drivers[i]; i++) { const struct vo_driver *video_driver = video_out_drivers[i]; - *vo = (struct vo){.opts = opts}; + *vo = (struct vo){.opts = opts, .x11 = x11}; vo->driver = video_driver; if (!vo_preinit(vo, vo_subdevice)) return vo; // success! diff --git a/libvo/video_out.h b/libvo/video_out.h index 5e1e244e8c..c1ba46e59f 100644 --- a/libvo/video_out.h +++ b/libvo/video_out.h @@ -210,9 +210,10 @@ struct vo { const struct vo_driver *driver; void *priv; struct MPOpts *opts; + struct vo_x11_state *x11; }; -struct vo *init_best_video_out(struct MPOpts *opts); +struct vo *init_best_video_out(struct MPOpts *opts, struct vo_x11_state *x11); int vo_config(struct vo *vo, uint32_t width, uint32_t height, uint32_t d_width, uint32_t d_height, uint32_t flags, char *title, uint32_t format); diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 47758b0d08..e5dbee5734 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -122,6 +122,10 @@ static int vo_x11_get_fs_type(int supported); static void saver_off(Display *); static void saver_on(Display *); +void vo_x11_init_state(struct vo_x11_state *s) +{ + *s = (struct vo_x11_state){}; +} /* * Sends the EWMH fullscreen state event. diff --git a/libvo/x11_common.h b/libvo/x11_common.h index fa9d7d0444..4585bc6bd5 100644 --- a/libvo/x11_common.h +++ b/libvo/x11_common.h @@ -6,6 +6,10 @@ struct vo; +struct vo_x11_state { + int unused; // placeholder to avoid empty struct +}; + #ifdef X11_FULLSCREEN #define vo_wm_LAYER 1 @@ -36,6 +40,7 @@ extern int mLocalDisplay; extern int vo_mouse_autohide; +void vo_x11_init_state(struct vo_x11_state *s); extern int vo_init( void ); extern void vo_uninit( void ); extern void vo_x11_decoration( Display * vo_Display,Window w,int d ); |