]> git.sesse.net Git - vlc/blobdiff - src/video_output/video_output.c
* ALL: Major rework of the subpictures architecture.
[vlc] / src / video_output / video_output.c
index 64c5dc35b97df2ce24ae7c649fded78842247cc5..633c59437e8f8a9eae06da2941c9c0b0722d0823 100644 (file)
@@ -232,7 +232,7 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
         return NULL;
     }
 
-    /* Initialize pictures and subpictures - translation tables and functions
+    /* Initialize pictures - translation tables and functions
      * will be initialized later in InitThread */
     for( i_index = 0; i_index < 2 * VOUT_MAX_PICTURES + 1; i_index++)
     {
@@ -243,12 +243,6 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
         p_vout->p_picture[i_index].b_slow   = 0;
     }
 
-    for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++)
-    {
-        p_vout->p_subpicture[i_index].i_status = FREE_SUBPICTURE;
-        p_vout->p_subpicture[i_index].i_type   = EMPTY_SUBPICTURE;
-    }
-
     /* No images in the heap */
     p_vout->i_heap_size = 0;
 
@@ -416,13 +410,8 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
         return NULL;
     }
 
-    p_vout->p_text_renderer_module =
-        module_Need( p_vout, "text renderer", NULL, 0 );
-    if( p_vout->p_text_renderer_module == NULL )
-    {
-        msg_Warn( p_vout, "no suitable text renderer module" );
-        p_vout->pf_add_string = NULL;
-    }
+    /* Initialize subpicture unit */
+    vout_InitSPU( p_vout );
 
     /* Create a few object variables for interface interaction */
     var_Create( p_vout, "deinterlace", VLC_VAR_STRING | VLC_VAR_HASCHOICE );
@@ -489,10 +478,6 @@ vout_thread_t * __vout_Create( vlc_object_t *p_parent,
         /* Make sure the thread is destroyed */
         p_vout->b_die = VLC_TRUE;
 
-        if( p_vout->p_text_renderer_module )
-        {
-            module_Unneed( p_vout, p_vout->p_text_renderer_module );
-        }
         vlc_thread_join( p_vout );
 
         vlc_object_detach( p_vout );
@@ -1127,18 +1112,8 @@ static void EndThread( vout_thread_t *p_vout )
         }
     }
 
-    /* Destroy all remaining subpictures */
-    for( i_index = 0; i_index < VOUT_MAX_SUBPICTURES; i_index++ )
-    {
-        if( p_vout->p_subpicture[i_index].i_status != FREE_SUBPICTURE )
-        {
-            vout_DestroySubPicture( p_vout,
-                                    &p_vout->p_subpicture[i_index] );
-        }
-    }
-
-    if( p_vout->p_text_renderer_module )
-        module_Unneed( p_vout, p_vout->p_text_renderer_module );
+    /* Destroy subpicture unit */
+    vout_DestroySPU( p_vout );
 
     /* Destroy translation tables */
     p_vout->pf_end( p_vout );