Commit 7f24aa81 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

DTV: add ISDB-S (untested)

parent a5e92fec
...@@ -144,6 +144,8 @@ static const char *const rolloff_user[] = { N_("Automatic"), ...@@ -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"), 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_TEXT N_("Polarization (Voltage)")
#define POLARIZATION_LONGTEXT N_( \ #define POLARIZATION_LONGTEXT N_( \
"To select the polarization of the transponder, a different voltage " \ "To select the polarization of the transponder, a different voltage " \
...@@ -217,7 +219,8 @@ vlc_module_begin () ...@@ -217,7 +219,8 @@ vlc_module_begin ()
set_capability ("access", 0) set_capability ("access", 0)
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", "isdb-s",
"terrestrial", "dvb-t", "dvb-t2", "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
...@@ -292,6 +295,11 @@ vlc_module_begin () ...@@ -292,6 +295,11 @@ vlc_module_begin ()
change_integer_list (rolloff_vlc, rolloff_user) change_integer_list (rolloff_vlc, rolloff_user)
change_safe () 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) set_section (N_("Satellite equipment control"), NULL)
add_string ("dvb-polarization", "", add_string ("dvb-polarization", "",
POLARIZATION_TEXT, POLARIZATION_LONGTEXT, false) POLARIZATION_TEXT, POLARIZATION_LONGTEXT, false)
...@@ -348,7 +356,9 @@ typedef struct delsys ...@@ -348,7 +356,9 @@ typedef struct delsys
/* TODO: scan stuff */ /* TODO: scan stuff */
} delsys_t; } 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 block_t *Read (access_t *);
static int Control (access_t *, int, va_list); static int Control (access_t *, int, va_list);
...@@ -556,6 +566,8 @@ static const delsys_t *GuessSystem (const char *scheme, dvb_device_t *dev) ...@@ -556,6 +566,8 @@ static const delsys_t *GuessSystem (const char *scheme, dvb_device_t *dev)
return &dvbt; return &dvbt;
if (!strcasecmp (scheme, "dvb-t2")) if (!strcasecmp (scheme, "dvb-t2"))
return &dvbt2; return &dvbt2;
if (!strcasecmp (scheme, "isdb-s"))
return &isdbs;
unsigned systems = dvb_enum_systems (dev); unsigned systems = dvb_enum_systems (dev);
if (systems & ATSC) if (systems & ATSC)
...@@ -815,3 +827,17 @@ static int dvbt2_setup (vlc_object_t *obj, dvb_device_t *dev, uint64_t freq) ...@@ -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 dvbt = { .setup = dvbt_setup };
static const delsys_t dvbt2 = { .setup = dvbt2_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 };
...@@ -244,6 +244,12 @@ int dvb_set_dvbt2 (dvb_device_t *, uint32_t /*freq*/, const char * /*mod*/, ...@@ -244,6 +244,12 @@ int dvb_set_dvbt2 (dvb_device_t *, uint32_t /*freq*/, const char * /*mod*/,
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* ISDB-S */
int dvb_set_isdbs (dvb_device_t *, uint64_t /*freq*/, uint16_t /*ts_id*/)
{
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*/)
{ {
......
...@@ -35,6 +35,10 @@ enum { ...@@ -35,6 +35,10 @@ enum {
DVB_S2 = 0x00000080, DVB_S2 = 0x00000080,
DVB_T = 0x00000100, DVB_T = 0x00000100,
DVB_T2 = 0x00000200, DVB_T2 = 0x00000200,
ISDB_C = 0x00001000,
ISDB_S = 0x00002000,
ISDB_T = 0x00004000,
}; };
typedef struct dvb_device dvb_device_t; typedef struct dvb_device dvb_device_t;
...@@ -86,6 +90,10 @@ int dvb_set_dvbt2 (dvb_device_t *, uint32_t freq, const char *mod, ...@@ -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_atsc (dvb_device_t *, uint32_t freq, const char *mod);
int dvb_set_cqam (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 */ /* ISDB-T */
typedef struct isdbt_layer typedef struct isdbt_layer
{ {
......
...@@ -911,6 +911,23 @@ int dvb_set_dvbt2 (dvb_device_t *d, uint32_t freq, const char *modstr, ...@@ -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 ***/ /*** ATSC ***/
int dvb_set_atsc (dvb_device_t *d, uint32_t freq, const char *modstr) int dvb_set_atsc (dvb_device_t *d, uint32_t freq, const char *modstr)
{ {
......
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