[vlc-commits] demux: adaptative: add timeline debugging
Francois Cartegnie
git at videolan.org
Tue Oct 27 19:13:52 CET 2015
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Wed Oct 21 18:40:43 2015 +0200| [5bdf5dbd9b2e87e13f243462c62c7c1343013cbd] | committer: Francois Cartegnie
demux: adaptative: add timeline debugging
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=5bdf5dbd9b2e87e13f243462c62c7c1343013cbd
---
.../demux/adaptative/playlist/SegmentTemplate.cpp | 7 +++++++
modules/demux/adaptative/playlist/SegmentTemplate.h | 1 +
.../demux/adaptative/playlist/SegmentTimeline.cpp | 19 +++++++++++++++++++
modules/demux/adaptative/playlist/SegmentTimeline.h | 2 ++
4 files changed, 29 insertions(+)
diff --git a/modules/demux/adaptative/playlist/SegmentTemplate.cpp b/modules/demux/adaptative/playlist/SegmentTemplate.cpp
index 7af6f12..931ba2c 100644
--- a/modules/demux/adaptative/playlist/SegmentTemplate.cpp
+++ b/modules/demux/adaptative/playlist/SegmentTemplate.cpp
@@ -66,6 +66,13 @@ void MediaSegmentTemplate::setSourceUrl(const std::string &url)
sourceUrl = Url(Url::Component(url, this));
}
+void MediaSegmentTemplate::debug(vlc_object_t *obj, int indent) const
+{
+ Segment::debug(obj, indent);
+ if(segmentTimeline.Get())
+ segmentTimeline.Get()->debug(obj, indent + 1);
+}
+
InitSegmentTemplate::InitSegmentTemplate( ICanonicalUrl *parent ) :
BaseSegmentTemplate(parent)
{
diff --git a/modules/demux/adaptative/playlist/SegmentTemplate.h b/modules/demux/adaptative/playlist/SegmentTemplate.h
index 47f87be..69cdca7 100644
--- a/modules/demux/adaptative/playlist/SegmentTemplate.h
+++ b/modules/demux/adaptative/playlist/SegmentTemplate.h
@@ -52,6 +52,7 @@ namespace adaptative
virtual void setSourceUrl( const std::string &url ); /* reimpl */
void mergeWith( MediaSegmentTemplate *, mtime_t );
virtual uint64_t getSequenceNumber() const; /* reimpl */
+ virtual void debug(vlc_object_t *, int = 0) const; /* reimpl */
Property<size_t> startNumber;
};
diff --git a/modules/demux/adaptative/playlist/SegmentTimeline.cpp b/modules/demux/adaptative/playlist/SegmentTimeline.cpp
index 637260d..312c6a8 100644
--- a/modules/demux/adaptative/playlist/SegmentTimeline.cpp
+++ b/modules/demux/adaptative/playlist/SegmentTimeline.cpp
@@ -199,6 +199,17 @@ mtime_t SegmentTimeline::end() const
return scaled * CLOCK_FREQ / inheritTimescale();
}
+void SegmentTimeline::debug(vlc_object_t *obj, int indent) const
+{
+ std::stringstream ss;
+ ss << std::string(indent, ' ') << "Timeline";
+ msg_Dbg(obj, "%s", ss.str().c_str());
+
+ std::list<Element *>::const_iterator it;
+ for(it = elements.begin(); it != elements.end(); ++it)
+ (*it)->debug(obj, indent + 1);
+}
+
SegmentTimeline::Element::Element(uint64_t number_, stime_t d_, uint64_t r_, stime_t t_)
{
number = number_;
@@ -206,3 +217,11 @@ SegmentTimeline::Element::Element(uint64_t number_, stime_t d_, uint64_t r_, sti
t = t_;
r = r_;
}
+
+void SegmentTimeline::Element::debug(vlc_object_t *obj, int indent) const
+{
+ std::stringstream ss;
+ ss << std::string(indent + 1, ' ') << "Element #" << number
+ << " d=" << d << " r=" << r << " @t=" << t;
+ msg_Dbg(obj, "%s", ss.str().c_str());
+}
diff --git a/modules/demux/adaptative/playlist/SegmentTimeline.h b/modules/demux/adaptative/playlist/SegmentTimeline.h
index b743737..ca0a363 100644
--- a/modules/demux/adaptative/playlist/SegmentTimeline.h
+++ b/modules/demux/adaptative/playlist/SegmentTimeline.h
@@ -51,6 +51,7 @@ namespace adaptative
void mergeWith(SegmentTimeline &);
mtime_t start() const;
mtime_t end() const;
+ void debug(vlc_object_t *, int = 0) const;
private:
std::list<Element *> elements;
@@ -59,6 +60,7 @@ namespace adaptative
{
public:
Element(uint64_t, stime_t, uint64_t, stime_t);
+ void debug(vlc_object_t *, int = 0) const;
stime_t t;
stime_t d;
uint64_t r;
More information about the vlc-commits
mailing list