Ocean
Loading...
Searching...
No Matches
Ocean::Media::DirectShow::DSFileRecorder Class Reference

This class implements a DirectShow file recorder. More...

#include <DSFileRecorder.h>

Inheritance diagram for Ocean::Media::DirectShow::DSFileRecorder:

Public Member Functions

bool setFilename (const std::string &filename) override
 Sets the filename of this recorder.
 
bool isRecording () const override
 Returns whether this recorder is currently recording.
 
bool start () override
 Sets the recorder.
 
bool stop () override
 Stops the recorder.
 
- Public Member Functions inherited from Ocean::Media::Recorder
Type type () const
 Returns the type of this recorder.
 
- Public Member Functions inherited from Ocean::Media::FileRecorder
const std::string & filename () const
 Returns the filename of this recorder.
 
bool filenameSuffixed () const
 Returns whether the filename of this recorder will be suffixed with date and time.
 
virtual bool setFilenameSuffixed (const bool suffixed)
 Sets whether the filename will be suffixed with date and time.
 

Protected Member Functions

 DSFileRecorder ()=default
 Creates a new DirectShow file recorder.
 
 ~DSFileRecorder () override
 Destructs a DirectShow file recorder.
 
virtual bool insertFileWriterFilter (IPin *outputPin)
 Inserts an AVI MUX and file writer filter to the filter graph.
 
void releaseFileWriterFilter ()
 Releases the filter writer filter.
 
- Protected Member Functions inherited from Ocean::Media::DirectShow::DSRecorder
 DSRecorder ()
 Creates a new DirectShow recorder.
 
 ~DSRecorder () override
 Destructs a DirectShow recorder.
 
- Protected Member Functions inherited from Ocean::Media::DirectShow::DSGraphObject
 DSGraphObject ()=default
 Creates a new DSGraphObject element.
 
virtual ~DSGraphObject ()
 Destructs a DSGraphObject.
 
bool createGraphBuilder ()
 Creates a new filter graph builder.
 
void releaseGraphBuilder ()
 Releases a filter graph builder.
 
virtual bool buildGraph ()=0
 Builds the entire filter graph.
 
virtual void releaseGraph ()=0
 Releases the entire filter graph.
 
virtual bool startGraph ()
 Stars the filter graph.
 
virtual bool pauseGraph ()
 Pauses the filter graph.
 
virtual bool stopGraph ()
 Stops the filter graph.
 
ScopedIBaseFilter addFilter (const GUID &classIdentifier, const std::wstring &name)
 Adds a new filter to the filter graph.
 
bool connectFilters (IBaseFilter *outputFilter, IBaseFilter *inputFilter, const AM_MEDIA_TYPE *type=nullptr)
 Connects two filters by using the first free pins.
 
bool connectFilter (IPin *outputPin, IBaseFilter *inputFilter, const AM_MEDIA_TYPE *type=nullptr)
 Connects a pin with the first free pin of a filter.
 
bool connectFilter (IBaseFilter *outputFilter, IPin *inputPin, const AM_MEDIA_TYPE *type=nullptr)
 Connects a pin with the first free pin of a filter.
 
Filters filters ()
 Returns all filters which are part of the current filter graph.
 
bool addFilterGraphToROT ()
 Adds the filter graph to the running object table.
 
bool removeFilterGraphFromROT ()
 Removes the filter graph from the running object table.
 
- Protected Member Functions inherited from Ocean::Media::Recorder
 Recorder ()
 Creates a new recorder.
 
virtual ~Recorder ()
 Destructs a recorder.
 
- Protected Member Functions inherited from Ocean::Media::FileRecorder
 FileRecorder ()
 Creates a new file recorder.
 
 ~FileRecorder () override
 Destructs a file recorder.
 
- Protected Member Functions inherited from Ocean::Media::ExplicitRecorder
 ExplicitRecorder ()
 Creates a new explicit recorder.
 
 ~ExplicitRecorder () override
 Destructs a explicit recorder.
 

Protected Attributes

ScopedIBaseFilter aviMuxFilter_
 AVI MUX filter.
 
ScopedIBaseFilter fileWriterFilter_
 DirectShow file writer filter.
 
ScopedIFileSinkFilter fileSinkInterface_
 DirectShow file sink interface.
 
- Protected Attributes inherited from Ocean::Media::DirectShow::DSGraphObject
ScopedIGraphBuilder filterGraph_
 DirectShow filter graph manager.
 
ScopedIMediaControl mediaControlInterface_
 DirectShow media control interface.
 
ScopedIMediaEvent mediaEventInterface_
 DirectShow media event interface.
 
bool graphIsRunning_ = false
 Indicates whether the graph is running.
 
- Protected Attributes inherited from Ocean::Media::Recorder
Type recorderType
 Type of this recorder.
 
Lock recorderLock
 Lock of this recorder.
 
- Protected Attributes inherited from Ocean::Media::FileRecorder
std::string recorderFilename
 Filename of this recorder.
 
bool recorderFilenameSuffixed
 Flag determining whether the filename will be suffixed with date and time.
 

Additional Inherited Members

- Public Types inherited from Ocean::Media::DirectShow::DSObject
enum  PinType { PTYPE_INPUT , PTYPE_OUTPUT , PTYPE_DONT_CARE }
 Definition of input and output pin. More...
 
enum  ConnectionType { CTYPE_CONNECTED , CTYPE_NOT_CONNECTED , CTYPE_DONT_CARE }
 Definition of pin connection types. More...
 
typedef std::pair< ScopedIPin, ScopedIPinPinPair
 Definition of a pair of pins.
 
typedef std::vector< PinPairPinPairs
 Definition of a vector holding pin pairs.
 
typedef std::vector< ScopedIPinPins
 Definition of a vector holding pins.
 
- 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.
 
- Static Public Member Functions inherited from Ocean::Media::DirectShow::DSObject
static ScopedIPin firstPin (IBaseFilter *filter, PinType pinType, ConnectionType connectionType)
 Returns the first pin.
 
static Pins pins (IBaseFilter *filter, PinType pinType, ConnectionType connectionType)
 Returns all pins with a specified property.
 
static PinPairs connections (IBaseFilter *filter)
 Returns all connects in a branch.
 
static ScopedIBaseFilter pinOwner (IPin *pin)
 Returns the owner filter of a pin.
 
static ScopedIPin connectedPin (IPin *pin)
 Returns the connected pin of a given pin.
 
- Static Public Member Functions inherited from Ocean::Media::FileRecorder
static std::string addOptionalSuffixToFilename (const std::string &filename, const bool addSuffix)
 Determines the filename to be used for the next file.
 
static std::string addOptionalSuffixToFilename (const std::string &filename, const unsigned int index, const bool addSuffix)
 Determines the filename to be used for the next file.
 
- Protected Types inherited from Ocean::Media::DirectShow::DSGraphObject
typedef std::vector< ScopedIBaseFilterFilters
 Definition of a vector holding DirectShow filters.
 

Detailed Description

This class implements a DirectShow file recorder.

Constructor & Destructor Documentation

◆ DSFileRecorder()

Ocean::Media::DirectShow::DSFileRecorder::DSFileRecorder ( )
protecteddefault

Creates a new DirectShow file recorder.

◆ ~DSFileRecorder()

Ocean::Media::DirectShow::DSFileRecorder::~DSFileRecorder ( )
overrideprotected

Destructs a DirectShow file recorder.

Member Function Documentation

◆ insertFileWriterFilter()

virtual bool Ocean::Media::DirectShow::DSFileRecorder::insertFileWriterFilter ( IPin *  outputPin)
protectedvirtual

Inserts an AVI MUX and file writer filter to the filter graph.

The file writer filter should be connected with a MUX filter.

Parameters
outputPinOutput pin of e.g. encoder filter which will be connected with the input pin of the file writer filter
Returns
True, if succeeded

◆ isRecording()

bool Ocean::Media::DirectShow::DSFileRecorder::isRecording ( ) const
overridevirtual

Returns whether this recorder is currently recording.

See also
FileRecorder::isRecording().

Implements Ocean::Media::Recorder.

◆ releaseFileWriterFilter()

void Ocean::Media::DirectShow::DSFileRecorder::releaseFileWriterFilter ( )
protected

Releases the filter writer filter.

◆ setFilename()

bool Ocean::Media::DirectShow::DSFileRecorder::setFilename ( const std::string &  filename)
overridevirtual

Sets the filename of this recorder.

See also
FileRecroder::setFilename().

Reimplemented from Ocean::Media::FileRecorder.

◆ start()

bool Ocean::Media::DirectShow::DSFileRecorder::start ( )
overridevirtual

Sets the recorder.

See also
FileRecorder::start().

Implements Ocean::Media::ExplicitRecorder.

◆ stop()

bool Ocean::Media::DirectShow::DSFileRecorder::stop ( )
overridevirtual

Stops the recorder.

See also
FileRecorder::stop().

Implements Ocean::Media::ExplicitRecorder.

Field Documentation

◆ aviMuxFilter_

ScopedIBaseFilter Ocean::Media::DirectShow::DSFileRecorder::aviMuxFilter_
protected

AVI MUX filter.

◆ fileSinkInterface_

ScopedIFileSinkFilter Ocean::Media::DirectShow::DSFileRecorder::fileSinkInterface_
protected

DirectShow file sink interface.

◆ fileWriterFilter_

ScopedIBaseFilter Ocean::Media::DirectShow::DSFileRecorder::fileWriterFilter_
protected

DirectShow file writer filter.


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