diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-06-24 01:53:58 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-06-24 01:53:58 +0300 |
commit | a232f564d3f271277135276281c03cca7807ef16 (patch) | |
tree | 63c0ebd5b39094e2cc24da83a4e5ce889964b003 /libvo/old_vo_wrapper.c | |
parent | de560e8167c21a8fd9ea34f5f42f377102d65232 (diff) |
Create a context struct for OSD state
This commit creates the struct and passes it to some functions that
needs to access OSD state but does not yet move much data from globals
to it.
vf_expand accesses the OSD state for rendering purposes outside of the
normal OSD draw time. The way this currently works is suboptimal, but
I did not attempt to clean it up now. To keep things working the same
way vf_expand needs to know the address of the state object to be able
to access the data even in the functions that should normally not need
it. For that purpose this commit adds a VFCTRL to tell vf_expand the
address of the object.
Diffstat (limited to 'libvo/old_vo_wrapper.c')
-rw-r--r-- | libvo/old_vo_wrapper.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libvo/old_vo_wrapper.c b/libvo/old_vo_wrapper.c index 825f6da0ee..57d1145f53 100644 --- a/libvo/old_vo_wrapper.c +++ b/libvo/old_vo_wrapper.c @@ -23,6 +23,7 @@ #include "sub.h" struct vo *global_vo; +struct osd_state *global_osd; int old_vo_preinit(struct vo *vo, const char *arg) { @@ -59,8 +60,9 @@ int old_vo_draw_slice(struct vo *vo, uint8_t *src[], int stride[], } -void old_vo_draw_osd(struct vo *vo) +void old_vo_draw_osd(struct vo *vo, struct osd_state *osd) { + global_osd = osd; vo->driver->old_functions->draw_osd(); } @@ -94,6 +96,10 @@ static void draw_alpha_wrapper(void *ctx, int x0, int y0, int w, int h, void vo_draw_text(int dxs,int dys,void (*draw_alpha)(int x0,int y0, int w,int h, unsigned char* src, unsigned char *srca, int stride)) { - osd_draw_text(dxs, dys, draw_alpha_wrapper, draw_alpha); + osd_draw_text(global_osd, dxs, dys, draw_alpha_wrapper, draw_alpha); } +int vo_update_osd(int dxs, int dys) +{ + return osd_update(global_osd, dxs, dys); +} |