[vlc-commits] demux: ts: add debuging for arib descriptors

Francois Cartegnie git at videolan.org
Sun Mar 6 23:37:23 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Mar  6 23:21:04 2016 +0100| [b6a3dd5c4661f73f91d07f12fbb62c070ad1574f] | committer: Francois Cartegnie

demux: ts: add debuging for arib descriptors

>From untranslated TR-B14

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b6a3dd5c4661f73f91d07f12fbb62c070ad1574f
---

 modules/demux/mpeg/ts_psi.c     |   48 +++++++++++++++++++++++----------------
 modules/demux/mpeg/ts_strings.h |   21 +++++++++++++++++
 2 files changed, 49 insertions(+), 20 deletions(-)

diff --git a/modules/demux/mpeg/ts_psi.c b/modules/demux/mpeg/ts_psi.c
index 34d3334..ac14b79 100644
--- a/modules/demux/mpeg/ts_psi.c
+++ b/modules/demux/mpeg/ts_psi.c
@@ -265,27 +265,28 @@ static void ParsePMTRegistrations( demux_t *p_demux, const dvbpsi_descriptor_t
         if( p_dr->i_tag < 0x40 )
             continue;
 
-        switch(p_dr->i_tag)
+        if( registration_type == TS_PMT_REGISTRATION_NONE )
         {
-            case 0x88: /* EACEM Simulcast HD Logical channels ordering */
-                if( registration_type == TS_PMT_REGISTRATION_NONE )
-                    msg_Dbg( p_demux, PMT_DESC_PREFIX "EACEM Simulcast HD" );
-                    /* TODO: apply visibility flags */
-                break;
-
-            case 0xC1:
-                if( registration_type == TS_PMT_REGISTRATION_ARIB )
-                    msg_Dbg( p_demux, PMT_DESC_PREFIX "Digital copy control (0xC1)" );
-                break;
-
-            case 0xDE:
-                if( registration_type == TS_PMT_REGISTRATION_ARIB )
-                    msg_Dbg( p_demux, PMT_DESC_PREFIX "Content availability (0xDE)" );
-                break;
+            switch(p_dr->i_tag)
+            {
+                case 0x88: /* EACEM Simulcast HD Logical channels ordering */
+                    if( registration_type == TS_PMT_REGISTRATION_NONE )
+                        msg_Dbg( p_demux, PMT_DESC_PREFIX "EACEM Simulcast HD" );
+                        /* TODO: apply visibility flags */
+                    break;
 
-            default:
+                default:
+                    msg_Dbg( p_demux, PMT_DESC_PREFIX "Unknown Private (0x%x)", p_dr->i_tag );
+                    break;
+            }
+        }
+        else if( registration_type == TS_PMT_REGISTRATION_ARIB )
+        {
+            const char *psz_desc = ARIB_B10_Get_PMT_Descriptor_Description( p_dr->i_tag );
+            if( psz_desc )
+                msg_Dbg( p_demux, PMT_DESC_PREFIX "%s (0x%x)", psz_desc, p_dr->i_tag );
+            else
                 msg_Dbg( p_demux, PMT_DESC_PREFIX "Unknown Private (0x%x)", p_dr->i_tag );
-                break;
         }
     }
 
@@ -1471,11 +1472,18 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
         msg_Dbg( p_demux, "  * pid=%d type=0x%x %s",
                  p_dvbpsies->i_pid, p_dvbpsies->i_type, psz_typedesc );
 
+        /* PMT element/component descriptors */
         for( dvbpsi_descriptor_t *p_dr = p_dvbpsies->p_first_descriptor;
              p_dr != NULL; p_dr = p_dr->p_next )
         {
-            msg_Dbg( p_demux, "    - ES descriptor tag 0x%x",
-                     p_dr->i_tag );
+            const char *psz_desc = NULL;
+            if( registration_type == TS_PMT_REGISTRATION_ARIB )
+                psz_desc = ARIB_B10_Get_PMT_Descriptor_Description( p_dr->i_tag );
+
+            if( psz_desc )
+                msg_Dbg( p_demux, "    - ES descriptor %s 0x%x", psz_desc, p_dr->i_tag );
+            else
+                msg_Dbg( p_demux, "    - ES descriptor tag 0x%x", p_dr->i_tag );
         }
 
         const bool b_pid_inuse = ( pespid->type == TYPE_PES );
diff --git a/modules/demux/mpeg/ts_strings.h b/modules/demux/mpeg/ts_strings.h
index 5259c4c..efbbd8f 100644
--- a/modules/demux/mpeg/ts_strings.h
+++ b/modules/demux/mpeg/ts_strings.h
@@ -156,4 +156,25 @@ static const char *ISO13818_1_Get_Descriptor_Description(uint8_t i_desc)
         return ISO13818_1_other_descs[1];
 }
 
+/* From ARIB TR-B14 */
+static const struct
+{
+    uint8_t id;
+    const char *psz_desc;
+} ARIB_B10_PMT_Descriptors_descs[5] = {
+    { 0xC1, "Digital copy control" },
+    { 0xDE, "Content availability" },
+    { 0xF6, "Access Control" },
+    { 0xFC, "Emergency Information" },
+    { 0xFD, "Source Coding" },
+};
+
+static const char *ARIB_B10_Get_PMT_Descriptor_Description(uint8_t i_desc)
+{
+    for(uint8_t i=0; i<5; i++)
+        if(ARIB_B10_PMT_Descriptors_descs[i].id == i_desc)
+            return ARIB_B10_PMT_Descriptors_descs[i].psz_desc;
+    return NULL;
+}
+
 #endif



More information about the vlc-commits mailing list