[vlc-commits] transcode: video: move blender to id

Francois Cartegnie git at videolan.org
Mon Jul 9 16:15:49 CEST 2018


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jul  2 15:50:33 2018 +0200| [72a5bcb0dfd43fea700c50ccc27dfd2fe9345592] | committer: Francois Cartegnie

transcode: video: move blender to id

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=72a5bcb0dfd43fea700c50ccc27dfd2fe9345592
---

 modules/stream_out/transcode/transcode.c |  2 --
 modules/stream_out/transcode/transcode.h |  2 +-
 modules/stream_out/transcode/video.c     | 13 +++++++++----
 3 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/modules/stream_out/transcode/transcode.c b/modules/stream_out/transcode/transcode.c
index e2cf0cf17c..6e42a3db90 100644
--- a/modules/stream_out/transcode/transcode.c
+++ b/modules/stream_out/transcode/transcode.c
@@ -402,7 +402,6 @@ static int Open( vlc_object_t *p_this )
 
     /* Subpictures transcoding parameters */
     p_sys->p_spu = NULL;
-    p_sys->p_spu_blend = NULL;
     p_sys->psz_senc = NULL;
     p_sys->p_spu_cfg = NULL;
     p_sys->i_scodec = 0;
@@ -472,7 +471,6 @@ static void Close( vlc_object_t * p_this )
     free( p_sys->psz_senc );
 
     if( p_sys->p_spu ) spu_Destroy( p_sys->p_spu );
-    if( p_sys->p_spu_blend ) filter_DeleteBlend( p_sys->p_spu_blend );
 
     free( p_sys );
 }
diff --git a/modules/stream_out/transcode/transcode.h b/modules/stream_out/transcode/transcode.h
index cc62dfaa8a..ca7d026fca 100644
--- a/modules/stream_out/transcode/transcode.h
+++ b/modules/stream_out/transcode/transcode.h
@@ -102,7 +102,6 @@ typedef struct
     bool            b_soverlay;
     config_chain_t  *p_spu_cfg;
     spu_t           *p_spu;
-    filter_t        *p_spu_blend;
     unsigned int     i_spu_width; /* render width */
     unsigned int     i_spu_height;
 
@@ -151,6 +150,7 @@ struct sout_stream_id_sys_t
          {
              filter_chain_t  *p_f_chain; /**< Video filters */
              filter_chain_t  *p_uf_chain; /**< User-specified video filters */
+             filter_t        *p_spu_blender;
              video_format_t  fmt_input_video;
              video_format_t  video_dec_out; /* only rw from pf_vout_format_update() */
          };
diff --git a/modules/stream_out/transcode/video.c b/modules/stream_out/transcode/video.c
index 0cb845b569..8922581596 100644
--- a/modules/stream_out/transcode/video.c
+++ b/modules/stream_out/transcode/video.c
@@ -715,6 +715,8 @@ void transcode_video_close( sout_stream_t *p_stream,
         filter_chain_Delete( id->p_f_chain );
     if( id->p_uf_chain )
         filter_chain_Delete( id->p_uf_chain );
+    if( id->p_spu_blender )
+        filter_DeleteBlend( id->p_spu_blender );
 }
 
 static void OutputFrame( sout_stream_t *p_stream, picture_t *p_pic, sout_stream_id_sys_t *id, block_t **out )
@@ -755,10 +757,10 @@ static void OutputFrame( sout_stream_t *p_stream, picture_t *p_pic, sout_stream_
                     p_pic = p_tmp;
                 }
             }
-            if( unlikely( !p_sys->p_spu_blend ) )
-                p_sys->p_spu_blend = filter_NewBlend( VLC_OBJECT( p_sys->p_spu ), &fmt );
-            if( likely( p_sys->p_spu_blend ) )
-                picture_BlendSubpicture( p_pic, p_sys->p_spu_blend, p_subpic );
+            if( unlikely( !id->p_spu_blender ) )
+                id->p_spu_blender = filter_NewBlend( VLC_OBJECT( p_sys->p_spu ), &fmt );
+            if( likely( id->p_spu_blender ) )
+                picture_BlendSubpicture( p_pic, id->p_spu_blender, p_subpic );
             subpicture_Delete( p_subpic );
         }
     }
@@ -833,6 +835,9 @@ int transcode_video_process( sout_stream_t *p_stream, sout_stream_id_sys_t *id,
                 if( id->p_uf_chain )
                     filter_chain_Delete( id->p_uf_chain );
                 id->p_uf_chain = NULL;
+                if( id->p_spu_blender )
+                    filter_DeleteBlend( id->p_spu_blender );
+                id->p_spu_blender = NULL;
 
                 video_format_Clean( &id->fmt_input_video );
             }



More information about the vlc-commits mailing list