Add data accessors for USBCamera and MJPEGServer.

USBCamera: getPath()

MJPEGServer: getListenAddress() and getPort()
This commit is contained in:
Peter Johnson
2016-11-18 17:21:03 -08:00
parent 5eecbfd9bf
commit a05636d9a6
11 changed files with 133 additions and 8 deletions

View File

@@ -30,11 +30,13 @@ class SourceImpl;
class MJPEGServerImpl : public SinkImpl {
public:
MJPEGServerImpl(llvm::StringRef name, llvm::StringRef description,
MJPEGServerImpl(llvm::StringRef name, llvm::StringRef listenAddress, int port,
std::unique_ptr<wpi::NetworkAcceptor> acceptor);
~MJPEGServerImpl() override;
void Stop();
std::string GetListenAddress() { return m_listenAddress; }
int GetPort() { return m_port; }
private:
void SetSourceImpl(std::shared_ptr<SourceImpl> source) override;
@@ -43,6 +45,10 @@ class MJPEGServerImpl : public SinkImpl {
class ConnThread;
// Never changed, so not protected by mutex
std::string m_listenAddress;
int m_port;
std::unique_ptr<wpi::NetworkAcceptor> m_acceptor;
std::atomic_bool m_active; // set to false to terminate threads
std::thread m_serverThread;