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

MediaDiscoverer: Add binding for 3.0 functions

Do not expose deprecated API when new ones are available
parent 94c3ec9e
......@@ -27,6 +27,7 @@
#include "common.hpp"
#include <string>
#include <vlc/libvlc_version.h>
namespace VLC
{
......@@ -37,7 +38,6 @@ class Instance;
class MediaDiscoverer : public Internal<libvlc_media_discoverer_t>
{
public:
// libvlc_media_discoverer_new_from_name
/**
* Discover media service by name.
*
......@@ -48,11 +48,42 @@ public:
* fairly expensive to instantiate.
*/
MediaDiscoverer(Instance& inst, const std::string& name)
#if LIBVLC_VERSION(3, 0, 0, 0) >= LIBVLC_VERSION_INT
: Internal{ libvlc_media_discoverer_new(getInternalPtr<libvlc_instance_t>( inst ), name.c_str()),
#else
: Internal{ libvlc_media_discoverer_new_from_name(getInternalPtr<libvlc_instance_t>( inst ), name.c_str()),
#endif
libvlc_media_discoverer_release }
{
}
#if LIBVLC_VERSION(3, 0, 0, 0) >= LIBVLC_VERSION_INT
/**
* Start media discovery.
*
* To stop it, call MediaDiscover::stop() or
* destroy the object directly.
*
* \see MediaDiscover::stop
*
* \return false in case of error, true otherwise
*/
bool start()
{
return libvlc_media_discoverer_start( *this ) == 0;
}
/**
* Stop media discovery.
*
* \see MediaDiscoverer::start()
*/
void stop()
{
libvlc_media_discoverer_stop( *this );
}
#endif
/**
* Get media service discover object its localized name.
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment