summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile3
-rw-r--r--xine/vo_frameoutput.c72
-rw-r--r--xine/vo_frameoutput.h16
-rw-r--r--xine_frontend.c12
-rw-r--r--xine_frontend_internal.h5
5 files changed, 104 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index dbb57c17..e46bfec3 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
# See the main source file 'xineliboutput.c' for copyright information and
# how to reach the author.
#
-# $Id: Makefile,v 1.107 2012-01-10 19:52:41 phintuka Exp $
+# $Id: Makefile,v 1.108 2012-03-07 08:27:40 phintuka Exp $
#
# The official name of this plugin.
@@ -218,6 +218,7 @@ OBJS_MPG = black_720x576.o nosignal_720x576.o vdrlogo_720x576.o
# frontends
OBJS_FE_SO = xine_frontend.o logdefs.o \
xine/post.o xine/vo_hook.o xine/vo_osdscaler.o xine/vo_osdreorder.o xine/vo_lastpts.o \
+ xine/vo_frameoutput.o \
tools/rle.o
OBJS_FE = $(OBJS_FE_SO) tools/vdrdiscovery.o xine_frontend_main.o xine_frontend_lirc.o xine_frontend_kbd.o
diff --git a/xine/vo_frameoutput.c b/xine/vo_frameoutput.c
new file mode 100644
index 00000000..eee27b6c
--- /dev/null
+++ b/xine/vo_frameoutput.c
@@ -0,0 +1,72 @@
+/*
+ * vo_frameoutput.c:
+ *
+ * See the main source file 'xineliboutput.c' for copyright information and
+ * how to reach the author.
+ *
+ * $Id: vo_frameoutput.c,v 1.1 2012-03-07 08:27:40 phintuka Exp $
+ *
+ */
+
+#include <stdlib.h>
+
+#include <xine/xine_internal.h>
+#include <xine/video_out.h>
+
+#include "vo_hook.h"
+
+#define LOG_MODULENAME "[frame_out] "
+#include "../logdefs.h"
+
+#include "vo_frameoutput.h"
+
+
+/*
+ * frameoutput_hook_t
+ */
+typedef struct {
+ vo_driver_hook_t h;
+
+ /* callback */
+ void *handle;
+ void (*cb)(void *, vo_frame_t *);
+
+} frameoutput_hook_t;
+
+/*
+ * interface
+ */
+
+/*
+ * override display_frame()
+ */
+
+static void display_frame(vo_driver_t *self, vo_frame_t *vo_img)
+{
+ frameoutput_hook_t *this = (frameoutput_hook_t*)self;
+
+ ASSERT_RET(self, return);
+ ASSERT_RET(vo_img, return);
+
+ if (this->cb)
+ this->cb(this->handle, vo_img);
+
+ this->h.orig_driver->display_frame(this->h.orig_driver, vo_img);
+}
+
+
+/*
+ * init()
+ */
+vo_driver_t *vo_frameoutput_init(void *handle, void (*cb)(void*, vo_frame_t*))
+{
+ frameoutput_hook_t *this = calloc(1, sizeof(frameoutput_hook_t));
+
+ this->h.vo.display_frame = display_frame;
+
+ this->handle = handle;
+ this->cb = cb;
+
+ return &this->h.vo;
+}
+
diff --git a/xine/vo_frameoutput.h b/xine/vo_frameoutput.h
new file mode 100644
index 00000000..60ba8b09
--- /dev/null
+++ b/xine/vo_frameoutput.h
@@ -0,0 +1,16 @@
+/*
+ * vo_frameoutput.h:
+ *
+ * See the main source file 'xineliboutput.c' for copyright information and
+ * how to reach the author.
+ *
+ * $Id: vo_frameoutput.h,v 1.1 2012-03-07 08:27:40 phintuka Exp $
+ *
+ */
+
+#ifndef _XINELIBOUTPUT_VO_FRAMEOUTPUT_H
+#define _XINELIBOUTPUT_VO_FRAMEOUTPUT_H
+
+vo_driver_t *vo_frameoutput_init(void *handle, void (*cb)(void*, vo_frame_t*));
+
+#endif /* _XINELIBOUTPUT_VO_FRAMEOUTPUT_H */
diff --git a/xine_frontend.c b/xine_frontend.c
index d6f4bdbb..942d3c90 100644
--- a/xine_frontend.c
+++ b/xine_frontend.c
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend.c,v 1.122 2011-12-14 08:12:16 phintuka Exp $
+ * $Id: xine_frontend.c,v 1.123 2012-03-07 08:27:40 phintuka Exp $
*
*/
@@ -39,6 +39,7 @@
#include "xine/vo_osdscaler.h"
#include "xine/vo_osdreorder.h"
#include "xine/vo_lastpts.h"
+#include "xine/vo_frameoutput.h"
#undef MIN
#define MIN(a,b) ( (a) < (b) ? (a) : (b))
@@ -694,9 +695,16 @@ static int fe_xine_init(frontend_t *this_gen, const char *audio_driver,
}
intercept_video_driver(this->video_port);
+ if (this->frame_draw_cb) {
+ vo_driver_t *frameoutput = vo_frameoutput_init(this, this->frame_draw_cb);
+ if (! wire_video_driver(this->video_port, frameoutput)) {
+ LOGMSG("wire_video_driver() for frame output handler failed");
+ frameoutput->dispose(frameoutput);
+ }
+ }
this->video_port_none = NULL;
-
+
/* re-configure display size (DirectFB driver changes display mode in init) */
if(this->update_display_size_cb)
this->update_display_size_cb(this);
diff --git a/xine_frontend_internal.h b/xine_frontend_internal.h
index a4f95ad3..eb183a35 100644
--- a/xine_frontend_internal.h
+++ b/xine_frontend_internal.h
@@ -4,7 +4,7 @@
* See the main source file 'xineliboutput.c' for copyright information and
* how to reach the author.
*
- * $Id: xine_frontend_internal.h,v 1.8 2011-02-28 13:23:46 phintuka Exp $
+ * $Id: xine_frontend_internal.h,v 1.9 2012-03-07 08:27:40 phintuka Exp $
*
*/
@@ -38,6 +38,9 @@ typedef struct fe_s {
void (*update_display_size_cb) (struct fe_s *);
void (*toggle_fullscreen_cb) (struct fe_s *, int);
+ /* if set before xine_init(), will be called by video driver wrapper for each frame */
+ void (*frame_draw_cb)(void *, vo_frame_t *);
+
/* vdr callbacks */
fe_keypress_f keypress;