[dvblast-devel] [PATCH 14/17] mpeg/psi: Add support for descriptor 0x11 (STD descriptor).

Georgi Chorbadzhiyski gf at unixsol.org
Fri Sep 9 23:28:36 CEST 2011


---
 dvb/si_print.h |    1 +
 mpeg/psi.h     |   40 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/dvb/si_print.h b/dvb/si_print.h
index e44a73a..e4afc33 100644
--- a/dvb/si_print.h
+++ b/dvb/si_print.h
@@ -101,6 +101,7 @@ static inline void descs_print(uint8_t *p_descs,
         CASE_DESC(0c)
         CASE_DESC(0e)
         CASE_DESC(10)
+        CASE_DESC(11)
         CASE_DESC_ICONV(40)
         CASE_DESC(41)
         CASE_DESC(43)
diff --git a/mpeg/psi.h b/mpeg/psi.h
index dca6ac2..83f84db 100644
--- a/mpeg/psi.h
+++ b/mpeg/psi.h
@@ -679,6 +679,46 @@ static inline void desc10_print(const uint8_t *p_desc, f_print pf_print,
 }
 
 /*****************************************************************************
+ * Descriptor 0x11: STD descriptor
+ *****************************************************************************/
+#define DESC11_HEADER_SIZE      (DESC_HEADER_SIZE + 1)
+
+static inline void desc11_init(uint8_t *p_desc)
+{
+    desc_set_tag(p_desc, 0x11);
+    desc_set_length(p_desc, DESC11_HEADER_SIZE - DESC_HEADER_SIZE);
+}
+
+static inline void desc11_set_leak_valid_flag(uint8_t *p_desc, bool leak_valid_flag)
+{
+    p_desc[2] = 0xfe | leak_valid_flag;
+}
+
+static inline bool desc11_get_leak_valid_flag(const uint8_t *p_desc)
+{
+    return (p_desc[2] & 0x01) == 0x01;
+}
+
+static inline bool desc11_validate(const uint8_t *p_desc)
+{
+    return desc_get_length(p_desc) >= DESC11_HEADER_SIZE - DESC_HEADER_SIZE;
+}
+
+static inline void desc11_print(const uint8_t *p_desc, f_print pf_print,
+                                void *opaque, print_type_t i_print_type)
+{
+    switch (i_print_type) {
+    case PRINT_XML:
+        pf_print(opaque, "<STD_DESC leak_valid_flag=\"%u\"/>",
+                 desc11_get_leak_valid_flag(p_desc));
+        break;
+    default:
+        pf_print(opaque, "    - desc 11 leak_valid_flag=%u",
+                 desc11_get_leak_valid_flag(p_desc));
+    }
+}
+
+/*****************************************************************************
  * Descriptors list
  *****************************************************************************/
 #define DESCS_HEADER_SIZE       2
-- 
1.7.5.1



More information about the dvblast-devel mailing list