[vlc-commits] DTV: add ISDB-S (untested)

Rémi Denis-Courmont git at videolan.org
Sat Jul 30 10:13:02 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jul 30 10:24:51 2011 +0300| [7f24aa817b38bcbdfec1d1a702c839169649e451] | committer: Rémi Denis-Courmont

DTV: add ISDB-S (untested)

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

 modules/access/dtv/access.c     |   30 ++++++++++++++++++++++++++++--
 modules/access/dtv/bdagraph.cpp |    6 ++++++
 modules/access/dtv/dtv.h        |    8 ++++++++
 modules/access/dtv/linux.c      |   17 +++++++++++++++++
 4 files changed, 59 insertions(+), 2 deletions(-)

diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index 9d718ae..2f130f2 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -144,6 +144,8 @@ static const char *const rolloff_user[] = { N_("Automatic"),
     N_("0.35 (same as DVB-S)"), N_("0.20"), N_("0.25"),
 };
 
+#define TS_ID_TEXT N_("Transport stream ID")
+
 #define POLARIZATION_TEXT N_("Polarization (Voltage)")
 #define POLARIZATION_LONGTEXT N_( \
     "To select the polarization of the transponder, a different voltage " \
@@ -217,7 +219,8 @@ vlc_module_begin ()
     set_capability ("access", 0)
     set_callbacks (Open, Close)
     add_shortcut ("dtv", "tv", "dvb", /* "radio", "dab",*/
-                  "cable", "dvb-c", "satellite", "dvb-s", "dvb-s2",
+                  "cable", "dvb-c",
+                  "satellite", "dvb-s", "dvb-s2", "isdb-s",
                   "terrestrial", "dvb-t", "dvb-t2", "atsc", "cqam")
 
     /* All options starting with dvb- can be overridden in the MRL, so they
@@ -292,6 +295,11 @@ vlc_module_begin ()
         change_integer_list (rolloff_vlc, rolloff_user)
         change_safe ()
 
+    set_section (N_("ISDB-S parameters"), NULL)
+    add_integer ("dvb-ts-id", 0, TS_ID_TEXT, TS_ID_TEXT, false)
+        change_integer_range (0, 0xffff)
+        change_safe ()
+
     set_section (N_("Satellite equipment control"), NULL)
     add_string ("dvb-polarization", "",
                 POLARIZATION_TEXT, POLARIZATION_LONGTEXT, false)
@@ -348,7 +356,9 @@ typedef struct delsys
     /* TODO: scan stuff */
 } delsys_t;
 
-static const delsys_t dvbc, dvbs, dvbs2, dvbt, dvbt2, atsc, cqam;
+static const delsys_t dvbc, dvbs, dvbs2, dvbt, dvbt2;
+static const delsys_t isdbs;
+static const delsys_t atsc, cqam;
 
 static block_t *Read (access_t *);
 static int Control (access_t *, int, va_list);
@@ -556,6 +566,8 @@ static const delsys_t *GuessSystem (const char *scheme, dvb_device_t *dev)
         return &dvbt;
     if (!strcasecmp (scheme, "dvb-t2"))
         return &dvbt2;
+    if (!strcasecmp (scheme, "isdb-s"))
+        return &isdbs;
 
     unsigned systems = dvb_enum_systems (dev);
     if (systems & ATSC)
@@ -815,3 +827,17 @@ static int dvbt2_setup (vlc_object_t *obj, dvb_device_t *dev, uint64_t freq)
 
 static const delsys_t dvbt = { .setup = dvbt_setup };
 static const delsys_t dvbt2 = { .setup = dvbt2_setup };
+
+
+/*** ISDB-S ***/
+static int isdbs_setup (vlc_object_t *obj, dvb_device_t *dev, uint64_t freq)
+{
+    uint16_t ts_id = var_InheritInteger (obj, "dvb-ts-id");
+
+    int ret = dvb_set_isdbs (dev, freq, ts_id);
+    if (ret == 0)
+        ret = sec_setup (obj, dev, freq);
+    return ret;
+}
+
+static const delsys_t isdbs = { .setup = isdbs_setup };
diff --git a/modules/access/dtv/bdagraph.cpp b/modules/access/dtv/bdagraph.cpp
index 5081ae5..f9e4d31 100644
--- a/modules/access/dtv/bdagraph.cpp
+++ b/modules/access/dtv/bdagraph.cpp
@@ -244,6 +244,12 @@ int dvb_set_dvbt2 (dvb_device_t *, uint32_t /*freq*/, const char * /*mod*/,
     return VLC_EGENERIC;
 }
 
+/* ISDB-S */
+int dvb_set_isdbs (dvb_device_t *, uint64_t /*freq*/, uint16_t /*ts_id*/)
+{
+    return VLC_EGENERIC;
+}
+
 /* ATSC */
 int dvb_set_atsc (dvb_device_t *d, uint32_t freq, const char * /*mod*/)
 {
diff --git a/modules/access/dtv/dtv.h b/modules/access/dtv/dtv.h
index ac87c64..5d3a4f5 100644
--- a/modules/access/dtv/dtv.h
+++ b/modules/access/dtv/dtv.h
@@ -35,6 +35,10 @@ enum {
     DVB_S2 = 0x00000080,
     DVB_T  = 0x00000100,
     DVB_T2 = 0x00000200,
+
+    ISDB_C = 0x00001000,
+    ISDB_S = 0x00002000,
+    ISDB_T = 0x00004000,
 };
 
 typedef struct dvb_device dvb_device_t;
@@ -86,6 +90,10 @@ int dvb_set_dvbt2 (dvb_device_t *, uint32_t freq, const char *mod,
 int dvb_set_atsc (dvb_device_t *, uint32_t freq, const char *mod);
 int dvb_set_cqam (dvb_device_t *, uint32_t freq, const char *mod);
 
+/* ISDB-S */
+/* TODO: modulation? */
+int dvb_set_isdbs (dvb_device_t *, uint64_t freq, uint16_t ts_id);
+
 /* ISDB-T */
 typedef struct isdbt_layer
 {
diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 9788449..a8255d7 100644
--- a/modules/access/dtv/linux.c
+++ b/modules/access/dtv/linux.c
@@ -911,6 +911,23 @@ int dvb_set_dvbt2 (dvb_device_t *d, uint32_t freq, const char *modstr,
 }
 
 
+/*** ISDB-S ***/
+int dvb_set_isdbs (dvb_device_t *d, uint64_t freq_Hz, uint16_t ts_id)
+{
+#if DVBv5(1)
+    uint32_t freq = freq_Hz / 1000;
+
+    if (dvb_find_frontend (d, FE_QPSK, FE_IS_STUPID))
+        return -1;
+    return dvb_set_props (d, 5, DTV_CLEAR, 0, DTV_DELIVERY_SYSTEM, SYS_ISDBS,
+                          DTV_FREQUENCY, freq,
+                          DTV_ISDBS_TS_ID, (uint32_t)ts_id);
+#else
+# warning ISDB-S needs Linux DVB version 5.1 or later.
+#endif
+}
+
+
 /*** ATSC ***/
 int dvb_set_atsc (dvb_device_t *d, uint32_t freq, const char *modstr)
 {



More information about the vlc-commits mailing list