Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(286)

Unified Diff: media/filters/chunk_demuxer.h

Issue 10558011: Fix ChunkDemuxer so it properly outputs buffered ranges. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address more CR comments and added an end of stream test case. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/base/ranges_unittest.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/chunk_demuxer.h
diff --git a/media/filters/chunk_demuxer.h b/media/filters/chunk_demuxer.h
index a03d50f4a224f51403dc922917ca269ff39561d2..ecd2d772e00d2c4c7b68316ae4bedf7d0670ed22 100644
--- a/media/filters/chunk_demuxer.h
+++ b/media/filters/chunk_demuxer.h
@@ -13,6 +13,7 @@
#include "base/synchronization/lock.h"
#include "media/base/byte_queue.h"
#include "media/base/demuxer.h"
+#include "media/base/ranges.h"
#include "media/base/stream_parser.h"
#include "media/filters/source_buffer_stream.h"
@@ -32,8 +33,6 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
kReachedIdLimit, // Reached ID limit. We can't handle any more IDs.
};
- typedef std::vector<std::pair<base::TimeDelta, base::TimeDelta> > Ranges;
-
explicit ChunkDemuxer(ChunkDemuxerClient* client);
// Demuxer implementation.
@@ -65,10 +64,7 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
void RemoveId(const std::string& id);
// Gets the currently buffered ranges for the specified ID.
- // Returns true if data is buffered & |ranges_out| is set to the
- // time ranges currently buffered.
- // Returns false if no data is buffered.
- bool GetBufferedRanges(const std::string& id, Ranges* ranges_out) const;
+ Ranges<base::TimeDelta> GetBufferedRanges(const std::string& id) const;
// Appends media data to the source buffer associated with |id|. Returns
// false if this method is called in an invalid state.
@@ -121,15 +117,9 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
void OnNewMediaSegment(const std::string& source_id,
base::TimeDelta start_timestamp);
- // Helper functions for calculating GetBufferedRanges().
- bool CopyIntoRanges(
- const SourceBufferStream::TimespanList& timespans,
- Ranges* ranges_out) const;
- void AddIntersectionRange(
- SourceBufferStream::Timespan timespan_a,
- SourceBufferStream::Timespan timespan_b,
- bool last_range_after_ended,
- Ranges* ranges_out) const;
+ // Computes the intersection between the video & audio
+ // buffered ranges.
+ Ranges<base::TimeDelta> ComputeIntersection() const;
mutable base::Lock lock_;
State state_;
@@ -142,8 +132,6 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer {
scoped_refptr<ChunkDemuxerStream> audio_;
scoped_refptr<ChunkDemuxerStream> video_;
- int64 buffered_bytes_;
-
base::TimeDelta duration_;
typedef std::map<std::string, StreamParser*> StreamParserMap;
« no previous file with comments | « media/base/ranges_unittest.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698