MCPcopy Create free account
hub / github.com/Haivision/srt / InitParameters

Method InitParameters

testing/testmedia.cpp:199–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197Iface* CreateFile(const string& name) { return new typename File<Iface>::type (name); }
198
199void SrtCommon::InitParameters(string host, string path, map<string,string> par)
200{
201 // Application-specific options: mode, blocking, timeout, adapter
202 if ( Verbose::on && !par.empty())
203 {
204 Verb() << "SRT parameters specified:\n";
205 for (map<string,string>::iterator i = par.begin(); i != par.end(); ++i)
206 {
207 Verb() << "\t" << i->first << " = '" << i->second << "'\n";
208 }
209 }
210
211 if (path != "")
212 {
213 // Special case handling of an unusual specification.
214
215 if (path.substr(0, 2) != "//")
216 {
217 Error("Path specification not supported for SRT (use // in front for special cases)");
218 }
219
220 path = path.substr(2);
221
222#if ENABLE_BONDING
223 if (path == "group")
224 {
225 // Group specified, check type.
226 m_group_type = par["type"];
227 if (m_group_type == "")
228 {
229 Error("With //group, the group 'type' must be specified.");
230 }
231
232 vector<string> parts;
233 Split(m_group_type, '/', back_inserter(parts));
234 if (parts.size() == 0 || parts.size() > 2)
235 {
236 Error("Invalid specification for 'type' parameter");
237 }
238
239 if (parts.size() == 2)
240 {
241 m_group_type = parts[0];
242 m_group_config = parts[1];
243 }
244
245 vector<string> nodes;
246 Split(par["nodes"], ',', back_inserter(nodes));
247
248 if (nodes.empty())
249 {
250 Error("With //group, 'nodes' must specify comma-separated host:port specs.");
251 }
252
253 int token = 1;
254
255 // Check if correctly specified
256 for (string& hostport: nodes)

Callers

nothing calls this directly

Calls 15

VerbFunction · 0.85
SplitFunction · 0.85
srt_create_configFunction · 0.85
srt_delete_configFunction · 0.85
PrintableFunction · 0.85
SrtInterpretModeFunction · 0.85
SprintFunction · 0.85
SrtParseVersionFunction · 0.85
hostMethod · 0.80
portMethod · 0.80
portnoMethod · 0.80
queryValueMethod · 0.80

Tested by

no test coverage detected