Commit 0a2447ba authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

DTV: add ISDB-T (untested and exclusing sound broadcasting)

parent 7f24aa81
This diff is collapsed.
...@@ -250,6 +250,14 @@ int dvb_set_isdbs (dvb_device_t *, uint64_t /*freq*/, uint16_t /*ts_id*/) ...@@ -250,6 +250,14 @@ int dvb_set_isdbs (dvb_device_t *, uint64_t /*freq*/, uint16_t /*ts_id*/)
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* ISDB-T */
int dvb_set_isdbt (dvb_device_t *, uint32_t /*freq*/, uint32_t /*bandwidth*/,
int /*transmit_mode*/, uint32_t /*guard*/,
const isdbt_layer_t /*layers*/[3])
{
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*/)
{ {
......
...@@ -98,20 +98,21 @@ int dvb_set_isdbs (dvb_device_t *, uint64_t freq, uint16_t ts_id); ...@@ -98,20 +98,21 @@ int dvb_set_isdbs (dvb_device_t *, uint64_t freq, uint16_t ts_id);
typedef struct isdbt_layer typedef struct isdbt_layer
{ {
const char *modulation; const char *modulation;
const char *code_rate; uint32_t code_rate;
uint8_t segment_count; uint8_t segment_count;
uint8_t time_interleaving; uint8_t time_interleaving;
} isdbt_layer_t; } isdbt_layer_t;
int dvb_set_isdbt (dvb_device_t *, uint32_t freq, uint32_t bandwith,
int transmission, uint32_t guard, const isdbt_layer_t[3]);
typedef struct isdbt_sound typedef struct isdbt_sound
{ {
uint8_t subchannel_id; uint8_t subchannel_id;
uint8_t segment_index; uint8_t segment_cound; uint8_t segment_index;
uint8_t segment_count;
} isdbt_sound_t; } isdbt_sound_t;
int dvb_set_isdbt (dvb_device_t *, uint32_t freq, const isdbt_layer_t *a,
const isdbt_layer_t *b, const isdbt_layer_t *c,
const isdbt_sound_t *sb);
# ifdef __cplusplus # ifdef __cplusplus
} }
# endif # endif
......
...@@ -928,6 +928,49 @@ int dvb_set_isdbs (dvb_device_t *d, uint64_t freq_Hz, uint16_t ts_id) ...@@ -928,6 +928,49 @@ int dvb_set_isdbs (dvb_device_t *d, uint64_t freq_Hz, uint16_t ts_id)
} }
/*** ISDB-T ***/
static int dvb_set_isdbt_layer (dvb_device_t *d, unsigned num,
const isdbt_layer_t *l)
{
uint32_t mod = dvb_parse_modulation (l->modulation, QAM_AUTO);
uint32_t fec = dvb_parse_fec (l->code_rate);
uint32_t count = l->segment_count;
uint32_t ti = l->time_interleaving;
num *= DTV_ISDBT_LAYERB_FEC - DTV_ISDBT_LAYERA_FEC;
return dvb_set_props (d, 5, DTV_DELIVERY_SYSTEM, SYS_ISDBT,
DTV_ISDBT_LAYERA_FEC + num, fec,
DTV_ISDBT_LAYERA_MODULATION + num, mod,
DTV_ISDBT_LAYERA_SEGMENT_COUNT + num, count,
DTV_ISDBT_LAYERA_TIME_INTERLEAVING + num, ti);
}
int dvb_set_isdbt (dvb_device_t *d, uint32_t freq, uint32_t bandwidth,
int transmit_mode, uint32_t guard,
const isdbt_layer_t layers[3])
{
#if DVBv5(1)
bandwidth = dvb_parse_bandwidth (bandwidth);
transmit_mode = dvb_parse_transmit_mode (transmit_mode);
guard = dvb_parse_guard (guard);
if (dvb_find_frontend (d, FE_OFDM, FE_IS_STUPID))
return -1;
if (dvb_set_props (d, 5, DTV_CLEAR, 0, DTV_DELIVERY_SYSTEM, SYS_ISDBT,
DTV_FREQUENCY, freq, DTV_BANDWIDTH_HZ, bandwidth,
DTV_GUARD_INTERVAL, guard))
return -1;
for (unsigned i = 0; i < 3; i++)
if (dvb_set_isdbt_layer (d, i, layers + i))
return -1;
return 0;
#else
# warning ISDB-T 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