summaryrefslogtreecommitdiffstats
path: root/libvo/video_out_internal.h
diff options
context:
space:
mode:
authorUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-03 06:25:41 +0300
committerUoti Urpala <uau@symbol.nonexistent.invalid>2008-04-23 13:41:04 +0300
commit2bcfe1e077fe043751d3f7c73c82be761629419f (patch)
treed66207e0fad0af6d50b1d8a047d34570730a3413 /libvo/video_out_internal.h
parent3bb140d847eb214cf71256794170d72616edbaf4 (diff)
downloadmpv-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/video_out_internal.h')
-rw-r--r--libvo/video_out_internal.h19
1 files changed, 16 insertions, 3 deletions
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"