diff options
Diffstat (limited to 'libvo/vo_xover.c')
-rw-r--r-- | libvo/vo_xover.c | 60 |
1 files changed, 23 insertions, 37 deletions
diff --git a/libvo/vo_xover.c b/libvo/vo_xover.c index 06815f15cd..dd7bceadb1 100644 --- a/libvo/vo_xover.c +++ b/libvo/vo_xover.c @@ -48,10 +48,6 @@ #include "aspect.h" #include "mp_msg.h" -#ifdef CONFIG_GUI -#include "gui/interface.h" -#endif - static const vo_info_t info = { @@ -82,8 +78,8 @@ static uint32_t window_width, window_height; static uint32_t drwX, drwY, drwWidth, drwHeight, drwBorderWidth, drwDepth, drwcX, drwcY, dwidth, dheight; -static const vo_functions_t* sub_vo = NULL; - +static const struct vo_old_functions *sub_vo = NULL; +static const struct vo_info_s *sub_info; static void set_window(int force_update) { @@ -224,7 +220,7 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, mp_colorkey_t colork; char _title[255]; - sprintf(_title,"MPlayer %s X11 Overlay",sub_vo->info->name); + sprintf(_title,"MPlayer %s X11 Overlay", sub_info->name); title = _title; panscan_init(); @@ -270,12 +266,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, vo_dy += xinerama_y; vo_dwidth=d_width; vo_dheight=d_height; -#ifdef CONFIG_GUI - if(use_gui) guiGetEvent( guiSetShVideo,0 ); // the GUI will set up / resize the window - else - { -#endif - #ifdef X11_FULLSCREEN if ( ( flags&VOFLAG_FULLSCREEN )||(flags & VOFLAG_SWSCALE) ) aspect(&d_width, &d_height, A_ZOOM); #endif @@ -302,10 +292,6 @@ static int config(uint32_t width, uint32_t height, uint32_t d_width, xswa.colormap, "xvidix", title); XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa); -#ifdef CONFIG_GUI - } -#endif - if ( ( !WinID )&&( flags&VOFLAG_FULLSCREEN ) ) { vo_dx=0; vo_dy=0; vo_dwidth=vo_screenwidth; vo_dheight=vo_screenheight; vo_fs=1; } if(sub_vo->config(image_width,image_height,vo_dwidth,vo_dheight, @@ -378,10 +364,10 @@ static void uninit(void) sub_vo = NULL; vo_x11_uninit(); // Restore our callbacks - video_out_xover.draw_frame = draw_frame; - video_out_xover.draw_slice = draw_slice; - video_out_xover.flip_page = flip_page; - video_out_xover.draw_osd = draw_osd; + video_out_xover.old_functions->draw_frame = draw_frame; + video_out_xover.old_functions->draw_slice = draw_slice; + video_out_xover.old_functions->flip_page = flip_page; + video_out_xover.old_functions->draw_osd = draw_osd; } static int preinit(const char *arg) @@ -393,40 +379,41 @@ static int preinit(const char *arg) return 1; } - for(i = 0 ; video_out_drivers[i] != NULL ; i++) { - if(!strcmp(video_out_drivers[i]->info->short_name,arg) && - strcmp(video_out_drivers[i]->info->short_name,"xover")) + const struct vo_driver *candidate; + for(i = 0; (candidate = video_out_drivers[i]) != NULL; i++) + if (!candidate->is_new && !strcmp(candidate->info->short_name,arg) && + strcmp(candidate->info->short_name,"xover")) break; - } - if(!video_out_drivers[i]) { + if (!candidate) { mp_msg(MSGT_VO, MSGL_ERR, "VO XOverlay: Subdriver %s not found\n", arg); return 1; } - if(video_out_drivers[i]->control(VOCTRL_XOVERLAY_SUPPORT,NULL) != VO_TRUE) { + + const struct vo_old_functions *functions = candidate->old_functions; + if (functions->control(VOCTRL_XOVERLAY_SUPPORT,NULL) != VO_TRUE) { mp_msg(MSGT_VO, MSGL_ERR, "VO XOverlay: %s doesn't support XOverlay\n", arg); return 1; } // X11 init if (!vo_init()) return VO_FALSE; - if(video_out_drivers[i]->preinit(NULL)) { + if(functions->preinit(NULL)) { mp_msg(MSGT_VO, MSGL_ERR, "VO XOverlay: Subvo init failed\n"); return 1; } - sub_vo = video_out_drivers[i]; + sub_vo = functions; + sub_info = candidate->info; // Setup the sub vo callbacks - video_out_xover.draw_frame = sub_vo->draw_frame; - video_out_xover.draw_slice = sub_vo->draw_slice; - video_out_xover.flip_page = sub_vo->flip_page; - video_out_xover.draw_osd = sub_vo->draw_osd; + video_out_xover.old_functions->draw_frame = sub_vo->draw_frame; + video_out_xover.old_functions->draw_slice = sub_vo->draw_slice; + video_out_xover.old_functions->flip_page = sub_vo->flip_page; + video_out_xover.old_functions->draw_osd = sub_vo->draw_osd; return 0; } -static int control(uint32_t request, void *data, ...) +static int control(uint32_t request, void *data) { if(!sub_vo) return VO_ERROR; switch (request) { - case VOCTRL_GUISUPPORT: - return VO_TRUE; case VOCTRL_GET_PANSCAN: if ( !vo_config_count || !vo_fs ) return VO_FALSE; return VO_TRUE; @@ -443,7 +430,6 @@ static int control(uint32_t request, void *data, ...) } return VO_TRUE; default: - // Safe atm bcs nothing use more than 1 arg return sub_vo->control(request,data); } return VO_NOTIMPL; |