[vlc-commits] DTV: add ISDB-C (ITU J.83 Annex C) untested support

Rémi Denis-Courmont git at videolan.org
Sun Nov 20 21:31:48 CET 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Nov 20 22:30:02 2011 +0200| [a2705d44b894fd789eba80791cf9c48a5d5fecd2] | committer: Rémi Denis-Courmont

DTV: add ISDB-C (ITU J.83 Annex C) untested support

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

 modules/access/dtv/access.c     |   19 +++++++++++++++++--
 modules/access/dtv/bdagraph.cpp |    7 +++++++
 modules/access/dtv/dtv.h        |    4 ++++
 modules/access/dtv/linux.c      |   16 ++++++++++++++++
 4 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index e2fdc16..860f21f 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -230,7 +230,7 @@ vlc_module_begin ()
     set_capability ("access", 0)
     set_callbacks (Open, Close)
     add_shortcut ("dtv", "tv", "dvb", /* "radio", "dab",*/
-                  "cable", "dvb-c", "cqam"
+                  "cable", "dvb-c", "cqam", "isdb-c",
                   "satellite", "dvb-s", "dvb-s2", "isdb-s",
                   "terrestrial", "dvb-t", "dvb-t2", "isdb-t", "atsc")
 
@@ -405,7 +405,7 @@ typedef struct delsys
 } delsys_t;
 
 static const delsys_t dvbc, dvbs, dvbs2, dvbt, dvbt2;
-static const delsys_t isdbs, isdbt;
+static const delsys_t isdbc, isdbs, isdbt;
 static const delsys_t atsc, cqam;
 
 static block_t *Read (access_t *);
@@ -621,6 +621,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-c"))
+        return &isdbc;
     if (!strcasecmp (scheme, "isdb-s"))
         return &isdbs;
     if (!strcasecmp (scheme, "isdb-t"))
@@ -886,6 +888,19 @@ static const delsys_t dvbt = { .setup = dvbt_setup };
 static const delsys_t dvbt2 = { .setup = dvbt2_setup };
 
 
+/*** ISDB-C ***/
+static int isdbc_setup (vlc_object_t *obj, dvb_device_t *dev, uint64_t freq)
+{
+    const char *mod = var_InheritModulation (obj, "dvb-modulation");
+    uint32_t fec = var_InheritCodeRate (obj, "dvb-fec");
+    unsigned srate = var_InheritInteger (obj, "dvb-srate");
+
+    return dvb_set_isdbc (dev, freq, mod, srate, fec);
+}
+
+static const delsys_t isdbc = { .setup = isdbc_setup };
+
+
 /*** ISDB-S ***/
 static int isdbs_setup (vlc_object_t *obj, dvb_device_t *dev, uint64_t freq)
 {
diff --git a/modules/access/dtv/bdagraph.cpp b/modules/access/dtv/bdagraph.cpp
index 3d6e5a5..445180b 100644
--- a/modules/access/dtv/bdagraph.cpp
+++ b/modules/access/dtv/bdagraph.cpp
@@ -245,6 +245,13 @@ int dvb_set_dvbt2 (dvb_device_t *, uint32_t /*freq*/, const char * /*mod*/,
     return VLC_EGENERIC;
 }
 
+/* ISDB-C */
+int dvb_set_isdbc (dvb_device_t *, uint32_t freq, const char *mod,
+                   uint32_t srate, uint32_t fec)
+{
+    return VLC_EGENERIC;
+}
+
 /* ISDB-S */
 int dvb_set_isdbs (dvb_device_t *, uint64_t /*freq*/, uint16_t /*ts_id*/)
 {
diff --git a/modules/access/dtv/dtv.h b/modules/access/dtv/dtv.h
index b62a93c..3cf6503 100644
--- a/modules/access/dtv/dtv.h
+++ b/modules/access/dtv/dtv.h
@@ -90,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-C */
+int dvb_set_isdbc (dvb_device_t *, uint32_t freq, const char *mod,
+                   uint32_t srate, uint32_t fec);
+
 /* ISDB-S */
 /* TODO: modulation? */
 int dvb_set_isdbs (dvb_device_t *, uint64_t freq, uint16_t ts_id);
diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 7104e15..4bbef3f 100644
--- a/modules/access/dtv/linux.c
+++ b/modules/access/dtv/linux.c
@@ -911,6 +911,22 @@ int dvb_set_dvbt2 (dvb_device_t *d, uint32_t freq, const char *modstr,
 }
 
 
+/*** ISDB-C ***/
+int dvb_set_isdbc (dvb_device_t *d, uint32_t freq, const char *modstr,
+                   uint32_t srate, uint32_t fec)
+{
+    unsigned mod = dvb_parse_modulation (modstr, QAM_AUTO);
+    fec = dvb_parse_fec (fec);
+
+    if (dvb_find_frontend (d, FE_QAM, FE_IS_STUPID))
+        return -1;
+    return dvb_set_props (d, 6, DTV_CLEAR, 0,
+                          DTV_DELIVERY_SYSTEM, SYS_DVBC_ANNEX_AC,
+                          DTV_FREQUENCY, freq, DTV_MODULATION, mod,
+                          DTV_SYMBOL_RATE, srate, DTV_INNER_FEC, fec);
+}
+
+
 /*** ISDB-S ***/
 int dvb_set_isdbs (dvb_device_t *d, uint64_t freq_Hz, uint16_t ts_id)
 {



More information about the vlc-commits mailing list