Ocean
Ocean::Media::MovieFrameProviderInterface Class Reference

This class implements a frame provider interface specialization using a movie frame provider object. More...

Inheritance diagram for Ocean::Media::MovieFrameProviderInterface:

Public Member Functions

 MovieFrameProviderInterface (const MovieFrameProviderRef &movieFrameProvider)
 Creates a new media frame provider interface. More...
 
 ~MovieFrameProviderInterface () override
 Destructs this frame provider interface. More...
 
bool isInitialized () override
 Returns whether the internal information of this interface has been initialized already and whether request functions can be handled. More...
 
bool setPreferredFrameType (const FrameType::PixelFormat pixelFormat, const FrameType::PixelOrigin pixelOrigin) override
 Sets a preferred frame type pixel format and pixel origin for this interface. More...
 
void asynchronFrameRequest (const unsigned int index, const bool priority) override
 Invokes an asynchronous frame request. More...
 
FrameRef synchronFrameRequest (const unsigned int index, const double timeout, bool *abort=nullptr) override
 Invokes a synchronous frame request. More...
 
void frameCacheRequest (const unsigned int index, const int range) override
 Invokes a suggestion to pre-load or to cache some frames that might be requested soon. More...
 
void asynchronFrameNumberRequest () override
 Invokes an asynchronous frame number request. More...
 
unsigned int synchronFrameNumberRequest (const double timeout, bool *abort=nullptr) override
 Invokes a synchronous frame number request. More...
 
void asynchronFrameTypeRequest () override
 Invokes an asynchronous frame type request. More...
 
FrameType synchronFrameTypeRequest (const double timeout, bool *abort=nullptr) override
 Invokes a synchronous frame type request. More...
 
void release () override
 Releases all associated resources. More...
 
- Public Member Functions inherited from Ocean::CV::FrameProviderInterface
virtual bool synchronInitializationRequest (const double timeout=120.0, bool *abort=nullptr)
 Waits until this interface has been initialized. More...
 
void registerFrameCallback (const FrameCallback &callback)
 Registers a new callback function for asynchronous frame requests. More...
 
void unregisterFrameCallback (const FrameCallback &callback)
 Unregisters an already registered callback function for frame requests. More...
 
void registerFrameNumberCallback (const FrameNumberCallback &callback)
 Registers a new callback function for asynchronous frame number requests. More...
 
void unregisterFrameNumberCallback (const FrameNumberCallback &callback)
 Unregisters an already registered callback function for frame number requests. More...
 
void registerFrameTypeCallback (const FrameTypeCallback &callback)
 Registers a new callback function for asynchronous frame type requests. More...
 
void unregisterFrameTypeCallback (const FrameTypeCallback &callback)
 Unregisters an already registered callback function for frame type requests. More...
 

Private Types

typedef std::pair< unsigned int, FrameRefFramePair
 Definition of pair combining a frame index with a frame reference. More...
 
typedef std::queue< FramePairFrameQueue
 Definition of a queue storing frame pairs. More...
 

Private Member Functions

void onScheduler ()
 Scheduler event function. More...
 
void onFrame (const unsigned int frameIndex, const bool frameRequested)
 Internal callback function for frame requests arriving from the internal media frame provider. More...
 

Private Attributes

MovieFrameProviderRef movieFrameProvider_
 The movie frame provider that provides the individual frames for this interface. More...
 
FrameQueue frameQueue_
 Frame queue for asynchronous frame requests. More...
 
bool asynchronousFrameNumber_ = false
 True, if an asynchronous frame number request has been invoked. More...
 
bool asynchronousFrameType_ = false
 True, if an asynchronous frame type request has been invoked. More...
 
Lock lock_
 Interface lock. More...
 

Additional Inherited Members

- Public Types inherited from Ocean::CV::FrameProviderInterface
typedef Callback< void, FrameRef, const unsigned int > FrameCallback
 Definition of a frame request callback function. More...
 
typedef Callback< void, unsigned int > FrameNumberCallback
 Definition of a frame number request callback function. More...
 
typedef Callback< void, const FrameType & > FrameTypeCallback
 Definition of a frame type request callback function. More...
 
- Protected Types inherited from Ocean::CV::FrameProviderInterface
typedef ConcurrentCallbacks< FrameCallbackFrameCallbacks
 Definition of a list that stores frame request callbacks. More...
 
typedef ConcurrentCallbacks< FrameNumberCallbackFrameNumberCallbacks
 Definition of a list that stores frame number request callbacks. More...
 
typedef ConcurrentCallbacks< FrameTypeCallbackFrameTypeCallbacks
 Definition of a list that stores frame type request callbacks. More...
 
- Protected Member Functions inherited from Ocean::CV::FrameProviderInterface
 FrameProviderInterface ()=default
 Protected default constructor. More...
 
 FrameProviderInterface (const FrameProviderInterface &frameProviderInterface)=delete
 Disabled copy constructor. More...
 
virtual ~FrameProviderInterface ()
 Releases the interface. More...
 
FrameProviderInterfaceoperator= (const FrameProviderInterface &frameProviderInterface)=delete
 Disabled copy constructor. More...
 
- Protected Attributes inherited from Ocean::CV::FrameProviderInterface
FrameCallbacks frameCallbacks_
 A list of frame request callbacks. More...
 
FrameNumberCallbacks frameNumberCallbacks_
 A list of frame number request callbacks. More...
 
FrameTypeCallbacks frameTypeCallbacks_
 A list of frame type request callbacks. More...
 

Detailed Description

This class implements a frame provider interface specialization using a movie frame provider object.

Actually, this function is nothing else but a wrapper for a MovieFrameProvider object.
We should investigate whether we really need an own MovideFrameProvider class anymore.
However, the MovieFrameProvider is able to deliver preview images, which is not part of this interface.

See also
MovieFrameProvider.

Member Typedef Documentation

◆ FramePair

typedef std::pair<unsigned int, FrameRef> Ocean::Media::MovieFrameProviderInterface::FramePair
private

Definition of pair combining a frame index with a frame reference.

◆ FrameQueue

Definition of a queue storing frame pairs.

Constructor & Destructor Documentation

◆ MovieFrameProviderInterface()

Ocean::Media::MovieFrameProviderInterface::MovieFrameProviderInterface ( const MovieFrameProviderRef movieFrameProvider)

Creates a new media frame provider interface.

Parameters
movieFrameProviderMovie frame provider object that is connected with this interface and that provides the individual frames

◆ ~MovieFrameProviderInterface()

Ocean::Media::MovieFrameProviderInterface::~MovieFrameProviderInterface ( )
override

Destructs this frame provider interface.

Member Function Documentation

◆ asynchronFrameNumberRequest()

void Ocean::Media::MovieFrameProviderInterface::asynchronFrameNumberRequest ( )
overridevirtual

Invokes an asynchronous frame number request.

See also
CV::FrameProviderInterface::asynchronFrameNumberRequest().

Implements Ocean::CV::FrameProviderInterface.

◆ asynchronFrameRequest()

void Ocean::Media::MovieFrameProviderInterface::asynchronFrameRequest ( const unsigned int  index,
const bool  priority 
)
overridevirtual

Invokes an asynchronous frame request.

See also
CV::FrameProviderInterface::asynchronFrameRequest().

Implements Ocean::CV::FrameProviderInterface.

◆ asynchronFrameTypeRequest()

void Ocean::Media::MovieFrameProviderInterface::asynchronFrameTypeRequest ( )
overridevirtual

Invokes an asynchronous frame type request.

See also
CV::FrameProviderInterface::asynchronFrameTypeRequest().

Implements Ocean::CV::FrameProviderInterface.

◆ frameCacheRequest()

void Ocean::Media::MovieFrameProviderInterface::frameCacheRequest ( const unsigned int  index,
const int  range 
)
overridevirtual

Invokes a suggestion to pre-load or to cache some frames that might be requested soon.

See also
CV::FrameProviderInterface::frameCacheRequest().

Reimplemented from Ocean::CV::FrameProviderInterface.

◆ isInitialized()

bool Ocean::Media::MovieFrameProviderInterface::isInitialized ( )
overridevirtual

Returns whether the internal information of this interface has been initialized already and whether request functions can be handled.

See also
CV::FrameProviderInterface::isInitialized().

Implements Ocean::CV::FrameProviderInterface.

◆ onFrame()

void Ocean::Media::MovieFrameProviderInterface::onFrame ( const unsigned int  frameIndex,
const bool  frameRequested 
)
private

Internal callback function for frame requests arriving from the internal media frame provider.

Parameters
frameIndexIndex of the frame that recently has been encoded by the media frame provider
frameRequestedTrue, if the frame has been requested, false if the frame just has been encoded without explicit request

◆ onScheduler()

void Ocean::Media::MovieFrameProviderInterface::onScheduler ( )
private

Scheduler event function.

◆ release()

void Ocean::Media::MovieFrameProviderInterface::release ( )
overridevirtual

Releases all associated resources.

See also
CV::FrameProviderInterface::release().

Reimplemented from Ocean::CV::FrameProviderInterface.

◆ setPreferredFrameType()

bool Ocean::Media::MovieFrameProviderInterface::setPreferredFrameType ( const FrameType::PixelFormat  pixelFormat,
const FrameType::PixelOrigin  pixelOrigin 
)
overridevirtual

Sets a preferred frame type pixel format and pixel origin for this interface.

See also
CV::FrameProviderInterface::setPreferredFrameType().

Implements Ocean::CV::FrameProviderInterface.

◆ synchronFrameNumberRequest()

unsigned int Ocean::Media::MovieFrameProviderInterface::synchronFrameNumberRequest ( const double  timeout,
bool *  abort = nullptr 
)
overridevirtual

Invokes a synchronous frame number request.

See also
CV::FrameProviderInterface::synchronFrameNumberRequest().

Implements Ocean::CV::FrameProviderInterface.

◆ synchronFrameRequest()

FrameRef Ocean::Media::MovieFrameProviderInterface::synchronFrameRequest ( const unsigned int  index,
const double  timeout,
bool *  abort = nullptr 
)
overridevirtual

Invokes a synchronous frame request.

See also
CV::FrameProviderInterface::synchronFrameRequest().

Implements Ocean::CV::FrameProviderInterface.

◆ synchronFrameTypeRequest()

FrameType Ocean::Media::MovieFrameProviderInterface::synchronFrameTypeRequest ( const double  timeout,
bool *  abort = nullptr 
)
overridevirtual

Invokes a synchronous frame type request.

See also
CV::FrameProviderInterface::synchronFrameTypeRequest().

Implements Ocean::CV::FrameProviderInterface.

Field Documentation

◆ asynchronousFrameNumber_

bool Ocean::Media::MovieFrameProviderInterface::asynchronousFrameNumber_ = false
private

True, if an asynchronous frame number request has been invoked.

◆ asynchronousFrameType_

bool Ocean::Media::MovieFrameProviderInterface::asynchronousFrameType_ = false
private

True, if an asynchronous frame type request has been invoked.

◆ frameQueue_

FrameQueue Ocean::Media::MovieFrameProviderInterface::frameQueue_
private

Frame queue for asynchronous frame requests.

◆ lock_

Lock Ocean::Media::MovieFrameProviderInterface::lock_
private

Interface lock.

◆ movieFrameProvider_

MovieFrameProviderRef Ocean::Media::MovieFrameProviderInterface::movieFrameProvider_
private

The movie frame provider that provides the individual frames for this interface.


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