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

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

Issue 1171263004: Allow setting memory limits on media::DemuxerStream (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merged CL that adds get/set buffer size on WMP Created 5 years, 6 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
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 <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 20 matching lines...) Expand all
31 31
32 class SourceBufferStreamTest : public testing::Test { 32 class SourceBufferStreamTest : public testing::Test {
33 protected: 33 protected:
34 SourceBufferStreamTest() { 34 SourceBufferStreamTest() {
35 video_config_ = TestVideoConfig::Normal(); 35 video_config_ = TestVideoConfig::Normal();
36 SetStreamInfo(kDefaultFramesPerSecond, kDefaultKeyframesPerSecond); 36 SetStreamInfo(kDefaultFramesPerSecond, kDefaultKeyframesPerSecond);
37 stream_.reset(new SourceBufferStream(video_config_, log_cb(), true)); 37 stream_.reset(new SourceBufferStream(video_config_, log_cb(), true));
38 } 38 }
39 39
40 void SetMemoryLimit(int buffers_of_data) { 40 void SetMemoryLimit(int buffers_of_data) {
41 stream_->set_memory_limit(buffers_of_data * kDataSize); 41 stream_->SetMemoryLimit(buffers_of_data * kDataSize);
42 } 42 }
43 43
44 void SetStreamInfo(int frames_per_second, int keyframes_per_second) { 44 void SetStreamInfo(int frames_per_second, int keyframes_per_second) {
45 frames_per_second_ = frames_per_second; 45 frames_per_second_ = frames_per_second;
46 keyframes_per_second_ = keyframes_per_second; 46 keyframes_per_second_ = keyframes_per_second;
47 frame_duration_ = ConvertToFrameDuration(frames_per_second); 47 frame_duration_ = ConvertToFrameDuration(frames_per_second);
48 } 48 }
49 49
50 void SetTextStream() { 50 void SetTextStream() {
51 video_config_ = TestVideoConfig::Invalid(); 51 video_config_ = TestVideoConfig::Invalid();
(...skipping 4071 matching lines...) Expand 10 before | Expand all | Expand 10 after
4123 CheckNoNextBuffer(); 4123 CheckNoNextBuffer();
4124 } 4124 }
4125 4125
4126 // TODO(vrk): Add unit tests where keyframes are unaligned between streams. 4126 // TODO(vrk): Add unit tests where keyframes are unaligned between streams.
4127 // (crbug.com/133557) 4127 // (crbug.com/133557)
4128 4128
4129 // TODO(vrk): Add unit tests with end of stream being called at interesting 4129 // TODO(vrk): Add unit tests with end of stream being called at interesting
4130 // times. 4130 // times.
4131 4131
4132 } // namespace media 4132 } // namespace media
OLDNEW
« no previous file with comments | « media/filters/source_buffer_stream.cc ('k') | media/mojo/services/mojo_demuxer_stream_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698