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

Side by Side Diff: media/filters/source_buffer_stream_unittest.cc

Issue 1235403002: Change ChunkDemuxerStream/SourceBufferStream memory limit to size_t type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: A few more minor fixes Created 5 years, 5 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 | « media/filters/source_buffer_stream.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 (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 #include "media/filters/source_buffer_stream.h" 5 #include "media/filters/source_buffer_stream.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <string> 8 #include <string>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 20 matching lines...) Expand all
31 static const int kDataSize = 1; 31 static const int kDataSize = 1;
32 32
33 class SourceBufferStreamTest : public testing::Test { 33 class SourceBufferStreamTest : public testing::Test {
34 protected: 34 protected:
35 SourceBufferStreamTest() { 35 SourceBufferStreamTest() {
36 video_config_ = TestVideoConfig::Normal(); 36 video_config_ = TestVideoConfig::Normal();
37 SetStreamInfo(kDefaultFramesPerSecond, kDefaultKeyframesPerSecond); 37 SetStreamInfo(kDefaultFramesPerSecond, kDefaultKeyframesPerSecond);
38 stream_.reset(new SourceBufferStream(video_config_, log_cb(), true)); 38 stream_.reset(new SourceBufferStream(video_config_, log_cb(), true));
39 } 39 }
40 40
41 void SetMemoryLimit(int buffers_of_data) { 41 void SetMemoryLimit(size_t buffers_of_data) {
42 stream_->set_memory_limit(buffers_of_data * kDataSize); 42 stream_->set_memory_limit(buffers_of_data * kDataSize);
43 } 43 }
44 44
45 void SetStreamInfo(int frames_per_second, int keyframes_per_second) { 45 void SetStreamInfo(int frames_per_second, int keyframes_per_second) {
46 frames_per_second_ = frames_per_second; 46 frames_per_second_ = frames_per_second;
47 keyframes_per_second_ = keyframes_per_second; 47 keyframes_per_second_ = keyframes_per_second;
48 frame_duration_ = ConvertToFrameDuration(frames_per_second); 48 frame_duration_ = ConvertToFrameDuration(frames_per_second);
49 } 49 }
50 50
51 void SetTextStream() { 51 void SetTextStream() {
(...skipping 4233 matching lines...) Expand 10 before | Expand all | Expand 10 after
4285 CheckVideoConfig(new_config); 4285 CheckVideoConfig(new_config);
4286 } 4286 }
4287 4287
4288 // TODO(vrk): Add unit tests where keyframes are unaligned between streams. 4288 // TODO(vrk): Add unit tests where keyframes are unaligned between streams.
4289 // (crbug.com/133557) 4289 // (crbug.com/133557)
4290 4290
4291 // TODO(vrk): Add unit tests with end of stream being called at interesting 4291 // TODO(vrk): Add unit tests with end of stream being called at interesting
4292 // times. 4292 // times.
4293 4293
4294 } // namespace media 4294 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/source_buffer_stream.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698