| 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_for_testing(buffers_of_data * kDataSize); | 41 stream_->set_memory_limit(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 3889 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3941 CheckNoNextBuffer(); | 3941 CheckNoNextBuffer(); |
| 3942 } | 3942 } |
| 3943 | 3943 |
| 3944 // TODO(vrk): Add unit tests where keyframes are unaligned between streams. | 3944 // TODO(vrk): Add unit tests where keyframes are unaligned between streams. |
| 3945 // (crbug.com/133557) | 3945 // (crbug.com/133557) |
| 3946 | 3946 |
| 3947 // TODO(vrk): Add unit tests with end of stream being called at interesting | 3947 // TODO(vrk): Add unit tests with end of stream being called at interesting |
| 3948 // times. | 3948 // times. |
| 3949 | 3949 |
| 3950 } // namespace media | 3950 } // namespace media |
| OLD | NEW |