]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
dvb: export dvb_network_find_mux() for the SAT>IP server
authorJaroslav Kysela <perex@perex.cz>
Mon, 23 Feb 2015 14:42:06 +0000 (15:42 +0100)
committerJaroslav Kysela <perex@perex.cz>
Wed, 11 Mar 2015 20:41:12 +0000 (21:41 +0100)
src/input/mpegts/mpegts_dvb.h
src/input/mpegts/mpegts_network_dvb.c

index cacb520a2c80baeb0c8351c82fa9c438663ea936..f786ecc45a64e985100169bd8a31484e5eecc04b 100644 (file)
 #ifndef __TVH_MPEGTS_DVB_H__
 #define __TVH_MPEGTS_DVB_H__
 
-/*
- * Network
- */
-
 typedef struct dvb_network
 {
   mpegts_network_t;
@@ -34,6 +30,20 @@ typedef struct dvb_network
   dvb_fe_type_t ln_type;
 } dvb_network_t;
 
+typedef struct dvb_mux
+{
+  mpegts_mux_t;
+
+  /*
+   * Tuning information
+   */
+  dvb_mux_conf_t lm_tuning;
+} dvb_mux_t;
+
+/*
+ * Network
+ */
+
 extern const idclass_t dvb_network_class;
 extern const idclass_t dvb_network_dvbt_class;
 extern const idclass_t dvb_network_dvbc_class;
@@ -48,21 +58,14 @@ static inline dvb_network_t *dvb_network_find_by_uuid(const char *uuid)
 dvb_network_t *dvb_network_create0
   ( const char *uuid, const idclass_t *idc, htsmsg_t *conf );
 
+dvb_mux_t *dvb_network_find_mux
+  ( dvb_network_t *ln, dvb_mux_conf_t *dmc, uint16_t onid, uint16_t tsid );
+
 int dvb_network_get_orbital_pos(mpegts_network_t *mn);
 
 /*
  *
  */
-typedef struct dvb_mux
-{
-  mpegts_mux_t;
-
-  /*
-   * Tuning information
-   */
-  dvb_mux_conf_t lm_tuning;
-} dvb_mux_t;
-
 extern const idclass_t dvb_mux_dvbt_class;
 extern const idclass_t dvb_mux_dvbc_class;
 extern const idclass_t dvb_mux_dvbs_class;
index d7d4154234d256e610ec3673ba047a8cc8fc9140..0e4e575f6f26202e127ed05d33a7b1c02aee4602 100644 (file)
 #include <dirent.h>
 #include <fcntl.h>
 
-static mpegts_mux_t *
-dvb_network_find_mux
-  ( dvb_network_t *ln, dvb_mux_conf_t *dmc, uint16_t onid, uint16_t tsid );
-
 /* ****************************************************************************
  * Class definition
  * ***************************************************************************/
@@ -68,7 +64,7 @@ dvb_network_class_scanfile_set ( void *o, const void *s )
   dvb_network_t *ln = o;
   dvb_mux_conf_t *dmc;
   scanfile_network_t *sfn;
-  mpegts_mux_t *mm;
+  dvb_mux_t *mm;
 
   /* Find */
   if (!s)
@@ -83,12 +79,10 @@ dvb_network_class_scanfile_set ( void *o, const void *s )
   /* Create */
   LIST_FOREACH(dmc, &sfn->sfn_muxes, dmc_link) {
     if (!(mm = dvb_network_find_mux(ln, dmc, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE))) {
-      mm = (mpegts_mux_t*)dvb_mux_create0(o,
-                                          MPEGTS_ONID_NONE,
-                                          MPEGTS_TSID_NONE,
-                                          dmc, NULL, NULL);
+      mm = dvb_mux_create0(o, MPEGTS_ONID_NONE, MPEGTS_TSID_NONE,
+                           dmc, NULL, NULL);
       if (mm)
-        mm->mm_config_save(mm);
+        mm->mm_config_save((mpegts_mux_t *)mm);
 #if ENABLE_TRACE
       char buf[128];
       dvb_mux_conf_str(dmc, buf, sizeof(buf));
@@ -328,7 +322,7 @@ dvb_network_check_orbital_pos ( int satpos1, int satpos2 )
   return 0;
 }
 
-static mpegts_mux_t *
+dvb_mux_t *
 dvb_network_find_mux
   ( dvb_network_t *ln, dvb_mux_conf_t *dmc, uint16_t onid, uint16_t tsid )
 {
@@ -390,7 +384,7 @@ dvb_network_find_mux
     /* in the NIT table information and real mux feed */
     mm = mm_alt;
   }
-  return mm;
+  return (dvb_mux_t *)mm;
 }
 
 static void
@@ -447,7 +441,7 @@ dvb_network_create_mux
   }
 
   ln = (dvb_network_t*)mn;
-  mm = (dvb_mux_t *)dvb_network_find_mux(ln, dmc, onid, tsid);
+  mm = dvb_network_find_mux(ln, dmc, onid, tsid);
   if (!mm && (ln->mn_autodiscovery || force)) {
     cls = dvb_network_mux_class((mpegts_network_t *)ln);
     save |= cls == &dvb_mux_dvbt_class && dmc->dmc_fe_type == DVB_TYPE_T;