[vlc-devel] [PATCH 14/18] filter_chain: pass the ES category to use

Steve Lhomme robux4 at videolabs.io
Wed Jul 5 17:00:28 CEST 2017


This will avoid creating ES with UNKNOWN_ES
---
 include/vlc_filter.h                |  4 ++--
 src/misc/filter_chain.c             | 13 +++++++------
 src/video_output/vout_subpictures.c |  4 ++--
 3 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/include/vlc_filter.h b/include/vlc_filter.h
index a0b6bb2945..d26cad53a9 100644
--- a/include/vlc_filter.h
+++ b/include/vlc_filter.h
@@ -298,9 +298,9 @@ typedef struct filter_chain_t filter_chain_t;
  * \param psz_capability vlc capability of filters in filter chain
  * \return pointer to a filter chain
  */
-filter_chain_t * filter_chain_New( vlc_object_t *, const char * )
+filter_chain_t * filter_chain_New( vlc_object_t *, const char *, enum es_format_category_e )
 VLC_USED;
-#define filter_chain_New( a, b ) filter_chain_New( VLC_OBJECT( a ), b )
+#define filter_chain_New( a, b, c ) filter_chain_New( VLC_OBJECT( a ), b, c )
 
 /**
  * Creates a new video filter chain.
diff --git a/src/misc/filter_chain.c b/src/misc/filter_chain.c
index 741a63c9ad..02e389d4ef 100644
--- a/src/misc/filter_chain.c
+++ b/src/misc/filter_chain.c
@@ -71,7 +71,7 @@ static void FilterDeletePictures( picture_t * );
 
 static filter_chain_t *filter_chain_NewInner( const filter_owner_t *callbacks,
     const char *cap, const char *conv_cap, bool fmt_out_change,
-    const filter_owner_t *owner )
+    const filter_owner_t *owner, enum es_format_category_e cat )
 {
     assert( callbacks != NULL && callbacks->sys != NULL );
     assert( cap != NULL );
@@ -85,8 +85,8 @@ static filter_chain_t *filter_chain_NewInner( const filter_owner_t *callbacks,
         chain->owner = *owner;
     chain->first = NULL;
     chain->last = NULL;
-    es_format_Init( &chain->fmt_in, UNKNOWN_ES, 0 );
-    es_format_Init( &chain->fmt_out, UNKNOWN_ES, 0 );
+    es_format_Init( &chain->fmt_in, cat, 0 );
+    es_format_Init( &chain->fmt_out, cat, 0 );
     chain->length = 0;
     chain->b_allow_fmt_out_change = fmt_out_change;
     chain->filter_cap = cap;
@@ -98,13 +98,14 @@ static filter_chain_t *filter_chain_NewInner( const filter_owner_t *callbacks,
 /**
  * Filter chain initialisation
  */
-filter_chain_t *filter_chain_New( vlc_object_t *obj, const char *cap )
+filter_chain_t *filter_chain_New( vlc_object_t *obj, const char *cap,
+                                  enum es_format_category_e cat )
 {
     filter_owner_t callbacks = {
         .sys = obj,
     };
 
-    return filter_chain_NewInner( &callbacks, cap, NULL, false, NULL );
+    return filter_chain_NewInner( &callbacks, cap, NULL, false, NULL, cat );
 }
 
 /** Chained filter picture allocator function */
@@ -141,7 +142,7 @@ filter_chain_t *filter_chain_NewVideo( vlc_object_t *obj, bool allow_change,
     };
 
     return filter_chain_NewInner( &callbacks, "video filter",
-                                  "video converter", allow_change, owner );
+                                  "video converter", allow_change, owner, VIDEO_ES );
 }
 
 /**
diff --git a/src/video_output/vout_subpictures.c b/src/video_output/vout_subpictures.c
index 62ac580fb4..acc0173518 100644
--- a/src/video_output/vout_subpictures.c
+++ b/src/video_output/vout_subpictures.c
@@ -1286,8 +1286,8 @@ spu_t *spu_Create(vlc_object_t *object, vout_thread_t *vout)
     sys->filter_chain_update = NULL;
     vlc_mutex_init(&sys->source_chain_lock);
     vlc_mutex_init(&sys->filter_chain_lock);
-    sys->source_chain = filter_chain_New(spu, "sub source");
-    sys->filter_chain = filter_chain_New(spu, "sub filter");
+    sys->source_chain = filter_chain_New(spu, "sub source", SPU_ES);
+    sys->filter_chain = filter_chain_New(spu, "sub filter", SPU_ES);
 
     /* Load text and scale module */
     sys->text = SpuRenderCreateAndLoadText(spu);
-- 
2.12.1



More information about the vlc-devel mailing list