* Decode a container file with the given decoder plugin. * * DecoderControl::mutex is not locked by caller. */
| 404 | * DecoderControl::mutex is not locked by caller. |
| 405 | */ |
| 406 | static DecodeResult |
| 407 | TryContainerDecoder(DecoderBridge &bridge, Path path_fs, |
| 408 | std::string_view suffix, |
| 409 | const DecoderPlugin &plugin) |
| 410 | { |
| 411 | if (plugin.container_scan == nullptr || |
| 412 | plugin.file_decode == nullptr || |
| 413 | !plugin.SupportsSuffix(suffix)) |
| 414 | return DecodeResult::NO_PLUGIN; |
| 415 | |
| 416 | bridge.Reset(); |
| 417 | |
| 418 | DecoderControl &dc = bridge.dc; |
| 419 | const std::lock_guard protect{dc.mutex}; |
| 420 | return decoder_file_decode(plugin, bridge, path_fs); |
| 421 | } |
| 422 | |
| 423 | /** |
| 424 | * Decode a container file. |
no test coverage detected