#include <vlc_common.h>
#include <vlc_plugin.h>
#include <vlc_demux.h>
+#include <vlc_meta.h>
#include <errno.h>
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;
}
void ProgramInformation::setSource(const std::string &source)
{
- if ( source.empty() == false )
- this->source = source;
+ this->source = source;
}
const std::string &ProgramInformation::getCopyright() const
void ProgramInformation::setCopyright(const std::string ©right)
{
- 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
void ProgramInformation::setTitle (const std::string &title)
{
- if ( title.empty() == false )
- this->title = title;
+ this->title = title;
}