[vlc-devel] [PATCH 1/8] vlc_es: store the category as an enum es_format_category_e

Steve Lhomme robux4 at videolabs.io
Wed Jul 5 17:09:14 CEST 2017


---
 include/vlc_es.h                                   | 24 +++++++++++-----------
 .../demux/smooth/playlist/ForgedInitSegment.hpp    |  3 ++-
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/include/vlc_es.h b/include/vlc_es.h
index bc55bdd1e4..d469c376f7 100644
--- a/include/vlc_es.h
+++ b/include/vlc_es.h
@@ -543,6 +543,17 @@ typedef struct extra_languages_t
         char *psz_description;
 } extra_languages_t;
 
+/** ES Categories */
+enum es_format_category_e
+{
+    UNKNOWN_ES = 0x00,
+    VIDEO_ES,
+    AUDIO_ES,
+    SPU_ES,
+    NAV_ES,
+};
+#define ES_CATEGORY_COUNT (NAV_ES + 1)
+
 /**
  * ES format definition
  */
@@ -552,7 +563,7 @@ typedef struct extra_languages_t
 #define ES_PRIORITY_MIN ES_PRIORITY_NOT_SELECTABLE
 struct es_format_t
 {
-    int             i_cat;              /**< ES category @see es_format_category_e */
+    enum es_format_category_e i_cat;    /**< ES category */
     vlc_fourcc_t    i_codec;            /**< FOURCC value as used in vlc */
     vlc_fourcc_t    i_original_fourcc;  /**< original FOURCC from the container */
 
@@ -593,17 +604,6 @@ struct es_format_t
 
 };
 
-/** ES Categories */
-enum es_format_category_e
-{
-    UNKNOWN_ES = 0x00,
-    VIDEO_ES,
-    AUDIO_ES,
-    SPU_ES,
-    NAV_ES,
-};
-#define ES_CATEGORY_COUNT (NAV_ES + 1)
-
 /**
  * This function will fill all RGB shift from RGB masks.
  */
diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.hpp b/modules/demux/smooth/playlist/ForgedInitSegment.hpp
index 3172c214cb..9dd60bc7e6 100644
--- a/modules/demux/smooth/playlist/ForgedInitSegment.hpp
+++ b/modules/demux/smooth/playlist/ForgedInitSegment.hpp
@@ -23,6 +23,7 @@
 #include "../adaptive/playlist/Segment.h"
 #include "../adaptive/playlist/Inheritables.hpp"
 
+#include <vlc_es.h>
 #include <vlc_codecs.h>
 
 namespace smooth
@@ -64,7 +65,7 @@ namespace smooth
                 WAVEFORMATEX formatex;
                 unsigned width, height;
                 vlc_fourcc_t fourcc;
-                int es_type;
+                enum es_format_category_e es_type;
                 unsigned track_id;
         };
     }
-- 
2.12.1



More information about the vlc-devel mailing list