OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |