mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-04 03:11:43 +00:00
Add data accessors for USBCamera and MJPEGServer.
USBCamera: getPath() MJPEGServer: getListenAddress() and getPort()
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user