Ocean
|
This is the base class for all mediums. More...
Public Types | |
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... | |
Public Member Functions | |
const std::string & | url () const |
Returns the url of the medium. More... | |
bool | isValid () const |
Returns whether the medium is valid. More... | |
const std::string & | library () const |
Returns the name of the owner library. More... | |
Type | type () const |
Returns the type of the medium. More... | |
bool | isType (const Type type) const |
Returns whether a medium has a given type. More... | |
virtual bool | isStarted () const =0 |
Returns whether the medium is started currently. More... | |
bool | isExclusive () const |
Returns whether this medium can be use exclusively. More... | |
virtual bool | start ()=0 |
Starts the medium. More... | |
virtual bool | pause ()=0 |
Pauses the medium. More... | |
virtual bool | stop ()=0 |
Stops the medium. More... | |
virtual Timestamp | startTimestamp () const =0 |
Returns the start timestamp. More... | |
virtual Timestamp | pauseTimestamp () const =0 |
Returns the pause timestamp. More... | |
virtual Timestamp | stopTimestamp () const =0 |
Returns the stop timestamp. More... | |
virtual MediumRef | clone () const |
Clones this medium and returns a new independent instance of this medium. More... | |
Static Public Member Functions | |
static std::string | convertType (const Type type) |
Converts a medium type to a unique string. More... | |
static Type | convertType (const std::string &type) |
Converts a medium type string to a medium type. More... | |
Protected Member Functions | |
Medium (const Medium &medium)=delete | |
Disabled copy constructor. More... | |
Medium (const std::string &url) | |
Creates a new medium by a given url. More... | |
virtual | ~Medium () |
Destructs a medium. More... | |
Medium & | operator= (const Medium &medium)=delete |
Disabled copy operator. More... | |
Protected Attributes | |
std::string | url_ |
Url of the medium. More... | |
std::string | libraryName_ |
Name of the owner library. More... | |
bool | isValid_ = false |
Determines whether the medium is valid. More... | |
Type | type_ = MEDIUM |
Type of the medium. More... | |
Lock | lock_ |
Medium lock. More... | |
Friends | |
class | ObjectRef< Medium > |
This is the base class for all mediums.
A medium may provide visual or/and audio content.
The medium's source may be live, a buffer or a file.
A new medium object cannot be created directly.
The Manager provides powerful functions allowing to create medium object from individual libraries and with individual properties.
Mediums can be exclusive or non-exclusive:
An non-exclusive medium can be used by several individual clients to save resources like memory or/and computational power.
An exclusive medium should be used by one client only.
The exclusiveness of a medium can be decided during the creation of a medium.
enum Ocean::Media::Medium::Type : uint32_t |
Definition of different medium types.
Enumerator | |
---|---|
MEDIUM | Simple medium. |
FRAME_MEDIUM | Frame medium. |
SOUND_MEDIUM | Sound medium. |
FINITE_MEDIUM | Finite medium. |
LIVE_MEDIUM | Live medium. |
CONFIG_MEDIUM | Config medium. |
AUDIO | Audio medium. |
IMAGE | Image medium. |
PIXEL_IMAGE | Pixel image medium. |
BUFFER_IMAGE | Pixel image medium. |
IMAGE_SEQUENCE | Image sequence medium. |
LIVE_AUDIO | Live audio medium. |
LIVE_VIDEO | Live video medium. |
MICROPHONE | Microphone medium. |
MOVIE | Movie medium. |
|
protecteddelete |
Disabled copy constructor.
medium | Object which would be copied |
|
explicitprotected |
Creates a new medium by a given url.
url | Url of the medium |
|
protectedvirtual |
Destructs a medium.
|
virtual |
Clones this medium and returns a new independent instance of this medium.
Beware: Some medium objects like e.g. live video or live audio objects cannot be cloned.
Reimplemented in Ocean::Media::WIC::WICImageSequence, Ocean::Media::WIC::WICBufferImage, Ocean::Media::OpenImageLibraries::OILImageSequence, Ocean::Media::OpenImageLibraries::OILBufferImage, Ocean::Media::MediaFoundation::MFMovie, Ocean::Media::MediaFoundation::MFAudio, Ocean::Media::ImageIO::IIOImageSequence, Ocean::Media::ImageIO::IIOBufferImage, Ocean::Media::FFmpeg::FFMMovie, Ocean::Media::DirectShow::DSMovie, Ocean::Media::DirectShow::DSAudio, Ocean::Media::AVFoundation::AVFMovie, Ocean::Media::AVFoundation::AVFLiveVideo, Ocean::Media::AVFoundation::AVFAudio, Ocean::Media::Android::AMovie, Ocean::Media::Android::ALiveAudio, and Ocean::Media::Android::AAudio.
|
static |
|
static |
Converts a medium type to a unique string.
type | Type of the medium to convert |
bool Ocean::Media::Medium::isExclusive | ( | ) | const |
Returns whether this medium can be use exclusively.
|
pure virtual |
Returns whether the medium is started currently.
Implemented in Ocean::Media::USB::USBLiveVideo, Ocean::Media::PixelImage, Ocean::Media::MediaFoundation::MFMedium, Ocean::Media::ImageFileSequence, Ocean::Media::FFmpeg::FFMMedium, Ocean::Media::DirectShow::DSMedium, Ocean::Media::BufferImage, Ocean::Media::AVFoundation::AVFMedium, Ocean::Media::Android::AMovie, Ocean::Media::Android::AMicrophone, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveAudio, and Ocean::Media::Android::AAudio.
bool Ocean::Media::Medium::isType | ( | const Type | type | ) | const |
Returns whether a medium has a given type.
type | Type to check |
|
inline |
Returns whether the medium is valid.
|
inline |
Returns the name of the owner library.
Disabled copy operator.
medium | Object which would be copied |
|
pure virtual |
Pauses the medium.
Implemented in Ocean::Media::WIC::WICBufferImage, Ocean::Media::USB::USBLiveVideo, Ocean::Media::PixelImage, Ocean::Media::OpenImageLibraries::OILBufferImage, Ocean::Media::MediaFoundation::MFMedium, Ocean::Media::ImageIO::IIOBufferImage, Ocean::Media::ImageFileSequence, Ocean::Media::FFmpeg::FFMMedium, Ocean::Media::DirectShow::DSMedium, Ocean::Media::AVFoundation::AVFMedium, Ocean::Media::Android::AMovie, Ocean::Media::Android::AMicrophone, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveAudio, and Ocean::Media::Android::AAudio.
|
pure virtual |
Returns the pause timestamp.
Implemented in Ocean::Media::USB::USBLiveVideo, Ocean::Media::PixelImage, Ocean::Media::MediaFoundation::MFMedium, Ocean::Media::ImageFileSequence, Ocean::Media::FFmpeg::FFMMedium, Ocean::Media::DirectShow::DSMedium, Ocean::Media::BufferImage, Ocean::Media::AVFoundation::AVFMedium, Ocean::Media::Android::AMovie, Ocean::Media::Android::AMicrophone, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveAudio, and Ocean::Media::Android::AAudio.
|
pure virtual |
Starts the medium.
Implemented in Ocean::Media::WIC::WICBufferImage, Ocean::Media::USB::USBLiveVideo, Ocean::Media::PixelImage, Ocean::Media::OpenImageLibraries::OILBufferImage, Ocean::Media::MediaFoundation::MFMedium, Ocean::Media::ImageIO::IIOBufferImage, Ocean::Media::ImageFileSequence, Ocean::Media::FFmpeg::FFMMedium, Ocean::Media::DirectShow::DSMedium, Ocean::Media::AVFoundation::AVFMedium, Ocean::Media::Android::AMovie, Ocean::Media::Android::AMicrophone, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveAudio, and Ocean::Media::Android::AAudio.
|
pure virtual |
Returns the start timestamp.
Implemented in Ocean::Media::USB::USBLiveVideo, Ocean::Media::PixelImage, Ocean::Media::MediaFoundation::MFMedium, Ocean::Media::ImageFileSequence, Ocean::Media::FFmpeg::FFMMedium, Ocean::Media::DirectShow::DSMedium, Ocean::Media::BufferImage, Ocean::Media::AVFoundation::AVFMedium, Ocean::Media::Android::AMovie, Ocean::Media::Android::AMicrophone, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveAudio, and Ocean::Media::Android::AAudio.
|
pure virtual |
Stops the medium.
Implemented in Ocean::Media::WIC::WICBufferImage, Ocean::Media::USB::USBLiveVideo, Ocean::Media::PixelImage, Ocean::Media::OpenImageLibraries::OILBufferImage, Ocean::Media::MediaFoundation::MFMedium, Ocean::Media::ImageIO::IIOBufferImage, Ocean::Media::ImageFileSequence, Ocean::Media::FFmpeg::FFMMedium, Ocean::Media::DirectShow::DSMedium, Ocean::Media::AVFoundation::AVFMedium, Ocean::Media::Android::AMovie, Ocean::Media::Android::AMicrophone, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveAudio, and Ocean::Media::Android::AAudio.
|
pure virtual |
Returns the stop timestamp.
Implemented in Ocean::Media::USB::USBLiveVideo, Ocean::Media::PixelImage, Ocean::Media::MediaFoundation::MFMedium, Ocean::Media::ImageFileSequence, Ocean::Media::FFmpeg::FFMMedium, Ocean::Media::DirectShow::DSMedium, Ocean::Media::BufferImage, Ocean::Media::AVFoundation::AVFMedium, Ocean::Media::Android::AMovie, Ocean::Media::Android::AMicrophone, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveVideo, Ocean::Media::Android::ALiveAudio, and Ocean::Media::Android::AAudio.
|
inline |
Returns the type of the medium.
|
inline |
Returns the url of the medium.
|
protected |
Determines whether the medium is valid.
|
protected |
Name of the owner library.
|
protected |
Url of the medium.