From 7597f15d24919761da115fc1c94cf06bec3bac6e Mon Sep 17 00:00:00 2001 From: badaix Date: Thu, 11 Feb 2021 08:33:36 +0100 Subject: [PATCH] Tidy up code --- client/decoder/pcm_decoder.cpp | 10 +++---- client/player/alsa_player.cpp | 4 +-- client/player/opensl_player.cpp | 36 ++++++++++++------------ client/snapclient.cpp | 6 ++-- client/stream.cpp | 7 +---- client/stream.hpp | 4 +-- common/resampler.cpp | 4 +-- common/sample_format.cpp | 6 ++-- server/config.cpp | 4 --- server/config.hpp | 8 +++--- server/control_session_http.cpp | 6 ++-- server/control_session_http.hpp | 4 +-- server/encoder/pcm_encoder.cpp | 8 +++--- server/publishZeroConf/publish_avahi.cpp | 2 +- server/server.hpp | 8 +++--- server/snapserver.cpp | 2 +- server/stream_server.hpp | 8 +++--- server/streamreader/airplay_stream.cpp | 6 ++-- server/streamreader/airplay_stream.hpp | 4 +-- server/streamreader/alsa_stream.cpp | 14 ++++----- server/streamreader/meta_stream.cpp | 4 +-- server/streamreader/meta_stream.hpp | 4 +-- 22 files changed, 74 insertions(+), 85 deletions(-) diff --git a/client/decoder/pcm_decoder.cpp b/client/decoder/pcm_decoder.cpp index 3d9faa74..4451a9a4 100644 --- a/client/decoder/pcm_decoder.cpp +++ b/client/decoder/pcm_decoder.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -24,10 +24,10 @@ namespace decoder { -#define ID_RIFF 0x46464952 -#define ID_WAVE 0x45564157 -#define ID_FMT 0x20746d66 -#define ID_DATA 0x61746164 +static constexpr auto ID_RIFF = 0x46464952; +static constexpr auto ID_WAVE = 0x45564157; +static constexpr auto ID_FMT = 0x20746d66; +static constexpr auto ID_DATA = 0x61746164; struct riff_wave_header { diff --git a/client/player/alsa_player.cpp b/client/player/alsa_player.cpp index d83faadf..f128ee1f 100644 --- a/client/player/alsa_player.cpp +++ b/client/player/alsa_player.cpp @@ -261,7 +261,7 @@ void AlsaPlayer::initMixer() throw SnapException(std::string("Failed to open mixer, error: ") + snd_strerror(err)); if ((err = snd_mixer_attach(mixer_, mixer_device_.c_str())) < 0) throw SnapException("Failed to attach mixer to " + mixer_device_ + ", error: " + snd_strerror(err)); - if ((err = snd_mixer_selem_register(mixer_, NULL, NULL)) < 0) + if ((err = snd_mixer_selem_register(mixer_, nullptr, nullptr)) < 0) throw SnapException(std::string("Failed to register selem, error: ") + snd_strerror(err)); if ((err = snd_mixer_load(mixer_)) < 0) throw SnapException(std::string("Failed to load mixer, error: ") + snd_strerror(err)); @@ -402,7 +402,7 @@ void AlsaPlayer::initAlsa() buffer_time = period_time * periods; } - if ((err = snd_pcm_hw_params_set_buffer_time_near(handle_, params, &buffer_time, 0)) < 0) + if ((err = snd_pcm_hw_params_set_buffer_time_near(handle_, params, &buffer_time, nullptr)) < 0) throw SnapException("Can't set buffer time to " + cpt::to_string(buffer_time) + " us : " + string(snd_strerror(err))); // unsigned int periods = periods_; diff --git a/client/player/opensl_player.cpp b/client/player/opensl_player.cpp index cb1ac57b..1fe652de 100644 --- a/client/player/opensl_player.cpp +++ b/client/player/opensl_player.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,8 +53,8 @@ static void bqPlayerCallback(SLAndroidSimpleBufferQueueItf bq, void* context) OpenslPlayer::OpenslPlayer(boost::asio::io_context& io_context, const ClientSettings::Player& settings, std::shared_ptr stream) - : Player(io_context, settings, stream), engineObject(NULL), engineEngine(NULL), outputMixObject(NULL), bqPlayerObject(NULL), bqPlayerPlay(NULL), - bqPlayerBufferQueue(NULL), bqPlayerVolume(NULL), curBuffer(0), ms_(50), buff_size(0), pubStream_(stream) + : Player(io_context, settings, stream), engineObject(nullptr), engineEngine(nullptr), outputMixObject(nullptr), bqPlayerObject(nullptr), + bqPlayerPlay(nullptr), bqPlayerBufferQueue(nullptr), bqPlayerVolume(nullptr), curBuffer(0), ms_(50), buff_size(0), pubStream_(stream) { initOpensl(); } @@ -178,7 +178,7 @@ void OpenslPlayer::initOpensl() SLresult result; // create engine SLEngineOption engineOption[] = {{(SLuint32)SL_ENGINEOPTION_THREADSAFE, (SLuint32)SL_BOOLEAN_TRUE}}; - result = slCreateEngine(&engineObject, 1, engineOption, 0, NULL, NULL); + result = slCreateEngine(&engineObject, 1, engineOption, 0, nullptr, nullptr); throwUnsuccess(kPhaseInit, "slCreateEngine", result); result = (*engineObject)->Realize(engineObject, SL_BOOLEAN_FALSE); throwUnsuccess(kPhaseInit, "EngineObject::Realize", result); @@ -266,7 +266,7 @@ void OpenslPlayer::initOpensl() // configure audio sink SLDataLocator_OutputMix loc_outmix = {SL_DATALOCATOR_OUTPUTMIX, outputMixObject}; - SLDataSink audioSnk = {&loc_outmix, NULL}; + SLDataSink audioSnk = {&loc_outmix, nullptr}; // create audio player const SLInterfaceID ids[3] = {SL_IID_ANDROIDCONFIGURATION, SL_IID_PLAY, SL_IID_BUFFERQUEUE}; //, SL_IID_VOLUME}; @@ -321,7 +321,7 @@ void OpenslPlayer::uninitOpensl() LOG(INFO, LOG_TAG) << "uninitOpensl\n"; SLresult result; LOG(INFO, LOG_TAG) << "OpenSLWrap_Shutdown - stopping playback\n"; - if (bqPlayerPlay != NULL) + if (bqPlayerPlay != nullptr) { result = (*bqPlayerPlay)->SetPlayState(bqPlayerPlay, SL_PLAYSTATE_STOPPED); if (SL_RESULT_SUCCESS != result) @@ -330,37 +330,37 @@ void OpenslPlayer::uninitOpensl() LOG(INFO, LOG_TAG) << "OpenSLWrap_Shutdown - deleting player object\n"; - if (bqPlayerObject != NULL) + if (bqPlayerObject != nullptr) { (*bqPlayerObject)->Destroy(bqPlayerObject); - bqPlayerObject = NULL; - bqPlayerPlay = NULL; - bqPlayerBufferQueue = NULL; - bqPlayerVolume = NULL; + bqPlayerObject = nullptr; + bqPlayerPlay = nullptr; + bqPlayerBufferQueue = nullptr; + bqPlayerVolume = nullptr; } LOG(INFO, LOG_TAG) << "OpenSLWrap_Shutdown - deleting mix object\n"; - if (outputMixObject != NULL) + if (outputMixObject != nullptr) { (*outputMixObject)->Destroy(outputMixObject); - outputMixObject = NULL; + outputMixObject = nullptr; } LOG(INFO, LOG_TAG) << "OpenSLWrap_Shutdown - deleting engine object\n"; - if (engineObject != NULL) + if (engineObject != nullptr) { (*engineObject)->Destroy(engineObject); - engineObject = NULL; - engineEngine = NULL; + engineObject = nullptr; + engineEngine = nullptr; } delete[] buffer[0]; - buffer[0] = NULL; + buffer[0] = nullptr; delete[] buffer[1]; - buffer[1] = NULL; + buffer[1] = nullptr; LOG(INFO, LOG_TAG) << "OpenSLWrap_Shutdown - finished\n"; active_ = false; diff --git a/client/snapclient.cpp b/client/snapclient.cpp index 91524f78..00c123c4 100644 --- a/client/snapclient.cpp +++ b/client/snapclient.cpp @@ -122,7 +122,7 @@ int main(int argc, char** argv) int exitcode = EXIT_SUCCESS; try { - string meta_script(""); + string meta_script; ClientSettings settings; string pcm_device(player::DEFAULT_DEVICE); @@ -309,8 +309,8 @@ int main(int argc, char** argv) string pidFile = "/var/run/snapclient/pid"; if (settings.instance != 1) pidFile += "." + cpt::to_string(settings.instance); - string user = ""; - string group = ""; + string user; + string group; if (userValue->is_set()) { diff --git a/client/stream.cpp b/client/stream.cpp index ce0f0da2..92c15852 100644 --- a/client/stream.cpp +++ b/client/stream.cpp @@ -67,11 +67,6 @@ Stream::Stream(const SampleFormat& in_format, const SampleFormat& out_format) } -Stream::~Stream() -{ -} - - void Stream::setRealSampleRate(double sampleRate) { if (sampleRate == format_.rate()) @@ -95,7 +90,7 @@ void Stream::setBufferLen(size_t bufferLenMs) void Stream::clearChunks() { std::lock_guard lock(mutex_); - while (chunks_.size() > 0) + while (!chunks_.empty()) chunks_.pop(); resetBuffers(); } diff --git a/client/stream.hpp b/client/stream.hpp index 503b5213..8b88586e 100644 --- a/client/stream.hpp +++ b/client/stream.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ class Stream { public: Stream(const SampleFormat& in_format, const SampleFormat& out_format); - virtual ~Stream(); + virtual ~Stream() = default; /// Adds PCM data to the queue void addChunk(std::unique_ptr chunk); diff --git a/common/resampler.cpp b/common/resampler.cpp index bb60e208..b15bf374 100644 --- a/common/resampler.cpp +++ b/common/resampler.cpp @@ -44,8 +44,8 @@ Resampler::Resampler(const SampleFormat& in_format, const SampleFormat& out_form soxr_io_spec_t iospec = soxr_io_spec(in_type, out_type); // HQ should be fine: http://sox.sourceforge.net/Docs/FAQ soxr_quality_spec_t q_spec = soxr_quality_spec(SOXR_HQ, 0); - soxr_ = - soxr_create(static_cast(in_format_.rate()), static_cast(out_format_.rate()), in_format_.channels(), &error, &iospec, &q_spec, NULL); + soxr_ = soxr_create(static_cast(in_format_.rate()), static_cast(out_format_.rate()), in_format_.channels(), &error, &iospec, &q_spec, + nullptr); if (error != nullptr) { LOG(ERROR, LOG_TAG) << "Error soxr_create: " << error << "\n"; diff --git a/common/sample_format.cpp b/common/sample_format.cpp index df0237ba..6c6cecb7 100644 --- a/common/sample_format.cpp +++ b/common/sample_format.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -43,9 +43,9 @@ SampleFormat::SampleFormat(const std::string& format) } -SampleFormat::SampleFormat(uint32_t sampleRate, uint16_t bitsPerSample, uint16_t channelCount) +SampleFormat::SampleFormat(uint32_t sampleRate, uint16_t bitsPerSample, uint16_t channels) { - setFormat(sampleRate, bitsPerSample, channelCount); + setFormat(sampleRate, bitsPerSample, channels); } diff --git a/server/config.cpp b/server/config.cpp index 7fa17d1b..ad20cad9 100644 --- a/server/config.cpp +++ b/server/config.cpp @@ -30,10 +30,6 @@ using namespace std; -Config::Config() -{ -} - Config::~Config() { diff --git a/server/config.hpp b/server/config.hpp index ac982c92..8a5de073 100644 --- a/server/config.hpp +++ b/server/config.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -16,8 +16,8 @@ along with this program. If not, see . ***/ -#ifndef CONFIG_H -#define CONFIG_H +#ifndef CONFIG_HPP +#define CONFIG_HPP #include #include @@ -395,7 +395,7 @@ public: std::vector groups; private: - Config(); + Config() = default; ~Config(); std::string filename_; }; diff --git a/server/control_session_http.cpp b/server/control_session_http.cpp index 398aaa15..6255ccd2 100644 --- a/server/control_session_http.cpp +++ b/server/control_session_http.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -363,8 +363,10 @@ void ControlSessionHttp::on_read(beast::error_code ec, std::size_t bytes_transfe } -void ControlSessionHttp::on_write(beast::error_code ec, std::size_t, bool close) +void ControlSessionHttp::on_write(beast::error_code ec, std::size_t bytes, bool close) { + std::ignore = bytes; + // Handle the error, if any if (ec) { diff --git a/server/control_session_http.hpp b/server/control_session_http.hpp index ff43fc27..6d0ef47a 100644 --- a/server/control_session_http.hpp +++ b/server/control_session_http.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -58,7 +58,7 @@ public: protected: // HTTP methods void on_read(beast::error_code ec, std::size_t bytes_transferred); - void on_write(beast::error_code ec, std::size_t, bool close); + void on_write(beast::error_code ec, std::size_t bytes, bool close); template void handle_request(http::request>&& req, Send&& send); diff --git a/server/encoder/pcm_encoder.cpp b/server/encoder/pcm_encoder.cpp index 3d14cb31..3fe7b7d8 100644 --- a/server/encoder/pcm_encoder.cpp +++ b/server/encoder/pcm_encoder.cpp @@ -24,10 +24,10 @@ namespace encoder { -#define ID_RIFF 0x46464952 -#define ID_WAVE 0x45564157 -#define ID_FMT 0x20746d66 -#define ID_DATA 0x61746164 +static constexpr auto ID_RIFF = 0x46464952; +static constexpr auto ID_WAVE = 0x45564157; +static constexpr auto ID_FMT = 0x20746d66; +static constexpr auto ID_DATA = 0x61746164; namespace diff --git a/server/publishZeroConf/publish_avahi.cpp b/server/publishZeroConf/publish_avahi.cpp index f71ab272..70f1dfd1 100644 --- a/server/publishZeroConf/publish_avahi.cpp +++ b/server/publishZeroConf/publish_avahi.cpp @@ -152,7 +152,7 @@ void PublishAvahi::create_services(AvahiClient* c) for (const auto& service : services_) { if ((ret = avahi_entry_group_add_service(group, AVAHI_IF_UNSPEC, AVAHI_PROTO_UNSPEC, AvahiPublishFlags(0), name, service.name_.c_str(), nullptr, - nullptr, service.port_, static_cast(NULL))) < 0) + nullptr, service.port_, static_cast(nullptr))) < 0) { if (ret == AVAHI_ERR_COLLISION) goto collision; diff --git a/server/server.hpp b/server/server.hpp index 1d6bb187..b0175cf8 100644 --- a/server/server.hpp +++ b/server/server.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -63,11 +63,11 @@ public: private: /// Implementation of StreamMessageReceiver - void onMessageReceived(StreamSession* connection, const msg::BaseMessage& baseMessage, char* buffer) override; - void onDisconnect(StreamSession* connection) override; + void onMessageReceived(StreamSession* streamSession, const msg::BaseMessage& baseMessage, char* buffer) override; + void onDisconnect(StreamSession* streamSession) override; /// Implementation of ControllMessageReceiver - std::string onMessageReceived(ControlSession* connection, const std::string& message) override; + std::string onMessageReceived(ControlSession* controlSession, const std::string& message) override; void onNewSession(const std::shared_ptr& session) override { std::ignore = session; diff --git a/server/snapserver.cpp b/server/snapserver.cpp index 4070ae63..925e4d16 100644 --- a/server/snapserver.cpp +++ b/server/snapserver.cpp @@ -242,7 +242,7 @@ int main(int argc, char* argv[]) if (daemonOption->is_set()) { if (settings.server.user.empty()) - std::invalid_argument("user must not be empty"); + throw std::invalid_argument("user must not be empty"); if (settings.server.data_dir.empty()) settings.server.data_dir = "/var/lib/snapserver"; diff --git a/server/stream_server.hpp b/server/stream_server.hpp index f10033e0..d99ccb6e 100644 --- a/server/stream_server.hpp +++ b/server/stream_server.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -67,7 +67,7 @@ public: void onMetaChanged(const PcmStream* pcmStream, std::shared_ptr meta); void onChunkEncoded(const PcmStream* pcmStream, bool isDefaultStream, std::shared_ptr chunk, double duration); - session_ptr getStreamSession(const std::string& mac) const; + session_ptr getStreamSession(const std::string& clientId) const; session_ptr getStreamSession(StreamSession* session) const; private: @@ -76,8 +76,8 @@ private: void cleanup(); /// Implementation of StreamMessageReceiver - void onMessageReceived(StreamSession* connection, const msg::BaseMessage& baseMessage, char* buffer) override; - void onDisconnect(StreamSession* connection) override; + void onMessageReceived(StreamSession* streamSession, const msg::BaseMessage& baseMessage, char* buffer) override; + void onDisconnect(StreamSession* streamSession) override; mutable std::recursive_mutex sessionsMutex_; mutable std::recursive_mutex clientMutex_; diff --git a/server/streamreader/airplay_stream.cpp b/server/streamreader/airplay_stream.cpp index 28f91329..20e7400c 100644 --- a/server/streamreader/airplay_stream.cpp +++ b/server/streamreader/airplay_stream.cpp @@ -33,7 +33,7 @@ static constexpr auto LOG_TAG = "AirplayStream"; namespace { -string hex2str(string input) +string hex2str(const string& input) { using byte = unsigned char; unsigned long x = strtoul(input.c_str(), nullptr, 16); @@ -88,7 +88,7 @@ AirplayStream::~AirplayStream() } #ifdef HAS_EXPAT -int AirplayStream::parse(string line) +int AirplayStream::parse(const string& line) { enum XML_Status result; @@ -345,7 +345,7 @@ void XMLCALL AirplayStream::element_end(void* userdata, const char* element_name self->entry_->type.assign(hex2str(self->buf_)); else if (name == "length") - self->entry_->length = strtoul(self->buf_.c_str(), 0, 10); + self->entry_->length = strtoul(self->buf_.c_str(), nullptr, 10); else if (name == "data") self->entry_->data = self->buf_; diff --git a/server/streamreader/airplay_stream.hpp b/server/streamreader/airplay_stream.hpp index 7e634b55..08758876 100644 --- a/server/streamreader/airplay_stream.hpp +++ b/server/streamreader/airplay_stream.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -74,7 +74,7 @@ protected: void pipeReadLine(); #ifdef HAS_EXPAT - int parse(std::string line); + int parse(const std::string& line); void createParser(); void push(); void setMetaData(const std::string& key, const std::string& newValue); diff --git a/server/streamreader/alsa_stream.cpp b/server/streamreader/alsa_stream.cpp index 7c7eefcd..4ed68066 100644 --- a/server/streamreader/alsa_stream.cpp +++ b/server/streamreader/alsa_stream.cpp @@ -134,17 +134,13 @@ void AlsaStream::initAlsa() if ((err = snd_pcm_hw_params_set_format(handle_, hw_params, snd_pcm_format)) < 0) throw SnapException("Can't set sample format: " + string(snd_strerror(err))); - if ((err = snd_pcm_hw_params_set_rate_near(handle_, hw_params, &rate, 0)) < 0) - { + if ((err = snd_pcm_hw_params_set_rate_near(handle_, hw_params, &rate, nullptr)) < 0) throw SnapException("Can't set rate: " + string(snd_strerror(err))); - } - else + + if (rate != sampleFormat_.rate()) { - if (rate != sampleFormat_.rate()) - { - LOG(WARNING, LOG_TAG) << "Rate is not accurate (requested: " << sampleFormat_.rate() << ", got: " << rate << "), using: " << rate << "\n"; - sampleFormat_.setFormat(rate, sampleFormat_.bits(), sampleFormat_.channels()); - } + LOG(WARNING, LOG_TAG) << "Rate is not accurate (requested: " << sampleFormat_.rate() << ", got: " << rate << "), using: " << rate << "\n"; + sampleFormat_.setFormat(rate, sampleFormat_.bits(), sampleFormat_.channels()); } if ((err = snd_pcm_hw_params_set_channels(handle_, hw_params, sampleFormat_.channels())) < 0) diff --git a/server/streamreader/meta_stream.cpp b/server/streamreader/meta_stream.cpp index 91145f9f..5a03bc9f 100644 --- a/server/streamreader/meta_stream.cpp +++ b/server/streamreader/meta_stream.cpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -32,7 +32,7 @@ static constexpr auto LOG_TAG = "MetaStream"; // static constexpr auto kResyncTolerance = 50ms; -MetaStream::MetaStream(PcmListener* pcmListener, std::vector> streams, boost::asio::io_context& ioc, const StreamUri& uri) +MetaStream::MetaStream(PcmListener* pcmListener, const std::vector>& streams, boost::asio::io_context& ioc, const StreamUri& uri) : PcmStream(pcmListener, ioc, uri), first_read_(true) { auto path_components = utils::string::split(uri.path, '/'); diff --git a/server/streamreader/meta_stream.hpp b/server/streamreader/meta_stream.hpp index 3ba080b5..8000b49f 100644 --- a/server/streamreader/meta_stream.hpp +++ b/server/streamreader/meta_stream.hpp @@ -1,6 +1,6 @@ /*** This file is part of snapcast - Copyright (C) 2014-2020 Johannes Pohl + Copyright (C) 2014-2021 Johannes Pohl This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -37,7 +37,7 @@ class MetaStream : public PcmStream, public PcmListener { public: /// ctor. Encoded PCM data is passed to the PcmListener - MetaStream(PcmListener* pcmListener, std::vector> streams, boost::asio::io_context& ioc, const StreamUri& uri); + MetaStream(PcmListener* pcmListener, const std::vector>& streams, boost::asio::io_context& ioc, const StreamUri& uri); virtual ~MetaStream(); void start() override;