AbstractRecordingStrategy Class Reference

Abstract interface of a recording strategy. More...

#include <VisionX/libraries/imrec/record/AbstractRecordingStrategy.h>

+ Inheritance diagram for AbstractRecordingStrategy:

Public Member Functions

 AbstractRecordingStrategy ()
 Default constructor to start the recording manually. More...
 
 AbstractRecordingStrategy (const std::filesystem::path &filePath)
 Constructor for any recording strategy, immediately starting the recording. More...
 
virtual std::filesystem::path getDotExtension () const
 Gets the extension plus preceeded dot of the configured file (e.g. More...
 
virtual std::filesystem::path getFilePath () const
 Gets the raw file path for the recording as configured. More...
 
virtual std::filesystem::path getMetadataPath () const
 
virtual std::filesystem::path getPath () const
 Gets the path to the recording without filename. More...
 
virtual std::filesystem::path getStem () const
 Gets the stem of the configured file (filename without extension) More...
 
virtual bool isRecording () const
 Indicates whether this instance is already initialised for recording. More...
 
virtual void recordFrame (const CByteImage &frame, std::chrono::microseconds timestamp)
 Adds the given frame to the recording. More...
 
virtual void recordFrame (const cv::Mat &frame, std::chrono::microseconds timestamp)
 Adds the given frame to the recording. More...
 
virtual void startRecording ()
 Starts the recording manually if constructed empty. More...
 
virtual void stopRecording ()
 Stops the recording. More...
 
virtual void writeMetadataDatetime (const std::string &var_name, std::chrono::microseconds timestamp)
 
virtual std::tuple< unsigned int, std::string > writeMetadataFrame (const CByteImage &frame, std::chrono::microseconds timestamp)
 
virtual std::tuple< unsigned int, std::string > writeMetadataFrame (const cv::Mat &frame, std::chrono::microseconds timestamp)
 
virtual void writeMetadataLine (const std::string &var_name, std::string_view var_type, std::string_view var_value)
 
virtual ~AbstractRecordingStrategy ()
 Destructor. More...
 

Protected Attributes

std::filesystem::path m_file_path
 Path to where the recording file should be written to. More...
 

Detailed Description

Abstract interface of a recording strategy.

Definition at line 54 of file AbstractRecordingStrategy.h.

Constructor & Destructor Documentation

◆ AbstractRecordingStrategy() [1/2]

Default constructor to start the recording manually.

Definition at line 46 of file AbstractRecordingStrategy.cpp.

◆ AbstractRecordingStrategy() [2/2]

AbstractRecordingStrategy ( const std::filesystem::path &  filePath)

Constructor for any recording strategy, immediately starting the recording.

Parameters
filePathPath to where the recording file should be written to
fpsAmount of frames being recorded per second

Definition at line 53 of file AbstractRecordingStrategy.cpp.

◆ ~AbstractRecordingStrategy()

Destructor.

Definition at line 61 of file AbstractRecordingStrategy.cpp.

Member Function Documentation

◆ getDotExtension()

std::filesystem::path getDotExtension ( ) const
virtual

Gets the extension plus preceeded dot of the configured file (e.g.

".avi")

Returns
Extention plus preceeded dot of the configured file

Reimplemented in AbstractSequencedRecordingStrategy.

Definition at line 149 of file AbstractRecordingStrategy.cpp.

◆ getFilePath()

std::filesystem::path getFilePath ( ) const
virtual

Gets the raw file path for the recording as configured.

Returns
Raw file path for the recording as configureds

Definition at line 128 of file AbstractRecordingStrategy.cpp.

◆ getMetadataPath()

std::filesystem::path getMetadataPath ( ) const
virtual

Reimplemented in AbstractSequencedRecordingStrategy.

Definition at line 156 of file AbstractRecordingStrategy.cpp.

◆ getPath()

std::filesystem::path getPath ( ) const
virtual

Gets the path to the recording without filename.

Returns
Path to the recording without filename

Definition at line 135 of file AbstractRecordingStrategy.cpp.

◆ getStem()

std::filesystem::path getStem ( ) const
virtual

Gets the stem of the configured file (filename without extension)

Returns
Stem of the configured file

Definition at line 142 of file AbstractRecordingStrategy.cpp.

◆ isRecording()

bool isRecording ( ) const
virtual

Indicates whether this instance is already initialised for recording.

Returns
True if it is initialised and ready to record, false if not

Definition at line 71 of file AbstractRecordingStrategy.cpp.

◆ recordFrame() [1/2]

void recordFrame ( const CByteImage &  frame,
std::chrono::microseconds  timestamp 
)
virtual

Adds the given frame to the recording.

Parameters
frameFrame to be added

Reimplemented in BMPRecordingStrategy.

Definition at line 90 of file AbstractRecordingStrategy.cpp.

+ Here is the call graph for this function:

◆ recordFrame() [2/2]

void recordFrame ( const cv::Mat &  frame,
std::chrono::microseconds  timestamp 
)
virtual

Adds the given frame to the recording.

Parameters
frameFrame to be added

Reimplemented in PNGParallelRecordingStrategy, AVIRecordingStrategy, H264RecordingStrategy, PNGRecordingStrategy, and JPGRecordingStrategy.

Definition at line 103 of file AbstractRecordingStrategy.cpp.

+ Here is the call graph for this function:

◆ startRecording()

void startRecording ( )
virtual

Starts the recording manually if constructed empty.

Parameters
filePathPath to where the recording file should be written to
fpsAmount of frames being recorded per second

Reimplemented in AbstractSequencedRecordingStrategy, PNGParallelRecordingStrategy, AVIRecordingStrategy, H264RecordingStrategy, PNGRecordingStrategy, and JPGRecordingStrategy.

Definition at line 78 of file AbstractRecordingStrategy.cpp.

+ Here is the caller graph for this function:

◆ stopRecording()

void stopRecording ( )
virtual

Stops the recording.

Reimplemented in PNGParallelRecordingStrategy, AVIRecordingStrategy, and H264RecordingStrategy.

Definition at line 116 of file AbstractRecordingStrategy.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ writeMetadataDatetime()

void writeMetadataDatetime ( const std::string &  var_name,
std::chrono::microseconds  timestamp 
)
virtual

Definition at line 206 of file AbstractRecordingStrategy.cpp.

+ Here is the call graph for this function:

◆ writeMetadataFrame() [1/2]

std::tuple< unsigned int, std::string > writeMetadataFrame ( const CByteImage &  frame,
std::chrono::microseconds  timestamp 
)
virtual

Definition at line 165 of file AbstractRecordingStrategy.cpp.

+ Here is the call graph for this function:

◆ writeMetadataFrame() [2/2]

std::tuple< unsigned int, std::string > writeMetadataFrame ( const cv::Mat &  frame,
std::chrono::microseconds  timestamp 
)
virtual

Definition at line 174 of file AbstractRecordingStrategy.cpp.

+ Here is the call graph for this function:

◆ writeMetadataLine()

void writeMetadataLine ( const std::string &  var_name,
std::string_view  var_type,
std::string_view  var_value 
)
virtual

Definition at line 214 of file AbstractRecordingStrategy.cpp.

Member Data Documentation

◆ m_file_path

std::filesystem::path m_file_path
protected

Path to where the recording file should be written to.

Definition at line 62 of file AbstractRecordingStrategy.h.


The documentation for this class was generated from the following files: