* Try decoding a URI. * * DecoderControl::mutex is not be locked by caller. */
| 307 | * DecoderControl::mutex is not be locked by caller. |
| 308 | */ |
| 309 | static DecodeResult |
| 310 | TryUriDecode(DecoderBridge &bridge, const char *uri) |
| 311 | { |
| 312 | DecodeResult result = DecodeResult::NO_PLUGIN; |
| 313 | |
| 314 | for (const auto &plugin : GetEnabledDecoderPlugins()) { |
| 315 | if (!plugin.SupportsUri(uri)) |
| 316 | continue; |
| 317 | |
| 318 | std::unique_lock lock{bridge.dc.mutex}; |
| 319 | bridge.Reset(); |
| 320 | |
| 321 | if (const auto r = DecoderUriDecode(plugin, bridge, uri); |
| 322 | r > result) { |
| 323 | result = r; |
| 324 | if (IsFinalDecodeResult(result)) |
| 325 | break; |
| 326 | } |
| 327 | } |
| 328 | |
| 329 | return result; |
| 330 | } |
| 331 | |
| 332 | /** |
| 333 | * Try decoding a stream. |
no test coverage detected