18 #include <llvm/DenseMap.h> 19 #include <llvm/StringMap.h> 20 #include <llvm/StringRef.h> 22 #include "ErrorBase.h" 24 #include "networktables/NetworkTable.h" 34 static constexpr uint16_t kBasePort = 1181;
35 static constexpr
int kSize640x480 = 0;
36 static constexpr
int kSize320x240 = 1;
37 static constexpr
int kSize160x120 = 2;
144 template <
typename T>
186 template <
typename T>
188 std::initializer_list<T> hosts);
296 std::shared_ptr<nt::NetworkTable> GetSourceTable(CS_Source source);
297 std::vector<std::string> GetSinkStreamValues(CS_Sink sink);
298 std::vector<std::string> GetSourceStreamValues(CS_Source source);
299 void UpdateStreamValues();
301 static constexpr
char const* kPublishName =
"/CameraPublisher";
304 std::atomic<int> m_defaultUsbDevice;
305 std::string m_primarySourceName;
309 std::shared_ptr<nt::NetworkTable> m_publishTable;
313 std::vector<std::string> m_addresses;
318 #include "CameraServer.inc"
Definition: DenseMap.h:585
void SetSize(int size)
Sets the size of the image to use.
Definition: CameraServer.cpp:709
A source for video that provides a sequence of frames.
Definition: cscore_oo.h:86
A sink for video that accepts a sequence of frames.
Definition: cscore_oo.h:457
cs::AxisCamera AddAxisCamera(llvm::StringRef host)
Adds an Axis IP camera.
Definition: CameraServer.cpp:524
void StartAutomaticCapture(const cs::VideoSource &camera)
Start automatically capturing images to send to the dashboard from an existing camera.
Definition: CameraServer.cpp:568
A source that represents a USB camera.
Definition: cscore_oo.h:239
An event listener.
Definition: cscore_oo.h:616
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: ArrayRef.h:32
static CameraServer * GetInstance()
Get the CameraServer instance.
Definition: CameraServer.cpp:20
cs::CvSource PutVideo(llvm::StringRef name, int width, int height)
Create a MJPEG stream with OpenCV input.
Definition: CameraServer.cpp:638
A source for user code to provide OpenCV images as video frames.
Definition: cscore_oo.h:364
Base class for most objects.
Definition: ErrorBase.h:74
void RemoveCamera(llvm::StringRef name)
Removes a camera by name.
Definition: CameraServer.cpp:704
cs::MjpegServer AddServer(llvm::StringRef name)
Adds a MJPEG server at the next available port.
Definition: CameraServer.cpp:645
void AddCamera(const cs::VideoSource &camera)
Adds an already created camera.
Definition: CameraServer.cpp:697
Singleton class for creating and keeping camera servers.
Definition: CameraServer.h:32
void RemoveServer(llvm::StringRef name)
Removes a server by name.
Definition: CameraServer.cpp:665
A sink that acts as a MJPEG-over-HTTP network server.
Definition: cscore_oo.h:530
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:42
A source that represents an Axis IP camera.
Definition: cscore_oo.h:324
cs::CvSink GetVideo()
Get OpenCV access to the primary camera feed.
Definition: CameraServer.cpp:577
A sink for user code to accept video frames as OpenCV images.
Definition: cscore_oo.h:553
cs::VideoSink GetServer()
Get server for the primary camera feed.
Definition: CameraServer.cpp:670