[vlc-devel] [PATCH v2 16/20] filters: drain filter chains after the regular picture filtering

Steve Lhomme robux4 at ycbcr.xyz
Wed Oct 14 14:39:16 CEST 2020


---
 modules/stream_out/mosaic_bridge.c   | 13 +++++++++++++
 modules/stream_out/sdi/SDIStream.cpp | 12 +++++++++++-
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/modules/stream_out/mosaic_bridge.c b/modules/stream_out/mosaic_bridge.c
index 74e780566cd..38bd6c714c1 100644
--- a/modules/stream_out/mosaic_bridge.c
+++ b/modules/stream_out/mosaic_bridge.c
@@ -591,6 +591,19 @@ static void decoder_queue_video( decoder_t *p_dec, picture_t *p_pic )
     vlc_global_lock( VLC_MOSAIC_MUTEX );
     vlc_picture_chain_Append( &p_es->pictures, p_new_pic );
     vlc_global_unlock( VLC_MOSAIC_MUTEX );
+
+    if( p_sys->p_vf2 )
+    {
+        p_new_pic = filter_chain_VideoDrain( p_sys->p_vf2 );
+        while ( p_new_pic != NULL )
+        {
+            /* push the picture in the mosaic-struct structure */
+            vlc_global_lock( VLC_MOSAIC_MUTEX );
+            vlc_picture_chain_Append( &p_es->pictures, p_new_pic );
+            vlc_global_unlock( VLC_MOSAIC_MUTEX );
+            p_new_pic = filter_chain_VideoDrain( p_sys->p_vf2 );
+        }
+    }
 }
 
 static int Send( sout_stream_t *p_stream, void *id, block_t *p_buffer )
diff --git a/modules/stream_out/sdi/SDIStream.cpp b/modules/stream_out/sdi/SDIStream.cpp
index ce4588d28ce..55d66c575b9 100644
--- a/modules/stream_out/sdi/SDIStream.cpp
+++ b/modules/stream_out/sdi/SDIStream.cpp
@@ -584,9 +584,19 @@ void VideoDecodedStream::Output(picture_t *p_pic)
     }
 
     if(p_filters_chain)
-        p_pic = filter_chain_VideoFilter(p_filters_chain, p_pic);
+        p_pic = filter_chain_VideoFilter(p_filters_chain, p_pic );
     if(p_pic)
         outputbuffer->Enqueue(p_pic);
+
+    if(p_filters_chain)
+    {
+        p_pic = filter_chain_VideoDrain(p_filters_chain);
+        while (p_pic)
+        {
+            outputbuffer->Enqueue(p_pic);
+            p_pic = filter_chain_VideoDrain(p_filters_chain);
+        }
+    }
 }
 
 void VideoDecodedStream::QueueCC(block_t *p_block)
-- 
2.26.2



More information about the vlc-devel mailing list