diff --git a/src/output/output_http_internal.cpp b/src/output/output_http_internal.cpp index 8216a499..525c995c 100644 --- a/src/output/output_http_internal.cpp +++ b/src/output/output_http_internal.cpp @@ -217,21 +217,6 @@ namespace Mist{ } }; - void addSource(const std::string &rel, std::set &sources, const HTTP::URL &url, - JSON::Value &conncapa, unsigned int most_simul, unsigned int total_matches){ - JSON::Value tmp; - tmp["type"] = conncapa["type"]; - tmp["relurl"] = rel; - tmp["priority"] = conncapa["priority"]; - if (conncapa.isMember("player_url")){ - tmp["player_url"] = conncapa["player_url"].asStringRef(); - } - tmp["simul_tracks"] = most_simul; - tmp["total_matches"] = total_matches; - tmp["url"] = url.link(rel).getUrl(); - sources.insert(tmp); - } - void addSources(std::string &streamname, std::set &sources, HTTP::URL url, JSON::Value &conncapa, JSON::Value &strmMeta, const std::string &useragent){ url.path += "/"; @@ -325,7 +310,18 @@ namespace Mist{ if (it->isMember("handler")){ url.protocol = (*it)["handler"].asStringRef() + (isSSL?"s":""); } - addSource(relurl, sources, url, *it, most_simul, total_matches); + JSON::Value tmp; + tmp["type"] = (*it)["type"]; + tmp["relurl"] = relurl; + tmp["priority"] = (*it)["priority"]; + if ((*it).isMember("player_url")){ + tmp["player_url"] = (*it)["player_url"].asStringRef(); + } + if (conncapa.isMember("cnf") && conncapa["cnf"].isMember("iceservers")){tmp["RTCIceServers"] = conncapa["cnf"]["iceservers"];} + tmp["simul_tracks"] = most_simul; + tmp["total_matches"] = total_matches; + tmp["url"] = url.link(relurl).getUrl(); + sources.insert(tmp); } } } @@ -556,6 +552,7 @@ namespace Mist{ } // and a URL - then list the URL JSON::Value capa_json = capa.asJSON(); + capa_json["cnf"] = prots.getIndice(i).asJSON(); if (capa.getMember("url_rel") || capa.getMember("methods")){ jsonForEach(pubAddrs, jit){ HTTP::URL altURL = outURL; @@ -577,6 +574,13 @@ namespace Mist{ connectors.getIndice(j).getMember("deps").asString() == cProv && connectors.getIndice(j).getMember("methods")){ JSON::Value subcapa_json = connectors.getIndice(j).asJSON(); + subcapa_json["cnf"] = prots.getIndice(i).asJSON(); + for (unsigned int k = 0; k < prots_ctr; ++k){ + if (prots.getIndice(k).getMember("connector").asString() == connectors.getIndiceName(j)){ + subcapa_json["cnf"].extend(prots.getIndice(k).asJSON()); + break; + } + } jsonForEach(pubAddrs, jit){ HTTP::URL altURL = outURL; diff --git a/src/output/output_webrtc.cpp b/src/output/output_webrtc.cpp index 3f59684d..c591b935 100644 --- a/src/output/output_webrtc.cpp +++ b/src/output/output_webrtc.cpp @@ -272,6 +272,14 @@ namespace Mist{ capa["optional"]["key"]["default"] = ""; capa["optional"]["key"]["type"] = "str"; + capa["optional"]["iceservers"]["name"] = "STUN/TURN config"; + capa["optional"]["iceservers"]["help"] = "An array of RTCIceServer objects, each describing one server which may be used by the ICE agent; these are typically STUN and/or TURN servers. These will be passed verbatim to the RTCPeerConnection constructor as the 'iceServers' property."; + capa["optional"]["iceservers"]["option"] = "--iceservers"; + capa["optional"]["iceservers"]["short"] = "z"; + capa["optional"]["iceservers"]["default"] = ""; + capa["optional"]["iceservers"]["type"] = "json"; + + config->addOptionsFromCapabilities(capa); }