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

Side by Side Diff: media/base/decoder_buffer.h

Issue 1018373003: Improving WebM video duration estimation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adding limited media log (10 times max) for WebM duration estimates. Created 5 years, 9 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
« no previous file with comments | « no previous file | media/base/decoder_buffer.cc » ('j') | media/filters/source_buffer_range.cc » ('J')
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_BASE_DECODER_BUFFER_H_ 5 #ifndef MEDIA_BASE_DECODER_BUFFER_H_
6 #define MEDIA_BASE_DECODER_BUFFER_H_ 6 #define MEDIA_BASE_DECODER_BUFFER_H_
7 7
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 } 79 }
80 80
81 void set_duration(base::TimeDelta duration) { 81 void set_duration(base::TimeDelta duration) {
82 DCHECK(!end_of_stream()); 82 DCHECK(!end_of_stream());
83 DCHECK(duration == kNoTimestamp() || 83 DCHECK(duration == kNoTimestamp() ||
84 (duration >= base::TimeDelta() && duration != kInfiniteDuration())) 84 (duration >= base::TimeDelta() && duration != kInfiniteDuration()))
85 << duration.InSecondsF(); 85 << duration.InSecondsF();
86 duration_ = duration; 86 duration_ = duration;
87 } 87 }
88 88
89 bool is_duration_estimated() { return is_duration_estimated_; }
wolenetz 2015/03/28 00:26:05 nit: const method
chcunningham 2015/04/13 23:25:17 Done.
90
91 void set_is_duration_estimated(bool is_estimated) {
wolenetz 2015/03/28 00:26:05 Must these be in DecoderBuffer? Or is StreamParser
chcunningham 2015/04/13 23:25:17 Moved to StreamParserBuffer. SBS is currently the
92 is_duration_estimated_ = is_estimated;
93 }
94
89 const uint8* data() const { 95 const uint8* data() const {
90 DCHECK(!end_of_stream()); 96 DCHECK(!end_of_stream());
91 return data_.get(); 97 return data_.get();
92 } 98 }
93 99
94 uint8* writable_data() const { 100 uint8* writable_data() const {
95 DCHECK(!end_of_stream()); 101 DCHECK(!end_of_stream());
96 return data_.get(); 102 return data_.get();
97 } 103 }
98 104
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 // will be padded and aligned as necessary. If |data| is NULL then |data_| is 185 // will be padded and aligned as necessary. If |data| is NULL then |data_| is
180 // set to NULL and |buffer_size_| to 0. |is_key_frame_| will default to 186 // set to NULL and |buffer_size_| to 0. |is_key_frame_| will default to
181 // false. 187 // false.
182 DecoderBuffer(const uint8* data, int size, 188 DecoderBuffer(const uint8* data, int size,
183 const uint8* side_data, int side_data_size); 189 const uint8* side_data, int side_data_size);
184 virtual ~DecoderBuffer(); 190 virtual ~DecoderBuffer();
185 191
186 private: 192 private:
187 base::TimeDelta timestamp_; 193 base::TimeDelta timestamp_;
188 base::TimeDelta duration_; 194 base::TimeDelta duration_;
195 bool is_duration_estimated_;
189 196
190 int size_; 197 int size_;
191 scoped_ptr<uint8, base::AlignedFreeDeleter> data_; 198 scoped_ptr<uint8, base::AlignedFreeDeleter> data_;
192 int side_data_size_; 199 int side_data_size_;
193 scoped_ptr<uint8, base::AlignedFreeDeleter> side_data_; 200 scoped_ptr<uint8, base::AlignedFreeDeleter> side_data_;
194 scoped_ptr<DecryptConfig> decrypt_config_; 201 scoped_ptr<DecryptConfig> decrypt_config_;
195 DiscardPadding discard_padding_; 202 DiscardPadding discard_padding_;
196 base::TimeDelta splice_timestamp_; 203 base::TimeDelta splice_timestamp_;
197 bool is_key_frame_; 204 bool is_key_frame_;
198 205
199 // Constructor helper method for memory allocations. 206 // Constructor helper method for memory allocations.
200 void Initialize(); 207 void Initialize();
201 208
202 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer); 209 DISALLOW_COPY_AND_ASSIGN(DecoderBuffer);
203 }; 210 };
204 211
205 } // namespace media 212 } // namespace media
206 213
207 #endif // MEDIA_BASE_DECODER_BUFFER_H_ 214 #endif // MEDIA_BASE_DECODER_BUFFER_H_
OLDNEW
« no previous file with comments | « no previous file | media/base/decoder_buffer.cc » ('j') | media/filters/source_buffer_range.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698