changeset 36495:211cb1950419

vo_bl: Switch to modern VOCTRL_DRAW_IMAGE API.
author reimar
date Sat, 18 Jan 2014 11:58:13 +0000
parents 60d86116a5bc
children cf65ac6b4842
files libvo/video_out_internal.h libvo/vo_bl.c
diffstat 2 files changed, 16 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/video_out_internal.h	Sat Jan 18 11:41:27 2014 +0000
+++ b/libvo/video_out_internal.h	Sat Jan 18 11:58:13 2014 +0000
@@ -32,8 +32,16 @@
 static int config(uint32_t width, uint32_t height, uint32_t d_width,
 		     uint32_t d_height, uint32_t fullscreen, char *title,
 		     uint32_t format);
+#ifdef NO_DRAW_FRAME
+#define draw_frame NULL
+#else
 static int draw_frame(uint8_t *src[]);
+#endif
+#ifdef NO_DRAW_SLICE
+#define draw_slice NULL
+#else
 static int draw_slice(uint8_t *image[], int stride[], int w,int h,int x,int y);
+#endif
 static void draw_osd(void);
 static void flip_page(void);
 static void check_events(void);
--- a/libvo/vo_bl.c	Sat Jan 18 11:41:27 2014 +0000
+++ b/libvo/vo_bl.c	Sat Jan 18 11:58:13 2014 +0000
@@ -48,6 +48,8 @@
 #include <netinet/in.h>
 
 #include "video_out.h"
+#define NO_DRAW_FRAME
+#define NO_DRAW_SLICE
 #include "video_out_internal.h"
 #include "mp_msg.h"
 #include "m_option.h"
@@ -300,13 +302,9 @@
 	return;
 }
 
-static int draw_frame(uint8_t * src[]) {
-	return 0;
-}
-
 static int query_format(uint32_t format) {
 	if (format == bl->img_format)
-		return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW;
+		return VFCAP_CSP_SUPPORTED|VFCAP_CSP_SUPPORTED_BY_HW|VFCAP_ACCEPT_STRIDE|VOCAP_NOSLICES;
 	return 0;
 }
 
@@ -327,12 +325,9 @@
 static void check_events(void) {
 }
 
-static int draw_slice(uint8_t *srcimg[], int stride[],
-		int w, int h, int x, int y) {
-	uint8_t *dst = image + y * bl->width + x;
-	// copy Y:
-	memcpy_pic(dst, srcimg[0], w, h, bl->width, stride[0]);
- 	return 0;
+static uint32_t draw_image(mp_image_t *mpi) {
+    memcpy_pic(image, mpi->planes[0], bl->width, bl->height, bl->width, mpi->stride[0]);
+    return VO_TRUE;
 }
 
 static int preinit(const char *arg) {
@@ -465,6 +460,8 @@
 	switch (request) {
 		case VOCTRL_QUERY_FORMAT:
 			return query_format(*((uint32_t*)data));
+		case VOCTRL_DRAW_IMAGE:
+			return draw_image(data);
   		}
   	return VO_NOTIMPL;
 }