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

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

Issue 10800041: Update media duration if data is appended after the previous duration (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase ToT 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
« no previous file with comments | « media/base/clock.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // buffered ranges. 129 // buffered ranges.
130 Ranges<base::TimeDelta> ComputeIntersection() const; 130 Ranges<base::TimeDelta> ComputeIntersection() const;
131 131
132 // Applies |time_offset| to the timestamps of |buffers|. 132 // Applies |time_offset| to the timestamps of |buffers|.
133 void AdjustBufferTimestamps(const StreamParser::BufferQueue& buffers, 133 void AdjustBufferTimestamps(const StreamParser::BufferQueue& buffers,
134 base::TimeDelta timestamp_offset); 134 base::TimeDelta timestamp_offset);
135 135
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
140 // |duration_|. The |duration_| is set to the end buffered timestamp of
141 // |stream|.
142 void IncreaseDurationIfNecessary(
143 const StreamParser::BufferQueue& buffers,
144 const scoped_refptr<ChunkDemuxerStream>& stream);
145
146 // Sets |duration_| to |new_duration| and notifies |host_|.
147 void UpdateDuration(base::TimeDelta new_duration);
148
139 mutable base::Lock lock_; 149 mutable base::Lock lock_;
140 State state_; 150 State state_;
141 151
142 DemuxerHost* host_; 152 DemuxerHost* host_;
143 ChunkDemuxerClient* client_; 153 ChunkDemuxerClient* client_;
144 PipelineStatusCB init_cb_; 154 PipelineStatusCB init_cb_;
145 PipelineStatusCB seek_cb_; 155 PipelineStatusCB seek_cb_;
146 156
147 scoped_refptr<ChunkDemuxerStream> audio_; 157 scoped_refptr<ChunkDemuxerStream> audio_;
148 scoped_refptr<ChunkDemuxerStream> video_; 158 scoped_refptr<ChunkDemuxerStream> video_;
(...skipping 18 matching lines...) Expand all
167 std::string source_id_video_; 177 std::string source_id_video_;
168 178
169 base::TimeDelta start_time_; 179 base::TimeDelta start_time_;
170 180
171 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer); 181 DISALLOW_COPY_AND_ASSIGN(ChunkDemuxer);
172 }; 182 };
173 183
174 } // namespace media 184 } // namespace media
175 185
176 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_ 186 #endif // MEDIA_FILTERS_CHUNK_DEMUXER_H_
OLDNEW
« no previous file with comments | « media/base/clock.cc ('k') | media/filters/chunk_demuxer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698