Index: media/filters/chunk_demuxer.h |
diff --git a/media/filters/chunk_demuxer.h b/media/filters/chunk_demuxer.h |
index ced6d97759128200facc3b07f12b01273b72841e..8a433cfb6c837f918b9357b7a5ad53edc8f80e39 100644 |
--- a/media/filters/chunk_demuxer.h |
+++ b/media/filters/chunk_demuxer.h |
@@ -22,6 +22,7 @@ namespace media { |
class ChunkDemuxerClient; |
class ChunkDemuxerStream; |
class FFmpegURLProtocol; |
+class SourceInfo; |
// Demuxer implementation that allows chunks of media data to be passed |
// from JavaScript to the media stack. |
@@ -74,6 +75,10 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer { |
// it can accept a new segment. |
void Abort(const std::string& id); |
+ // Sets a time |offset| in seconds to be applied to subsequent buffers |
+ // appended to the source buffer assicated with |id|. |
+ bool TimestampOffset(const std::string& id, float offset); |
acolwell GONE FROM CHROMIUM
2012/07/20 18:21:01
nit: SetTimestampOffset()?
vrk (LEFT CHROMIUM)
2012/07/25 17:16:48
Done, and changed other similar methods.
|
+ |
// Signals an EndOfStream request. |
// Returns false if called in an unexpected state or if there is a gap between |
// the current position and the end of the buffered data. |
@@ -117,11 +122,16 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer { |
bool OnNeedKey(scoped_array<uint8> init_data, int init_data_size); |
void OnNewMediaSegment(const std::string& source_id, |
base::TimeDelta start_timestamp); |
+ void OnEndOfMediaSegment(const std::string& source_id); |
// Computes the intersection between the video & audio |
// buffered ranges. |
Ranges<base::TimeDelta> ComputeIntersection() const; |
+ // Applies |time_offset| to the timestamps of |buffers|. |
+ void AdjustBufferTimestamps(const StreamParser::BufferQueue& buffers, |
+ base::TimeDelta timestamp_offset); |
+ |
mutable base::Lock lock_; |
State state_; |
@@ -138,6 +148,14 @@ class MEDIA_EXPORT ChunkDemuxer : public Demuxer { |
typedef std::map<std::string, StreamParser*> StreamParserMap; |
StreamParserMap stream_parser_map_; |
+ // Contains state belonging to a media source. |
+ struct StreamInfo { |
acolwell GONE FROM CHROMIUM
2012/07/20 18:21:01
nit: s/StreamInfo/SourceInfo or SourceIdInfo since
vrk (LEFT CHROMIUM)
2012/07/25 17:16:48
Done.
|
+ base::TimeDelta timestamp_offset; |
+ bool can_update_offset; |
+ }; |
+ typedef std::map<std::string, StreamInfo> StreamInfoMap; |
+ StreamInfoMap stream_info_map_; |
+ |
// Used to ensure that (1) config data matches the type and codec provided in |
// AddId(), (2) only 1 audio and 1 video sources are added, and (3) ids may be |
// removed with RemoveID() but can not be re-added (yet). |