| 22 | } |
| 23 | |
| 24 | Cicada::IDataSource *dataSourcePrototype::create(const std::string &uri, const Cicada::options *opts, int flags) |
| 25 | { |
| 26 | int score_res = 0; |
| 27 | dataSourcePrototype *dataSource = nullptr; |
| 28 | IDataSource *source = nullptr; |
| 29 | |
| 30 | for (int i = 0; i < _nextSlot; ++i) { |
| 31 | int score = dataSourceQueue[i]->probeScore(uri, opts, flags); |
| 32 | |
| 33 | if (score > score_res) { |
| 34 | score_res = score; |
| 35 | dataSource = dataSourceQueue[i]; |
| 36 | } |
| 37 | |
| 38 | if (score >= SUPPORT_MAX) { |
| 39 | break; |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | if (dataSource) { |
| 44 | source = dataSource->clone(uri); |
| 45 | } |
| 46 | #ifdef ENABLE_CURL_SOURCE |
| 47 | else if (globalSettings::getSetting().getProperty("protected.network.http.http2") == "ON" && CurlDataSource2::probe(uri)) { |
| 48 | source = new CurlDataSource2(uri); |
| 49 | } else if (globalSettings::getSetting().getProperty("protected.network.http.http2") != "ON" && CurlDataSource::probe(uri)) { |
| 50 | source = new CurlDataSource(uri); |
| 51 | } |
| 52 | #endif |
| 53 | else { |
| 54 | source = new ffmpegDataSource(uri); |
| 55 | } |
| 56 | |
| 57 | source->setOptions(opts); |
| 58 | return source; |
nothing calls this directly
no test coverage detected