decoder/plugin: add method protocols()
Similar to commit 4e2a551f30 but for
decoder plugins. This is tailored for the FFmpeg decoder plugin which
implements some protocols (e.g. RTSP) as demuxer plugin.
This commit is contained in:
@@ -18,10 +18,24 @@
|
||||
*/
|
||||
|
||||
#include "DecoderPlugin.hxx"
|
||||
#include "util/StringCompare.hxx"
|
||||
#include "util/StringUtil.hxx"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
||||
bool
|
||||
DecoderPlugin::SupportsUri(const char *uri) const noexcept
|
||||
{
|
||||
if (protocols != nullptr) {
|
||||
const auto p = protocols();
|
||||
return std::any_of(p.begin(), p.end(), [uri](const auto &schema)
|
||||
{ return StringStartsWithIgnoreCase(uri, schema.c_str()); } );
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
DecoderPlugin::SupportsSuffix(const char *suffix) const noexcept
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user