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

Function SelectMedium

testing/srt-test-multiplex.cpp:230–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230string SelectMedium(string id, bool mode_output)
231{
232 static int number = 0;
233
234 // Empty ID is incorrect.
235 if ( id == "" )
236 {
237 applog.Error() << "SelectMedium: empty id";
238 return "";
239 }
240
241 string uri = map_get(defined_streams, id);
242
243 // Test the URI if it is openable.
244 UriParser u(uri);
245 if ( u.scheme() == "file" && u.path() == "" )
246 {
247 if (mode_output)
248 {
249 ++number;
250 string sol = ResolveFilePattern(number);
251 applog.Warn() << "SelectMedium: for [" << id << "] uri '" << uri << "' is file with no path - autogenerating filename: " << sol;
252 return sol;
253 }
254 applog.Error() << "SelectMedium: id not found: [" << id << "]";
255 return "";
256 }
257
258 applog.Note() << "SelectMedium: for [" << id << "] found medium: " << uri;
259 return uri;
260}
261
262bool PrepareStreamNames(const map<string,vector<string>>& params, bool mode_output)
263{

Callers 1

SelectAndLinkFunction · 0.85

Calls 5

map_getFunction · 0.85
ResolveFilePatternFunction · 0.85
schemeMethod · 0.80
pathMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected