37 #include "../common.h"
137 virtual bool hasNew() = 0;
143 virtual bool isOpen()
const = 0;
166 virtual bool record(
const std::string& filename,
167 const std::string& codec =
"") = 0;
194 virtual void stop() = 0;
219 id_counter = std::max(id_counter, desired_id+1);
220 source_id = desired_id;
222 source_id = id_counter++;
virtual bool hasNew()=0
Checks whether the device has a new image to be retrieved or not.
DISALLOW_COPY_AND_ASSIGN(Source)
Copy and assign of the class is not allowed.
virtual FrameTime getPosition() const =0
Retrieves the current time position of the source.
virtual void resetStats() final
Resets the source statistics.
Definition: source.h:172
unsigned int SourceID
Used to indicate unique source ID-numbers.
Definition: common.h:229
virtual SourceStats getStats()=0
Retrieves the source statistical information.
const SourceID UNDEFINED_SOURCE
Used to indicate unknown sources.
Definition: common.h:234
virtual bool record(const std::string &filename, const std::string &codec="")=0
Starts the recording of the source to the file.
virtual double getBarrelCorrection()=0
Returns the barrel correction applied to the source frames.
virtual cv::Size getResolution() const =0
Retrieves the resolution of the source.
virtual void setBarrelCorrection(double amount)=0
Sets the new barrel correction value.
virtual SourceType getSourceType() const
Returns the type of the source.
Definition: source.h:122
The structure to hold statistics about the source performance.
Definition: common.h:327
The camera and video file source base class.
Definition: source.h:51
virtual bool canRecord() const =0
Returns information on the source recording abilities.
virtual bool isPlaying() const =0
Checks whether the source is playing or not.
SourceStats statistics
The statistics of the source.
Definition: source.h:229
virtual bool isOpen() const =0
Checks whether the source has been initialized or not.
SourceType
Available source types are the following ones: CAMERA = hardware or network camera, NOTHING = not a working source, STREAM = network stream, VIDEO = video file and VIDEOSET = set of multiple files.
Definition: common.h:68
Source(SourceID desired_id=UNDEFINED_SOURCE)
General Source creator.
Definition: source.h:211
virtual SourceID getID() const final
Gets the unique source ID number.
Definition: source.h:104
virtual void stop()=0
Stops the source.
std::uint64_t FrameTime
Used to store milliseconds interval in frame times.
Definition: common.h:138
The structure is used for storing a single source frame.
Definition: common.h:241
virtual double getFramerate() const =0
Retrieves the framerate.
virtual bool setResolution(const cv::Size &new_size)=0
Sets the source resolution.
virtual std::string getDescription() const =0
Retrieves the description of the source.
virtual void play()
Starts to play the source.
Definition: source.h:155