Commit 407007d7 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

DTV: common support for DVB-T2

parent d1627ea8
...@@ -108,26 +108,26 @@ static const char *const code_rate_user[] = { N_("Automatic"), ...@@ -108,26 +108,26 @@ static const char *const code_rate_user[] = { N_("Automatic"),
#define TRANSMISSION_TEXT N_("Transmission mode") #define TRANSMISSION_TEXT N_("Transmission mode")
const int transmission_vlc[] = { -1, const int transmission_vlc[] = { -1,
2, 4, 8, /*16, 32,*/ 1, 2, 4, 8, 16, 32,
}; };
static const char *const transmission_user[] = { N_("Automatic"), static const char *const transmission_user[] = { N_("Automatic"),
"2k", "4k", "8k", /*"16k", "32k", */ "1k", "2k", "4k", "8k", "16k", "32k",
}; };
#define BANDWIDTH_TEXT N_("Bandwidth (MHz)") #define BANDWIDTH_TEXT N_("Bandwidth (MHz)")
const int bandwidth_vlc[] = { 0, const int bandwidth_vlc[] = { 0,
8, 7, 6, 8, 7, 6, 5,
}; };
static const char *const bandwidth_user[] = { N_("Automatic"), static const char *const bandwidth_user[] = { N_("Automatic"),
N_("8 MHz"), N_("7 MHz"), N_("6 MHz"), N_("8 MHz"), N_("7 MHz"), N_("6 MHz"), N_("5 MHz"),
}; };
#define GUARD_TEXT N_("Guard interval") #define GUARD_TEXT N_("Guard interval")
const char *const guard_vlc[] = { "", const char *const guard_vlc[] = { "",
/*"1/128",*/ "1/32", "1/16", /*"19/128",*/ "1/8", /*"9/256",*/ "1/4", "1/128", "1/32", "1/16", "19/256", "1/8", "19/128", "1/4",
}; };
static const char *const guard_user[] = { N_("Automatic"), static const char *const guard_user[] = { N_("Automatic"),
/*"1/128",*/ "1/32", "1/16", /*"19/128",*/ "1/8", /*"9/256",*/ "1/4", "1/128", "1/32", "1/16", "19/256", "1/8", "19/128", "1/4",
}; };
#define HIERARCHY_TEXT N_("Hierarchy mode") #define HIERARCHY_TEXT N_("Hierarchy mode")
...@@ -222,7 +222,7 @@ vlc_module_begin () ...@@ -222,7 +222,7 @@ vlc_module_begin ()
set_callbacks (Open, Close) set_callbacks (Open, Close)
add_shortcut ("dtv", "tv", "dvb", /* "radio", "dab",*/ add_shortcut ("dtv", "tv", "dvb", /* "radio", "dab",*/
"cable", "dvb-c", "satellite", "dvb-s", "dvb-s2", "cable", "dvb-c", "satellite", "dvb-s", "dvb-s2",
"terrestrial", "dvb-t", "atsc", "cqam") "terrestrial", "dvb-t", "dvb-t2", "atsc", "cqam")
/* All options starting with dvb- can be overridden in the MRL, so they /* All options starting with dvb- can be overridden in the MRL, so they
* must all be "safe". Nevertheless, we do not mark as safe those that are * must all be "safe". Nevertheless, we do not mark as safe those that are
...@@ -551,6 +551,8 @@ static const delsys_t *GuessSystem (const char *scheme, dvb_device_t *dev) ...@@ -551,6 +551,8 @@ static const delsys_t *GuessSystem (const char *scheme, dvb_device_t *dev)
return &dvbs2; return &dvbs2;
if (!strcasecmp (scheme, "dvb-t")) if (!strcasecmp (scheme, "dvb-t"))
return &dvbt; return &dvbt;
if (!strcasecmp (scheme, "dvb-t2"))
return &dvbt2;
return dvb_guess_system (dev); return dvb_guess_system (dev);
} }
...@@ -788,4 +790,16 @@ static int dvbt_setup (vlc_object_t *obj, dvb_device_t *dev, unsigned freq) ...@@ -788,4 +790,16 @@ static int dvbt_setup (vlc_object_t *obj, dvb_device_t *dev, unsigned freq)
return dvb_set_dvbt (dev, freq, mod, fec_hp, fec_lp, bw, tx, guard, h); return dvb_set_dvbt (dev, freq, mod, fec_hp, fec_lp, bw, tx, guard, h);
} }
static int dvbt2_setup (vlc_object_t *obj, dvb_device_t *dev, unsigned freq)
{
const char *mod = var_InheritModulation (obj);
uint32_t fec = var_InheritCodeRate (obj, "dvb-fec");
uint32_t guard = var_InheritGuardInterval (obj);
uint32_t bw = var_InheritInteger (obj, "dvb-bandwidth");
int tx = var_InheritInteger (obj, "dvb-transmission");
return dvb_set_dvbt2 (dev, freq, mod, fec, bw, tx, guard);
}
const delsys_t dvbt = { .setup = dvbt_setup }; const delsys_t dvbt = { .setup = dvbt_setup };
const delsys_t dvbt2 = { .setup = dvbt2_setup };
...@@ -240,6 +240,13 @@ int dvb_set_dvbt (dvb_device_t *d, uint32_t freq, const char *mod, ...@@ -240,6 +240,13 @@ int dvb_set_dvbt (dvb_device_t *d, uint32_t freq, const char *mod,
bandwidth, transmission, guard, hierarchy); bandwidth, transmission, guard, hierarchy);
} }
int dvb_set_dvbt2 (dvb_device_t *d, uint32_t freq, const char *mod,
uint32_t fec, uint32_t bandwidth, int transmission,
uint32_t guard)
{
return VLC_EGENERIC;
}
/* ATSC */ /* ATSC */
int dvb_set_atsc (dvb_device_t *d, uint32_t freq, const char *mod) int dvb_set_atsc (dvb_device_t *d, uint32_t freq, const char *mod)
{ {
......
...@@ -28,7 +28,7 @@ extern "C" { ...@@ -28,7 +28,7 @@ extern "C" {
typedef struct delsys delsys_t; typedef struct delsys delsys_t;
extern const delsys_t dvbc, dvbs, dvbs2, dvbt, atsc, cqam; extern const delsys_t dvbc, dvbs, dvbs2, dvbt, dvbt2, atsc, cqam;
typedef struct dvb_device dvb_device_t; typedef struct dvb_device dvb_device_t;
...@@ -66,6 +66,9 @@ int dvb_set_sec (dvb_device_t *, uint32_t freq, char pol, ...@@ -66,6 +66,9 @@ int dvb_set_sec (dvb_device_t *, uint32_t freq, char pol,
int dvb_set_dvbt (dvb_device_t *, uint32_t freq, const char *mod, int dvb_set_dvbt (dvb_device_t *, uint32_t freq, const char *mod,
uint32_t fec_hp, uint32_t fec_lp, uint32_t bandwidth, uint32_t fec_hp, uint32_t fec_lp, uint32_t bandwidth,
int transmission, uint32_t guard, int hierarchy); int transmission, uint32_t guard, int hierarchy);
int dvb_set_dvbt2 (dvb_device_t *, uint32_t freq, const char *mod,
uint32_t fec, uint32_t bandwidth,
int transmission, uint32_t guard);
/* ATSC */ /* ATSC */
int dvb_set_atsc (dvb_device_t *, uint32_t freq, const char *mod); int dvb_set_atsc (dvb_device_t *, uint32_t freq, const char *mod);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment