17 #include <llvm/DenseMap.h> 18 #include <llvm/StringMap.h> 19 #include <llvm/StringRef.h> 20 #include <networktables/NetworkTable.h> 21 #include <support/mutex.h> 23 #include "ErrorBase.h" 35 static constexpr uint16_t kBasePort = 1181;
36 static constexpr
int kSize640x480 = 0;
37 static constexpr
int kSize320x240 = 1;
38 static constexpr
int kSize160x120 = 2;
139 template <
typename T>
181 template <
typename T>
183 std::initializer_list<T> hosts);
291 std::shared_ptr<nt::NetworkTable> GetSourceTable(CS_Source source);
292 std::vector<std::string> GetSinkStreamValues(CS_Sink sink);
293 std::vector<std::string> GetSourceStreamValues(CS_Source source);
294 void UpdateStreamValues();
296 static constexpr
char const* kPublishName =
"/CameraPublisher";
299 std::atomic<int> m_defaultUsbDevice;
300 std::string m_primarySourceName;
304 std::shared_ptr<nt::NetworkTable> m_publishTable;
308 std::vector<std::string> m_addresses;
313 #include "CameraServer.inc" Definition: RobotController.cpp:14
Definition: DenseMap.h:585
void SetSize(int size)
Sets the size of the image to use.
Definition: CameraServer.cpp:666
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:459
cs::AxisCamera AddAxisCamera(llvm::StringRef host)
Adds an Axis IP camera.
Definition: CameraServer.cpp:477
void StartAutomaticCapture(const cs::VideoSource &camera)
Start automatically capturing images to send to the dashboard from an existing camera.
Definition: CameraServer.cpp:525
A source that represents a USB camera.
Definition: cscore_oo.h:241
An event listener.
Definition: cscore_oo.h:620
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:21
cs::CvSource PutVideo(llvm::StringRef name, int width, int height)
Create a MJPEG stream with OpenCV input.
Definition: CameraServer.cpp:595
A source for user code to provide OpenCV images as video frames.
Definition: cscore_oo.h:366
Base class for most objects.
Definition: ErrorBase.h:74
void RemoveCamera(llvm::StringRef name)
Removes a camera by name.
Definition: CameraServer.cpp:661
cs::MjpegServer AddServer(llvm::StringRef name)
Adds a MJPEG server at the next available port.
Definition: CameraServer.cpp:602
void AddCamera(const cs::VideoSource &camera)
Adds an already created camera.
Definition: CameraServer.cpp:654
Singleton class for creating and keeping camera servers.
Definition: CameraServer.h:33
void RemoveServer(llvm::StringRef name)
Removes a server by name.
Definition: CameraServer.cpp:622
A sink that acts as a MJPEG-over-HTTP network server.
Definition: cscore_oo.h:532
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:326
cs::CvSink GetVideo()
Get OpenCV access to the primary camera feed.
Definition: CameraServer.cpp:534
A sink for user code to accept video frames as OpenCV images.
Definition: cscore_oo.h:555
cs::VideoSink GetServer()
Get server for the primary camera feed.
Definition: CameraServer.cpp:627