]> git.sesse.net Git - vlc/commitdiff
Core changes needed to add asa support. By equinox, part of Google
authorSigmund Augdal Helberg <sigmunau@videolan.org>
Fri, 25 Jan 2008 21:23:56 +0000 (21:23 +0000)
committerSigmund Augdal Helberg <sigmunau@videolan.org>
Fri, 25 Jan 2008 21:23:56 +0000 (21:23 +0000)
Summer of Code 2007

include/vlc_vout.h
src/video_output/vout_subpictures.c

index 69da3ffbb55aa8a740b57e823929c7a3b2d3c448..30baf2517827185f3b73f55ae10d33f482ed1e96 100644 (file)
@@ -284,6 +284,10 @@ struct subpicture_t
                                                 video_format_t *, picture_t * );
     void ( *pf_destroy_region ) ( vlc_object_t *, subpicture_region_t * );
 
+    void ( *pf_pre_render ) ( video_format_t *, spu_t *, subpicture_t *, mtime_t );
+    subpicture_region_t * ( *pf_update_regions ) ( video_format_t *, spu_t *,
+                                                   subpicture_t *, mtime_t );
+
     /** Private data - the subtitle plugin might want to put stuff here to
      * keep track of the subpicture */
     subpicture_sys_t *p_sys;                              /* subpicture data */
index 7110ee12b289520dcd5eafbeba9c54973d09bbef..3b7ff37c35e6a1716a5e63d217782a768d904541 100644 (file)
@@ -519,10 +519,21 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
 {
     int i_source_video_width;
     int i_source_video_height;
+    subpicture_t *p_subpic_v = p_subpic;
 
     /* Get lock */
     vlc_mutex_lock( &p_spu->subpicture_lock );
 
+    for( p_subpic_v = p_subpic;
+            p_subpic_v != NULL && p_subpic_v->i_status != FREE_SUBPICTURE;
+            p_subpic_v = p_subpic_v->p_next )
+    {
+        if( p_subpic_v->pf_pre_render )
+        {
+            p_subpic_v->pf_pre_render( p_fmt, p_spu, p_subpic_v, mdate() );
+        }
+    }
+
     if( i_scale_width_orig <= 0 )
         i_scale_width_orig = 1;
     if( i_scale_height_orig <= 0 )
@@ -534,7 +545,7 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
     /* Check i_status again to make sure spudec hasn't destroyed the subpic */
     while( ( p_subpic != NULL ) && ( p_subpic->i_status != FREE_SUBPICTURE ) )
     {
-        subpicture_region_t *p_region = p_subpic->p_region;
+        subpicture_region_t *p_region;
         int pi_scale_width[ SCALE_SIZE ];
         int pi_scale_height[ SCALE_SIZE ];
         int pi_subpic_x[ SCALE_SIZE ];
@@ -554,6 +565,18 @@ void spu_RenderSubpictures( spu_t *p_spu, video_format_t *p_fmt,
         for( k = 0; k < SCALE_SIZE ; k++ )
             pi_subpic_x[ k ] = p_subpic->i_x;
 
+        if( p_subpic->pf_update_regions )
+        {
+            if ( p_subpic->p_region ) {
+                spu_DestroyRegion( p_spu, p_subpic->p_region );
+            }
+            p_subpic->p_region = p_region = p_subpic->pf_update_regions( p_fmt, p_spu, p_subpic, mdate() );
+        }
+        else
+        {
+            p_region = p_subpic->p_region;
+        }
+
         /* Load the blending module */
         if( !p_spu->p_blend && p_region )
         {