Commit a649c63e authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: don't gather/copy stringlist on debug

parent 974b79d8
...@@ -79,17 +79,12 @@ bool BaseAdaptationSet::getBitstreamSwitching () const ...@@ -79,17 +79,12 @@ bool BaseAdaptationSet::getBitstreamSwitching () const
return this->isBitstreamSwitching; return this->isBitstreamSwitching;
} }
std::vector<std::string> BaseAdaptationSet::toString(int indent) const void BaseAdaptationSet::debug(vlc_object_t *obj, int indent) const
{ {
std::vector<std::string> ret;
std::string text(indent, ' '); std::string text(indent, ' ');
text.append("BaseAdaptationSet"); text.append("BaseAdaptationSet");
ret.push_back(text); msg_Dbg(obj, "%s", text.c_str());
std::vector<BaseRepresentation *>::const_iterator k; std::vector<BaseRepresentation *>::const_iterator k;
for(k = representations.begin(); k != representations.end(); ++k) for(k = representations.begin(); k != representations.end(); ++k)
{ (*k)->debug(obj, indent + 1);
std::vector<std::string> debug = (*k)->toString(indent + 1);
ret.insert(ret.end(), debug.begin(), debug.end());
}
return ret;
} }
...@@ -50,7 +50,7 @@ namespace adaptative ...@@ -50,7 +50,7 @@ namespace adaptative
void setBitstreamSwitching(bool value); void setBitstreamSwitching(bool value);
bool getBitstreamSwitching() const; bool getBitstreamSwitching() const;
void addRepresentation( BaseRepresentation *rep ); void addRepresentation( BaseRepresentation *rep );
std::vector<std::string> toString(int = 0) const; void debug(vlc_object_t *,int = 0) const;
protected: protected:
std::vector<BaseRepresentation *> representations; std::vector<BaseRepresentation *> representations;
......
...@@ -87,19 +87,14 @@ BaseAdaptationSet * BasePeriod::getAdaptationSet(StreamType type) const ...@@ -87,19 +87,14 @@ BaseAdaptationSet * BasePeriod::getAdaptationSet(StreamType type) const
return NULL; return NULL;
} }
std::vector<std::string> BasePeriod::toString(int indent) const void BasePeriod::debug(vlc_object_t *obj, int indent) const
{ {
std::vector<std::string> ret;
std::string text(indent, ' '); std::string text(indent, ' ');
text.append("Period"); text.append("Period");
ret.push_back(text); msg_Dbg(obj, "%s", text.c_str());
std::vector<BaseAdaptationSet *>::const_iterator k; std::vector<BaseAdaptationSet *>::const_iterator k;
for(k = adaptationSets.begin(); k != adaptationSets.end(); ++k) for(k = adaptationSets.begin(); k != adaptationSets.end(); ++k)
{ (*k)->debug(obj, indent + 1);
std::vector<std::string> debug = (*k)->toString(indent + 1);
ret.insert(ret.end(), debug.begin(), debug.end());
}
return ret;
} }
mtime_t BasePeriod::getPeriodStart() const mtime_t BasePeriod::getPeriodStart() const
......
...@@ -25,7 +25,6 @@ ...@@ -25,7 +25,6 @@
#define BASEPERIOD_H_ #define BASEPERIOD_H_
#include <vector> #include <vector>
#include <string>
#include "BaseAdaptationSet.h" #include "BaseAdaptationSet.h"
#include "SegmentInformation.hpp" #include "SegmentInformation.hpp"
...@@ -46,7 +45,7 @@ namespace adaptative ...@@ -46,7 +45,7 @@ namespace adaptative
const std::vector<BaseAdaptationSet *> getAdaptationSets (StreamType) const; const std::vector<BaseAdaptationSet *> getAdaptationSets (StreamType) const;
BaseAdaptationSet * getAdaptationSet (StreamType) const; BaseAdaptationSet * getAdaptationSet (StreamType) const;
void addAdaptationSet (BaseAdaptationSet *AdaptationSet); void addAdaptationSet (BaseAdaptationSet *AdaptationSet);
std::vector<std::string> toString (int = 0) const; void debug (vlc_object_t *,int = 0) const;
virtual mtime_t getPeriodStart() const; /* reimpl */ virtual mtime_t getPeriodStart() const; /* reimpl */
......
...@@ -55,21 +55,15 @@ void BaseRepresentation::setBandwidth( uint64_t bandwidth ) ...@@ -55,21 +55,15 @@ void BaseRepresentation::setBandwidth( uint64_t bandwidth )
this->bandwidth = bandwidth; this->bandwidth = bandwidth;
} }
std::vector<std::string> BaseRepresentation::toString(int indent) const void BaseRepresentation::debug(vlc_object_t *obj, int indent) const
{ {
std::vector<std::string> ret;
std::string text(indent, ' '); std::string text(indent, ' ');
text.append("Representation"); text.append("Representation");
ret.push_back(text); msg_Dbg(obj, "%s", text.c_str());
std::vector<ISegment *> list = getSegments(); std::vector<ISegment *> list = getSegments();
std::vector<ISegment *>::const_iterator l; std::vector<ISegment *>::const_iterator l;
for(l = list.begin(); l < list.end(); ++l) for(l = list.begin(); l < list.end(); ++l)
{ (*l)->debug(obj, indent + 1);
std::vector<std::string> debug = (*l)->toString(indent + 1);
ret.insert(ret.end(), debug.begin(), debug.end());
}
return ret;
} }
AbstractPlaylist * BaseRepresentation::getPlaylist() const AbstractPlaylist * BaseRepresentation::getPlaylist() const
......
...@@ -56,7 +56,7 @@ namespace adaptative ...@@ -56,7 +56,7 @@ namespace adaptative
AbstractPlaylist* getPlaylist () const; AbstractPlaylist* getPlaylist () const;
std::vector<std::string> toString(int = 0) const; void debug (vlc_object_t *,int = 0) const;
/* for segment templates */ /* for segment templates */
virtual std::string contextualize(size_t, const std::string &, virtual std::string contextualize(size_t, const std::string &,
......
...@@ -88,15 +88,13 @@ size_t ISegment::getOffset() const ...@@ -88,15 +88,13 @@ size_t ISegment::getOffset() const
return startByte; return startByte;
} }
std::vector<std::string> ISegment::toString(int indent) const void ISegment::debug(vlc_object_t *obj, int indent) const
{ {
std::vector<std::string> out;
std::stringstream ss; std::stringstream ss;
ss << std::string(indent, ' ') << debugName << " url=" << getUrlSegment().toString(); ss << std::string(indent, ' ') << debugName << " url=" << getUrlSegment().toString();
if(startByte!=endByte) if(startByte!=endByte)
ss << " @" << startByte << ".." << endByte; ss << " @" << startByte << ".." << endByte;
out.push_back(ss.str()); msg_Dbg(obj, "%s", ss.str().c_str());
return out;
} }
bool ISegment::contains(size_t byte) const bool ISegment::contains(size_t byte) const
...@@ -153,23 +151,20 @@ void Segment::setSourceUrl ( const std::string &url ) ...@@ -153,23 +151,20 @@ void Segment::setSourceUrl ( const std::string &url )
this->sourceUrl = url; this->sourceUrl = url;
} }
std::vector<std::string> Segment::toString(int indent) const void Segment::debug(vlc_object_t *obj, int indent) const
{ {
if (subsegments.empty()) if (subsegments.empty())
{ {
return ISegment::toString(indent); ISegment::debug(obj, indent);
} }
else else
{ {
std::vector<std::string> ret; std::string text(indent, ' ');
text.append("Segment");
msg_Dbg(obj, "%s", text.c_str());
std::vector<SubSegment *>::const_iterator l; std::vector<SubSegment *>::const_iterator l;
ret.push_back(std::string(indent, ' ').append("Segment"));
for(l = subsegments.begin(); l != subsegments.end(); ++l) for(l = subsegments.begin(); l != subsegments.end(); ++l)
{ (*l)->debug(obj, indent + 1);
std::vector<std::string> debug = (*l)->toString(indent + 1);
ret.insert(ret.end(), debug.begin(), debug.end());
}
return ret;
} }
} }
......
...@@ -56,7 +56,7 @@ namespace adaptative ...@@ -56,7 +56,7 @@ namespace adaptative
virtual size_t getOffset () const; virtual size_t getOffset () const;
virtual std::vector<ISegment*> subSegments () = 0; virtual std::vector<ISegment*> subSegments () = 0;
virtual void addSubSegment (SubSegment *) = 0; virtual void addSubSegment (SubSegment *) = 0;
virtual std::vector<std::string> toString (int = 0) const; virtual void debug (vlc_object_t *,int = 0) const;
virtual bool contains (size_t byte) const; virtual bool contains (size_t byte) const;
int getClassId () const; int getClassId () const;
Property<mtime_t> startTime; Property<mtime_t> startTime;
...@@ -95,7 +95,7 @@ namespace adaptative ...@@ -95,7 +95,7 @@ namespace adaptative
virtual Url getUrlSegment() const; /* impl */ virtual Url getUrlSegment() const; /* impl */
virtual Chunk* toChunk(size_t, BaseRepresentation * = NULL); virtual Chunk* toChunk(size_t, BaseRepresentation * = NULL);
virtual std::vector<ISegment*> subSegments(); virtual std::vector<ISegment*> subSegments();
virtual std::vector<std::string> toString(int = 0) const; virtual void debug(vlc_object_t *,int = 0) const;
virtual void addSubSegment(SubSegment *); virtual void addSubSegment(SubSegment *);
static const int CLASSID_SEGMENT = 1; static const int CLASSID_SEGMENT = 1;
......
...@@ -72,12 +72,5 @@ void MPD::debug() ...@@ -72,12 +72,5 @@ void MPD::debug()
std::vector<BasePeriod *>::const_iterator i; std::vector<BasePeriod *>::const_iterator i;
for(i = getPeriods().begin(); i != getPeriods().end(); ++i) for(i = getPeriods().begin(); i != getPeriods().end(); ++i)
{ (*i)->debug(VLC_OBJECT(stream));
std::vector<std::string> debug = (*i)->toString();
std::vector<std::string>::const_iterator l;
for(l = debug.begin(); l < debug.end(); ++l)
{
msg_Dbg(stream, "%s", (*l).c_str());
}
}
} }
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