Commit Graph

55 Commits

Author SHA1 Message Date
Dustin Spicuzza
8c3efa5926 Increment reference count when creating VideoSource object (#53) 2017-02-09 00:55:40 -08:00
Thad House
cf8cab850b Fixes missing VideoProperty constructor. (#49) 2017-01-20 00:49:58 -07:00
Peter Johnson
883fd5b062 For property events, provide property name rather than source name.
This is much more useful.
2017-01-02 23:17:00 -08:00
Peter Johnson
7ddbf20108 Create VideoCamera base class and move camera settings functions to it.
This makes them available for both UsbCamera and HttpCamera / AxisCamera.

To avoid virtual functions in the public-facing interface, move the
implementation of the camera settings functions to the core library.
2017-01-02 23:17:00 -08:00
Peter Johnson
318d23ba1c Add AxisCamera wrapper class.
This takes hosts (IP or DNS name) rather than URLs, making it easier
to use.

Also add more overloads to resolve ambiguities encountered when using
std::string and const char*, and also add overloads for
std::initializer_list<T> so braced initializer lists can be used.
2016-12-23 22:26:27 -08:00
Peter Johnson
9016a9e8b8 Start implementing HttpCamera.
This is a work in progress that does not yet support camera settings.
2016-12-23 22:26:27 -08:00
Peter Johnson
4c8c41fdc0 CvSink: Support grayscale images.
Also support 4-channel BGRx images and provide better error reporting
on bad images passed to PutFrame.
2016-12-23 22:25:11 -08:00
Peter Johnson
80abf6bf24 Support per-stream resolution settings.
The code now automatically resizes as required.

This change also disconnects camera resolution settings from MJPEG
stream connections; setting the camera resolution can now only be done
via code.
2016-12-20 20:48:31 -08:00
Peter Johnson
28a2ba4bf8 Add external logger interface. 2016-12-18 09:13:01 -08:00
Peter Johnson
1f93a4ab4f Change acronym class names to use MixedCase (UsbCamera, MjpegServer). (#22) 2016-12-04 00:08:47 -08:00
Thad House
3625f11e08 Adds C methods that take a cv::Mat* (#21)
Some implementations of OpenCV use cv::Mat as their native pointer
rather then CvMat, so we need to support both in the C interface
2016-11-30 22:00:44 -08:00
Peter Johnson
a05636d9a6 Add data accessors for USBCamera and MJPEGServer.
USBCamera: getPath()

MJPEGServer: getListenAddress() and getPort()
2016-11-18 17:21:03 -08:00
Peter Johnson
881d55f858 VideoListener: Add move assignment operator. 2016-11-18 15:10:37 -08:00
Peter Johnson
cc20d9d0fe Add no-parameter constructors for specific sources/sinks. 2016-11-18 14:33:47 -08:00
Peter Johnson
bad4ca4666 Add event for network interfaces change. 2016-11-18 12:41:08 -08:00
Peter Johnson
5fecc57e8a Add methods to get the hostname and network interfaces. 2016-11-18 12:41:08 -08:00
Peter Johnson
5ace9e4189 Renumber event kind values. 2016-11-18 12:41:08 -08:00
Peter Johnson
dcf773c3ef Add USBCamera setting functions similar to the old WPILib nivision ones. 2016-11-18 12:41:08 -08:00
Peter Johnson
791cabbc26 Rename Type to Kind. 2016-11-18 12:41:08 -08:00
Peter Johnson
3c7d8063f6 VideoProperty: rename type() to getType(). 2016-11-18 12:41:08 -08:00
Peter Johnson
3381340eb5 Add method to get source/sink type.
Also provide convenience method to enumerate all sinks connected to a source.
2016-11-18 12:41:08 -08:00
Peter Johnson
6446b9ef10 Add sink source changed event. 2016-11-18 12:41:08 -08:00
Peter Johnson
6c19eb59b2 VideoSource, VideoSink: Provide equality operation.
* Provide hashCode implementation for Java.

* Provide getHandle for both C++ and Java.
2016-11-18 12:41:08 -08:00
Peter Johnson
f83ff41e47 Rename from cameraserver to cscore.
This is primarily to avoid header naming conflicts with wpilib.
2016-11-05 22:11:55 -07:00
Peter Johnson
29d8d1d74c Implement listener interfaces. 2016-11-05 13:19:02 -07:00
Peter Johnson
8d2efb2838 Improve listener interface.
Now a structure is passed back, enabling combining the existing source
and sink listeners and adding property listeners as well.
2016-11-05 13:19:02 -07:00
Peter Johnson
c66a55d81a Implement CvSink.
* Make CvSink constructor explicit.

* Add SetDescription function.
2016-10-26 23:37:00 -07:00
Peter Johnson
7ca6c5ef34 Remove RemoveSourceProperty. 2016-10-24 22:29:58 -07:00
Peter Johnson
9142cbb820 CvSource: Update interface functions.
- Add SetDescription
- Supply minimum, maximum, step, defaultValue, and value to CreateProperty
- Add SetEnumPropertyChoices
2016-10-23 08:43:06 -07:00
Peter Johnson
218718a063 Add OpenCV dependency and update OpenCV interfaces.
This requires the wpilibsuite/opencv packages with PRs 1-3 applied.
2016-10-22 09:57:33 -07:00
Peter Johnson
9caa0af4d9 USBCamera, HTTPCamera: Name functions consistent with classes. 2016-10-15 23:07:28 -07:00
Peter Johnson
30f4ecd171 Rename HTTPSink to MJPEGServer. 2016-10-15 22:44:26 -07:00
Peter Johnson
70616c48e3 Add support for enumerating and changing USB camera video mode. 2016-09-29 00:04:16 -07:00
Peter Johnson
d5e5755ff4 Collapse boolean/double/enum properties into just integer. 2016-09-20 22:17:12 -07:00
Peter Johnson
dad44cc928 Add status parameter to property functions. 2016-09-19 23:50:47 -07:00
Peter Johnson
6eba04ed8e Use copy-and-swap idiom for reference-counted classes. 2016-09-18 17:25:48 -07:00
Peter Johnson
c606671d27 Consistently name property max/min functions and add step/default. 2016-09-18 17:25:21 -07:00
Peter Johnson
9bb37d5df0 Remove support for multiple channels. 2016-09-18 17:15:27 -07:00
Peter Johnson
052f746c68 Use StringRef and ArrayRef return values when buf passed.
For functions where a SmallVector is passed to be used as a stack buffer for
the return value, have the return value be the appropriate StringRef or
ArrayRef type.  This allows for both more natural usage and enables directly
returning (rather than copying) a permanently stored or constant string.
2016-09-10 21:30:39 -07:00
Peter Johnson
52c8743b36 Finish rename of EnumerateSinks to EnumerateSinkHandles.
And similarly for EnumerateSources to EnumerateSourceHandles.
2016-09-09 23:28:57 -07:00
Peter Johnson
5c59b9aeb3 Make HTTPCamera constructor public. 2016-09-09 23:06:50 -07:00
Peter Johnson
9dd5bea7a5 Create a common CS_Handle. Add initial status values. 2016-09-08 00:07:20 -07:00
Peter Johnson
ec080118f4 Clean up odd special case of GetSourceProperty(). 2016-08-26 09:24:18 -07:00
Peter Johnson
6bcc0e2d82 Correctly prefix CS_EnumerateSourceProperties. 2016-08-26 09:12:55 -07:00
Peter Johnson
0fbb2e8a14 Add methods to get property name and enumerate properties.
Also add method to remove property by handle.
2016-08-26 08:51:23 -07:00
Peter Johnson
0158fd35f0 Continue implementing C wrappers.
Implement non-OO C++ EnumerateUSBCameras().
2016-08-26 07:04:33 -07:00
Peter Johnson
80b15b7fe5 Add a bit of description about how handles work in the C API. 2016-08-26 01:00:38 -07:00
Peter Johnson
2acca6eeb1 cameraserver_cpp.h: Move stdint.h above the C++ includes. 2016-08-26 00:43:03 -07:00
Peter Johnson
151c89fb5d Rename FrameGrab to GrabFrame. 2016-08-26 00:30:45 -07:00
Peter Johnson
4f22ac4100 Move all non-trivial inline functions to cameraserver_oo.inl. 2016-08-26 00:29:28 -07:00