Commit 5e3944b4 authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: dash: return meta from manifest

parent 53beda0a
......@@ -36,6 +36,7 @@
#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_demux.h>
#include <vlc_meta.h>
#include <errno.h>
......@@ -226,6 +227,33 @@ static int Control (demux_t *p_demux, int i_query, va_list args)
var_InheritInteger(p_demux, "network-caching");
break;
case DEMUX_GET_META:
{
if(!p_sys->p_mpd->getProgramInformation())
break;
vlc_meta_t *p_meta = (vlc_meta_t *) va_arg (args, vlc_meta_t*);
vlc_meta_t *meta = vlc_meta_New();
if (meta == NULL)
return VLC_EGENERIC;
if(!p_sys->p_mpd->getProgramInformation()->getTitle().empty())
vlc_meta_SetTitle(meta, p_sys->p_mpd->getProgramInformation()->getTitle().c_str());
if(!p_sys->p_mpd->getProgramInformation()->getSource().empty())
vlc_meta_SetPublisher(meta, p_sys->p_mpd->getProgramInformation()->getSource().c_str());
if(!p_sys->p_mpd->getProgramInformation()->getCopyright().empty())
vlc_meta_SetCopyright(meta, p_sys->p_mpd->getProgramInformation()->getCopyright().c_str());
if(!p_sys->p_mpd->getProgramInformation()->getMoreInformationUrl().empty())
vlc_meta_SetURL(meta, p_sys->p_mpd->getProgramInformation()->getMoreInformationUrl().c_str());
vlc_meta_Merge(p_meta, meta);
vlc_meta_Delete(meta);
break;
}
default:
return VLC_EGENERIC;
}
......
......@@ -36,8 +36,7 @@ const std::string &ProgramInformation::getSource() const
void ProgramInformation::setSource(const std::string &source)
{
if ( source.empty() == false )
this->source = source;
this->source = source;
}
const std::string &ProgramInformation::getCopyright() const
......@@ -47,14 +46,17 @@ const std::string &ProgramInformation::getCopyright() const
void ProgramInformation::setCopyright(const std::string &copyright)
{
if ( copyright.empty() == false )
this->copyright = copyright;
this->copyright = copyright;
}
void ProgramInformation::setMoreInformationUrl(const std::string &url)
{
if ( url.empty() == false )
this->moreInformationUrl = url;
this->moreInformationUrl = url;
}
const std::string & ProgramInformation::getMoreInformationUrl() const
{
return moreInformationUrl;
}
const std::string &ProgramInformation::getTitle() const
......@@ -64,6 +66,5 @@ const std::string &ProgramInformation::getTitle() const
void ProgramInformation::setTitle (const std::string &title)
{
if ( title.empty() == false )
this->title = title;
this->title = title;
}
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