]> git.sesse.net Git - vlc/blobdiff - src/video_output/video_output.c
Calls directly the vout wrapper iof using function pointers.
[vlc] / src / video_output / video_output.c
index b834655325361ba3b1a4ec7d67567f58b3355a37..22b07d40799e3a578eb686c56b18d8a4676bf306 100644 (file)
@@ -379,7 +379,6 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
     p_vout->p->b_filter_change = 0;
     p_vout->p->b_paused = false;
     p_vout->p->i_pause_date = 0;
-    p_vout->pf_control = NULL;
     p_vout->p->i_par_num =
     p_vout->p->i_par_den = 1;
     p_vout->p->p_picture_displayed = NULL;
@@ -495,7 +494,6 @@ vout_thread_t * vout_Create( vlc_object_t *p_parent, video_format_t *p_fmt )
         psz_name = psz_tmp;
     }
     p_vout->p->psz_module_name = psz_name;
-    p_vout->p_module = NULL;
 
     /* */
     vlc_object_set_destructor( p_vout, vout_Destructor );
@@ -789,7 +787,7 @@ static int InitThread( vout_thread_t *p_vout )
     int i;
 
     /* Initialize output method, it allocates direct buffers for us */
-    if( p_vout->pf_init( p_vout ) )
+    if( vout_InitWrapper( p_vout ) )
         return VLC_EGENERIC;
 
     p_vout->p->p_picture_displayed = NULL;
@@ -798,7 +796,7 @@ static int InitThread( vout_thread_t *p_vout )
     {
         msg_Err( p_vout, "plugin was unable to allocate at least "
                          "one direct buffer" );
-        p_vout->pf_end( p_vout );
+        vout_EndWrapper( p_vout );
         return VLC_EGENERIC;
     }
 
@@ -806,7 +804,7 @@ static int InitThread( vout_thread_t *p_vout )
     {
         msg_Err( p_vout, "plugin allocated too many direct buffers, "
                          "our internal buffers must have overflown." );
-        p_vout->pf_end( p_vout );
+        vout_EndWrapper( p_vout );
         return VLC_EGENERIC;
     }
 
@@ -909,7 +907,7 @@ static int InitThread( vout_thread_t *p_vout )
 
         if( ChromaCreate( p_vout ) )
         {
-            p_vout->pf_end( p_vout );
+            vout_EndWrapper( p_vout );
             return VLC_EGENERIC;
         }
 
@@ -1154,10 +1152,10 @@ static void* RunThread( void *p_this )
         /*
          * 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 */
-            p_vout->pf_render( p_vout, p_directbuffer );
+            vout_RenderWrapper( p_vout, p_directbuffer );
         }
 
         /*
@@ -1213,8 +1211,7 @@ static void* RunThread( void *p_this )
         if( p_filtered_picture != NULL && p_directbuffer != NULL )
         {
             /* Display the direct buffer returned by vout_RenderPicture */
-            if( p_vout->pf_display )
-                p_vout->pf_display( p_vout, p_directbuffer );
+            vout_DisplayWrapper( p_vout, p_directbuffer );
 
             /* Tell the vout this was the last picture and that it does not
              * need to be forced anymore. */
@@ -1238,7 +1235,7 @@ static void* RunThread( void *p_this )
         /*
          * 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
              * immediately, without displaying anything - setting b_error to 1
@@ -1248,13 +1245,8 @@ static void* RunThread( void *p_this )
             break;
         }
 
-        while( p_vout->i_changes & VOUT_ON_TOP_CHANGE )
-        {
+        if( p_vout->i_changes & VOUT_ON_TOP_CHANGE )
             p_vout->i_changes &= ~VOUT_ON_TOP_CHANGE;
-            vlc_mutex_unlock( &p_vout->change_lock );
-            vout_Control( p_vout, VOUT_SET_STAY_ON_TOP, p_vout->b_on_top );
-            vlc_mutex_lock( &p_vout->change_lock );
-        }
 
         if( p_vout->i_changes & VOUT_SIZE_CHANGE )
         {
@@ -1272,7 +1264,7 @@ static void* RunThread( void *p_this )
 
             vlc_mutex_lock( &p_vout->picture_lock );
 
-            p_vout->pf_end( p_vout );
+            vout_EndWrapper( p_vout );
 
             p_vout->p->p_picture_displayed = NULL;
             for( i = 0; i < I_OUTPUTPICTURES; i++ )
@@ -1281,7 +1273,7 @@ static void* RunThread( void *p_this )
 
             I_OUTPUTPICTURES = 0;
 
-            if( p_vout->pf_init( p_vout ) )
+            if( vout_InitWrapper( p_vout ) )
             {
                 msg_Err( p_vout, "cannot resize display" );
                 /* FIXME: pf_end will be called again in CleanThread()? */
@@ -1317,7 +1309,7 @@ static void* RunThread( void *p_this )
 
             vlc_mutex_lock( &p_vout->picture_lock );
 
-            p_vout->pf_end( p_vout );
+            vout_EndWrapper( p_vout );
 
             I_OUTPUTPICTURES = I_RENDERPICTURES = 0;
 
@@ -1434,7 +1426,7 @@ static void CleanThread( vout_thread_t *p_vout )
 
     /* Destroy translation tables */
     if( !p_vout->b_error )
-        p_vout->pf_end( p_vout );
+        vout_EndWrapper( p_vout );
 }
 
 /*****************************************************************************