SAT>IP: handle SRCS pass (for DVB-S) in server and client
This commit is contained in:
parent
a87aae0aaf
commit
1c9b527011
5 changed files with 23 additions and 7 deletions
|
@ -418,6 +418,7 @@ satip_device_create( satip_device_info_t *info )
|
|||
ASSIGN(tunercfg);
|
||||
#undef ASSIGN
|
||||
sd->sd_info.rtsp_port = info->rtsp_port;
|
||||
sd->sd_info.srcs = info->srcs;
|
||||
|
||||
/*
|
||||
* device specific hacks
|
||||
|
@ -732,13 +733,19 @@ satip_discovery_http_closed(http_client_t *hc, int errn)
|
|||
goto finish;
|
||||
|
||||
info.rtsp_port = 554;
|
||||
info.srcs = 4;
|
||||
|
||||
upc = htsmsg_xml_get_cdata_str(device, "UPC");
|
||||
if (upc && (s = strstr(upc, "{{{")) != NULL &&
|
||||
strcmp(s + strlen(s) - 3, "}}}") == 0) {
|
||||
if ((p = strstr(s, "RTSP:")) != NULL) {
|
||||
if ((i = atoi(p + 5)) > 0 && i < 65535)
|
||||
info.rtsp_port = i;
|
||||
}
|
||||
if ((p = strstr(s, "SRCS:")) != NULL) {
|
||||
i = atoi(p + 5);
|
||||
info.rtsp_port = i;
|
||||
if ((i = atoi(p + 5)) > 0 && i < 128)
|
||||
info.srcs = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1716,7 +1716,7 @@ satip_frontend_create
|
|||
char id[16], lname[256];
|
||||
satip_frontend_t *lfe;
|
||||
uint32_t master = 0;
|
||||
int i, def_positions = 4;
|
||||
int i, def_positions = sd->sd_info.srcs;
|
||||
|
||||
/* Override type */
|
||||
snprintf(id, sizeof(id), "override #%d", num);
|
||||
|
|
|
@ -54,6 +54,7 @@ struct satip_device_info
|
|||
char *presentation;
|
||||
char *tunercfg; /*< XML urn:ses-com:satipX_SATIPCAP contents */
|
||||
int rtsp_port;
|
||||
int srcs;
|
||||
};
|
||||
|
||||
struct satip_device
|
||||
|
|
|
@ -35,6 +35,7 @@ typedef struct session {
|
|||
int stream;
|
||||
int frontend;
|
||||
int findex;
|
||||
int src;
|
||||
uint32_t nsession;
|
||||
char session[9];
|
||||
dvb_mux_conf_t dmc;
|
||||
|
@ -294,7 +295,7 @@ rtsp_start(http_connection_t *hc, session_t *rs, char *addrbuf)
|
|||
LIST_FOREACH(mn, &mpegts_network_all, mn_global_link) {
|
||||
ln = (dvb_network_t *)mn;
|
||||
if (ln->ln_type == rs->dmc.dmc_fe_type &&
|
||||
mn->mn_satip_source == rs->findex)
|
||||
mn->mn_satip_source == rs->src)
|
||||
break;
|
||||
}
|
||||
if (mn) {
|
||||
|
@ -650,6 +651,8 @@ rtsp_process_play(http_connection_t *hc, int setup)
|
|||
mtype = mtype_to_tvh(hc);
|
||||
if (mtype == DVB_MOD_NONE) goto error;
|
||||
|
||||
src = 1;
|
||||
|
||||
if (msys == DVB_SYS_DVBS || msys == DVB_SYS_DVBS2) {
|
||||
|
||||
src = atoi(http_arg_get_remove(&hc->hc_req_args, "src"));
|
||||
|
@ -746,6 +749,7 @@ rtsp_process_play(http_connection_t *hc, int setup)
|
|||
if (stream_id == 0)
|
||||
stream_id++;
|
||||
rs->stream = stream_id % 0x7fff;
|
||||
rs->src = src;
|
||||
|
||||
memset(&rs->udp_rtp, 0, sizeof(rs->udp_rtp));
|
||||
memset(&rs->udp_rtcp, 0, sizeof(rs->udp_rtcp));
|
||||
|
|
|
@ -104,7 +104,7 @@ satip_server_http_xml(http_connection_t *hc)
|
|||
char *devicelist = NULL;
|
||||
htsbuf_queue_t q;
|
||||
mpegts_network_t *mn;
|
||||
int dvbt = 0, dvbs = 0, dvbc = 0, delim = 0, i;
|
||||
int dvbt = 0, dvbs = 0, dvbc = 0, srcs = 0, delim = 0, i;
|
||||
|
||||
htsbuf_queue_init(&q, 0);
|
||||
|
||||
|
@ -114,9 +114,11 @@ satip_server_http_xml(http_connection_t *hc)
|
|||
continue;
|
||||
if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbt_class))
|
||||
dvbt++;
|
||||
else if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbs_class))
|
||||
else if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbs_class)) {
|
||||
dvbs++;
|
||||
else if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbc_class))
|
||||
if (srcs < mn->mn_satip_source)
|
||||
srcs = mn->mn_satip_source;
|
||||
} else if (idnode_is_instance(&mn->mn_id, &dvb_network_dvbc_class))
|
||||
dvbc++;
|
||||
}
|
||||
if (dvbt && (i = config_get_int("satip_dvbt", 0)) > 0) {
|
||||
|
@ -138,6 +140,8 @@ satip_server_http_xml(http_connection_t *hc)
|
|||
dvbc = 0;
|
||||
}
|
||||
pthread_mutex_unlock(&global_lock);
|
||||
if (!dvbs)
|
||||
srcs = 0;
|
||||
|
||||
devicelist = htsbuf_to_string(&q);
|
||||
htsbuf_queue_flush(&q);
|
||||
|
@ -151,7 +155,7 @@ satip_server_http_xml(http_connection_t *hc)
|
|||
snprintf(buf, sizeof(buf), MSG,
|
||||
tvheadend_version, tvheadend_version,
|
||||
satip_server_uuid, tvheadend_version,
|
||||
satip_server_rtsp_port, dvbs,
|
||||
satip_server_rtsp_port, srcs,
|
||||
http_server_ip, http_server_port,
|
||||
http_server_ip, http_server_port,
|
||||
http_server_ip, http_server_port,
|
||||
|
|
Loading…
Add table
Reference in a new issue