SAT>IP: Added OctopusNet pids hack

This commit is contained in:
Jaroslav Kysela 2014-04-17 22:12:04 +02:00
parent 18c46144f0
commit ff145046f7
4 changed files with 46 additions and 5 deletions

View file

@ -105,6 +105,13 @@ const idclass_t satip_device_class =
.opts = PO_ADVANCED,
.off = offsetof(satip_device_t, sd_pids_deladd),
},
{
.type = PT_BOOL,
.id = "pids0",
.name = "PIDs in setup",
.opts = PO_ADVANCED,
.off = offsetof(satip_device_t, sd_pids0),
},
{
.type = PT_STR,
.id = "addr",
@ -263,6 +270,9 @@ satip_device_hack( satip_device_t *sd )
sd->sd_pids_deladd = 0;
tvhwarn("satip", "Detected old Inverto firmware V1.13.0.105 and less");
tvhwarn("satip", "Upgrade to V1.16.0.120 - http://http://www.inverto.tv/support/ - IDL400s");
} else if (strstr(sd->sd_info.location, ":8888/octonet.xml")) {
/* OctopusNet requires pids in the SETUP RTSP command */
sd->sd_pids0 = 1;
}
}

View file

@ -531,6 +531,11 @@ satip_frontend_decode_rtcp( satip_frontend_t *lfe, const char *name,
* DVB-T:
* ver=1.1;tuner=<feID>,<level>,<lock>,<quality>,<freq>,<bw>,<msys>,<tmode>,\
* <mtype>,<gi>,<fec>,<plp>,<t2id>,<sm>;pids=<pid0>,...,<pidn>
*
* DVB-C (OctopusNet):
* ver=0.9;tuner=<feID>,<0>,<lock>,<0>,<freq>,<bw>,<msys>,<mtype>;pids=<pid0>,...<pidn>
* example:
* ver=0.9;tuner=1,0,1,0,362.000,6900,dvbc,256qam;pids=0,1,16,17,18
*/
/* level:
@ -567,7 +572,25 @@ satip_frontend_decode_rtcp( satip_frontend_t *lfe, const char *name,
s = (char *)rtcp + 16;
tvhtrace("satip", "Status string: '%s'", s);
status = SIGNAL_NONE;
if (strncmp(s, "ver=1.0;", 8) == 0) {
if (strncmp(s, "ver=0.9;tuner=", 14) == 0) {
n = http_tokenize(s + 14, argv, 4, ',');
if (n < 4)
return;
if (atoi(argv[0]) != lfe->sf_number)
return;
mmi->mmi_stats.signal =
(atoi(argv[1]) * 100) / lfe->sf_device->sd_sig_scale;
if (atoi(argv[2]) > 0)
status = SIGNAL_GOOD;
mmi->mmi_stats.snr = atoi(argv[3]);
if (status == SIGNAL_GOOD &&
mmi->mmi_stats.signal == 0 && mmi->mmi_stats.snr == 0) {
/* some values that we're tuned */
mmi->mmi_stats.signal = 50;
mmi->mmi_stats.snr = 12;
}
goto ok;
} else if (strncmp(s, "ver=1.0;", 8) == 0) {
if ((s = strstr(s + 8, ";tuner=")) == NULL)
return;
s += 7;
@ -825,7 +848,8 @@ satip_frontend_input_thread ( void *aux )
r = satip_rtsp_setup(rtsp,
lfe->sf_position, lfe->sf_number,
lfe->sf_rtp_port, &lm->lm_tuning);
lfe->sf_rtp_port, &lm->lm_tuning,
lfe->sf_device->sd_pids0);
if (r < 0) {
tvherror("satip", "%s - failed to tune", buf);
return NULL;

View file

@ -78,6 +78,7 @@ struct satip_device
int sd_pids_len;
int sd_pids_deladd;
int sd_sig_scale;
int sd_pids0;
};
struct satip_frontend
@ -202,7 +203,8 @@ int satip_satconf_get_position
int
satip_rtsp_setup( http_client_t *hc,
int src, int fe, int udp_port,
const dvb_mux_conf_t *dmc );
const dvb_mux_conf_t *dmc,
int pids0 );
int
satip_rtsp_play( http_client_t *hc, const char *pids,

View file

@ -70,7 +70,7 @@ satip_rtsp_add_val(const char *name, char *buf, uint32_t val)
int
satip_rtsp_setup( http_client_t *hc, int src, int fe,
int udp_port, const dvb_mux_conf_t *dmc )
int udp_port, const dvb_mux_conf_t *dmc, int pids0 )
{
static tvh2satip_t msys[] = {
{ .t = DVB_SYS_DVBT, "dvbt" },
@ -175,7 +175,10 @@ satip_rtsp_setup( http_client_t *hc, int src, int fe,
ADD(dmc_fe_delsys, msys, "dvbc");
ADD(dmc_fe_modulation, mtype, "64qam");
/* missing plp */
ADD(u.dmc_fe_qpsk.fec_inner, fec, "auto");
if (dmc->u.dmc_fe_qam.fec_inner != DVB_FEC_NONE &&
dmc->u.dmc_fe_qam.fec_inner != DVB_FEC_AUTO)
/* note: OctopusNet device does not handle 'fec=auto' */
ADD(u.dmc_fe_qam.fec_inner, fec, "auto");
} else {
if (dmc->u.dmc_fe_ofdm.bandwidth != DVB_BANDWIDTH_AUTO &&
dmc->u.dmc_fe_ofdm.bandwidth != DVB_BANDWIDTH_NONE)
@ -192,6 +195,8 @@ satip_rtsp_setup( http_client_t *hc, int src, int fe,
dmc->u.dmc_fe_ofdm.guard_interval != DVB_GUARD_INTERVAL_NONE)
ADD(u.dmc_fe_ofdm.guard_interval, gi, "18");
}
if (pids0)
strcat(buf, "&pids=0");
tvhtrace("satip", "setup params - %s", buf);
if (hc->hc_rtsp_stream_id >= 0)
snprintf(stream = _stream, sizeof(_stream), "/stream=%li",