[vlc-devel] commit: Allowed to use vout_display with a dummy vout. (Laurent Aimar )
git version control
git at videolan.org
Sun Dec 13 13:53:41 CET 2009
vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sun Dec 13 12:42:17 2009 +0100| [49b2bfc868a9703d1d1dcbe188a8331d4669eb7c] | committer: Laurent Aimar
Allowed to use vout_display with a dummy vout.
It is needed as long as we cannot directly get an opengl context
from a vout_thread_t.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=49b2bfc868a9703d1d1dcbe188a8331d4669eb7c
---
src/video_output/display.c | 33 +++++++++++++++++++++++++++++++++
1 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 7702358..eec4536 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -40,6 +40,10 @@
#include "event.h"
+/* It must be present as long as a vout_display_t must be created using a dummy
+ * vout (as an opengl provider) */
+#define ALLOW_DUMMY_VOUT
+
static void SplitterClose(vout_display_t *vd);
/*****************************************************************************
@@ -354,8 +358,14 @@ struct vout_display_owner_sys_t {
int display_height;
bool display_is_fullscreen;
bool display_is_forced;
+
+#ifdef ALLOW_DUMMY_VOUT
+ vlc_mouse_t vout_mouse;
+#endif
};
+static void DummyVoutSendDisplayEventMouse(vout_thread_t *, vlc_mouse_t *fallback, const vlc_mouse_t *m);
+
static void VoutDisplayCreateRender(vout_display_t *vd)
{
vout_display_owner_sys_t *osys = vd->owner.sys;
@@ -527,7 +537,11 @@ static void VoutDisplayEventMouse(vout_display_t *vd, int event, va_list args)
/* */
vout_SendEventMouseVisible(osys->vout);
+#ifdef ALLOW_DUMMY_VOUT
+ DummyVoutSendDisplayEventMouse(osys->vout, &osys->vout_mouse, &m);
+#else
vout_SendDisplayEventMouse(osys->vout, &m);
+#endif
}
static void VoutDisplayEvent(vout_display_t *vd, int event, va_list args)
@@ -1078,6 +1092,9 @@ static vout_display_t *DisplayNew(vout_thread_t *vout,
osys->sar.num = osys->sar_initial.num ? osys->sar_initial.num : source.i_sar_num;
osys->sar.den = osys->sar_initial.den ? osys->sar_initial.den : source.i_sar_den;
+#ifdef ALLOW_DUMMY_VOUT
+ vlc_mouse_Init(&osys->vout_mouse);
+#endif
vout_display_owner_t owner;
if (owner_ptr) {
@@ -1431,6 +1448,22 @@ void vout_SendDisplayEventMouse(vout_thread_t *vout, const vlc_mouse_t *m)
vout_SendEventMouseDoubleClick(vout);
vout->p->mouse = *m;
}
+#ifdef ALLOW_DUMMY_VOUT
+static void DummyVoutSendDisplayEventMouse(vout_thread_t *vout, vlc_mouse_t *fallback, const vlc_mouse_t *m)
+{
+ vout_thread_sys_t p;
+
+ if (!vout->p) {
+ p.mouse = *fallback;
+ vout->p = &p;
+ }
+ vout_SendDisplayEventMouse(vout, m);
+ if (vout->p == &p) {
+ *fallback = p.mouse;
+ vout->p = NULL;
+ }
+}
+#endif
vout_window_t * vout_NewDisplayWindow(vout_thread_t *vout, vout_display_t *vd, const vout_window_cfg_t *cfg)
{
VLC_UNUSED(vd);
More information about the vlc-devel
mailing list