Commit c5ae5a73 authored by Steve Lhomme's avatar Steve Lhomme Committed by Thomas Guillem

vout: opengl: initialize viewpoint on creation

Signed-off-by: Thomas Guillem's avatarThomas Guillem <thomas@gllm.fr>
parent 142bedc3
......@@ -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;
......
......@@ -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)
......
......@@ -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;
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment