[vlc-devel] [PATCH v1 15/33] filter_chain: remove dead code
Steve Lhomme
robux4 at ycbcr.xyz
Fri Sep 25 16:46:51 CEST 2020
We don't use pending pictures anymore as they are all pushed during a call to
filter_chain_VideoFilterInto (and thus filter_chain_VideoFilter).
In the video output only the static filters are likely to push multiple
pictures in a single call. But they are put in a FIFO and treated one by one in
a loop later.
In other cases the number of output may multiply in a single call, in the worst
case scenario. But they are not time sensitive cases like the video output.
---
src/misc/filter_chain.c | 36 ------------------------------------
1 file changed, 36 deletions(-)
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 083ed165f62..08ab8ddc835 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -39,7 +39,6 @@ typedef struct chained_filter_t
/* Private filter chain data (shhhh!) */
struct chained_filter_t *prev, *next;
vlc_mouse_t *mouse;
- vlc_picture_chain_t pending;
} chained_filter_t;
/* */
@@ -61,8 +60,6 @@ struct filter_chain_t
/**
* Local prototypes
*/
-static void FilterDeletePictures( vlc_picture_chain_t * );
-
static filter_chain_t *filter_chain_NewInner( vlc_object_t *obj,
const char *cap, const char *conv_cap, bool fmt_out_change,
enum es_format_category_e cat )
@@ -276,7 +273,6 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
if( likely(mouse != NULL) )
vlc_mouse_Init( mouse );
chained->mouse = mouse;
- vlc_picture_chain_Init( &chained->pending );
msg_Dbg( chain->obj, "Filter '%s' (%p) appended to chain",
(name != NULL) ? name : module_get_name(filter->p_module, false),
@@ -333,7 +329,6 @@ void filter_chain_DeleteFilter( filter_chain_t *chain, filter_t *filter )
module_unneed( filter, filter->p_module );
msg_Dbg( chain->obj, "Filter %p removed from chain", (void *)filter );
- FilterDeletePictures( &chained->pending );
free( chained->mouse );
es_format_Clean( &filter->fmt_out );
@@ -431,24 +426,6 @@ static int PushFilteredPic(struct vlc_video_sink *sink, picture_t *pic)
return VLC_SUCCESS;
}
-static picture_t *FilterChainVideoFilter( chained_filter_t *f, picture_t *p_pic )
-{
- for( ; f != NULL; f = f->next )
- {
- filter_t *p_filter = &f->filter;
- p_pic = p_filter->pf_video_filter( p_filter, p_pic );
- if( !p_pic )
- break;
- if( !vlc_picture_chain_IsEmpty( &f->pending ) )
- {
- msg_Warn( p_filter, "dropping pictures" );
- FilterDeletePictures( &f->pending );
- }
- f->pending = picture_GetAndResetChain( p_pic );
- }
- return p_pic;
-}
-
static int FilterChainLastPush(struct vlc_video_sink *sink, picture_t *p_pic)
{
picture_t **outpic = sink->sys;
@@ -534,9 +511,6 @@ void filter_chain_VideoFlush( filter_chain_t *p_chain )
for( chained_filter_t *f = p_chain->first; f != NULL; f = f->next )
{
filter_t *p_filter = &f->filter;
-
- FilterDeletePictures( &f->pending );
-
filter_Flush( p_filter );
}
}
@@ -591,13 +565,3 @@ int filter_chain_MouseFilter( filter_chain_t *p_chain, vlc_mouse_t *p_dst, const
*p_dst = current;
return VLC_SUCCESS;
}
-
-/* Helpers */
-static void FilterDeletePictures( vlc_picture_chain_t *pictures )
-{
- while( !vlc_picture_chain_IsEmpty( pictures ) )
- {
- picture_t *next = vlc_picture_chain_PopFront( pictures );
- picture_Release( next );
- }
-}
--
2.26.2
More information about the vlc-devel
mailing list