Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
SAT>IP server: print fe (tuner selection) config
  • Loading branch information
perexg committed Apr 6, 2016
1 parent 2358d89 commit a9cd108
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 13 deletions.
21 changes: 17 additions & 4 deletions src/satip/rtsp.c
Expand Up @@ -91,9 +91,10 @@ static void rtsp_free_session(session_t *rs);
/*
*
*/
static int
rtsp_delsys(int fe, int *findex)
int
satip_rtsp_delsys(int fe, int *findex, const char **ftype)
{
const char *t = NULL;
int res, i;

if (fe < 1)
Expand All @@ -102,55 +103,65 @@ rtsp_delsys(int fe, int *findex)
i = satip_server_conf.satip_dvbs;
if (fe <= i) {
res = DVB_SYS_DVBS;
t = "DVB-S";
goto result;
}
fe -= i;
i = satip_server_conf.satip_dvbs2;
if (fe <= i) {
res = DVB_SYS_DVBS;
t = "DVB-S2";
goto result;
}
fe -= i;
i = satip_server_conf.satip_dvbt;
if (fe <= i) {
res = DVB_SYS_DVBT;
t = "DVB-T";
goto result;
}
fe -= i;
i = satip_server_conf.satip_dvbt2;
if (fe <= i) {
res = DVB_SYS_DVBT;
t = "DVB-T2";
goto result;
}
fe -= i;
i = satip_server_conf.satip_dvbc;
if (fe <= i) {
res = DVB_SYS_DVBC_ANNEX_A;
t = "DVB-C";
goto result;
}
fe -= i;
i = satip_server_conf.satip_dvbc2;
if (fe <= i) {
res = DVB_SYS_DVBC_ANNEX_A;
t = "DVB-C2";
goto result;
}
fe -= i;
i = satip_server_conf.satip_atsc_t;
if (fe <= i) {
res = DVB_SYS_ATSC;
t = "ATSC-T";
goto result;
}
fe -= i;
i = satip_server_conf.satip_atsc_c;
if (fe <= i) {
res = DVB_SYS_DVBC_ANNEX_B;
t = "ATSC-C";
goto result;
}
pthread_mutex_unlock(&global_lock);
return DVB_SYS_NONE;
result:
pthread_mutex_unlock(&global_lock);
*findex = i;
if (ftype)
*ftype = t;
return res;
}

Expand Down Expand Up @@ -896,9 +907,11 @@ rtsp_parse_cmd
rs = rtsp_find_session(hc, stream);

if (fe > 0) {
delsys = rtsp_delsys(fe, &findex);
if (delsys == DVB_SYS_NONE)
delsys = satip_rtsp_delsys(fe, &findex, NULL);
if (delsys == DVB_SYS_NONE) {
tvherror("satips", "fe=%d does not exist", fe);
goto end;
}
} else {
delsys = msys;
}
Expand Down
17 changes: 8 additions & 9 deletions src/satip/server.c
Expand Up @@ -522,22 +522,21 @@ static void satips_rtsp_port(int def)

static void satip_server_info(const char *prefix, int descramble, int muxcnf)
{
int fe, findex;
const char *ftype;

tvhinfo("satips", "SAT>IP Server %sinitialized "
"(HTTP %s:%d, RTSP %s:%d, "
"descramble %d, muxcnf %d)",
prefix,
http_server_ip, http_server_port,
http_server_ip, satip_server_rtsp_port,
descramble, muxcnf);
tvhinfo("satips", "SAT>IP Server tuners: DVB-T/T2 %d/%d, DVB-S/S2 %d/%d, DVB-C/C2 %d/%d, ATSC-T/C %d/%d",
satip_server_conf.satip_dvbt,
satip_server_conf.satip_dvbt2,
satip_server_conf.satip_dvbs,
satip_server_conf.satip_dvbs2,
satip_server_conf.satip_dvbc,
satip_server_conf.satip_dvbc2,
satip_server_conf.satip_atsc_t,
satip_server_conf.satip_atsc_c);
for (fe = 1; fe <= 128; fe++) {
if (satip_rtsp_delsys(fe, &findex, &ftype) == DVB_TYPE_NONE)
break;
tvhinfo("satips", " tuner[fe=%d]: %s #%d", fe, ftype, findex);
}
}

/*
Expand Down
2 changes: 2 additions & 0 deletions src/satip/server.h
Expand Up @@ -82,6 +82,8 @@ void satip_rtp_close(void *id);
void satip_rtp_init(int boot);
void satip_rtp_done(void);

int satip_rtsp_delsys(int fe, int *findex, const char **ftype);

void satip_server_rtsp_init(const char *bindaddr, int port,
int descramble, int rewrite_pmt, int muxcnf,
const char *nat_ip);
Expand Down

0 comments on commit a9cd108

Please sign in to comment.