From 2bcfe1e077fe043751d3f7c73c82be761629419f Mon Sep 17 00:00:00 2001 From: Uoti Urpala Date: Thu, 3 Apr 2008 06:25:41 +0300 Subject: 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. --- libvo/video_out_internal.h | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'libvo/video_out_internal.h') diff --git a/libvo/video_out_internal.h b/libvo/video_out_internal.h index 1bfb91d18c..ba37f9ea50 100644 --- a/libvo/video_out_internal.h +++ b/libvo/video_out_internal.h @@ -29,6 +29,7 @@ #include "libmpcodecs/vfcap.h" #include "libmpcodecs/mp_image.h" #include "geometry.h" +#include "old_vo_wrapper.h" static int control(uint32_t request, void *data); static int config(uint32_t width, uint32_t height, uint32_t d_width, @@ -43,9 +44,20 @@ static void uninit(void); static int query_format(uint32_t format); static int preinit(const char *); -#define LIBVO_EXTERN(x) vo_functions_t video_out_##x =\ +#define LIBVO_EXTERN(x) struct vo_driver video_out_##x =\ {\ - &info,\ + .is_new = 0,\ + .info = &info,\ + .preinit = old_vo_preinit,\ + .config = old_vo_config,\ + .control = old_vo_control,\ + .draw_frame = old_vo_draw_frame,\ + .draw_slice = old_vo_draw_slice,\ + .draw_osd = old_vo_draw_osd,\ + .flip_page = old_vo_flip_page,\ + .check_events = old_vo_check_events,\ + .uninit = old_vo_uninit,\ + .old_functions = &(struct vo_old_functions){\ preinit,\ config,\ control,\ @@ -54,7 +66,8 @@ static int preinit(const char *); draw_osd,\ flip_page,\ check_events,\ - uninit\ + uninit,\ + }\ }; #include "osd.h" -- cgit v1.2.3