[vlc-commits] [Git][videolan/libvlcpp][master] Instance: expose RendererDiscovererDescription

Hugo Beauzée-Luyssen gitlab at videolan.org
Mon Mar 12 14:39:40 CET 2018


Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / libvlcpp


Commits:
4202d81d by Martin Finkel at 2018-03-09T16:06:38+01:00
Instance: expose RendererDiscovererDescription

Signed-off-by: Hugo Beauzée-Luyssen <hugo at beauzee.fr>

- - - - -


2 changed files:

- vlcpp/Instance.hpp
- vlcpp/structures.hpp


Changes:

=====================================
vlcpp/Instance.hpp
=====================================
--- a/vlcpp/Instance.hpp
+++ b/vlcpp/Instance.hpp
@@ -536,6 +536,24 @@ public:
             res.emplace_back( pp_descs[i]->psz_name, pp_descs[i]->psz_longname, pp_descs[i]->i_cat );
         return res;
     }
+
+    std::vector<RendererDiscovererDescription> rendererDiscoverers()
+    {
+        libvlc_rd_description_t** pp_descs;
+        auto nbSd = libvlc_renderer_discoverer_list_get(*this, &pp_descs);
+        if (nbSd == 0)
+            return {};
+        auto releaser = [nbSd](libvlc_rd_description_t** ptr) {
+            libvlc_renderer_discoverer_list_release(ptr, nbSd);
+        };
+        std::unique_ptr<libvlc_rd_description_t*, decltype(releaser)> descPtr(pp_descs, releaser);
+        std::vector<RendererDiscovererDescription> res;
+        res.reserve(nbSd);
+        for (auto i = 0u; i < nbSd; ++i)
+            res.emplace_back( pp_descs[i] );
+        return res;
+    }
+
 #endif
 
 #endif


=====================================
vlcpp/structures.hpp
=====================================
--- a/vlcpp/structures.hpp
+++ b/vlcpp/structures.hpp
@@ -693,6 +693,31 @@ public:
     }
 };
 
+class RendererDiscovererDescription 
+{
+public:
+    explicit RendererDiscovererDescription( const libvlc_rd_description_t* d )
+    {
+        if (d->psz_name != NULL)
+            m_name = d->psz_name;
+        if (d->psz_longname != NULL)
+            m_longName = d->psz_longname;
+    }
+
+    const std::string& name() const
+    {
+        return m_name;
+    }
+
+    const std::string& longName() const
+    {
+        return m_longName;
+    }
+
+private:
+    std::string m_name;
+    std::string m_longName;
+};
 
 #endif
 



View it on GitLab: https://code.videolan.org/videolan/libvlcpp/commit/4202d81db433bbf4cc7cca812b3dd21f51bba3a0

---
View it on GitLab: https://code.videolan.org/videolan/libvlcpp/commit/4202d81db433bbf4cc7cca812b3dd21f51bba3a0
You're receiving this email because of your account on code.videolan.org.


More information about the vlc-commits mailing list