#define MPS_WEIGHT_NIT 999
#define MPS_WEIGHT_BAT 999
#define MPS_WEIGHT_VCT 999
+#define MPS_WEIGHT_STT 999
#define MPS_WEIGHT_EIT 999
#define MPS_WEIGHT_PMT 998
#define MPS_WEIGHT_PCR 997
(struct mpegts_table *mt, const uint8_t *ptr, int len, int tableid);
int atsc_vct_callback
(struct mpegts_table *mt, const uint8_t *ptr, int len, int tableid);
+int atsc_stt_callback
+ (struct mpegts_table *mt, const uint8_t *ptr, int len, int tableid);
void psi_tables_install
(mpegts_input_t *mi, mpegts_mux_t *mm, dvb_fe_delivery_system_t delsys);
return dvb_table_end((mpegts_psi_table_t *)mt, st, sect);
}
+/*
+ * ATSC STT processing
+ */
+int
+atsc_stt_callback
+ (mpegts_table_t *mt, const uint8_t *ptr, int len, int tableid)
+{
+ int r, sect, last, ver, extraid;
+ uint32_t systemtime, gps_utc_offset;
+ int is_dst;
+ mpegts_table_state_t *st = NULL;
+
+ /* Validate */
+ if (tableid != DVB_ATSC_STT_BASE) return -1;
+
+ /* Extra ID */
+ extraid = ptr[0] << 8 | ptr[1];
+
+ /* Begin */
+ r = dvb_table_begin(mt, ptr, len, tableid, extraid, 7,
+ &st, §, &last, &ver);
+ if (r != 1) return r;
+
+ /* Parse fields */
+ systemtime = ptr[6] << 24 | ptr[7] << 16 | ptr[8] << 8 | ptr[9];
+ gps_utc_offset = ptr[10];
+ is_dst = ptr[11] >> 7;
+
+ tvhdebug("stt", "system_time %d, gps_utc_offset %d, is DST %d",
+ systemtime, gps_utc_offset, is_dst);
+
+ return dvb_table_end(mt, st, sect);
+}
/*
* DVB BAT processing
mpegts_table_add(mm, DVB_VCT_C_BASE, DVB_VCT_MASK, atsc_vct_callback,
NULL, "vct", MT_QUICKREQ | MT_CRC | MT_RECORD,
DVB_VCT_PID, MPS_WEIGHT_VCT);
+ mpegts_table_add(mm, DVB_ATSC_STT_BASE, DVB_ATSC_STT_MASK, atsc_stt_callback,
+ NULL, "stt", MT_QUICKREQ | MT_CRC | MT_RECORD,
+ DVB_ATSC_STT_PID, MPS_WEIGHT_STT);
}
static void
mpegts_table_add(mm, DVB_VCT_T_BASE, DVB_VCT_MASK, atsc_vct_callback,
NULL, "vct", MT_QUICKREQ | MT_CRC | MT_RECORD,
DVB_VCT_PID, MPS_WEIGHT_VCT);
+ mpegts_table_add(mm, DVB_ATSC_STT_BASE, DVB_ATSC_STT_MASK, atsc_stt_callback,
+ NULL, "stt", MT_QUICKREQ | MT_CRC | MT_RECORD,
+ DVB_ATSC_STT_PID, MPS_WEIGHT_STT);
}
void