Commit 6de088e2 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Use shared/unique pointers to manage vlcpp/libvlc objects

parent cdb2aad7
......@@ -27,18 +27,13 @@
namespace VLC
{
EventManager::EventManager(const EventManager& em)
: Internal( em )
{
}
bool EventManager::attach(libvlc_event_type_t type, IMediaEventCb* cb)
{
if ( cb == NULL )
return false;
if ( type < libvlc_MediaMetaChanged || type > libvlc_MediaSubItemTreeAdded )
return false;
libvlc_event_attach( *this, type, &handleMediaEvent, cb );
libvlc_event_attach( get(), type, &handleMediaEvent, cb );
return true;
}
......@@ -48,7 +43,7 @@ bool EventManager::attach(libvlc_event_type_t type, IMediaPlayerEventCb* cb)
return false;
if ( type < libvlc_MediaPlayerMediaChanged || type > libvlc_MediaPlayerESSelected )
return false;
libvlc_event_attach( *this, type, &handleMediaPlayerEvent, cb );
libvlc_event_attach( get(), type, &handleMediaPlayerEvent, cb );
return true;
}
......@@ -58,7 +53,7 @@ bool EventManager::attach(libvlc_event_type_t type, IMediaListEventCb* cb)
return false;
if ( type < libvlc_MediaListItemAdded || type > libvlc_MediaListWillDeleteItem )
return false;
libvlc_event_attach( *this, type, &handleMediaListEvent, cb );
libvlc_event_attach( get(), type, &handleMediaListEvent, cb );
return true;
}
......@@ -68,7 +63,7 @@ bool EventManager::attach(libvlc_event_type_t type, IMediaListPlayerEventCb* cb)
return false;
if ( type < libvlc_MediaListPlayerPlayed || type > libvlc_MediaListPlayerStopped )
return false;
libvlc_event_attach( *this, type, &handleMediaListPlayerEvent, cb );
libvlc_event_attach( get(), type, &handleMediaListPlayerEvent, cb );
return true;
}
......@@ -78,7 +73,7 @@ bool EventManager::attach(libvlc_event_type_t type, IMediaDiscovererEventCb* cb)
return false;
if ( type < libvlc_MediaDiscovererStarted || type > libvlc_MediaDiscovererEnded )
return false;
libvlc_event_attach( *this, type, &handleMediaDiscovererEvent, cb );
libvlc_event_attach( get(), type, &handleMediaDiscovererEvent, cb );
return true;
}
......@@ -88,38 +83,38 @@ bool EventManager::attach( libvlc_event_type_t type, IVLMEventCb* cb )
return false;
if ( type < libvlc_VlmMediaAdded || type > libvlc_VlmMediaInstanceStatusError )
return false;
libvlc_event_attach( *this, type, &handleVLMEvent, cb );
libvlc_event_attach( get(), type, &handleVLMEvent, cb );
return true;
}
void EventManager::detach(libvlc_event_type_t type, IMediaEventCb* cb)
{
libvlc_event_detach( *this, type, &handleMediaEvent, cb );
libvlc_event_detach( get(), type, &handleMediaEvent, cb );
}
void EventManager::detach(libvlc_event_type_t type, IMediaPlayerEventCb* cb)
{
libvlc_event_detach( *this, type, &handleMediaPlayerEvent, cb );
libvlc_event_detach( get(), type, &handleMediaPlayerEvent, cb );
}
void EventManager::detach(libvlc_event_type_t type, IMediaListEventCb* cb)
{
libvlc_event_detach( *this, type, &handleMediaListEvent, cb );
libvlc_event_detach( get(), type, &handleMediaListEvent, cb );
}
void EventManager::detach(libvlc_event_type_t type, IMediaListPlayerEventCb* cb)
{
libvlc_event_detach( *this, type, &handleMediaListPlayerEvent, cb );
libvlc_event_detach( get(), type, &handleMediaListPlayerEvent, cb );
}
void EventManager::detach(libvlc_event_type_t type, IMediaDiscovererEventCb* cb)
{
libvlc_event_detach( *this, type, &handleMediaDiscovererEvent, cb );
libvlc_event_detach( get(), type, &handleMediaDiscovererEvent, cb );
}
void EventManager::detach(libvlc_event_type_t type, IVLMEventCb* cb)
{
libvlc_event_detach( *this, type, &handleVLMEvent, cb );
libvlc_event_detach( get(), type, &handleVLMEvent, cb );
}
void EventManager::handleMediaEvent(const libvlc_event_t* event, void* data)
......@@ -131,7 +126,7 @@ void EventManager::handleMediaEvent(const libvlc_event_t* event, void* data)
cb->metaChanged( event->u.media_meta_changed.meta_type );
break;
case libvlc_MediaSubItemAdded:
cb->subItemAdded( Media( event->u.media_subitem_added.new_child, true ) );
cb->subItemAdded( std::make_shared<Media>( event->u.media_subitem_added.new_child, true ) );
break;
case libvlc_MediaDurationChanged:
cb->durationChanged( event->u.media_duration_changed.new_duration );
......@@ -140,13 +135,13 @@ void EventManager::handleMediaEvent(const libvlc_event_t* event, void* data)
cb->parsedChanged( event->u.media_parsed_changed.new_status != 0 );
break;
case libvlc_MediaFreed:
cb->freed( Media( event->u.media_freed.md, true ) );
cb->freed( std::make_shared<Media>( event->u.media_freed.md, true ) );
break;
case libvlc_MediaStateChanged:
cb->stateChanged( event->u.media_state_changed.new_state );
break;
case libvlc_MediaSubItemTreeAdded:
cb->subItemTreeAdded( Media( event->u.media_subitemtree_added.item, true ) );
cb->subItemTreeAdded( std::make_shared<Media>( event->u.media_subitemtree_added.item, true ) );
break;
default:
assert(false);
......@@ -159,7 +154,7 @@ void EventManager::handleMediaPlayerEvent(const libvlc_event_t* event, void* dat
switch ( event->type )
{
case libvlc_MediaPlayerMediaChanged:
cb->mediaChanged( Media( event->u.media_player_media_changed.new_media, true ) );
cb->mediaChanged( std::make_shared<Media>( event->u.media_player_media_changed.new_media, true ) );
break;
case libvlc_MediaPlayerNothingSpecial:
cb->nothingSpecial();
......@@ -238,16 +233,16 @@ void EventManager::handleMediaListEvent(const libvlc_event_t* event, void* data)
switch ( event->type )
{
case libvlc_MediaListItemAdded:
cb->itemAdded( Media( event->u.media_list_item_added.item, true ), event->u.media_list_item_added.index );
cb->itemAdded( std::make_shared<Media>( event->u.media_list_item_added.item, true ), event->u.media_list_item_added.index );
break;
case libvlc_MediaListWillAddItem:
cb->willAddItem( Media( event->u.media_list_will_add_item.item, true ), event->u.media_list_will_add_item.index );
cb->willAddItem( std::make_shared<Media>( event->u.media_list_will_add_item.item, true ), event->u.media_list_will_add_item.index );
break;
case libvlc_MediaListItemDeleted:
cb->itemDeleted( Media( event->u.media_list_item_deleted.item, true ), event->u.media_list_item_deleted.index );
cb->itemDeleted( std::make_shared<Media>( event->u.media_list_item_deleted.item, true ), event->u.media_list_item_deleted.index );
break;
case libvlc_MediaListWillDeleteItem:
cb->willDeleteItem( Media( event->u.media_list_will_delete_item.item, true ), event->u.media_list_will_delete_item.index );
cb->willDeleteItem( std::make_shared<Media>( event->u.media_list_will_delete_item.item, true ), event->u.media_list_will_delete_item.index );
break;
default:
assert(false);
......@@ -263,7 +258,7 @@ void EventManager::handleMediaListPlayerEvent(const libvlc_event_t* event, void*
cb->played();
break;
case libvlc_MediaListPlayerNextItemSet:
cb->nextItemSet( Media( event->u.media_list_player_next_item_set.item, true ) );
cb->nextItemSet( std::make_shared<Media>( event->u.media_list_player_next_item_set.item, true ) );
break;
case libvlc_MediaListPlayerStopped:
cb->stopped();
......@@ -334,8 +329,8 @@ void EventManager::handleVLMEvent(const libvlc_event_t* event, void* data)
}
}
EventManager::EventManager( InternalPtr obj)
: Internal( obj )
EventManager::EventManager(Internal::InternalPtr ptr)
: Internal{ ptr, [](InternalPtr){ /* No-op; EventManager's are handled by their respective objects */ } }
{
}
......
......@@ -37,19 +37,19 @@ class IMediaEventCb
public:
virtual ~IMediaEventCb() {}
virtual void metaChanged( libvlc_meta_t ) {}
virtual void subItemAdded( const Media& ) {}
virtual void subItemAdded( MediaPtr ) {}
virtual void durationChanged( int64_t ) {}
virtual void parsedChanged( bool ) {}
virtual void freed( const Media& ) {}
virtual void freed( MediaPtr ) {}
virtual void stateChanged( libvlc_state_t ) {}
virtual void subItemTreeAdded( const Media& ) {}
virtual void subItemTreeAdded( MediaPtr ) {}
};
class IMediaPlayerEventCb
{
public:
virtual ~IMediaPlayerEventCb(){}
virtual void mediaChanged( const Media& ) {}
virtual void mediaChanged( MediaPtr ) {}
virtual void nothingSpecial() {}
virtual void opening() {}
virtual void buffering( float ) {}
......@@ -78,10 +78,10 @@ class IMediaListEventCb
{
public:
virtual ~IMediaListEventCb() {}
virtual void itemAdded( const Media&, int ) {}
virtual void willAddItem( const Media&, int ) {}
virtual void itemDeleted( const Media&, int ) {}
virtual void willDeleteItem( const Media&, int ) {}
virtual void itemAdded( MediaPtr, int ) {}
virtual void willAddItem( MediaPtr, int ) {}
virtual void itemDeleted( MediaPtr, int ) {}
virtual void willDeleteItem( MediaPtr, int ) {}
};
// MediaListView events are not being sent by VLC, so we don't implement them here
......@@ -91,7 +91,7 @@ class IMediaListPlayerEventCb
public:
virtual ~IMediaListPlayerEventCb() {}
virtual void played() {}
virtual void nextItemSet( const Media& ) {}
virtual void nextItemSet( MediaPtr ) {}
virtual void stopped() {}
};
......@@ -123,7 +123,8 @@ class IVLMEventCb
class VLCPP_API EventManager : public Internal<libvlc_event_manager_t>
{
public:
EventManager( const EventManager& em );
EventManager(InternalPtr ptr);
bool attach( libvlc_event_type_t type, IMediaEventCb* cb );
bool attach( libvlc_event_type_t type, IMediaPlayerEventCb* cb );
bool attach( libvlc_event_type_t type, IMediaListEventCb* cb );
......@@ -147,13 +148,6 @@ class VLCPP_API EventManager : public Internal<libvlc_event_manager_t>
static void handleVLMEvent( const libvlc_event_t* event, void* data );
static void handleEvent( const libvlc_event_t* event, void* data );
EventManager(InternalPtr obj );
friend class Media;
friend class MediaDiscoverer;
friend class MediaList;
friend class MediaListPlayer;
friend class MediaPlayer;
};
}
......
......@@ -27,26 +27,8 @@ namespace VLC
{
Instance::Instance(int argc, const char* const* argv)
: Internal{ libvlc_new( argc, argv ), libvlc_release }
{
m_obj = libvlc_new( argc, argv );
}
Instance::Instance( const Instance& another )
: Internal( another )
{
retain();
}
Instance& Instance::operator=( const Instance& another )
{
if ( this == &another )
{
return *this;
}
release();
m_obj = another.m_obj;
retain();
return *this;
}
bool Instance::operator==( const Instance& another ) const
......@@ -54,49 +36,44 @@ bool Instance::operator==( const Instance& another ) const
return m_obj == another.m_obj;
}
Instance::~Instance()
{
release();
}
int Instance::addIntf( const std::string& name )
{
return libvlc_add_intf( m_obj, name.c_str() );
return libvlc_add_intf( get(), name.c_str() );
}
void Instance::setExitHandler( void(*cb)(void *), void * opaque )
{
libvlc_set_exit_handler( m_obj, cb, opaque );
libvlc_set_exit_handler( get(), cb, opaque );
}
void Instance::setUserAgent( const std::string& name, const std::string& http )
{
libvlc_set_user_agent( m_obj, name.c_str(), http.c_str() );
libvlc_set_user_agent( get(), name.c_str(), http.c_str() );
}
void Instance::setAppId( const std::string& id, const std::string& version, const std::string& icon )
{
libvlc_set_app_id( m_obj, id.c_str(), version.c_str(), icon.c_str() );
libvlc_set_app_id( get(), id.c_str(), version.c_str(), icon.c_str() );
}
void Instance::logUnset()
{
libvlc_log_unset( m_obj );
libvlc_log_unset( get() );
}
void Instance::logSet( libvlc_log_cb cb, void * data )
{
libvlc_log_set(m_obj, cb, data);
libvlc_log_set(get(), cb, data);
}
void Instance::logSetFile( FILE * stream )
{
libvlc_log_set_file( m_obj, stream );
libvlc_log_set_file( get(), stream );
}
std::vector<ModuleDescription> Instance::audioFilterList()
{
libvlc_module_description_t* result = libvlc_audio_filter_list_get(m_obj);
libvlc_module_description_t* result = libvlc_audio_filter_list_get(get());
std::vector<ModuleDescription> res;
if ( result == NULL )
return res;
......@@ -112,7 +89,7 @@ std::vector<ModuleDescription> Instance::audioFilterList()
std::vector<ModuleDescription> Instance::videoFilterList()
{
libvlc_module_description_t* result = libvlc_video_filter_list_get(m_obj);
libvlc_module_description_t* result = libvlc_video_filter_list_get(get());
std::vector<ModuleDescription> res;
if ( result == NULL )
return res;
......@@ -128,7 +105,7 @@ std::vector<ModuleDescription> Instance::videoFilterList()
std::vector<AudioOutputDescription> Instance::audioOutputList()
{
libvlc_audio_output_t* result = libvlc_audio_output_list_get(m_obj);
libvlc_audio_output_t* result = libvlc_audio_output_list_get(get());
std::vector<AudioOutputDescription> res;
if ( result == NULL )
return res;
......@@ -144,7 +121,7 @@ std::vector<AudioOutputDescription> Instance::audioOutputList()
std::vector<AudioOutputDeviceDescription> Instance::audioOutputDeviceList(const std::string& aout)
{
libvlc_audio_output_device_t* devices = libvlc_audio_output_device_list_get( m_obj, aout.c_str() );
libvlc_audio_output_device_t* devices = libvlc_audio_output_device_list_get( get(), aout.c_str() );
std::vector<AudioOutputDeviceDescription> res;
if ( devices == NULL )
return res;
......@@ -154,17 +131,5 @@ std::vector<AudioOutputDeviceDescription> Instance::audioOutputDeviceList(const
return res;
}
void Instance::release()
{
if ( isValid() )
libvlc_release(m_obj);
}
void Instance::retain()
{
if ( isValid() )
libvlc_retain(m_obj);
}
} // namespace VLC
......@@ -60,19 +60,6 @@ public:
*/
Instance(int argc, const char *const * argv);
/**
* Copy libvlc_instance_t from another to new Instance object.
* \param another existing Instance
*/
Instance(const Instance& another);
/**
* Copy libvlc_instance_t from another Instance
* to this Instance
* \param another existing Instance
*/
Instance& operator=(const Instance& another);
/**
* Check if 2 Instance objects contain the same libvlc_instance_t.
* \param another another Instance
......@@ -80,8 +67,6 @@ public:
*/
bool operator==(const Instance& another) const;
~Instance();
/**
* Try to start a user interface for the libvlc instance.
*
......@@ -240,20 +225,6 @@ public:
* \version LibVLC 2.1.0 or later.
*/
std::vector<AudioOutputDeviceDescription> audioOutputDeviceList(const std::string& aout);
private:
explicit Instance( InternalPtr ptr, bool increaseRefCount );
/**
* Decrement the reference count of a libvlc instance, and destroy it if
* it reaches zero.
*/
void release();
/**
* Increments the reference count of a libvlc instance. The initial
* reference count is 1 after Instance::Instance() returns.
*/
void retain();
};
} // namespace VLC
......
......@@ -26,31 +26,36 @@
#include <cassert>
#include <stdlib.h>
#include <vlc/libvlc.h>
#include <memory>
#include <stdexcept>
namespace VLC
{
template < typename T >
template <typename T, typename Releaser = void(*)(T*)>
class Internal
{
public:
typedef T* InternalPtr;
InternalPtr getInternalPtr()
using InternalType = T;
using InternalPtr = T*;
using Pointer = std::unique_ptr<T, Releaser>;
InternalPtr get() { return m_obj.get(); }
bool isValid() const { return (bool)m_obj; }
protected:
Internal( InternalPtr obj, Releaser releaser )
: m_obj{ obj, releaser }
{
if ( obj == nullptr )
throw std::runtime_error("Wrapping a NULL instance");
}
Internal(Releaser releaser)
: m_obj{ nullptr, releaser }
{
assert( m_obj != NULL );
return m_obj;
}
operator T*() { return m_obj; }
bool isValid() const { return m_obj != NULL; }
protected:
Internal( InternalPtr obj = NULL ) : m_obj( obj ) {}
Internal( const Internal& copied ) : m_obj( copied.m_obj ) {}
~Internal(){}
InternalPtr m_obj;
private:
Internal& operator=(const Internal&);
protected:
Pointer m_obj;
};
}
......
......@@ -27,66 +27,38 @@
namespace VLC
{
Media::Media(Instance &instance, const std::string &mrl, Media::FromType type)
: Internal( NULL )
Media::Media(InstancePtr instance, const std::string &mrl, Media::FromType type)
: Internal{ libvlc_media_release }
{
InternalPtr ptr = nullptr;
switch (type)
{
case FromLocation:
m_obj = libvlc_media_new_location( instance, mrl.c_str() );
ptr = libvlc_media_new_location( instance->get(), mrl.c_str() );
break;
case FromPath:
m_obj = libvlc_media_new_path( instance, mrl.c_str() );
ptr = libvlc_media_new_path( instance->get(), mrl.c_str() );
break;
case AsNode:
m_obj = libvlc_media_new_as_node( instance, mrl.c_str() );
ptr = libvlc_media_new_as_node( instance->get(), mrl.c_str() );
break;
default:
break;
}
if ( m_obj == NULL )
if ( ptr == nullptr )
throw std::runtime_error("Failed to construct a media");
m_obj.reset( ptr );
}
Media::Media(Instance& instance, int fd)
Media::Media(InstancePtr instance, int fd)
: Internal { libvlc_media_new_fd( instance->get(), fd ), libvlc_media_release }
{
m_obj = libvlc_media_new_fd( instance, fd );
if ( m_obj == NULL )
throw std::runtime_error("Failed to construct a media");
}
Media::Media(MediaList& list)
{
m_obj = libvlc_media_list_media( list );
if ( m_obj == NULL )
throw std::runtime_error("Failed to construct a media");
}
Media::Media(const Media& another)
: Internal(another)
, m_eventManager( NULL )
Media::Media(MediaListPtr list)
: Internal{ libvlc_media_list_media( list->get() ), libvlc_media_release }
{
retain();
if ( another.m_eventManager != NULL )
m_eventManager = new EventManager( *another.m_eventManager );
}
Media& Media::operator=(const Media& another)
{
if (this == &another)
{
return *this;
}
release();
m_obj = another.m_obj;
delete m_eventManager;
if ( another.m_eventManager != NULL )
m_eventManager = new EventManager( *another.m_eventManager );
else
m_eventManager = NULL;
retain();
return *this;
}
bool Media::operator==(const Media& another) const
......@@ -94,25 +66,19 @@ bool Media::operator==(const Media& another) const
return m_obj == another.m_obj;
}
Media::~Media()
{
delete m_eventManager;
release();
}
void Media::addOption(const std::string& psz_options)
{
libvlc_media_add_option(m_obj, psz_options.c_str());
libvlc_media_add_option(get(), psz_options.c_str());
}
void Media::addOptionFlag(const std::string& psz_options, unsigned i_flags)
{
libvlc_media_add_option_flag(m_obj, psz_options.c_str(), i_flags);
libvlc_media_add_option_flag(get(), psz_options.c_str(), i_flags);
}
std::string Media::mrl()
{
char* c_result = libvlc_media_get_mrl(m_obj);
char* c_result = libvlc_media_get_mrl(get());
if ( c_result == NULL )
return std::string();
std::string result = c_result;
......@@ -122,13 +88,13 @@ std::string Media::mrl()
Media Media::duplicate()
{
InternalPtr obj = libvlc_media_duplicate(m_obj);
InternalPtr obj = libvlc_media_duplicate(get());
return Media( obj, true );
}
std::string Media::meta(libvlc_meta_t e_meta)
{
char* c_result = libvlc_media_get_meta(m_obj, e_meta);
char* c_result = libvlc_media_get_meta(get(), e_meta);
if ( c_result == NULL )
return std::string();
std::string result = c_result;
......@@ -138,68 +104,68 @@ std::string Media::meta(libvlc_meta_t e_meta)
void Media::setMeta(libvlc_meta_t e_meta, const std::string& psz_value)
{
libvlc_media_set_meta(m_obj, e_meta, psz_value.c_str());
libvlc_media_set_meta(get(), e_meta, psz_value.c_str());
}
int Media::saveMeta()
{
return libvlc_media_save_meta(m_obj);
return libvlc_media_save_meta(get());
}
libvlc_state_t Media::state()
{
return libvlc_media_get_state(m_obj);
return libvlc_media_get_state(get());
}
bool Media::stats(libvlc_media_stats_t * p_stats)
{
return libvlc_media_get_stats(m_obj, p_stats) != 0;
return libvlc_media_get_stats(get(), p_stats) != 0;
}
EventManager& Media::eventManager()
EventManagerPtr Media::eventManager()
{
if ( m_eventManager == NULL )
{
libvlc_event_manager_t* obj = libvlc_media_event_manager(m_obj);
m_eventManager = new EventManager( obj );
libvlc_event_manager_t* obj = libvlc_media_event_manager(get());
m_eventManager = std::make_shared<EventManager>( obj );
}
return *m_eventManager;
return m_eventManager;
}
libvlc_time_t Media::duration()
{
return libvlc_media_get_duration(m_obj);
return libvlc_media_get_duration(get());
}
void Media::parse()
{
libvlc_media_parse(m_obj);
libvlc_media_parse(get());
}
void Media::parseAsync()
{
libvlc_media_parse_async(m_obj);
libvlc_media_parse_async(get());
}
bool Media::isParsed()
{
return libvlc_media_is_parsed(m_obj) != 0;
return libvlc_media_is_parsed(get()) != 0;
}
void Media::setUserData(void * p_new_user_data)
{
libvlc_media_set_user_data(m_obj, p_new_user_data);
libvlc_media_set_user_data(get(), p_new_user_data);
}
void * Media::userData()
{
return libvlc_media_get_user_data(m_obj);
return libvlc_media_get_user_data(get());
}
std::vector<MediaTrack> Media::tracks()
{
libvlc_media_track_t** tracks;
uint32_t nbTracks = libvlc_media_tracks_get(m_obj, &tracks);
uint32_t nbTracks = libvlc_media_tracks_get(get(), &tracks);
std::vector<MediaTrack> res;
if ( nbTracks == 0 )
......@@ -211,24 +177,17 @@ std::vector<MediaTrack> Media::tracks()
return res;
}
Media::Media(Internal::InternalPtr ptr, bool increaseRefCount )
: Internal(ptr)
, m_eventManager( NULL )
Media::Media(Internal::InternalPtr ptr, bool incrementRefCount)
: Internal{ ptr, libvlc_media_release }
{
if ( increaseRefCount )
if (incrementRefCount)
retain();
}
void Media::retain()
{
if ( isValid() )
libvlc_media_retain(m_obj);
}
void Media::release()
{
if ( isValid() )
libvlc_media_release(m_obj);
libvlc_media_retain(get());
}
} // namespace VLC
......
......@@ -25,9 +25,7 @@
#define LIBVLC_CXX_MEDIA_H
#include <vector>
#include "common.hpp"
#include "Internal.hpp"
#include "structures.hpp"
#include "vlc.hpp"
namespace VLC
{
......@@ -68,7 +66,7 @@ public:
* @param mrl A path, location, or node name, depending on the 3rd parameter
* @param type The type of the 2nd argument. \sa{FromType}
*/
Media(Instance& instance, const std::string& mrl, FromType type);
Media(InstancePtr instance, const std::string& mrl, FromType type);
/**
* Create a media for an already open file descriptor.
......@@ -90,7 +88,7 @@ public:
* \param fd open file descriptor
* \return the newly created media or NULL on error
*/
Media(Instance& instance, int fd);
Media(InstancePtr instance, int fd);
/**
* Get media instance from this media list instance. This action will increase
......@@ -100,20 +98,9 @@ public:
* \param p_ml a media list instance