30 #ifndef VIDEOFILESET_H
31 #define VIDEOFILESET_H
33 #include "videofile.h"
86 {
return index_has_changed ?
true : getVideo(current_index)->hasNew(); }
103 bool open(
const std::string& filename,
bool get_first,
107 return open({filename}, start_point) == OpenError::OK;
121 void play()
override;
131 void stop()
override;
140 inline unsigned int frameIndex(
int i)
const;
147 int getFrameStart(
int i)
const {
return videos.at(i).second; }
154 std::shared_ptr<VideoFile> getVideo(
unsigned int i)
const
155 {
return videos.at(i).first; }
163 bool setActivePosition(
int frame);
175 inline bool setActiveVideo(
unsigned int new_index,
FrameTime start_seek);
177 unsigned int current_index = 0;
178 bool index_has_changed =
true;
179 std::vector<std::pair<std::shared_ptr<VideoFile>,
int>> videos;
183 #endif // VIDEOFILESET_H
void stop() override
Will stop the file from playing.
Definition: videofileset.cpp:266
SourceType getSourceType() const override
Returns the type of the source.
Definition: videofileset.h:81
void setBarrelCorrection(double amount) override
Sets the new barrel correction value.
Definition: videofileset.cpp:258
std::vector< std::string > getFilenames() const override
Returns the filenames of the source.
Definition: videofileset.cpp:115
unsigned int SourceID
Used to indicate unique source ID-numbers.
Definition: common.h:229
The class for the video file source.
Definition: videofile.h:51
const SourceID UNDEFINED_SOURCE
Used to indicate unknown sources.
Definition: common.h:234
double getBarrelCorrection() override
Returns the barrel correction applied to the source frames.
Definition: videofileset.cpp:96
bool open(const std::string &filename, bool get_first, FrameTime start_point) override
Opens a video file.
Definition: videofileset.h:103
cv::Size getResolution() const override
Retrieves the resolution of the source.
Definition: videofileset.cpp:137
The structure to hold statistics about the source performance.
Definition: common.h:327
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
void play() override
Starts frame updates on the file.
Definition: videofileset.cpp:205
std::uint64_t FrameTime
Used to store milliseconds interval in frame times.
Definition: common.h:138
SourceStats getStats() override
Retrieves the source statistical information.
Definition: videofileset.cpp:144
The structure is used for storing a single source frame.
Definition: common.h:241
std::string getDescription() const override
Retrieves the description of the source.
Definition: videofileset.cpp:103
bool skipFrame(int step) override
Skips the specific amount of frames on the video.
Definition: videofileset.cpp:246
bool hasNew() override
Checks whether the device has a new image to be retrieved or not.
Definition: videofileset.h:85
VideoFileSet(SourceID desired_id=UNDEFINED_SOURCE)
Creates a new source.
Definition: videofileset.h:61
The extension to the VideoFile class for handling multiple files.
Definition: videofileset.h:50
OpenError
Values that the VideoFileSet::open() function can return.
Definition: videofileset.h:91
double getFramerate() const override
Retrieves the framerate.
Definition: videofileset.cpp:130