[vlc-commits] DTV: add so-called "Clear" QAM
Rémi Denis-Courmont
git at videolan.org
Thu Mar 24 19:20:30 CET 2011
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Thu Mar 24 16:11:01 2011 +0200| [aee227cb004dcbba20902d8f14b5a63a3f320b3f] | committer: Rémi Denis-Courmont
DTV: add so-called "Clear" QAM
Use cqam:// as BDA already does.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=aee227cb004dcbba20902d8f14b5a63a3f320b3f
---
modules/access/dtv/access.c | 15 ++++++++++++++-
modules/access/dtv/dtv.h | 3 ++-
modules/access/dtv/linux.c | 9 +++++++++
3 files changed, 25 insertions(+), 2 deletions(-)
diff --git a/modules/access/dtv/access.c b/modules/access/dtv/access.c
index 277f128..2a33cd5 100644
--- a/modules/access/dtv/access.c
+++ b/modules/access/dtv/access.c
@@ -193,7 +193,7 @@ vlc_module_begin ()
set_callbacks (Open, Close)
add_shortcut ("dtv", "tv", "dvb", /* "radio", "dab",*/
"cable", "dvb-c", "satellite", "dvb-s", "dvb-s2",
- "terrestrial", "dvb-t", "atsc")
+ "terrestrial", "dvb-t", "atsc", "cqam")
/* All options starting with dvb- can be overriden in the MRL, so they
* must all be "safe". Nevertheless, we do not mark as safe those that are
@@ -494,6 +494,8 @@ static const delsys_t *GuessSystem (const char *scheme, dvb_device_t *dev)
if (!strcasecmp (scheme, "atsc"))
return &atsc;
+ if (!strcasecmp (scheme, "cqam"))
+ return &cqam;
if (!strcasecmp (scheme, "dvb-c"))
return &dvbc;
if (!strcasecmp (scheme, "dvb-s"))
@@ -592,6 +594,17 @@ static int atsc_setup (vlc_object_t *obj, dvb_device_t *dev, unsigned freq)
const delsys_t atsc = { .setup = atsc_setup };
+static int cqam_setup (vlc_object_t *obj, dvb_device_t *dev, unsigned freq)
+{
+ char *mod = var_InheritModulation (obj);
+
+ int ret = dvb_set_cqam (dev, freq, mod);
+ free (mod);
+ return ret;
+}
+
+const delsys_t cqam = { .setup = cqam_setup };
+
/*** DVB-C ***/
static int dvbc_setup (vlc_object_t *obj, dvb_device_t *dev, unsigned freq)
diff --git a/modules/access/dtv/dtv.h b/modules/access/dtv/dtv.h
index 5493db3..f4883e3 100644
--- a/modules/access/dtv/dtv.h
+++ b/modules/access/dtv/dtv.h
@@ -22,7 +22,7 @@
typedef struct delsys delsys_t;
-extern const delsys_t dvbc, dvbs, dvbs2, dvbt, atsc;
+extern const delsys_t dvbc, dvbs, dvbs2, dvbt, atsc, cqam;
typedef struct dvb_device dvb_device_t;
@@ -59,6 +59,7 @@ int dvb_set_dvbt (dvb_device_t *, uint32_t freq, const char *mod,
/* ATSC */
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-T */
typedef struct isdbt_layer
diff --git a/modules/access/dtv/linux.c b/modules/access/dtv/linux.c
index 268a3e8..80d4402 100644
--- a/modules/access/dtv/linux.c
+++ b/modules/access/dtv/linux.c
@@ -726,3 +726,12 @@ int dvb_set_atsc (dvb_device_t *d, uint32_t freq, const char *modstr)
return dvb_set_props (d, 4, DTV_CLEAR, 0, DTV_DELIVERY_SYSTEM, SYS_ATSC,
DTV_FREQUENCY, freq * 1000, DTV_MODULATION, mod);
}
+
+int dvb_set_cqam (dvb_device_t *d, uint32_t freq, const char *modstr)
+{
+ unsigned mod = dvb_parse_modulation (modstr, QAM_AUTO);
+
+ return dvb_set_props (d, 4, DTV_CLEAR, 0,
+ DTV_DELIVERY_SYSTEM, SYS_DVBC_ANNEX_B,
+ DTV_FREQUENCY, freq * 1000, DTV_MODULATION, mod);
+}
More information about the vlc-commits
mailing list