[vlc-devel] commit: Added a way to retreive an opengl context from a vout display. ( Laurent Aimar )

git version control git at videolan.org
Sun Dec 13 13:53:40 CET 2009


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Sat Dec 12 22:41:45 2009 +0100| [99bf49b13d643e3e4cc1c7205f59812512dda8f7] | committer: Laurent Aimar 

Added a way to retreive an opengl context from a vout display.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=99bf49b13d643e3e4cc1c7205f59812512dda8f7
---

 include/vlc_vout_display.h |    3 +++
 include/vlc_vout_wrapper.h |    2 ++
 src/libvlccore.sym         |    1 +
 src/video_output/display.c |    8 +++++++-
 4 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/include/vlc_vout_display.h b/include/vlc_vout_display.h
index f7c436d..5f927e0 100644
--- a/include/vlc_vout_display.h
+++ b/include/vlc_vout_display.h
@@ -157,6 +157,9 @@ enum {
      * The cropping requested is stored by video_format_t::i_x/y_offset and
      * video_format_t::i_visible_width/height */
     VOUT_DISPLAY_CHANGE_SOURCE_CROP,   /* const video_format_t *p_source */
+
+    /* Ask an opengl interface if available. */
+    VOUT_DISPLAY_GET_OPENGL,           /* vout_opengl_t ** */
 };
 
 /**
diff --git a/include/vlc_vout_wrapper.h b/include/vlc_vout_wrapper.h
index 13637c9..d6a9e2b 100644
--- a/include/vlc_vout_wrapper.h
+++ b/include/vlc_vout_wrapper.h
@@ -25,6 +25,7 @@
 #define VLC_VOUT_WRAPPER_H 1
 
 #include <vlc_vout_display.h>
+#include <vlc_vout_opengl.h>
 
 /* XXX DO NOT use it outside the vout module wrapper XXX */
 
@@ -87,6 +88,7 @@ VLC_EXPORT(void, vout_SetDisplayZoom, (vout_display_t *, int num, int den));
 VLC_EXPORT(void, vout_SetDisplayOnTop, (vout_display_t *, bool is_on_top));
 VLC_EXPORT(void, vout_SetDisplayAspect, (vout_display_t *, unsigned sar_num, unsigned sar_den));
 VLC_EXPORT(void, vout_SetDisplayCrop, (vout_display_t *, unsigned crop_num, unsigned crop_den, unsigned x, unsigned y, unsigned width, unsigned height));
+VLC_EXPORT(vout_opengl_t *, vout_GetDisplayOpengl, (vout_display_t *));
 
 #endif /* VLC_VOUT_WRAPPER_H */
 
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 246a739..06274d9 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -597,6 +597,7 @@ vout_AreDisplayPicturesInvalid
 vout_IsDisplayFiltered
 vout_FilterDisplay
 vout_ManageDisplay
+vout_GetDisplayOpengl
 vout_SetDisplayFullscreen
 vout_SetDisplayFilled
 vout_SetDisplayZoom
diff --git a/src/video_output/display.c b/src/video_output/display.c
index 5559797..7702358 100644
--- a/src/video_output/display.c
+++ b/src/video_output/display.c
@@ -1012,7 +1012,13 @@ void vout_SetDisplayCrop(vout_display_t *vd,
         osys->ch_crop = true;
     }
 }
-
+vout_opengl_t *vout_GetDisplayOpengl(vout_display_t *vd)
+{
+    vout_opengl_t *gl;
+    if (vout_display_Control(vd, VOUT_DISPLAY_GET_OPENGL, &gl))
+        return NULL;
+    return gl;
+}
 
 static vout_display_t *DisplayNew(vout_thread_t *vout,
                                   const video_format_t *source_org,




More information about the vlc-devel mailing list