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

Side by Side Diff: media/filters/chunk_demuxer.h

Issue 10829108: Cap sourceBuffered() on duration and truncate duration on EoS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated test Created 8 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_ 5 #ifndef MEDIA_FILTERS_CHUNK_DEMUXER_H_
6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_ 6 #define MEDIA_FILTERS_CHUNK_DEMUXER_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 // Returns true if |source_id| is valid, false otherwise. 136 // Returns true if |source_id| is valid, false otherwise.
137 bool IsValidId(const std::string& source_id) const; 137 bool IsValidId(const std::string& source_id) const;
138 138
139 // Increases |duration_| if the newly appended |buffers| exceed the current 139 // Increases |duration_| if the newly appended |buffers| exceed the current
140 // |duration_|. The |duration_| is set to the end buffered timestamp of 140 // |duration_|. The |duration_| is set to the end buffered timestamp of
141 // |stream|. 141 // |stream|.
142 void IncreaseDurationIfNecessary( 142 void IncreaseDurationIfNecessary(
143 const StreamParser::BufferQueue& buffers, 143 const StreamParser::BufferQueue& buffers,
144 const scoped_refptr<ChunkDemuxerStream>& stream); 144 const scoped_refptr<ChunkDemuxerStream>& stream);
145 145
146 // Decreases |duration_| if the buffered region is less than |duration_| when
147 // EoS is called.
acolwell GONE FROM CHROMIUM 2012/08/01 17:09:45 nit: Spell out EndOfStream() here. You've got the
vrk (LEFT CHROMIUM) 2012/08/02 18:23:00 Done.
148 void DecreaseDurationIfNecessary();
149
146 // Sets |duration_| to |new_duration| and notifies |host_|. 150 // Sets |duration_| to |new_duration| and notifies |host_|.
147 void UpdateDuration(base::TimeDelta new_duration); 151 void UpdateDuration(base::TimeDelta new_duration);
148 152
153 // Returns the ranges representing the buffered data in the demuxer.
154 Ranges<base::TimeDelta> GetBufferedRanges() const;
155
149 mutable base::Lock lock_; 156 mutable base::Lock lock_;
150 State state_; 157 State state_;
151 158
152 DemuxerHost* host_; 159 DemuxerHost* host_;
153 ChunkDemuxerClient* client_; 160 ChunkDemuxerClient* client_;
154 PipelineStatusCB init_cb_; 161 PipelineStatusCB init_cb_;
155 PipelineStatusCB seek_cb_; 162 PipelineStatusCB seek_cb_;
156 163
157 scoped_refptr<ChunkDemuxerStream> audio_; 164 scoped_refptr<ChunkDemuxerStream> audio_;
158 scoped_refptr<ChunkDemuxerStream> video_; 165 scoped_refptr<ChunkDemuxerStream> video_;
(...skipping 18 matching lines...) Expand all
177 std::string source_id_video_; 184 std::string source_id_video_;
178 185
179 base::TimeDelta start_time_; 186 base::TimeDelta start_time_;
180 187
181 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 188 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
182 }; 189 };
183 190
184 } // namespace media 191 } // namespace media
185 192
186 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 193 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698