Commit 4202d81d authored by Martin Finkel's avatar Martin Finkel Committed by Hugo Beauzée-Luyssen

Instance: expose RendererDiscovererDescription

Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 9bc01a71
......@@ -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
......
......@@ -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
......
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