Commit c1481178 authored by François Cartegnie's avatar François Cartegnie 🤞

stream_filter: dash: get mimeType() from representations

parent 27915e89
......@@ -48,6 +48,14 @@ AdaptationSet::~AdaptationSet ()
vlc_delete_all( this->representations );
}
const std::string& AdaptationSet::getMimeType() const
{
if (mimeType.empty() && !representations.empty())
return representations.front()->getMimeType();
else
return mimeType;
}
bool AdaptationSet::getSubsegmentAlignmentFlag() const
{
return this->subsegmentAlignmentFlag;
......
......@@ -44,6 +44,7 @@ namespace dash
AdaptationSet();
virtual ~AdaptationSet();
virtual const std::string& getMimeType() const; /*reimpl*/
bool getSubsegmentAlignmentFlag() const;
void setSubsegmentAlignmentFlag( bool alignment );
std::vector<Representation *>& getRepresentations ();
......
......@@ -38,7 +38,7 @@ namespace dash
public:
CommonAttributesElements();
virtual ~CommonAttributesElements();
const std::string& getMimeType() const;
virtual const std::string& getMimeType() const;
void setMimeType( const std::string &mimeType );
int getWidth() const;
void setWidth( int width );
......
......@@ -72,11 +72,16 @@ void IsoffMainParser::setMPDAttributes ()
void IsoffMainParser::setAdaptationSets (Node *periodNode, Period *period)
{
std::vector<Node *> adaptationSets = DOMHelper::getElementByTagName(periodNode, "AdaptationSet", false);
std::vector<Node *>::const_iterator it;
for(size_t i = 0; i < adaptationSets.size(); i++)
for(it = adaptationSets.begin(); it != adaptationSets.end(); it++)
{
AdaptationSet *adaptationSet = new AdaptationSet();
this->setRepresentations(adaptationSets.at(i), adaptationSet);
if(!adaptationSet)
continue;
if((*it)->hasAttribute("mimeType"))
adaptationSet->setMimeType((*it)->getAttributeValue("mimeType"));
setRepresentations((*it), adaptationSet);
period->addAdaptationSet(adaptationSet);
}
}
......@@ -102,6 +107,9 @@ void IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
if(repNode->hasAttribute("bandwidth"))
this->currentRepresentation->setBandwidth(atoi(repNode->getAttributeValue("bandwidth").c_str()));
if(repNode->hasAttribute("mimeType"))
currentRepresentation->setMimeType(repNode->getAttributeValue("mimeType"));
this->setSegmentBase(repNode, this->currentRepresentation);
this->setSegmentList(repNode, this->currentRepresentation);
adaptationSet->addRepresentation(this->currentRepresentation);
......
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