diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-03 06:25:41 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-23 13:41:04 +0300 |
commit | 2bcfe1e077fe043751d3f7c73c82be761629419f (patch) | |
tree | d66207e0fad0af6d50b1d8a047d34570730a3413 /libvo/vo_dxr2.c | |
parent | 3bb140d847eb214cf71256794170d72616edbaf4 (diff) | |
download | mpv-2bcfe1e077fe043751d3f7c73c82be761629419f.tar.bz2 mpv-2bcfe1e077fe043751d3f7c73c82be761629419f.tar.xz |
Add new video driver API
Create new video driver API that has a per-instance context structure
and does not rely on keeping status in global or static variables.
Existing drivers are not yet converted to this API; instead there is a
wrapper which translates calls to them.
In the new API, an old API call vo_functions->xyz(args) is generally
replaced by vo_xyz(vo_instance, args).
The changes to keep the vesa, dxr2 and xover drivers compiling have
not been tested.
Diffstat (limited to 'libvo/vo_dxr2.c')
-rw-r--r-- | libvo/vo_dxr2.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libvo/vo_dxr2.c b/libvo/vo_dxr2.c index 4b0d47326c..75e0ca1a81 100644 --- a/libvo/vo_dxr2.c +++ b/libvo/vo_dxr2.c @@ -37,7 +37,8 @@ static int movie_w,movie_h; static int playing = 0; // vo device used to blank the screen for the overlay init -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 uint8_t* sub_img = NULL; static int sub_x,sub_y,sub_w,sub_h; @@ -432,7 +433,7 @@ static int dxr2_load_vga_params(dxr2_vgaParams_t* vga,char* name) { } static int dxr2_setup_vga_params(void) { - const vo_info_t* vi = sub_vo->info; + const vo_info_t* vi = sub_info; dxr2_vgaParams_t vga; int loaded = dxr2_load_vga_params(&vga,(char*)vi->short_name); @@ -646,7 +647,7 @@ static int config(uint32_t s_width, uint32_t s_height, uint32_t width, uint32_t } // Does the sub vo support the x11 stuff // Fix me : test the other x11 vo's and enable them - if(strcmp(sub_vo->info->short_name,"x11") == 0) + if(strcmp(sub_info->short_name,"x11") == 0) sub_vo_win = 1; else sub_vo_win = 0; @@ -820,10 +821,11 @@ static int preinit(const char *arg) { const vo_info_t* vi = video_out_drivers[n]->info; if(!vi) continue; - if(strcasecmp(arg,vi->short_name) == 0) + if(!video_out_drivers[n]->is_new && strcasecmp(arg,vi->short_name) == 0) break; } - sub_vo = video_out_drivers[n]; + sub_vo = video_out_drivers[n]->old_functions; + sub_info = video_out_drivers[n]->info; } else { mp_msg(MSGT_VO,MSGL_WARN,"VO: [dxr2] We need a sub driver to initialize the overlay\n"); use_ol = 0; |