Ocean
Ocean::Media::Medium Class Referenceabstract

This is the base class for all mediums. More...

Inheritance diagram for Ocean::Media::Medium:

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...
 
Mediumoperator= (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 >
 

Detailed Description

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.

See also
Manager

Member Enumeration Documentation

◆ Type

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.

Constructor & Destructor Documentation

◆ Medium() [1/2]

Ocean::Media::Medium::Medium ( const Medium medium)
protecteddelete

Disabled copy constructor.

Parameters
mediumObject which would be copied

◆ Medium() [2/2]

Ocean::Media::Medium::Medium ( const std::string &  url)
explicitprotected

Creates a new medium by a given url.

Parameters
urlUrl of the medium

◆ ~Medium()

virtual Ocean::Media::Medium::~Medium ( )
protectedvirtual

Destructs a medium.

Member Function Documentation

◆ clone()

◆ convertType() [1/2]

static Type Ocean::Media::Medium::convertType ( const std::string &  type)
static

Converts a medium type string to a medium type.

Parameters
typeString of the medium type
Returns
Medium type

◆ convertType() [2/2]

static std::string Ocean::Media::Medium::convertType ( const Type  type)
static

Converts a medium type to a unique string.

Parameters
typeType of the medium to convert
Returns
Unique string

◆ isExclusive()

bool Ocean::Media::Medium::isExclusive ( ) const

Returns whether this medium can be use exclusively.

Returns
True, if so

◆ isStarted()

◆ isType()

bool Ocean::Media::Medium::isType ( const Type  type) const

Returns whether a medium has a given type.

Parameters
typeType to check
Returns
True, if so

◆ isValid()

bool Ocean::Media::Medium::isValid ( ) const
inline

Returns whether the medium is valid.

Returns
True, if so

◆ library()

const std::string & Ocean::Media::Medium::library ( ) const
inline

Returns the name of the owner library.

Returns
Library name

◆ operator=()

Medium& Ocean::Media::Medium::operator= ( const Medium medium)
protecteddelete

Disabled copy operator.

Parameters
mediumObject which would be copied
Returns
Reference to this object

◆ pause()

◆ pauseTimestamp()

◆ start()

◆ startTimestamp()

◆ stop()

◆ stopTimestamp()

◆ type()

Medium::Type Ocean::Media::Medium::type ( ) const
inline

Returns the type of the medium.

Returns
Medium type

◆ url()

const std::string & Ocean::Media::Medium::url ( ) const
inline

Returns the url of the medium.

Returns
Medium url

Friends And Related Function Documentation

◆ ObjectRef< Medium >

friend class ObjectRef< Medium >
friend

Field Documentation

◆ isValid_

bool Ocean::Media::Medium::isValid_ = false
protected

Determines whether the medium is valid.

◆ libraryName_

std::string Ocean::Media::Medium::libraryName_
protected

Name of the owner library.

◆ lock_

Lock Ocean::Media::Medium::lock_
mutableprotected

Medium lock.

◆ type_

Type Ocean::Media::Medium::type_ = MEDIUM
protected

Type of the medium.

◆ url_

std::string Ocean::Media::Medium::url_
protected

Url of the medium.


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