[vlc-devel] [PATCH 15/15] filter_chain: add a default implementation for the video_allocator
Steve Lhomme
robux4 at ycbcr.xyz
Fri Jul 19 15:32:19 CEST 2019
At some point NULL should not be allowed there.
---
src/misc/filter_chain.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 95b3a88b5b..e2ef604451 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -166,6 +166,12 @@ void filter_chain_Reset( filter_chain_t *p_chain, const es_format_t *p_fmt_in,
}
}
+static picture_t *DefaultNewPicture( filter_t *filter, void *opaque )
+{
+ (void) opaque;
+ return picture_NewFromFormat( &filter->fmt_out.video );
+}
+
static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
const char *name, const char *capability, config_chain_t *cfg,
const es_format_t *fmt_in, const es_format_t *fmt_out )
@@ -218,6 +224,12 @@ static filter_t *filter_chain_AppendInner( filter_chain_t *chain,
if( filter->p_module == NULL )
goto error;
+ if ( filter->video_allocator.buffer_new == NULL )
+ {
+ // legacy filters not setting a callback to create their output pictures
+ filter->video_allocator.buffer_new = DefaultNewPicture;
+ }
+
if( filter->b_allow_fmt_out_change )
{
es_format_Clean( &chain->fmt_out );
--
2.17.1
More information about the vlc-devel
mailing list