Commit 6d2319a0 authored by Laurent Aimar's avatar Laurent Aimar

Calls directly the vout wrapper iof using function pointers.

parent 14f9486c
...@@ -130,15 +130,6 @@ struct vout_thread_t ...@@ -130,15 +130,6 @@ struct vout_thread_t
/**@}*/ /**@}*/
/** \name Plugin used and shortcuts to access its capabilities */
/**@{*/
int ( *pf_init ) ( vout_thread_t * );
void ( *pf_end ) ( vout_thread_t * );
int ( *pf_manage ) ( vout_thread_t * );
void ( *pf_render ) ( vout_thread_t *, picture_t * );
void ( *pf_display ) ( vout_thread_t *, picture_t * );
/**@}*/
/** \name Video heap and translation tables */ /** \name Video heap and translation tables */
/**@{*/ /**@{*/
int i_heap_size; /**< heap size */ int i_heap_size; /**< heap size */
......
...@@ -787,7 +787,7 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -787,7 +787,7 @@ static int InitThread( vout_thread_t *p_vout )
int i; int i;
/* Initialize output method, it allocates direct buffers for us */ /* Initialize output method, it allocates direct buffers for us */
if( p_vout->pf_init( p_vout ) ) if( vout_InitWrapper( p_vout ) )
return VLC_EGENERIC; return VLC_EGENERIC;
p_vout->p->p_picture_displayed = NULL; p_vout->p->p_picture_displayed = NULL;
...@@ -796,7 +796,7 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -796,7 +796,7 @@ static int InitThread( vout_thread_t *p_vout )
{ {
msg_Err( p_vout, "plugin was unable to allocate at least " msg_Err( p_vout, "plugin was unable to allocate at least "
"one direct buffer" ); "one direct buffer" );
p_vout->pf_end( p_vout ); vout_EndWrapper( p_vout );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -804,7 +804,7 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -804,7 +804,7 @@ static int InitThread( vout_thread_t *p_vout )
{ {
msg_Err( p_vout, "plugin allocated too many direct buffers, " msg_Err( p_vout, "plugin allocated too many direct buffers, "
"our internal buffers must have overflown." ); "our internal buffers must have overflown." );
p_vout->pf_end( p_vout ); vout_EndWrapper( p_vout );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -907,7 +907,7 @@ static int InitThread( vout_thread_t *p_vout ) ...@@ -907,7 +907,7 @@ static int InitThread( vout_thread_t *p_vout )
if( ChromaCreate( p_vout ) ) if( ChromaCreate( p_vout ) )
{ {
p_vout->pf_end( p_vout ); vout_EndWrapper( p_vout );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
...@@ -1152,10 +1152,10 @@ static void* RunThread( void *p_this ) ...@@ -1152,10 +1152,10 @@ static void* RunThread( void *p_this )
/* /*
* Call the plugin-specific rendering method if there is one * Call the plugin-specific rendering method if there is one
*/ */
if( p_filtered_picture != NULL && p_directbuffer != NULL && p_vout->pf_render ) if( p_filtered_picture != NULL && p_directbuffer != NULL )
{ {
/* Render the direct buffer returned by vout_RenderPicture */ /* Render the direct buffer returned by vout_RenderPicture */
p_vout->pf_render( p_vout, p_directbuffer ); vout_RenderWrapper( p_vout, p_directbuffer );
} }
/* /*
...@@ -1211,8 +1211,7 @@ static void* RunThread( void *p_this ) ...@@ -1211,8 +1211,7 @@ static void* RunThread( void *p_this )
if( p_filtered_picture != NULL && p_directbuffer != NULL ) if( p_filtered_picture != NULL && p_directbuffer != NULL )
{ {
/* Display the direct buffer returned by vout_RenderPicture */ /* Display the direct buffer returned by vout_RenderPicture */
if( p_vout->pf_display ) vout_DisplayWrapper( p_vout, p_directbuffer );
p_vout->pf_display( p_vout, p_directbuffer );
/* Tell the vout this was the last picture and that it does not /* Tell the vout this was the last picture and that it does not
* need to be forced anymore. */ * need to be forced anymore. */
...@@ -1236,7 +1235,7 @@ static void* RunThread( void *p_this ) ...@@ -1236,7 +1235,7 @@ static void* RunThread( void *p_this )
/* /*
* Check events and manage thread * Check events and manage thread
*/ */
if( p_vout->pf_manage && p_vout->pf_manage( p_vout ) ) if( vout_ManageWrapper( p_vout ) )
{ {
/* A fatal error occurred, and the thread must terminate /* A fatal error occurred, and the thread must terminate
* immediately, without displaying anything - setting b_error to 1 * immediately, without displaying anything - setting b_error to 1
...@@ -1265,7 +1264,7 @@ static void* RunThread( void *p_this ) ...@@ -1265,7 +1264,7 @@ static void* RunThread( void *p_this )
vlc_mutex_lock( &p_vout->picture_lock ); vlc_mutex_lock( &p_vout->picture_lock );
p_vout->pf_end( p_vout ); vout_EndWrapper( p_vout );
p_vout->p->p_picture_displayed = NULL; p_vout->p->p_picture_displayed = NULL;
for( i = 0; i < I_OUTPUTPICTURES; i++ ) for( i = 0; i < I_OUTPUTPICTURES; i++ )
...@@ -1274,7 +1273,7 @@ static void* RunThread( void *p_this ) ...@@ -1274,7 +1273,7 @@ static void* RunThread( void *p_this )
I_OUTPUTPICTURES = 0; I_OUTPUTPICTURES = 0;
if( p_vout->pf_init( p_vout ) ) if( vout_InitWrapper( p_vout ) )
{ {
msg_Err( p_vout, "cannot resize display" ); msg_Err( p_vout, "cannot resize display" );
/* FIXME: pf_end will be called again in CleanThread()? */ /* FIXME: pf_end will be called again in CleanThread()? */
...@@ -1310,7 +1309,7 @@ static void* RunThread( void *p_this ) ...@@ -1310,7 +1309,7 @@ static void* RunThread( void *p_this )
vlc_mutex_lock( &p_vout->picture_lock ); vlc_mutex_lock( &p_vout->picture_lock );
p_vout->pf_end( p_vout ); vout_EndWrapper( p_vout );
I_OUTPUTPICTURES = I_RENDERPICTURES = 0; I_OUTPUTPICTURES = I_RENDERPICTURES = 0;
...@@ -1427,7 +1426,7 @@ static void CleanThread( vout_thread_t *p_vout ) ...@@ -1427,7 +1426,7 @@ static void CleanThread( vout_thread_t *p_vout )
/* Destroy translation tables */ /* Destroy translation tables */
if( !p_vout->b_error ) if( !p_vout->b_error )
p_vout->pf_end( p_vout ); vout_EndWrapper( p_vout );
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -120,6 +120,11 @@ void vout_UsePictureLocked( vout_thread_t *p_vout, picture_t *p_pic ); ...@@ -120,6 +120,11 @@ void vout_UsePictureLocked( vout_thread_t *p_vout, picture_t *p_pic );
/* */ /* */
int vout_OpenWrapper (vout_thread_t *, const char *); int vout_OpenWrapper (vout_thread_t *, const char *);
void vout_CloseWrapper(vout_thread_t *); void vout_CloseWrapper(vout_thread_t *);
int vout_InitWrapper(vout_thread_t *);
void vout_EndWrapper(vout_thread_t *);
int vout_ManageWrapper(vout_thread_t *);
void vout_RenderWrapper(vout_thread_t *, picture_t *);
void vout_DisplayWrapper(vout_thread_t *, picture_t *);
#endif #endif
...@@ -53,12 +53,6 @@ struct picture_sys_t { ...@@ -53,12 +53,6 @@ struct picture_sys_t {
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static int Init (vout_thread_t *);
static void End (vout_thread_t *);
static int Manage (vout_thread_t *);
static void Render (vout_thread_t *, picture_t *);
static void Display(vout_thread_t *, picture_t *);
static void VoutGetDisplayCfg(vout_thread_t *, static void VoutGetDisplayCfg(vout_thread_t *,
vout_display_cfg_t *, const char *title); vout_display_cfg_t *, const char *title);
#ifdef WIN32 #ifdef WIN32
...@@ -120,11 +114,6 @@ int vout_OpenWrapper(vout_thread_t *vout, const char *name) ...@@ -120,11 +114,6 @@ int vout_OpenWrapper(vout_thread_t *vout, const char *name)
#endif #endif
/* */ /* */
vout->pf_init = Init;
vout->pf_end = End;
vout->pf_manage = Manage;
vout->pf_render = Render;
vout->pf_display = Display;
vout->p_sys = sys; vout->p_sys = sys;
return VLC_SUCCESS; return VLC_SUCCESS;
...@@ -149,7 +138,7 @@ void vout_CloseWrapper(vout_thread_t *vout) ...@@ -149,7 +138,7 @@ void vout_CloseWrapper(vout_thread_t *vout)
/***************************************************************************** /*****************************************************************************
* *
*****************************************************************************/ *****************************************************************************/
static int Init(vout_thread_t *vout) int vout_InitWrapper(vout_thread_t *vout)
{ {
vout_sys_t *sys = vout->p_sys; vout_sys_t *sys = vout->p_sys;
vout_display_t *vd = sys->vd; vout_display_t *vd = sys->vd;
...@@ -244,7 +233,7 @@ static int Init(vout_thread_t *vout) ...@@ -244,7 +233,7 @@ static int Init(vout_thread_t *vout)
/***************************************************************************** /*****************************************************************************
* *
*****************************************************************************/ *****************************************************************************/
static void End(vout_thread_t *vout) void vout_EndWrapper(vout_thread_t *vout)
{ {
vout_sys_t *sys = vout->p_sys; vout_sys_t *sys = vout->p_sys;
...@@ -269,7 +258,7 @@ static void End(vout_thread_t *vout) ...@@ -269,7 +258,7 @@ static void End(vout_thread_t *vout)
/***************************************************************************** /*****************************************************************************
* *
*****************************************************************************/ *****************************************************************************/
static int Manage(vout_thread_t *vout) int vout_ManageWrapper(vout_thread_t *vout)
{ {
vout_sys_t *sys = vout->p_sys; vout_sys_t *sys = vout->p_sys;
vout_display_t *vd = sys->vd; vout_display_t *vd = sys->vd;
...@@ -363,7 +352,7 @@ static int Manage(vout_thread_t *vout) ...@@ -363,7 +352,7 @@ static int Manage(vout_thread_t *vout)
/***************************************************************************** /*****************************************************************************
* Render * Render
*****************************************************************************/ *****************************************************************************/
static void Render(vout_thread_t *vout, picture_t *picture) void vout_RenderWrapper(vout_thread_t *vout, picture_t *picture)
{ {
vout_sys_t *sys = vout->p_sys; vout_sys_t *sys = vout->p_sys;
vout_display_t *vd = sys->vd; vout_display_t *vd = sys->vd;
...@@ -385,7 +374,7 @@ static void Render(vout_thread_t *vout, picture_t *picture) ...@@ -385,7 +374,7 @@ static void Render(vout_thread_t *vout, picture_t *picture)
/***************************************************************************** /*****************************************************************************
* *
*****************************************************************************/ *****************************************************************************/
static void Display(vout_thread_t *vout, picture_t *picture) void vout_DisplayWrapper(vout_thread_t *vout, picture_t *picture)
{ {
vout_sys_t *sys = vout->p_sys; vout_sys_t *sys = vout->p_sys;
vout_display_t *vd = sys->vd; vout_display_t *vd = sys->vd;
......
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