SinkImpl: Refactor GetDescription, add GetError, SetEnabled.

This commit is contained in:
Peter Johnson
2016-10-26 23:31:48 -07:00
parent a5f63c3ae3
commit 5f69cb2a5b
4 changed files with 52 additions and 19 deletions

View File

@@ -332,20 +332,14 @@ void MJPEGServerImpl::SendJSON(llvm::raw_ostream& os, SourceImpl& source,
MJPEGServerImpl::MJPEGServerImpl(llvm::StringRef name,
llvm::StringRef description,
std::unique_ptr<wpi::NetworkAcceptor> acceptor)
: SinkImpl{name},
m_description(description),
m_acceptor{std::move(acceptor)} {
: SinkImpl{name}, m_acceptor{std::move(acceptor)} {
m_active = true;
SetDescription(description);
m_serverThread = std::thread(&MJPEGServerImpl::ServerThreadMain, this);
}
MJPEGServerImpl::~MJPEGServerImpl() { Stop(); }
llvm::StringRef MJPEGServerImpl::GetDescription(
llvm::SmallVectorImpl<char>& buf) const {
return m_description;
}
void MJPEGServerImpl::Stop() {
m_active = false;