|
Ocean
|
This class is the base class for all finite mediums. More...
#include <FiniteMedium.h>
Public Member Functions | |
| virtual double | duration () const =0 |
| Returns the duration of the finite medium. | |
| virtual double | normalDuration () const =0 |
| Returns the duration without speed consideration. | |
| virtual double | position () const =0 |
| Returns the recent position of the finite medium. | |
| virtual float | speed () const =0 |
| Returns the speed of the finite medium. | |
| bool | loop () const |
| Returns whether the medium is played in a loop. | |
| virtual bool | setPosition (const double position) |
| Sets the recent position of the finite medium. | |
| virtual bool | setSpeed (const float speed) |
| Sets the speed of the finite medium. | |
| virtual bool | setLoop (const bool value) |
| Sets whether the medium has to be played in a loop. | |
| virtual bool | taskFinished () const |
| Returns whether a previous task has been finished. | |
Public Member Functions inherited from Ocean::Media::Medium | |
| const std::string & | url () const |
| Returns the url of the medium. | |
| bool | isValid () const |
| Returns whether the medium is valid. | |
| const std::string & | library () const |
| Returns the name of the owner library. | |
| Type | type () const |
| Returns the type of the medium. | |
| bool | isType (const Type type) const |
| Returns whether a medium has a given type. | |
| virtual bool | isStarted () const =0 |
| Returns whether the medium is started currently. | |
| bool | isExclusive () const |
| Returns whether this medium can be use exclusively. | |
| virtual bool | start ()=0 |
| Starts the medium. | |
| virtual bool | pause ()=0 |
| Pauses the medium. | |
| virtual bool | stop ()=0 |
| Stops the medium. | |
| virtual Timestamp | startTimestamp () const =0 |
| Returns the start timestamp. | |
| virtual Timestamp | pauseTimestamp () const =0 |
| Returns the pause timestamp. | |
| virtual Timestamp | stopTimestamp () const =0 |
| Returns the stop timestamp. | |
| virtual MediumRef | clone () const |
| Clones this medium and returns a new independent instance of this medium. | |
Static Public Attributes | |
| static constexpr float | AS_FAST_AS_POSSIBLE = 0.0f |
| Definition of a speed value allowing to deliver the media content as fast as possible. | |
Protected Member Functions | |
| FiniteMedium (const std::string &url) | |
| Creates a new finite medium by a given url. | |
Protected Member Functions inherited from Ocean::Media::Medium | |
| Medium (const Medium &medium)=delete | |
| Disabled copy constructor. | |
| Medium (const std::string &url) | |
| Creates a new medium by a given url. | |
| virtual | ~Medium () |
| Destructs a medium. | |
| Medium & | operator= (const Medium &medium)=delete |
| Disabled copy operator. | |
Protected Attributes | |
| bool | loop_ = false |
| Determines whether the medium is played in a loop. | |
Protected Attributes inherited from Ocean::Media::Medium | |
| std::string | url_ |
| Url of the medium. | |
| std::string | libraryName_ |
| Name of the owner library. | |
| bool | isValid_ = false |
| Determines whether the medium is valid. | |
| Type | type_ = MEDIUM |
| Type of the medium. | |
| Lock | lock_ |
| Medium lock. | |
Additional Inherited Members | |
Public Types inherited from Ocean::Media::Medium | |
| enum | Type : uint32_t { MEDIUM = 0u , FRAME_MEDIUM = 1u << 0u , SOUND_MEDIUM = 1u << 1u , FINITE_MEDIUM = 1u << 2u , LIVE_MEDIUM = 1u << 3u , CONFIG_MEDIUM = 1u << 4u , AUDIO = (1u << 5u) | FINITE_MEDIUM | SOUND_MEDIUM , IMAGE = (1u << 6u) | FRAME_MEDIUM , PIXEL_IMAGE = (1u << 7u) | FRAME_MEDIUM , BUFFER_IMAGE = (1u << 8u) | FRAME_MEDIUM , IMAGE_SEQUENCE = (1u << 9u) | FRAME_MEDIUM | FINITE_MEDIUM , LIVE_AUDIO = (1u << 10u) | LIVE_MEDIUM | SOUND_MEDIUM , LIVE_VIDEO = (1u << 11u) | LIVE_MEDIUM | FRAME_MEDIUM , MICROPHONE = (1u << 12u) | LIVE_MEDIUM , MOVIE = (1u << 13u) | FINITE_MEDIUM | FRAME_MEDIUM | SOUND_MEDIUM } |
| Definition of different medium types. More... | |
Static Public Member Functions inherited from Ocean::Media::Medium | |
| static std::string | convertType (const Type type) |
| Converts a medium type to a unique string. | |
| static Type | convertType (const std::string &type) |
| Converts a medium type string to a medium type. | |
This class is the base class for all finite mediums.
|
explicitprotected |
Creates a new finite medium by a given url.
| url | Url of the finite medium |
|
pure virtual |
Returns the duration of the finite medium.
Implemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSFiniteMedium, Ocean::Media::FFmpeg::FFMMovie, Ocean::Media::ImageFileSequence, and Ocean::Media::MediaFoundation::MFFiniteMedium.
|
inline |
Returns whether the medium is played in a loop.
By default a finite medium will not be looped.
|
pure virtual |
Returns the duration without speed consideration.
Implemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSFiniteMedium, Ocean::Media::FFmpeg::FFMMovie, Ocean::Media::ImageFileSequence, and Ocean::Media::MediaFoundation::MFFiniteMedium.
|
pure virtual |
Returns the recent position of the finite medium.
Implemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSFiniteMedium, Ocean::Media::FFmpeg::FFMMovie, Ocean::Media::ImageFileSequence, and Ocean::Media::MediaFoundation::MFFiniteMedium.
|
virtual |
Sets whether the medium has to be played in a loop.
| value | True, if looping |
Reimplemented in Ocean::Media::Android::AAudio, and Ocean::Media::AVFoundation::AVFAudio.
|
virtual |
Sets the recent position of the finite medium.
| position | New position in seconds |
Reimplemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSFiniteMedium, Ocean::Media::FFmpeg::FFMMovie, Ocean::Media::ImageFileSequence, and Ocean::Media::MediaFoundation::MFFiniteMedium.
|
virtual |
Sets the speed of the finite medium.
The speed value is relative to the media's standard speed.
For example, a speed value of 1.0 means the standard speed, 2.0 is twice as fast, and 0.5 is half as fast as the standard speed.
However, a speed value of 0 (or AS_FAST_AS_POSSIBLE) will ignore the standard playback time and will deliver the media content as fast as possible.
| speed | The speed to set, with range (0, infinity), AS_FAST_AS_POSSIBLE to run the medium as fast as possible |
Reimplemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSFiniteMedium, Ocean::Media::FFmpeg::FFMMovie, Ocean::Media::ImageFileSequence, and Ocean::Media::MediaFoundation::MFFiniteMedium.
|
pure virtual |
Returns the speed of the finite medium.
The speed value is relative to the media's standard speed.
For example, a speed value of 1.0 means the standard speed, 2.0 is twice as fast, and 0.5 is half as fast as the standard speed.
However, a speed value of 0 (or AS_FAST_AS_POSSIBLE) will ignore the standard playback time and will deliver the media content as fast as possible.
Implemented in Ocean::Media::Android::AAudio, Ocean::Media::Android::AMovie, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::DirectShow::DSFiniteMedium, Ocean::Media::FFmpeg::FFMMovie, Ocean::Media::ImageFileSequence, and Ocean::Media::MediaFoundation::MFFiniteMedium.
|
virtual |
Returns whether a previous task has been finished.
A task has been finished if all data that has been requested before has been provided (or e.g. rendered).
Reimplemented in Ocean::Media::DirectShow::DSFiniteMedium, and Ocean::Media::MediaFoundation::MFFiniteMedium.
|
staticconstexpr |
Definition of a speed value allowing to deliver the media content as fast as possible.
At the same time, no media content is skipped.
|
protected |
Determines whether the medium is played in a loop.