Skip to content

Commit

Permalink
Add wildcard (*) support to metastreams
Browse files Browse the repository at this point in the history
  • Loading branch information
jdecourval committed Aug 22, 2024
1 parent e164b2f commit 185d4e6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion server/streamreader/meta_stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ bool MetaStream::isAllowed(const PcmStream& stream) const
if (component.empty())
continue;

if (stream.getName() == component)
if (component == WILDCARD || stream.getName() == component)
{
return true;
}
Expand Down Expand Up @@ -99,6 +99,8 @@ void MetaStream::updateActiveStream()
return true;
if (component == second->getName())
return false;
if (component == WILDCARD)
return false;
}
return false;
};
Expand Down
3 changes: 3 additions & 0 deletions server/streamreader/meta_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ namespace streamreader
*/
class MetaStream : public PcmStream, public PcmStream::Listener
{
public:
static inline const std::string WILDCARD = "*";

public:
/// ctor. Encoded PCM data is passed to the PcmStream::Listener
MetaStream(PcmStream::Listener* pcmListener, const std::vector<std::shared_ptr<PcmStream>>& streams, boost::asio::io_context& ioc,
Expand Down

0 comments on commit 185d4e6

Please sign in to comment.