| 228 | } |
| 229 | |
| 230 | string 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 | |
| 262 | bool PrepareStreamNames(const map<string,vector<string>>& params, bool mode_output) |
| 263 | { |
no test coverage detected