Ocean
Ocean::Media::Android::ALibrary Class Reference

This class implements the android library. More...

Inheritance diagram for Ocean::Media::Android::ALibrary:

Public Member Functions

MediumRef newMedium (const std::string &url, bool useExclusive=false) override
 Creates a new medium by a given url. More...
 
MediumRef newMedium (const std::string &url, const Medium::Type type, bool useExclusive=false) override
 Creates a new medium by a given url and an expected type. More...
 
RecorderRef newRecorder (const Recorder::Type type) override
 Creates a new recorder specified by the recorder type. More...
 
Medium::Type supportedTypes () const override
 Returns the supported medium types. More...
 
- Public Member Functions inherited from Ocean::Media::Library
const std::string & name () const
 Returns the name of the library. 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...
 
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 bool registerLibrary ()
 Registers this library at the global media manager. More...
 
static bool unregisterLibrary ()
 Unregisters this library at the global media manager. More...
 
- Static Public Member Functions inherited from Ocean::Media::Library
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 Member Functions

 ALibrary ()
 Creates a new ALibrary object. More...
 
 ~ALibrary () override
 Destructs an ALibrary object. More...
 
MediumRef newAudio (const std::string &url, bool useExclusive)
 Creates a new audio medium. More...
 
MediumRef newLiveAudio (const std::string &url, bool useExclusive)
 Creates a new live audio medium. More...
 
MediumRef newMicrophone (const std::string &url, bool useExclusive)
 Creates a new microphone medium. More...
 
bool initializerAudioEngine ()
 Initializes the SL audio engine. More...
 
void releaseAudioEngine ()
 Releases the SL audio engine. More...
 
- Protected Member Functions inherited from Ocean::Media::Library
 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...
 

Static Protected Member Functions

static MediumRef newLiveVideo (const std::string &url, bool useExclusive)
 Creates a new live video medium. More...
 
static MediumRef newMovie (const std::string &url, bool useExclusive)
 Creates a new movie medium. More...
 
static LibraryRef create ()
 Creates this library and returns it an object reference. More...
 

Protected Attributes

SLObjectItf slEngine_ = nullptr
 The SL engine for all audio objects. More...
 
SLEngineItf slEngineInterface_ = nullptr
 The SL engine interface for all audio objects. More...
 
NativeCameraLibrary::ScopedSubscription nativeCameraLibrarySubscription_
 The subscription for the native camera library. More...
 
NativeMediaLibrary::ScopedSubscription nativeMediaLibrarySubscription_
 The subscription for the native media library. More...
 
- Protected Attributes inherited from Ocean::Media::Library
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...
 

Friends

class Media::Manager
 
class AAudio
 
class ALiveAudio
 
class ALiveVideo
 
class AMovie
 

Additional Inherited Members

- Public Types inherited from Ocean::Media::Library
typedef std::vector< DefinitionDefinitions
 Definition of a vector holding medium definition objects. More...
 
- Protected Types inherited from Ocean::Media::Library
typedef std::set< std::string > ExtensionSet
 Definition of a set holding file extensions. More...
 

Detailed Description

This class implements the android library.

Constructor & Destructor Documentation

◆ ALibrary()

Ocean::Media::Android::ALibrary::ALibrary ( )
protected

Creates a new ALibrary object.

◆ ~ALibrary()

Ocean::Media::Android::ALibrary::~ALibrary ( )
overrideprotected

Destructs an ALibrary object.

Member Function Documentation

◆ create()

static LibraryRef Ocean::Media::Android::ALibrary::create ( )
staticprotected

Creates this library and returns it an object reference.

Returns
The new library object

◆ initializerAudioEngine()

bool Ocean::Media::Android::ALibrary::initializerAudioEngine ( )
protected

Initializes the SL audio engine.

Returns
True, if succeeded

◆ newAudio()

MediumRef Ocean::Media::Android::ALibrary::newAudio ( const std::string &  url,
bool  useExclusive 
)
protected

Creates a new audio medium.

Parameters
urlThe URL of the audio medium to create
useExclusiveDetermines whether the caller would like to use this medium exclusively
Returns
Reference of the new medium

◆ newLiveAudio()

MediumRef Ocean::Media::Android::ALibrary::newLiveAudio ( const std::string &  url,
bool  useExclusive 
)
protected

Creates a new live audio medium.

Parameters
urlThe URL of the audio medium to create
useExclusiveDetermines whether the caller would like to use this medium exclusively
Returns
Reference of the new medium

◆ newLiveVideo()

static MediumRef Ocean::Media::Android::ALibrary::newLiveVideo ( const std::string &  url,
bool  useExclusive 
)
staticprotected

Creates a new live video medium.

Parameters
urlThe URL of the live video medium to create
useExclusiveDetermines whether the caller would like to use this medium exclusively
Returns
Reference of the new medium

◆ newMedium() [1/2]

MediumRef Ocean::Media::Android::ALibrary::newMedium ( const std::string &  url,
bool  useExclusive = false 
)
overridevirtual

Creates a new medium by a given url.

See also
Library::newMedium().

Implements Ocean::Media::Library.

◆ newMedium() [2/2]

MediumRef Ocean::Media::Android::ALibrary::newMedium ( const std::string &  url,
const Medium::Type  type,
bool  useExclusive = false 
)
overridevirtual

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

See also
Library::newMedium().

Implements Ocean::Media::Library.

◆ newMicrophone()

MediumRef Ocean::Media::Android::ALibrary::newMicrophone ( const std::string &  url,
bool  useExclusive 
)
protected

Creates a new microphone medium.

Parameters
urlThe URL of the audio medium to create
useExclusiveDetermines whether the caller would like to use this medium exclusively
Returns
Reference of the new medium

◆ newMovie()

static MediumRef Ocean::Media::Android::ALibrary::newMovie ( const std::string &  url,
bool  useExclusive 
)
staticprotected

Creates a new movie medium.

Parameters
urlThe URL of the movie medium to create
useExclusiveDetermines whether the caller would like to use this medium exclusively
Returns
Reference of the new medium

◆ newRecorder()

RecorderRef Ocean::Media::Android::ALibrary::newRecorder ( const Recorder::Type  type)
overridevirtual

Creates a new recorder specified by the recorder type.

See also
Library::newRecorder().

Implements Ocean::Media::Library.

◆ registerLibrary()

static bool Ocean::Media::Android::ALibrary::registerLibrary ( )
static

Registers this library at the global media manager.

With each register call, the reference counter for a specific library will be incremented. Each call to registerLibrary() needs to be balanced with a corresponding call of unregisterLibrary() before shutting down.

Returns
True, if the library has not been registered before
See also
Manager, unregisterLibrary()

◆ releaseAudioEngine()

void Ocean::Media::Android::ALibrary::releaseAudioEngine ( )
protected

Releases the SL audio engine.

◆ supportedTypes()

Medium::Type Ocean::Media::Android::ALibrary::supportedTypes ( ) const
overridevirtual

Returns the supported medium types.

See also
Library::supportedTypes().

Reimplemented from Ocean::Media::Library.

◆ unregisterLibrary()

static bool Ocean::Media::Android::ALibrary::unregisterLibrary ( )
static

Unregisters this library at the global media manager.

With each unregister call, the reference counter for a specific library will be decremented and removed from the system if the counter reaches zero. Each call to registerLibrary() needs to be balanced with a corresponding call of unregisterLibrary() before shutting down.

Returns
True, if the library was actually removed from the system (as the reference counter reached zero); False, if the library is still used by someone else
See also
registerLibrary().

Friends And Related Function Documentation

◆ AAudio

friend class AAudio
friend

◆ ALiveAudio

friend class ALiveAudio
friend

◆ ALiveVideo

friend class ALiveVideo
friend

◆ AMovie

friend class AMovie
friend

◆ Media::Manager

friend class Media::Manager
friend

Field Documentation

◆ nativeCameraLibrarySubscription_

NativeCameraLibrary::ScopedSubscription Ocean::Media::Android::ALibrary::nativeCameraLibrarySubscription_
protected

The subscription for the native camera library.

◆ nativeMediaLibrarySubscription_

NativeMediaLibrary::ScopedSubscription Ocean::Media::Android::ALibrary::nativeMediaLibrarySubscription_
protected

The subscription for the native media library.

◆ slEngine_

SLObjectItf Ocean::Media::Android::ALibrary::slEngine_ = nullptr
protected

The SL engine for all audio objects.

◆ slEngineInterface_

SLEngineItf Ocean::Media::Android::ALibrary::slEngineInterface_ = nullptr
protected

The SL engine interface for all audio objects.


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