Commit 47af7ca1 authored by Francois Cartegnie's avatar Francois Cartegnie

stream_filter: dash: have vlc_object accessible from, at least, segments

parent 9227c871
...@@ -63,7 +63,7 @@ BasicCMParser::~BasicCMParser () ...@@ -63,7 +63,7 @@ BasicCMParser::~BasicCMParser ()
bool BasicCMParser::parse () bool BasicCMParser::parse ()
{ {
const std::map<std::string, std::string> attr = this->root->getAttributes(); const std::map<std::string, std::string> attr = this->root->getAttributes();
this->mpd = new MPD; this->mpd = new MPD(p_stream);
std::map<std::string, std::string>::const_iterator it; std::map<std::string, std::string>::const_iterator it;
it = attr.find("mediaPresentationDuration"); it = attr.find("mediaPresentationDuration");
......
...@@ -45,7 +45,7 @@ IsoffMainParser::~IsoffMainParser () ...@@ -45,7 +45,7 @@ IsoffMainParser::~IsoffMainParser ()
bool IsoffMainParser::parse () bool IsoffMainParser::parse ()
{ {
mpd = new MPD(); mpd = new MPD(p_stream);
setMPDAttributes(); setMPDAttributes();
setMPDBaseUrl(root); setMPDBaseUrl(root);
setPeriods(root); setPeriods(root);
......
...@@ -26,11 +26,14 @@ ...@@ -26,11 +26,14 @@
#endif #endif
#include "MPD.h" #include "MPD.h"
#include "Helper.h"
#include "dash.hpp"
using namespace dash::mpd; using namespace dash::mpd;
MPD::MPD () : MPD::MPD (stream_t *stream_) :
ICanonicalUrl(), ICanonicalUrl(),
stream(stream_),
profile( dash::mpd::Profile::Unknown ), profile( dash::mpd::Profile::Unknown ),
live( false ), live( false ),
availabilityStartTime( -1 ), availabilityStartTime( -1 ),
...@@ -170,3 +173,8 @@ std::string MPD::getUrlSegment() const ...@@ -170,3 +173,8 @@ std::string MPD::getUrlSegment() const
else else
return std::string(); return std::string();
} }
vlc_object_t * MPD::getVLCObject() const
{
return VLC_OBJECT(stream);
}
...@@ -42,7 +42,7 @@ namespace dash ...@@ -42,7 +42,7 @@ namespace dash
class MPD : public ICanonicalUrl class MPD : public ICanonicalUrl
{ {
public: public:
MPD(); MPD(stream_t *);
virtual ~MPD(); virtual ~MPD();
Profile getProfile() const; Profile getProfile() const;
...@@ -69,8 +69,10 @@ namespace dash ...@@ -69,8 +69,10 @@ namespace dash
void setProgramInformation (ProgramInformation *progInfo); void setProgramInformation (ProgramInformation *progInfo);
virtual std::string getUrlSegment() const; /* impl */ virtual std::string getUrlSegment() const; /* impl */
vlc_object_t * getVLCObject() const;
private: private:
stream_t *stream;
Profile profile; Profile profile;
bool live; bool live;
time_t availabilityStartTime; time_t availabilityStartTime;
......
...@@ -32,8 +32,9 @@ ...@@ -32,8 +32,9 @@
using namespace dash::mpd; using namespace dash::mpd;
Representation::Representation ( MPD *mpd ) : Representation::Representation ( MPD *mpd_ ) :
ICanonicalUrl ( mpd ), ICanonicalUrl ( mpd_ ),
mpd ( mpd_ ),
bandwidth (0), bandwidth (0),
qualityRanking ( -1 ), qualityRanking ( -1 ),
segmentInfo ( NULL ), segmentInfo ( NULL ),
...@@ -223,3 +224,8 @@ std::string Representation::getUrlSegment() const ...@@ -223,3 +224,8 @@ std::string Representation::getUrlSegment() const
ret.append(baseUrl->getUrl()); ret.append(baseUrl->getUrl());
return ret; return ret;
} }
MPD * Representation::getMPD() const
{
return mpd;
}
...@@ -84,11 +84,13 @@ namespace dash ...@@ -84,11 +84,13 @@ namespace dash
void setHeight (int height); void setHeight (int height);
int getHeight () const; int getHeight () const;
void setBaseUrl (BaseUrl *baseUrl); void setBaseUrl (BaseUrl *baseUrl);
MPD* getMPD () const;
std::vector<std::string> toString() const; std::vector<std::string> toString() const;
virtual std::string getUrlSegment () const; /* impl */ virtual std::string getUrlSegment () const; /* impl */
private: private:
MPD *mpd;
uint64_t bandwidth; uint64_t bandwidth;
std::string id; std::string id;
int qualityRanking; int qualityRanking;
......
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