Ocean
Loading...
Searching...
No Matches
Ocean::Media::FFmpeg::FFMLibrary Class Reference

This class implements the FFmpeg library. More...

#include <FFMLibrary.h>

Inheritance diagram for Ocean::Media::FFmpeg::FFMLibrary:

Public Member Functions

MediumRef newMedium (const std::string &url, bool useExclusive=false) override
 Creates a new medium by a given url.
 
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.
 
RecorderRef newRecorder (const Recorder::Type type) override
 Creates a new recorder specified by the recorder type.
 
Medium::Type supportedTypes () const override
 Returns the supported medium types.
 
- Public Member Functions inherited from Ocean::Media::Library
const std::string & name () const
 Returns the name of the library.
 
virtual Definitions selectableMedia () const
 Returns a list of selectable mediums.
 
virtual Definitions selectableMedia (const Medium::Type type) const
 Returns a list of specific selectable mediums.
 
bool supports (const Medium::Type type) const
 Returns whether the library supports a given medium type.
 
bool notSupported (const std::string &extension) const
 Returns whether a given file extension is not supported by this library.
 

Static Public Member Functions

static bool registerLibrary ()
 Registers this library at the global media manager.
 
static bool unregisterLibrary ()
 Unregisters this library at the global media manager.
 
- Static Public Member Functions inherited from Ocean::Media::Library
static std::string convertDefinition (const Definition &definition)
 Converts a medium definition to one string.
 
static Definition convertDefinition (const std::string &string)
 Converts a string to a medium definition.
 

Protected Member Functions

 FFMLibrary ()
 Creates a new FFMLibrary object.
 
 ~FFMLibrary () override
 Destructs an FFMLibrary object.
 
- Protected Member Functions inherited from Ocean::Media::Library
 Library (const Library &library)=delete
 Disabled copy constructor.
 
 Library (const std::string &name, const unsigned int priority)
 Creates a new Library object.
 
virtual ~Library ()
 Destructs a library.
 
unsigned int priority () const
 Returns the priority of this library.
 
void registerNotSupportedExtension (const std::string &extension)
 Registers file extensions not supported by this library.
 
Libraryoperator= (const Library &library)=delete
 Disabled copy operator.
 

Static Protected Member Functions

static LibraryRef create ()
 Creates this library and returns it an object reference.
 
static MediumRef newMovie (const std::string &url, bool useExclusive)
 Creates a new movie medium.
 
static void avLogCallback (void *context, int level, const char *message, va_list arguments)
 Callback function for FFmpeg's logs.
 

Friends

class Media::Manager
 
class FFMMovie
 

Additional Inherited Members

- Public Types inherited from Ocean::Media::Library
typedef std::vector< DefinitionDefinitions
 Definition of a vector holding medium definition objects.
 
- Protected Types inherited from Ocean::Media::Library
typedef std::set< std::string > ExtensionSet
 Definition of a set holding file extensions.
 
- Protected Attributes inherited from Ocean::Media::Library
std::string libraryName
 The name of the library.
 
unsigned int libraryPriority
 Priority of this library, the higher the value, the higher the priority.
 
Lock lock
 Library lock.
 

Detailed Description

This class implements the FFmpeg library.

Constructor & Destructor Documentation

◆ FFMLibrary()

Ocean::Media::FFmpeg::FFMLibrary::FFMLibrary ( )
protected

Creates a new FFMLibrary object.

◆ ~FFMLibrary()

Ocean::Media::FFmpeg::FFMLibrary::~FFMLibrary ( )
overrideprotected

Destructs an FFMLibrary object.

Member Function Documentation

◆ avLogCallback()

static void Ocean::Media::FFmpeg::FFMLibrary::avLogCallback ( void *  context,
int  level,
const char *  message,
va_list  arguments 
)
staticprotected

Callback function for FFmpeg's logs.

Parameters
contextThe context of the log
levelThe log's level
messageThe log message
argumentsThe log's arguments

◆ create()

static LibraryRef Ocean::Media::FFmpeg::FFMLibrary::create ( )
staticprotected

Creates this library and returns it an object reference.

Returns
The new library object

◆ newMedium() [1/2]

MediumRef Ocean::Media::FFmpeg::FFMLibrary::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::FFmpeg::FFMLibrary::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.

◆ newMovie()

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

Creates a new movie medium.

Parameters
urlUrl 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::FFmpeg::FFMLibrary::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::FFmpeg::FFMLibrary::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()

◆ supportedTypes()

Medium::Type Ocean::Media::FFmpeg::FFMLibrary::supportedTypes ( ) const
overridevirtual

Returns the supported medium types.

See also
Library::supportedTypes().

Reimplemented from Ocean::Media::Library.

◆ unregisterLibrary()

static bool Ocean::Media::FFmpeg::FFMLibrary::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 Symbol Documentation

◆ FFMMovie

friend class FFMMovie
friend

◆ Media::Manager

friend class Media::Manager
friend

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