[vlc-commits] demux: ts: add defines for SI pids

Francois Cartegnie git at videolan.org
Thu Mar 3 18:16:16 CET 2016


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Feb 29 16:11:40 2016 +0100| [ff618fd543aea259fc5de67a9d91abc49f2eec69] | committer: Francois Cartegnie

demux: ts: add defines for SI pids

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

 modules/demux/mpeg/ts.c         |   24 ++++++++++++------------
 modules/demux/mpeg/ts.h         |    2 ++
 modules/demux/mpeg/ts_psi_eit.c |   10 +++++-----
 modules/demux/mpeg/ts_psi_eit.h |   20 ++++++++++++--------
 4 files changed, 31 insertions(+), 25 deletions(-)

diff --git a/modules/demux/mpeg/ts.c b/modules/demux/mpeg/ts.c
index e18e5b9..306e4aa 100644
--- a/modules/demux/mpeg/ts.c
+++ b/modules/demux/mpeg/ts.c
@@ -426,24 +426,24 @@ static int Open( vlc_object_t *p_this )
 
     if( p_sys->b_dvb_meta )
     {
-          if( !PIDSetup( p_demux, TYPE_SDT, GetPID(p_sys, 0x11), NULL ) ||
-              !PIDSetup( p_demux, TYPE_EIT, GetPID(p_sys, 0x12), NULL ) ||
-              !PIDSetup( p_demux, TYPE_TDT, GetPID(p_sys, 0x14), NULL ) )
+          if( !PIDSetup( p_demux, TYPE_SDT, GetPID(p_sys, TS_PID_SDT), NULL ) ||
+              !PIDSetup( p_demux, TYPE_EIT, GetPID(p_sys, TS_PID_EIT), NULL ) ||
+              !PIDSetup( p_demux, TYPE_TDT, GetPID(p_sys, TS_PID_TDT), NULL ) )
           {
-              PIDRelease( p_demux, GetPID(p_sys, 0x11) );
-              PIDRelease( p_demux, GetPID(p_sys, 0x12) );
-              PIDRelease( p_demux, GetPID(p_sys, 0x14) );
+              PIDRelease( p_demux, GetPID(p_sys, TS_PID_SDT) );
+              PIDRelease( p_demux, GetPID(p_sys, TS_PID_EIT) );
+              PIDRelease( p_demux, GetPID(p_sys, TS_PID_TDT) );
               p_sys->b_dvb_meta = false;
           }
           else
           {
-              VLC_DVBPSI_DEMUX_TABLE_INIT(p_demux, GetPID(p_sys, 0x11));
-              VLC_DVBPSI_DEMUX_TABLE_INIT(p_demux, GetPID(p_sys, 0x12));
-              VLC_DVBPSI_DEMUX_TABLE_INIT(p_demux, GetPID(p_sys, 0x14));
+              VLC_DVBPSI_DEMUX_TABLE_INIT(p_demux, GetPID(p_sys, TS_PID_SDT));
+              VLC_DVBPSI_DEMUX_TABLE_INIT(p_demux, GetPID(p_sys, TS_PID_EIT));
+              VLC_DVBPSI_DEMUX_TABLE_INIT(p_demux, GetPID(p_sys, TS_PID_TDT));
               if( p_sys->b_access_control &&
-                  ( SetPIDFilter( p_sys, GetPID(p_sys, 0x11), true ) ||
-                    SetPIDFilter( p_sys, GetPID(p_sys, 0x14), true ) ||
-                    SetPIDFilter( p_sys, GetPID(p_sys, 0x12), true ) )
+                  ( SetPIDFilter( p_sys, GetPID(p_sys, TS_PID_SDT), true ) ||
+                    SetPIDFilter( p_sys, GetPID(p_sys, TS_PID_TDT), true ) ||
+                    SetPIDFilter( p_sys, GetPID(p_sys, TS_PID_EIT), true ) )
                  )
                      p_sys->b_access_control = false;
           }
diff --git a/modules/demux/mpeg/ts.h b/modules/demux/mpeg/ts.h
index b58ad2b..0e8777d 100644
--- a/modules/demux/mpeg/ts.h
+++ b/modules/demux/mpeg/ts.h
@@ -30,6 +30,8 @@ typedef struct csa_t csa_t;
 
 #define TS_USER_PMT_NUMBER (0)
 
+#define TS_PSI_PAT_PID 0x00
+
 typedef enum arib_modes_e
 {
     ARIBMODE_AUTO = -1,
diff --git a/modules/demux/mpeg/ts_psi_eit.c b/modules/demux/mpeg/ts_psi_eit.c
index e059336..4829cc6 100644
--- a/modules/demux/mpeg/ts_psi_eit.c
+++ b/modules/demux/mpeg/ts_psi_eit.c
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * ts_psi_eit.c : TS demuxer EIT handling
+ * ts_psi_eit.c : TS demuxer SI handling
  *****************************************************************************
  * Copyright (C) 2014-2016 - VideoLAN Authors
  *
@@ -351,11 +351,11 @@ static void EITCallBack( demux_t *p_demux,
             i_start += timezone; // FIXME: what about DST?
             i_tot_time += timezone;
 
-            if( p_evt->i_running_status == TS_PSI_RUNSTATUS_UNDEFINED &&
+            if( p_evt->i_running_status == TS_SI_RUNSTATUS_UNDEFINED &&
                 (i_start - 5 < i_tot_time &&
                  i_tot_time < i_start + i_duration + 5) )
             {
-                p_evt->i_running_status = TS_PSI_RUNSTATUS_RUNNING;
+                p_evt->i_running_status = TS_SI_RUNSTATUS_RUNNING;
                 msg_Dbg( p_demux, "  EIT running status undefined -> running" );
             }
         }
@@ -478,7 +478,7 @@ static void EITCallBack( demux_t *p_demux,
                               *psz_extra ? psz_extra : NULL, i_min_age );
 
         /* Update "now playing" field */
-        if( p_evt->i_running_status == TS_PSI_RUNSTATUS_RUNNING && i_start > 0  && psz_name && psz_text )
+        if( p_evt->i_running_status == TS_SI_RUNSTATUS_RUNNING && i_start > 0  && psz_name && psz_text )
             vlc_epg_SetCurrent( p_epg, i_start );
 
         free( psz_name );
@@ -559,7 +559,7 @@ static void PSINewTableCallBack( dvbpsi_t *h, uint8_t i_table_id,
             msg_Err( p_demux, "PSINewTableCallback: failed attaching EITCallback" );
     }
     else if( GetPID(p_sys, 0x11)->u.p_psi->i_version != -1 &&
-            (i_table_id == TS_PSI_TDT_TABLE_ID || i_table_id == TS_PSI_TOT_TABLE_ID) )
+            (i_table_id == TS_SI_TDT_TABLE_ID || i_table_id == TS_SI_TOT_TABLE_ID) )
     {
          msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
                  i_table_id, i_table_id, i_extension, i_extension );
diff --git a/modules/demux/mpeg/ts_psi_eit.h b/modules/demux/mpeg/ts_psi_eit.h
index db56468..1a23752 100644
--- a/modules/demux/mpeg/ts_psi_eit.h
+++ b/modules/demux/mpeg/ts_psi_eit.h
@@ -1,5 +1,5 @@
 /*****************************************************************************
- * ts_psi_eit.h : TS demuxer EIT handling
+ * ts_psi_eit.h : TS demuxer SI handling
  *****************************************************************************
  * Copyright (C) 2014-2016 - VideoLAN Authors
  *
@@ -21,14 +21,18 @@
 
 //#define PSI_DEBUG_EIT
 
-#define TS_PSI_TDT_TABLE_ID     0x70
-#define TS_PSI_TOT_TABLE_ID     0x73
+#define TS_SI_SDT_PID 0x11
+#define TS_SI_EIT_PID 0x12
+#define TS_SI_TDT_PID 0x14
 
-#define TS_PSI_RUNSTATUS_UNDEFINED 0x00
-#define TS_PSI_RUNSTATUS_STOPPED   0x01
-#define TS_PSI_RUNSTATUS_STARTING  0x02
-#define TS_PSI_RUNSTATUS_PAUSING   0x03
-#define TS_PSI_RUNSTATUS_RUNNING   0x04
+#define TS_SI_TDT_TABLE_ID     0x70
+#define TS_SI_TOT_TABLE_ID     0x73
+
+#define TS_SI_RUNSTATUS_UNDEFINED 0x00
+#define TS_SI_RUNSTATUS_STOPPED   0x01
+#define TS_SI_RUNSTATUS_STARTING  0x02
+#define TS_SI_RUNSTATUS_PAUSING   0x03
+#define TS_SI_RUNSTATUS_RUNNING   0x04
 
 bool ts_attach_PSINewTableCallBack( dvbpsi_t *p_handle, void * );
 



More information about the vlc-commits mailing list