Ocean
Ocean::Media::Library Class Referenceabstract

This class is the base class for all media libraries. More...

Inheritance diagram for Ocean::Media::Library:

Data Structures

class  Definition
 Class combining the url, type, library of a medium, and a unique identifier. More...
 

Public Types

typedef std::vector< DefinitionDefinitions
 Definition of a vector holding medium definition objects. More...
 

Public Member Functions

const std::string & name () const
 Returns the name of the library. More...
 
virtual MediumRef newMedium (const std::string &url, bool useExclusive=false)=0
 Creates a new medium by a given url. More...
 
virtual MediumRef newMedium (const std::string &url, const Medium::Type type, bool useExclusive=false)=0
 Creates a new medium by a given url and an expected type. More...
 
virtual RecorderRef newRecorder (const Recorder::Type type)=0
 Creates a new recorder specified by the recorder type. More...
 
virtual Definitions selectableMedia () const
 Returns a list of selectable mediums. More...
 
virtual Definitions selectableMedia (const Medium::Type type) const
 Returns a list of specific selectable mediums. More...
 
bool supports (const Medium::Type type) const
 Returns whether the library supports a given medium type. More...
 
virtual Medium::Type supportedTypes () const
 Returns the supported medium types. More...
 
bool notSupported (const std::string &extension) const
 Returns whether a given file extension is not supported by this library. More...
 

Static Public Member Functions

static std::string convertDefinition (const Definition &definition)
 Converts a medium definition to one string. More...
 
static Definition convertDefinition (const std::string &string)
 Converts a string to a medium definition. More...
 

Protected Types

typedef std::set< std::string > ExtensionSet
 Definition of a set holding file extensions. More...
 

Protected Member Functions

 Library (const Library &library)=delete
 Disabled copy constructor. More...
 
 Library (const std::string &name, const unsigned int priority)
 Creates a new Library object. More...
 
virtual ~Library ()
 Destructs a library. More...
 
unsigned int priority () const
 Returns the priority of this library. More...
 
void registerNotSupportedExtension (const std::string &extension)
 Registers file extensions not supported by this library. More...
 
Libraryoperator= (const Library &library)=delete
 Disabled copy operator. More...
 

Protected Attributes

std::string libraryName
 The name of the library. More...
 
unsigned int libraryPriority
 Priority of this library, the higher the value, the higher the priority. More...
 
Lock lock
 Library lock. More...
 

Private Attributes

ExtensionSet notSupportedExtensionSet
 Set holding file extensions which are not supported by this library. More...
 

Friends

class Manager
 
class ObjectRef< Library >
 

Detailed Description

This class is the base class for all media libraries.

Any derived library providing individual types of media objects must implement a library class which must be registered at the Manager object of the base media library.
A derived library may implement only one type of media object, all types of media objects or a subset of the media objects.

See also
Manager.

Member Typedef Documentation

◆ Definitions

Definition of a vector holding medium definition objects.

◆ ExtensionSet

typedef std::set<std::string> Ocean::Media::Library::ExtensionSet
protected

Definition of a set holding file extensions.

Constructor & Destructor Documentation

◆ Library() [1/2]

Ocean::Media::Library::Library ( const Library library)
protecteddelete

Disabled copy constructor.

Parameters
libraryObject which would be copied

◆ Library() [2/2]

Ocean::Media::Library::Library ( const std::string &  name,
const unsigned int  priority 
)
protected

Creates a new Library object.

Parameters
nameThe name of the library
priorityThe priority of this library, libraries with higher priority will be privileged compared to libraries with lower priority

◆ ~Library()

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

Destructs a library.

Member Function Documentation

◆ convertDefinition() [1/2]

static std::string Ocean::Media::Library::convertDefinition ( const Definition definition)
static

Converts a medium definition to one string.

Parameters
definitionMedium definition to convert
Returns
String of the definition

◆ convertDefinition() [2/2]

static Definition Ocean::Media::Library::convertDefinition ( const std::string &  string)
static

Converts a string to a medium definition.

Parameters
stringThe string of the medium definition
Returns
Medium definition

◆ name()

const std::string & Ocean::Media::Library::name ( ) const
inline

Returns the name of the library.

Returns
Library name

◆ newMedium() [1/2]

virtual MediumRef Ocean::Media::Library::newMedium ( const std::string &  url,
bool  useExclusive = false 
)
pure virtual

Creates a new medium by a given url.

Parameters
urlUrl to create the medium from
useExclusiveDetermines whether the caller would like to use this medium exclusively
Returns
Reference to the medium

Implemented in Ocean::Media::WIC::WICLibrary, Ocean::Media::USB::USBLibrary, Ocean::Media::OpenImageLibraries::OILLibrary, Ocean::Media::MediaFoundation::MFLibrary, Ocean::Media::ImageIO::IIOLibrary, Ocean::Media::FFmpeg::FFMLibrary, Ocean::Media::DirectShow::DSLibrary, Ocean::Media::AVFoundation::AVFLibrary, and Ocean::Media::Android::ALibrary.

◆ newMedium() [2/2]

virtual MediumRef Ocean::Media::Library::newMedium ( const std::string &  url,
const Medium::Type  type,
bool  useExclusive = false 
)
pure virtual

Creates a new medium by a given url and an expected type.

If no medium can be created an empty reference is returned.

Parameters
urlUrl of the medium
typeThe type of the expected medium
useExclusiveDetermines whether the caller would like to use this medium exclusively
Returns
Reference to the new medium

Implemented in Ocean::Media::WIC::WICLibrary, Ocean::Media::USB::USBLibrary, Ocean::Media::OpenImageLibraries::OILLibrary, Ocean::Media::MediaFoundation::MFLibrary, Ocean::Media::ImageIO::IIOLibrary, Ocean::Media::FFmpeg::FFMLibrary, Ocean::Media::DirectShow::DSLibrary, Ocean::Media::AVFoundation::AVFLibrary, and Ocean::Media::Android::ALibrary.

◆ newRecorder()

virtual RecorderRef Ocean::Media::Library::newRecorder ( const Recorder::Type  type)
pure virtual

◆ notSupported()

bool Ocean::Media::Library::notSupported ( const std::string &  extension) const

Returns whether a given file extension is not supported by this library.

Parameters
extensionFile extension to check with lower case
Returns
True, if so

◆ operator=()

Library& Ocean::Media::Library::operator= ( const Library library)
protecteddelete

Disabled copy operator.

Parameters
libraryObject which would be copied
Returns
Reference to this object

◆ priority()

unsigned int Ocean::Media::Library::priority ( ) const
inlineprotected

Returns the priority of this library.

Returns
Library priority

◆ registerNotSupportedExtension()

void Ocean::Media::Library::registerNotSupportedExtension ( const std::string &  extension)
protected

Registers file extensions not supported by this library.

Parameters
extensionNot supported file extension

◆ selectableMedia() [1/2]

virtual Definitions Ocean::Media::Library::selectableMedia ( ) const
virtual

◆ selectableMedia() [2/2]

virtual Definitions Ocean::Media::Library::selectableMedia ( const Medium::Type  type) const
virtual

Returns a list of specific selectable mediums.

Parameters
typeThe type of the selectable mediums
Returns
Selectable mediums

Reimplemented in Ocean::Media::USB::USBLibrary, Ocean::Media::MediaFoundation::MFLibrary, Ocean::Media::DirectShow::DSLibrary, and Ocean::Media::AVFoundation::AVFLibrary.

◆ supportedTypes()

◆ supports()

bool Ocean::Media::Library::supports ( const Medium::Type  type) const

Returns whether the library supports a given medium type.

Parameters
typeMedium type to check
Returns
True, if so

Friends And Related Function Documentation

◆ Manager

friend class Manager
friend

◆ ObjectRef< Library >

friend class ObjectRef< Library >
friend

Field Documentation

◆ libraryName

std::string Ocean::Media::Library::libraryName
protected

The name of the library.

◆ libraryPriority

unsigned int Ocean::Media::Library::libraryPriority
protected

Priority of this library, the higher the value, the higher the priority.

◆ lock

Lock Ocean::Media::Library::lock
mutableprotected

Library lock.

◆ notSupportedExtensionSet

ExtensionSet Ocean::Media::Library::notSupportedExtensionSet
private

Set holding file extensions which are not supported by this library.


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