Commit 32b211e4 authored by Gildas Bazin's avatar Gildas Bazin

* modules/video_output/x11/glx.c, modules/video_output/opengl.c: some fixes.

parent d049b8aa
......@@ -53,10 +53,11 @@ static int CreateVout ( vlc_object_t * );
static void DestroyVout ( vlc_object_t * );
static int Init ( vout_thread_t * );
static void End ( vout_thread_t * );
static void Render ( vout_thread_t *p_vout, picture_t *p_pic );
static int Manage ( vout_thread_t * );
static void Render ( vout_thread_t *, picture_t * );
static void DisplayVideo ( vout_thread_t *, picture_t * );
static inline int GetAlignedSize( int i_size );
static inline int GetAlignedSize( int );
/*****************************************************************************
* Module descriptor
......@@ -85,7 +86,6 @@ struct vout_sys_t
GLuint texture;
int i_effect; //XXX
};
/*****************************************************************************
......@@ -126,6 +126,10 @@ static int CreateVout( vlc_object_t *p_this )
p_sys->p_vout->i_window_width = p_vout->i_window_width;
p_sys->p_vout->i_window_height = p_vout->i_window_height;
p_sys->p_vout->b_fullscreen = p_vout->b_fullscreen;
p_sys->p_vout->render.i_width = p_vout->render.i_width;
p_sys->p_vout->render.i_height = p_vout->render.i_height;
p_sys->p_vout->render.i_aspect = p_vout->render.i_aspect;
p_sys->p_vout->i_window_height = p_vout->i_window_height;
p_sys->p_vout->p_module =
module_Need( p_sys->p_vout, "opengl provider", NULL, 0 );
......@@ -139,6 +143,7 @@ static int CreateVout( vlc_object_t *p_this )
p_vout->pf_init = Init;
p_vout->pf_end = End;
p_vout->pf_manage = Manage;
p_vout->pf_render = Render;
p_vout->pf_display = DisplayVideo;
......@@ -260,6 +265,18 @@ static void DestroyVout( vlc_object_t *p_this )
free( p_sys );
}
/*****************************************************************************
* Manage: handle Sys events
*****************************************************************************
* This function should be called regularly by video output thread. It returns
* a non null value if an error occured.
*****************************************************************************/
static int Manage( vout_thread_t *p_vout )
{
vout_sys_t *p_sys = p_vout->p_sys;
return p_sys->p_vout->pf_manage( p_sys->p_vout );
}
/*****************************************************************************
* Render: render previously calculated output
*****************************************************************************/
......
......@@ -171,6 +171,7 @@ static int CheckGLX( vlc_object_t *p_this, vlc_bool_t *b_glx13 )
if( !p_display )
{
msg_Err( p_this, "Cannot open display" );
XCloseDisplay( p_display );
return VLC_EGENERIC;
}
......@@ -178,11 +179,13 @@ static int CheckGLX( vlc_object_t *p_this, vlc_bool_t *b_glx13 )
if( !XQueryExtension( p_display, "GLX", &i_opcode, &i_evt, &i_err ) )
{
msg_Err( p_this, "GLX extension not supported" );
XCloseDisplay( p_display );
return VLC_EGENERIC;
}
if( !glXQueryExtension( p_display, &i_err, &i_evt ) )
{
msg_Err( p_this, "glXQueryExtension failed" );
XCloseDisplay( p_display );
return VLC_EGENERIC;
}
......@@ -190,6 +193,7 @@ static int CheckGLX( vlc_object_t *p_this, vlc_bool_t *b_glx13 )
if (!glXQueryVersion( p_display, &i_maj, &i_min ) )
{
msg_Err( p_this, "glXQueryVersion failed" );
XCloseDisplay( p_display );
return VLC_EGENERIC;
}
if( i_maj <= 0 || ((i_maj == 1) && (i_min < 3)) )
......@@ -203,6 +207,7 @@ static int CheckGLX( vlc_object_t *p_this, vlc_bool_t *b_glx13 )
msg_Dbg( p_this, "Using GLX 1.3 API" );
}
XCloseDisplay( p_display );
return VLC_SUCCESS;
}
......
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