[vlc-commits] vout: opengl: initialize viewpoint on creation
Steve Lhomme
git at videolan.org
Tue Nov 15 18:14:01 CET 2016
vlc | branch: master | Steve Lhomme <robux4 at videolabs.io> | Tue Nov 15 17:42:34 2016 +0100| [c5ae5a73ccf56548b7f487071a8d3bc5c04459f4] | committer: Thomas Guillem
vout: opengl: initialize viewpoint on creation
Signed-off-by: Thomas Guillem <thomas at gllm.fr>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c5ae5a73ccf56548b7f487071a8d3bc5c04459f4
---
modules/video_output/caopengllayer.m | 3 ++-
modules/video_output/gl.c | 3 ++-
modules/video_output/ios2.m | 3 ++-
modules/video_output/macosx.m | 3 ++-
modules/video_output/opengl.c | 10 +++++++++-
modules/video_output/opengl.h | 3 ++-
modules/video_output/win32/glwin32.c | 3 ++-
modules/video_output/xcb/glx.c | 3 ++-
8 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/modules/video_output/caopengllayer.m b/modules/video_output/caopengllayer.m
index f4ec98a..0c39fde 100644
--- a/modules/video_output/caopengllayer.m
+++ b/modules/video_output/caopengllayer.m
@@ -179,7 +179,8 @@ static int Open (vlc_object_t *p_this)
const vlc_fourcc_t *subpicture_chromas;
video_format_t fmt = vd->fmt;
- sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl);
+ sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl,
+ &vd->cfg->viewpoint);
if (!sys->vgl) {
msg_Err(vd, "Error while initializing opengl display.");
sys->gl.sys = NULL;
diff --git a/modules/video_output/gl.c b/modules/video_output/gl.c
index 082aa78..d9e48d3 100644
--- a/modules/video_output/gl.c
+++ b/modules/video_output/gl.c
@@ -125,7 +125,8 @@ static int Open (vlc_object_t *obj)
if (vlc_gl_MakeCurrent (sys->gl))
goto error;
- sys->vgl = vout_display_opengl_New (&vd->fmt, &spu_chromas, sys->gl);
+ sys->vgl = vout_display_opengl_New (&vd->fmt, &spu_chromas, sys->gl,
+ &vd->cfg->viewpoint);
vlc_gl_ReleaseCurrent (sys->gl);
if (sys->vgl == NULL)
diff --git a/modules/video_output/ios2.m b/modules/video_output/ios2.m
index 797c615..1f7c24b 100644
--- a/modules/video_output/ios2.m
+++ b/modules/video_output/ios2.m
@@ -262,7 +262,8 @@ static int Open(vlc_object_t *this)
sys->gl.getProcAddress = OurGetProcAddress;
sys->gl.sys = sys;
- sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl);
+ sys->vgl = vout_display_opengl_New(&vd->fmt, &subpicture_chromas, &sys->gl,
+ &vd->cfg->viewpoint);
if (!sys->vgl) {
sys->gl.sys = NULL;
goto bailout;
diff --git a/modules/video_output/macosx.m b/modules/video_output/macosx.m
index e9805ed..0e7a67c 100644
--- a/modules/video_output/macosx.m
+++ b/modules/video_output/macosx.m
@@ -260,7 +260,8 @@ static int Open (vlc_object_t *this)
sys->gl.sys = sys;
const vlc_fourcc_t *subpicture_chromas;
- sys->vgl = vout_display_opengl_New (&vd->fmt, &subpicture_chromas, &sys->gl);
+ sys->vgl = vout_display_opengl_New (&vd->fmt, &subpicture_chromas, &sys->gl,
+ &vd->cfg->viewpoint);
if (!sys->vgl) {
msg_Err(vd, "Error while initializing opengl display.");
sys->gl.sys = NULL;
diff --git a/modules/video_output/opengl.c b/modules/video_output/opengl.c
index 383104c..e5f23ba 100644
--- a/modules/video_output/opengl.c
+++ b/modules/video_output/opengl.c
@@ -427,7 +427,8 @@ static void BuildXYZFragmentShader(vout_display_opengl_t *vgl,
vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
const vlc_fourcc_t **subpicture_chromas,
- vlc_gl_t *gl)
+ vlc_gl_t *gl,
+ const vlc_viewpoint_t *viewpoint)
{
vout_display_opengl_t *vgl = calloc(1, sizeof(*vgl));
if (!vgl)
@@ -739,6 +740,13 @@ vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
vgl->region = NULL;
vgl->pool = NULL;
+ if (vgl->fmt.projection_mode != PROJECTION_MODE_RECTANGULAR
+ && vout_display_opengl_SetViewpoint(vgl, viewpoint) != VLC_SUCCESS)
+ {
+ vout_display_opengl_Delete(vgl);
+ return NULL;
+ }
+
*fmt = vgl->fmt;
if (subpicture_chromas) {
*subpicture_chromas = gl_subpicture_chromas;
diff --git a/modules/video_output/opengl.h b/modules/video_output/opengl.h
index f12c55c..9aff95b 100644
--- a/modules/video_output/opengl.h
+++ b/modules/video_output/opengl.h
@@ -91,7 +91,8 @@ typedef struct vout_display_opengl_t vout_display_opengl_t;
vout_display_opengl_t *vout_display_opengl_New(video_format_t *fmt,
const vlc_fourcc_t **subpicture_chromas,
- vlc_gl_t *gl);
+ vlc_gl_t *gl,
+ const vlc_viewpoint_t *viewpoint);
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/win32/glwin32.c b/modules/video_output/win32/glwin32.c
index 01bae19..810c063 100644
--- a/modules/video_output/win32/glwin32.c
+++ b/modules/video_output/win32/glwin32.c
@@ -210,7 +210,8 @@ static int Open(vlc_object_t *object)
video_format_t fmt = vd->fmt;
const vlc_fourcc_t *subpicture_chromas;
- sys->vgl = vout_display_opengl_New(&fmt, &subpicture_chromas, &sys->gl);
+ sys->vgl = vout_display_opengl_New(&fmt, &subpicture_chromas, &sys->gl,
+ &vd->cfg->viewpoint);
if (!sys->vgl)
goto error;
diff --git a/modules/video_output/xcb/glx.c b/modules/video_output/xcb/glx.c
index 469f9ec..7919311 100644
--- a/modules/video_output/xcb/glx.c
+++ b/modules/video_output/xcb/glx.c
@@ -109,7 +109,8 @@ static int Open (vlc_object_t *obj)
if (vlc_gl_MakeCurrent (sys->gl))
goto error;
- sys->vgl = vout_display_opengl_New (&vd->fmt, &spu_chromas, sys->gl);
+ sys->vgl = vout_display_opengl_New (&vd->fmt, &spu_chromas, sys->gl,
+ &vd->cfg->viewpoint);
vlc_gl_ReleaseCurrent (sys->gl);
if (sys->vgl == NULL)
goto error;
More information about the vlc-commits
mailing list