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

Side by Side Diff: media/blink/multibuffer_reader.h

Issue 2477513003: media: Increase preloading and max buffer for high-bitrate videos (Closed)
Patch Set: logic simplified, test added Created 4 years, 1 month 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 | « media/blink/multibuffer_data_source_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_BLINK_MULTIBUFFER_READER_H_ 5 #ifndef MEDIA_BLINK_MULTIBUFFER_READER_H_
6 #define MEDIA_BLINK_MULTIBUFFER_READER_H_ 6 #define MEDIA_BLINK_MULTIBUFFER_READER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 bool IsLoading() const; 89 bool IsLoading() const;
90 90
91 // Reader implementation. 91 // Reader implementation.
92 void NotifyAvailableRange(const Interval<MultiBufferBlockId>& range) override; 92 void NotifyAvailableRange(const Interval<MultiBufferBlockId>& range) override;
93 93
94 // Getters 94 // Getters
95 int64_t preload_high() const { return preload_high_; } 95 int64_t preload_high() const { return preload_high_; }
96 int64_t preload_low() const { return preload_low_; } 96 int64_t preload_low() const { return preload_low_; }
97 97
98 private: 98 private:
99 friend class MultibufferDataSourceTest;
100
99 // Returns the block for a particular byte position. 101 // Returns the block for a particular byte position.
100 MultiBufferBlockId block(int64_t byte_pos) const { 102 MultiBufferBlockId block(int64_t byte_pos) const {
101 return byte_pos >> multibuffer_->block_size_shift(); 103 return byte_pos >> multibuffer_->block_size_shift();
102 } 104 }
103 105
104 // Returns the block for a particular byte position, rounding up. 106 // Returns the block for a particular byte position, rounding up.
105 MultiBufferBlockId block_ceil(int64_t byte_pos) const { 107 MultiBufferBlockId block_ceil(int64_t byte_pos) const {
106 return block(byte_pos + (1LL << multibuffer_->block_size_shift()) - 1); 108 return block(byte_pos + (1LL << multibuffer_->block_size_shift()) - 1);
107 } 109 }
108 110
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 168
167 // Progress callback. 169 // Progress callback.
168 base::Callback<void(int64_t, int64_t)> progress_callback_; 170 base::Callback<void(int64_t, int64_t)> progress_callback_;
169 171
170 base::WeakPtrFactory<MultiBufferReader> weak_factory_; 172 base::WeakPtrFactory<MultiBufferReader> weak_factory_;
171 }; 173 };
172 174
173 } // namespace media 175 } // namespace media
174 176
175 #endif // MEDIA_BLINK_MULTIBUFFER_READER_H_ 177 #endif // MEDIA_BLINK_MULTIBUFFER_READER_H_
OLDNEW
« no previous file with comments | « media/blink/multibuffer_data_source_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698