90 explicit operator bool()
const {
return m_handle != 0; }
365 swap(first.m_status, second.m_status);
366 swap(first.m_handle, second.m_handle);
and restrictions which apply to each piece of software is included later in this file and or inside of the individual applicable source files The disclaimer of warranty in the WPILib license above applies to all code in and nothing in any of the other licenses gives permission to use the names of FIRST nor the names of the WPILib contributors to endorse or promote products derived from this software The following pieces of software have additional or alternate and or glfw and nanopb were modified for use in Google Inc All rights reserved Redistribution and use in source and binary with or without are permitted provided that the following conditions are this list of conditions and the following disclaimer *Redistributions in binary form must reproduce the above copyright this list of conditions and the following disclaimer in the documentation and or other materials provided with the distribution *Neither the name of Google Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS AND ANY EXPRESS OR IMPLIED BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH January AND DISTRIBUTION Definitions License shall mean the terms and conditions for and distribution as defined by Sections through of this document Licensor shall mean the copyright owner or entity authorized by the copyright owner that is granting the License Legal Entity shall mean the union of the acting entity and all other entities that control are controlled by or are under common control with that entity For the purposes of this definition control direct or to cause the direction or management of such whether by contract or including but not limited to software source documentation source
Definition ThirdPartyNotices.txt:123
@ name
Definition base.h:690
An event generated by the library and provided to event listeners.
Definition VideoEvent.hpp:17
A source or sink property.
Definition VideoProperty.hpp:34
A sink for video that accepts a sequence of frames.
Definition VideoSink.hpp:24
bool IsConnected() const
Is the source currently connected to whatever is providing the images?
Definition VideoSource.hpp:154
bool SetPixelFormat(wpi::util::PixelFormat pixelFormat)
Set the pixel format.
Definition VideoSource.hpp:226
wpi::util::json GetConfigJsonObject() const
Get a JSON configuration object.
Kind GetKind() const
Get the kind of the source.
Definition VideoSource.hpp:101
uint64_t GetLastFrameTime() const
Get the last time a frame was captured.
Definition VideoSource.hpp:129
VideoSource(CS_Source handle)
Definition VideoSource.hpp:370
int GetHandle() const
Definition VideoSource.hpp:92
double GetActualDataRate() const
Get the data rate (in bytes per second).
Definition VideoSource.hpp:333
void SetConnectionStrategy(ConnectionStrategy strategy)
Sets the connection strategy.
Definition VideoSource.hpp:143
~VideoSource()
Definition VideoSource.hpp:83
CS_Status m_status
Definition VideoSource.hpp:372
std::vector< VideoProperty > EnumerateProperties() const
Enumerate all properties of this source.
bool SetConfigJson(std::string_view config)
Set video mode and properties from a JSON configuration string.
Definition VideoSource.hpp:280
CS_Status GetLastStatus() const
Definition VideoSource.hpp:347
friend class VideoSink
Definition VideoSource.hpp:27
friend void swap(VideoSource &first, VideoSource &second) noexcept
Definition VideoSource.hpp:363
VideoSource & operator=(VideoSource other) noexcept
Definition VideoSource.hpp:78
bool SetVideoMode(wpi::util::PixelFormat pixelFormat, int width, int height, int fps)
Set the video mode.
Definition VideoSource.hpp:213
bool IsEnabled() const
Gets source enable status.
Definition VideoSource.hpp:165
VideoMode GetVideoMode() const
Get the current video mode.
Definition VideoSource.hpp:189
VideoSource() noexcept=default
double GetActualFPS() const
Get the actual FPS.
Definition VideoSource.hpp:320
Kind
Video source kind.
Definition VideoSource.hpp:33
@ kUsb
USB video source.
Definition VideoSource.hpp:37
@ kUnknown
Unknown video source.
Definition VideoSource.hpp:35
@ kHttp
HTTP video source.
Definition VideoSource.hpp:39
@ kRaw
Raw video source.
Definition VideoSource.hpp:43
@ kCv
CV video source.
Definition VideoSource.hpp:41
static std::vector< VideoSource > EnumerateSources()
Enumerate all existing sources.
bool SetFPS(int fps)
Set the frames per second (FPS).
Definition VideoSource.hpp:249
std::string GetConfigJson() const
Get a JSON configuration string.
Definition VideoSource.hpp:301
std::string GetName() const
Get the name of the source.
Definition VideoSource.hpp:110
ConnectionStrategy
Connection strategy.
Definition VideoSource.hpp:47
@ kConnectionForceClose
Never open the connection.
Definition VideoSource.hpp:64
@ kConnectionKeepOpen
Try to keep the connection open regardless of whether any sinks are connected.
Definition VideoSource.hpp:58
@ kConnectionAutoManage
Automatically connect or disconnect based on whether any sinks are connected to this source.
Definition VideoSource.hpp:52
bool SetVideoMode(const VideoMode &mode)
Set the video mode.
Definition VideoSource.hpp:199
VideoSource(VideoSource &&other) noexcept
Definition VideoSource.hpp:74
bool SetResolution(int width, int height)
Set the resolution.
Definition VideoSource.hpp:238
friend class VideoEvent
Definition VideoSource.hpp:26
bool SetConfigJson(const wpi::util::json &config)
Set video mode and properties from a JSON configuration object.
Definition VideoSource.hpp:291
CS_Source m_handle
Video source handle.
Definition VideoSource.hpp:375
std::vector< VideoSink > EnumerateSinks()
Enumerate all sinks connected to this source.
std::vector< VideoMode > EnumerateVideoModes() const
Enumerate all known video modes for this source.
Definition VideoSource.hpp:342
VideoProperty GetProperty(std::string_view name)
Get a property.
Definition VideoSource.hpp:176
std::string GetDescription() const
Get the source description.
Definition VideoSource.hpp:118
bool operator==(const VideoSource &other) const
Definition VideoSource.hpp:94
CS_ConnectionStrategy
Connection strategy.
Definition cscore_c.h:170
@ CS_CONNECTION_AUTO_MANAGE
Automatically connect or disconnect based on whether any sinks are connected to this source.
Definition cscore_c.h:175
@ CS_CONNECTION_KEEP_OPEN
Try to keep the connection open regardless of whether any sinks are connected.
Definition cscore_c.h:181
@ CS_CONNECTION_FORCE_CLOSE
Never open the connection.
Definition cscore_c.h:187
@ CS_SOURCE_FRAMES_RECEIVED
Definition cscore_c.h:166
@ CS_SOURCE_BYTES_RECEIVED
Definition cscore_c.h:165
@ CS_SOURCE_USB
Definition cscore_c.h:110
@ CS_SOURCE_HTTP
Definition cscore_c.h:111
@ CS_SOURCE_UNKNOWN
Definition cscore_c.h:109
@ CS_SOURCE_RAW
Definition cscore_c.h:113
@ CS_SOURCE_CV
Definition cscore_c.h:112
VideoMode GetSourceVideoMode(CS_Source source, CS_Status *status)
bool SetSourceResolution(CS_Source source, int width, int height, CS_Status *status)
std::string GetSourceConfigJson(CS_Source source, CS_Status *status)
void SetSourceConnectionStrategy(CS_Source source, CS_ConnectionStrategy strategy, CS_Status *status)
bool SetSourceFPS(CS_Source source, int fps, CS_Status *status)
void ReleaseSource(CS_Source source, CS_Status *status)
std::string GetSourceDescription(CS_Source source, CS_Status *status)
std::vector< VideoMode > EnumerateSourceVideoModes(CS_Source source, CS_Status *status)
uint64_t GetSourceLastFrameTime(CS_Source source, CS_Status *status)
bool IsSourceEnabled(CS_Source source, CS_Status *status)
CS_Source CopySource(CS_Source source, CS_Status *status)
bool SetSourceConfigJson(CS_Source source, std::string_view config, CS_Status *status)
CS_Property GetSourceProperty(CS_Source source, std::string_view name, CS_Status *status)
CS_SourceKind GetSourceKind(CS_Source source, CS_Status *status)
std::string GetSourceName(CS_Source source, CS_Status *status)
bool SetSourcePixelFormat(CS_Source source, wpi::util::PixelFormat pixelFormat, CS_Status *status)
bool SetSourceVideoMode(CS_Source source, const VideoMode &mode, CS_Status *status)
bool IsSourceConnected(CS_Source source, CS_Status *status)
double GetTelemetryAverageValue(CS_Handle handle, CS_TelemetryKind kind, CS_Status *status)
CS_Handle CS_Source
Definition cscore_c.h:48
int CS_Status
Definition cscore_c.h:41
void swap(wpi::util::StringMap< T > &lhs, wpi::util::StringMap< T > &rhs)
Definition StringMap.hpp:775
CameraServer (cscore) namespace.
Definition CvSource.hpp:15
PixelFormat
Pixel formats.
Definition PixelFormat.hpp:14
Video mode.
Definition VideoMode.hpp:15