Ocean
Ocean::Media::FrameRecorder Class Referenceabstract

This class is the base class for all frame recorders. More...

Inheritance diagram for Ocean::Media::FrameRecorder:

Public Member Functions

const FrameTypeframeType () const
 Returns the actual frame type of this recorder. More...
 
double frameFrequency () const
 Returns the frame frequency of this recorder in Hz. More...
 
const std::string & frameEncoder () const
 Returns the name of the encoder used to encoder the frames. More...
 
virtual Encoders frameEncoders () const
 Returns a list of possible frame encoders for this recorder. More...
 
virtual bool frameEncoderHasConfiguration ()
 Returns whether the selected frame encoder has a configuration possibility. More...
 
virtual bool setPreferredFrameType (const FrameType &type)
 Sets the preferred frame type of this recorder. More...
 
virtual bool setFrameFrequency (const double frequency)
 Sets the frame frequency of this recorder. More...
 
virtual bool setFrameEncoder (const std::string &encoder)
 Sets the frame encoder used to encode the frames. More...
 
virtual bool frameEncoderConfiguration (long long data)
 Starts the frame encoder configuration possibility. More...
 
virtual bool lockBufferToFill (Frame &recorderFrame, const bool respectFrameFrequency=true)=0
 Locks the most recent frame and returns it so that the image data can be written to this frame. More...
 
virtual void unlockBufferToFill ()=0
 Unlocks the filled buffer. More...
 
- Public Member Functions inherited from Ocean::Media::Recorder
virtual bool isRecording () const =0
 Returns whether this recorder is currently recording. More...
 
Type type () const
 Returns the type of this recorder. More...
 

Protected Member Functions

 FrameRecorder ()
 Creats a new frame recorder. More...
 
 ~FrameRecorder () override
 Destructs a frame recorder. More...
 
- Protected Member Functions inherited from Ocean::Media::Recorder
 Recorder ()
 Creates a new recorder. More...
 
virtual ~Recorder ()
 Destructs a recorder. More...
 

Protected Attributes

FrameType recorderFrameType
 Type of the frame to record. More...
 
double recorderFrameFrequency
 Frame frequency used by the recorder. More...
 
std::string recorderFrameEncoder
 Name of the frame encoder used to encode the frames. More...
 
- Protected Attributes inherited from Ocean::Media::Recorder
Type recorderType
 Type of this recorder. More...
 
Lock recorderLock
 Lock of this recorder. More...
 

Additional Inherited Members

- Public Types inherited from Ocean::Media::Recorder
enum  Type {
  RECORDER = 0 , FRAME_RECORDER = 1 , SOUND_RECORDER = 2 , EXPLICIT_RECORDER = 4 ,
  IMPLICIT_RECORDER = 8 , FILE_RECORDER = 16 | EXPLICIT_RECORDER , BUFFER_RECORDER = 32 | EXPLICIT_RECORDER , STREAMING_RECORDER = 64 | IMPLICIT_RECORDER ,
  MOVIE_RECORDER = 128 | FRAME_RECORDER | FILE_RECORDER , FRAME_STREAMING_RECORDER = 256 | FRAME_RECORDER | STREAMING_RECORDER , IMAGE_RECORDER = 512 | FRAME_RECORDER | FILE_RECORDER , BUFFER_IMAGE_RECORDER = 1024 | FRAME_RECORDER | BUFFER_RECORDER ,
  IMAGE_SEQUENCE_RECORDER = 2048 | FRAME_RECORDER | FILE_RECORDER , FRAME_MEMORY_RECORDER = 4096 | FRAME_RECORDER
}
 Definition of different recorder types. More...
 
typedef std::vector< std::string > Encoders
 Definition of a vector holding encoder names. More...
 

Detailed Description

This class is the base class for all frame recorders.

Constructor & Destructor Documentation

◆ FrameRecorder()

Ocean::Media::FrameRecorder::FrameRecorder ( )
protected

Creats a new frame recorder.

◆ ~FrameRecorder()

Ocean::Media::FrameRecorder::~FrameRecorder ( )
overrideprotected

Destructs a frame recorder.

Member Function Documentation

◆ frameEncoder()

const std::string & Ocean::Media::FrameRecorder::frameEncoder ( ) const
inline

Returns the name of the encoder used to encoder the frames.

Returns
Encoder name

◆ frameEncoderConfiguration()

virtual bool Ocean::Media::FrameRecorder::frameEncoderConfiguration ( long long  data)
virtual

Starts the frame encoder configuration possibility.

Parameters
dataPossible configuration data like gui handles.
Returns
True, if succeeded

Reimplemented in Ocean::Media::DirectShow::DSFrameRecorder.

◆ frameEncoderHasConfiguration()

virtual bool Ocean::Media::FrameRecorder::frameEncoderHasConfiguration ( )
virtual

Returns whether the selected frame encoder has a configuration possibility.

Returns
True, if so

Reimplemented in Ocean::Media::DirectShow::DSFrameRecorder.

◆ frameEncoders()

◆ frameFrequency()

double Ocean::Media::FrameRecorder::frameFrequency ( ) const
inline

Returns the frame frequency of this recorder in Hz.

Returns
Frame frequency

◆ frameType()

const FrameType & Ocean::Media::FrameRecorder::frameType ( ) const
inline

Returns the actual frame type of this recorder.

The actual frame type may be different from the preferred (requested) frametype.

Returns
Frame type
See also
setPreferredFrameType().

◆ lockBufferToFill()

virtual bool Ocean::Media::FrameRecorder::lockBufferToFill ( Frame recorderFrame,
const bool  respectFrameFrequency = true 
)
pure virtual

Locks the most recent frame and returns it so that the image data can be written to this frame.

Beware: Call unlockBufferToFill() once the image data is written to the frame.

Parameters
recorderFrameThe resulting frame in which the image data can be copied, the frame type of this frame must not be changed
respectFrameFrequencyFlag determining that a buffer will be returned if it is time for a new frame only
See also
unlockBufferToFill().

Implemented in Ocean::Media::WIC::WICImageRecorder, Ocean::Media::WIC::WICBufferImageRecorder, Ocean::Media::OpenImageLibraries::OILImageSequenceRecorder, Ocean::Media::OpenImageLibraries::OILImageRecorder, Ocean::Media::OpenImageLibraries::OILBufferImageRecorder, Ocean::Media::MediaFoundation::MFMovieRecorder, Ocean::Media::ImageRecorder, Ocean::Media::ImageIO::IIOImageRecorder, Ocean::Media::ImageIO::IIOBufferImageRecorder, Ocean::Media::DirectShow::DSFrameRecorder, Ocean::Media::BufferImageRecorder, Ocean::Media::AVFoundation::AVFMovieRecorder, and Ocean::Media::Android::AMovieRecorder.

◆ setFrameEncoder()

virtual bool Ocean::Media::FrameRecorder::setFrameEncoder ( const std::string &  encoder)
virtual

Sets the frame encoder used to encode the frames.

Parameters
encoderName of the encoder to use
Returns
True, if succeeded

Reimplemented in Ocean::Media::DirectShow::DSFrameRecorder.

◆ setFrameFrequency()

virtual bool Ocean::Media::FrameRecorder::setFrameFrequency ( const double  frequency)
virtual

Sets the frame frequency of this recorder.

Parameters
frequencyFrame frequency in Hz
Returns
True, if succeeded

Reimplemented in Ocean::Media::DirectShow::DSFrameRecorder.

◆ setPreferredFrameType()

virtual bool Ocean::Media::FrameRecorder::setPreferredFrameType ( const FrameType type)
virtual

Sets the preferred frame type of this recorder.

The recorder may not support the specific pixel format, therefore check the actual pixel format of the recorder.

Parameters
typeThe preferred frame type to record
Returns
True, if succeeded
See also
frameType().

Reimplemented in Ocean::Media::MediaFoundation::MFMovieRecorder, Ocean::Media::DirectShow::DSFrameRecorder, and Ocean::Media::Android::AMovieRecorder.

◆ unlockBufferToFill()

Field Documentation

◆ recorderFrameEncoder

std::string Ocean::Media::FrameRecorder::recorderFrameEncoder
protected

Name of the frame encoder used to encode the frames.

◆ recorderFrameFrequency

double Ocean::Media::FrameRecorder::recorderFrameFrequency
protected

Frame frequency used by the recorder.

◆ recorderFrameType

FrameType Ocean::Media::FrameRecorder::recorderFrameType
protected

Type of the frame to record.


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