Commit 7fa3fa11 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: adaptative: add default ID to AdaptationSet/Representation

parent 508d7a81
......@@ -34,6 +34,7 @@
#include "SegmentTemplate.h"
#include "BasePeriod.h"
#include "ID.hpp"
using namespace adaptative;
using namespace adaptative::playlist;
......@@ -61,6 +62,17 @@ std::vector<BaseRepresentation*>& BaseAdaptationSet::getRepresentations()
return representations;
}
BaseRepresentation * BaseAdaptationSet::getRepresentationByID(const ID &id)
{
std::vector<BaseRepresentation *>::const_iterator it;
for(it = representations.begin(); it != representations.end(); ++it)
{
if((*it)->getID() == id)
return *it;
}
return NULL;
}
void BaseAdaptationSet::addRepresentation(BaseRepresentation *rep)
{
representations.push_back(rep);
......@@ -80,7 +92,8 @@ bool BaseAdaptationSet::getBitstreamSwitching () const
void BaseAdaptationSet::debug(vlc_object_t *obj, int indent) const
{
std::string text(indent, ' ');
text.append("BaseAdaptationSet");
text.append("BaseAdaptationSet ");
text.append(id.str());
msg_Dbg(obj, "%s", text.c_str());
std::vector<BaseRepresentation *>::const_iterator k;
for(k = representations.begin(); k != representations.end(); ++k)
......
......@@ -38,6 +38,7 @@ namespace adaptative
{
class BaseRepresentation;
class BasePeriod;
class ID;
class BaseAdaptationSet : public CommonAttributesElements,
public SegmentInformation
......@@ -48,6 +49,7 @@ namespace adaptative
virtual StreamFormat getStreamFormat() const; /*reimpl*/
std::vector<BaseRepresentation *>& getRepresentations ();
BaseRepresentation * getRepresentationByID(const ID &);
void setSwitchPolicy(bool value);
bool getBitstreamSwitching() const;
void addRepresentation( BaseRepresentation *rep );
......
......@@ -30,6 +30,7 @@
#include "BaseRepresentation.h"
#include "BaseAdaptationSet.h"
#include "SegmentTemplate.h"
#include "ID.hpp"
using namespace adaptative;
using namespace adaptative::playlist;
......@@ -73,7 +74,8 @@ void BaseRepresentation::addCodec(const std::string &codec)
void BaseRepresentation::debug(vlc_object_t *obj, int indent) const
{
std::string text(indent, ' ');
text.append("Representation");
text.append("Representation ");
text.append(id.str());
msg_Dbg(obj, "%s", text.c_str());
std::vector<ISegment *> list;
getAllSegments(list);
......
......@@ -84,3 +84,8 @@ void CommonAttributesElements::addLang( const std::string &lang )
if ( lang.empty() == false )
this->lang.push_back( lang );
}
const ID & CommonAttributesElements::getID() const
{
return id;
}
......@@ -26,6 +26,7 @@
#include <list>
#include <string>
#include "ID.hpp"
namespace adaptative
{
......@@ -44,12 +45,14 @@ namespace adaptative
void setHeight( int height );
const std::list<std::string>& getLang() const;
void addLang( const std::string &lang );
const ID & getID() const;
protected:
std::string mimeType;
int width;
int height;
std::list<std::string> lang;
ID id;
};
}
}
......
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