[dvblast-devel] [PATCH 15/17] dvb/si: Add support for descriptor 0x47 (Bouquet name).

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


---
 dvb/si.h       |   50 ++++++++++++++++++++++++++++++++++++++++++++------
 dvb/si_print.h |    1 +
 2 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/dvb/si.h b/dvb/si.h
index a83c9a7..5a81591 100644
--- a/dvb/si.h
+++ b/dvb/si.h
@@ -333,10 +333,10 @@ static inline bool desc40_validate(const uint8_t *p_desc)
     return true;
 }
 
-static inline void desc40_print(const uint8_t *p_desc,
+static inline void __desc40_print(const uint8_t *p_desc,
                                 f_print pf_print, void *print_opaque,
                                 f_iconv pf_iconv, void *iconv_opaque,
-                                print_type_t i_print_type)
+                                print_type_t i_print_type, int b_bouquet_name)
 {
     uint8_t i_network_name_length;
     const uint8_t *p_network_name = desc40_get_networkname(p_desc,
@@ -348,16 +348,32 @@ static inline void desc40_print(const uint8_t *p_desc,
     switch (i_print_type) {
     case PRINT_XML:
         psz_network_name = dvb_string_xml_escape(psz_network_name);
-        pf_print(print_opaque, "<NETWORK_NAME_DESC networkname=\"%s\"/>",
-                 psz_network_name);
+        if ( !b_bouquet_name )
+            pf_print(print_opaque, "<NETWORK_NAME_DESC networkname=\"%s\"/>",
+                     psz_network_name);
+        else
+            pf_print(print_opaque, "<BOUQUET_NAME_DESC bouquetname=\"%s\"/>",
+                     psz_network_name);
         break;
     default:
-        pf_print(print_opaque, "    - desc 40 networkname=\"%s\"",
-                 psz_network_name);
+        if ( !b_bouquet_name )
+            pf_print(print_opaque, "    - desc 40 networkname=\"%s\"",
+                     psz_network_name);
+        else
+            pf_print(print_opaque, "    - desc 47 bouquetname=\"%s\"",
+                     psz_network_name);
     }
     free(psz_network_name);
 }
 
+static inline void desc40_print(const uint8_t *p_desc,
+                                f_print pf_print, void *print_opaque,
+                                f_iconv pf_iconv, void *iconv_opaque,
+                                print_type_t i_print_type)
+{
+    __desc40_print( p_desc, pf_print, print_opaque, pf_iconv, iconv_opaque, i_print_type, 0 );
+}
+
 /*****************************************************************************
  * Descriptor 0x41: Service list descriptor
  *****************************************************************************/
@@ -689,6 +705,28 @@ static inline void desc46_print(uint8_t *p_desc, f_print pf_print,
 }
 
 /*****************************************************************************
+ * Descriptor 0x47: Bouquet name descriptor
+ *****************************************************************************/
+#define DESC47_HEADER_SIZE      DESC_HEADER_SIZE
+
+static inline void desc47_init(uint8_t *p_desc)
+{
+    desc_set_tag(p_desc, 0x47);
+}
+
+#define desc47_set_bouquetname  desc40_set_networkname
+#define desc47_get_bouquetname  desc40_get_networkname
+#define desc47_validate         desc40_validate
+
+static inline void desc47_print(const uint8_t *p_desc,
+                                f_print pf_print, void *print_opaque,
+                                f_iconv pf_iconv, void *iconv_opaque,
+                                print_type_t i_print_type)
+{
+    __desc40_print( p_desc, pf_print, print_opaque, pf_iconv, iconv_opaque, i_print_type, 1 );
+}
+
+/*****************************************************************************
  * Descriptor 0x48: Service descriptor
  *****************************************************************************/
 #define DESC48_HEADER_SIZE      (DESC_HEADER_SIZE + 1)
diff --git a/dvb/si_print.h b/dvb/si_print.h
index e4afc33..732287b 100644
--- a/dvb/si_print.h
+++ b/dvb/si_print.h
@@ -107,6 +107,7 @@ static inline void descs_print(uint8_t *p_descs,
         CASE_DESC(43)
         CASE_DESC(44)
         CASE_DESC(46)
+        CASE_DESC_ICONV(47)
         CASE_DESC_ICONV(48)
         CASE_DESC(4a)
         CASE_DESC(56)
-- 
1.7.5.1



More information about the dvblast-devel mailing list