mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-17 02:56:16 +02:00
Add experimental TCP and UDP streams
This commit is contained in:
parent
6e138ff49f
commit
646c7593c1
9 changed files with 365 additions and 7 deletions
|
@ -26,12 +26,15 @@
|
|||
#include "librespot_stream.hpp"
|
||||
#include "pipe_stream.hpp"
|
||||
#include "process_stream.hpp"
|
||||
#include "tcp_stream.hpp"
|
||||
#include "udp_stream.hpp"
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
StreamManager::StreamManager(PcmListener* pcmListener, boost::asio::io_context& ioc, const std::string& defaultSampleFormat, const std::string& defaultCodec, size_t defaultReadBufferMs)
|
||||
StreamManager::StreamManager(PcmListener* pcmListener, boost::asio::io_context& ioc, const std::string& defaultSampleFormat, const std::string& defaultCodec,
|
||||
size_t defaultReadBufferMs)
|
||||
: pcmListener_(pcmListener), sampleFormat_(defaultSampleFormat), codec_(defaultCodec), readBufferMs_(defaultReadBufferMs), ioc_(ioc)
|
||||
{
|
||||
}
|
||||
|
@ -77,6 +80,14 @@ PcmStreamPtr StreamManager::addStream(const std::string& uri)
|
|||
{
|
||||
stream = make_shared<AirplayStream>(pcmListener_, ioc_, streamUri);
|
||||
}
|
||||
else if (streamUri.scheme == "experimental.tcp")
|
||||
{
|
||||
stream = make_shared<TcpStream>(pcmListener_, ioc_, streamUri);
|
||||
}
|
||||
else if (streamUri.scheme == "experimental.udp")
|
||||
{
|
||||
stream = make_shared<UdpStream>(pcmListener_, ioc_, streamUri);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw SnapException("Unknown stream type: " + streamUri.scheme);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue