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