[vlc-commits] Made vout_display_opengl_New return a list of chroma supported for subpicture blending .

Laurent Aimar git at videolan.org
Mon May 30 22:28:18 CEST 2011


vlc | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon May 30 21:52:57 2011 +0200| [095fa2eadbb62e11ec7b968c31b9e5c88962075a] | committer: Laurent Aimar

Made vout_display_opengl_New return a list of chroma supported for subpicture blending.

Not yet used.

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

 modules/video_output/gl.c          |    2 +-
 modules/video_output/ios.m         |    2 +-
 modules/video_output/macosx.m      |    2 +-
 modules/video_output/msw/glwin32.c |    4 +++-
 modules/video_output/opengl.c      |    4 ++++
 modules/video_output/opengl.h      |    4 +++-
 modules/video_output/xcb/glx.c     |    7 +++++--
 7 files changed, 18 insertions(+), 7 deletions(-)

diff --git a/modules/video_output/gl.c b/modules/video_output/gl.c
index 25fc310..70d85b0 100644
--- a/modules/video_output/gl.c
+++ b/modules/video_output/gl.c
@@ -137,7 +137,7 @@ static int Open (vlc_object_t *obj)
         goto error;
 
     /* Initialize video display */
-    sys->vgl = vout_display_opengl_New (&vd->fmt, sys->gl);
+    sys->vgl = vout_display_opengl_New (&vd->fmt, NULL, sys->gl);
     if (!sys->vgl)
         goto error;
 
diff --git a/modules/video_output/ios.m b/modules/video_output/ios.m
index e296348..d49aed2 100644
--- a/modules/video_output/ios.m
+++ b/modules/video_output/ios.m
@@ -151,7 +151,7 @@ static int Open(vlc_object_t *this)
 	sys->gl.getProcAddress = NULL;
     sys->gl.sys = sys;
 
-	sys->vgl = vout_display_opengl_New(&vd->fmt, &sys->gl);
+	sys->vgl = vout_display_opengl_New(&vd->fmt, NULL, &sys->gl);
 	if (!sys->vgl)
     {
         sys->gl.sys = NULL;
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index c218d35..920f1ed 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -190,7 +190,7 @@ static int Open(vlc_object_t *this)
     sys->gl.getProcAddress = NULL;
     sys->gl.sys = sys;
 
-	sys->vgl = vout_display_opengl_New(&vd->fmt, &sys->gl);
+	sys->vgl = vout_display_opengl_New(&vd->fmt, NULL, &sys->gl);
 	if (!sys->vgl)
     {
         sys->gl.sys = NULL;
diff --git a/modules/video_output/msw/glwin32.c b/modules/video_output/msw/glwin32.c
index 81e3198..d3619a9 100644
--- a/modules/video_output/msw/glwin32.c
+++ b/modules/video_output/msw/glwin32.c
@@ -116,7 +116,8 @@ static int Open(vlc_object_t *object)
     sys->gl.sys = vd;
 
     video_format_t fmt = vd->fmt;
-    sys->vgl = vout_display_opengl_New(&fmt, &sys->gl);
+    const vlc_fourcc_t *subpicture_chromas;
+    sys->vgl = vout_display_opengl_New(&fmt, &subpicture_chromas, &sys->gl);
     if (!sys->vgl)
         goto error;
 
@@ -125,6 +126,7 @@ static int Open(vlc_object_t *object)
     info.has_hide_mouse = false;
     info.has_pictures_invalid = true;
     info.has_event_thread = true;
+    info.subpicture_chromas = subpicture_chromas;
 
    /* Setup vout_display now that everything is fine */
     vd->fmt  = fmt;
diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 10d82b8..26cd383 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -114,6 +114,7 @@ static inline int GetAlignedSize(unsigned size)
 }
 
 vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
+                                               const vlc_fourcc_t **subpicture_chromas,
                                                vlc_gl_t *gl)
 {
     vout_display_opengl_t *vgl = calloc(1, sizeof(*vgl));
@@ -336,6 +337,9 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
     vgl->pool = NULL;
 
     *fmt = vgl->fmt;
+    if (subpicture_chromas) {
+        *subpicture_chromas = NULL;
+    }
     return vgl;
 }
 
diff --git a/modules/video_output/opengl.h b/modules/video_output/opengl.h
index 3c9e984..0704edb 100644
--- a/modules/video_output/opengl.h
+++ b/modules/video_output/opengl.h
@@ -58,7 +58,9 @@
 
 typedef struct vout_display_opengl_t vout_display_opengl_t;
 
-vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt, vlc_gl_t *gl);
+vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
+                                               const vlc_fourcc_t **subpicture_chromas,
+                                               vlc_gl_t *gl);
 void vout_display_opengl_Delete(vout_display_opengl_t *vgl);
 
 picture_pool_t *vout_display_opengl_GetPool(vout_display_opengl_t *vgl, unsigned);
diff --git a/modules/video_output/xcb/glx.c b/modules/video_output/xcb/glx.c
index 6d61b1e..53fc452 100644
--- a/modules/video_output/xcb/glx.c
+++ b/modules/video_output/xcb/glx.c
@@ -366,7 +366,8 @@ static int Open (vlc_object_t *obj)
     sys->gl.getProcAddress = GetProcAddress;
     sys->gl.sys = sys;
 
-    sys->vgl = vout_display_opengl_New (&vd->fmt, &sys->gl);
+    const vlc_fourcc_t *subpicture_chromas;
+    sys->vgl = vout_display_opengl_New (&vd->fmt, &subpicture_chromas, &sys->gl);
     if (!sys->vgl)
     {
         sys->gl.sys = NULL;
@@ -380,6 +381,7 @@ static int Open (vlc_object_t *obj)
     vout_display_info_t info = vd->info;
     info.has_pictures_invalid = false;
     info.has_event_thread = true;
+    info.subpicture_chromas = subpicture_chromas;
 
     /* Setup vout_display_t once everything is fine */
     vd->info = info;
@@ -477,7 +479,8 @@ static void PictureDisplay (vout_display_t *vd, picture_t *pic, subpicture_t *su
 
     vout_display_opengl_Display (sys->vgl, &vd->source);
     picture_Release (pic);
-    (void)subpicture;
+    if (subpicture)
+        subpicture_Delete(subpicture);
 }
 
 static int Control (vout_display_t *vd, int query, va_list ap)



More information about the vlc-commits mailing list