| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/base/fake_demuxer_stream.h" | 5 #include "media/base/fake_demuxer_stream.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 FakeDemuxerStream::~FakeDemuxerStream() {} | 55 FakeDemuxerStream::~FakeDemuxerStream() {} |
| 56 | 56 |
| 57 void FakeDemuxerStream::Initialize() { | 57 void FakeDemuxerStream::Initialize() { |
| 58 DCHECK_EQ(-1, read_to_hold_); | 58 DCHECK_EQ(-1, read_to_hold_); |
| 59 num_configs_left_ = num_configs_; | 59 num_configs_left_ = num_configs_; |
| 60 num_buffers_left_in_current_config_ = num_buffers_in_one_config_; | 60 num_buffers_left_in_current_config_ = num_buffers_in_one_config_; |
| 61 num_buffers_returned_ = 0; | 61 num_buffers_returned_ = 0; |
| 62 current_timestamp_ = base::TimeDelta::FromMilliseconds(kStartTimestampMs); | 62 current_timestamp_ = base::TimeDelta::FromMilliseconds(kStartTimestampMs); |
| 63 duration_ = base::TimeDelta::FromMilliseconds(kDurationMs); | 63 duration_ = base::TimeDelta::FromMilliseconds(kDurationMs); |
| 64 splice_timestamp_ = kNoTimestamp(); | 64 splice_timestamp_ = kNoTimestamp; |
| 65 next_coded_size_ = gfx::Size(kStartWidth, kStartHeight); | 65 next_coded_size_ = gfx::Size(kStartWidth, kStartHeight); |
| 66 next_read_num_ = 0; | 66 next_read_num_ = 0; |
| 67 } | 67 } |
| 68 | 68 |
| 69 void FakeDemuxerStream::Read(const ReadCB& read_cb) { | 69 void FakeDemuxerStream::Read(const ReadCB& read_cb) { |
| 70 DCHECK(task_runner_->BelongsToCurrentThread()); | 70 DCHECK(task_runner_->BelongsToCurrentThread()); |
| 71 DCHECK(read_cb_.is_null()); | 71 DCHECK(read_cb_.is_null()); |
| 72 | 72 |
| 73 read_cb_ = BindToCurrentLoop(read_cb); | 73 read_cb_ = BindToCurrentLoop(read_cb); |
| 74 | 74 |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() { | 229 FakeDemuxerStreamProvider::~FakeDemuxerStreamProvider() { |
| 230 } | 230 } |
| 231 | 231 |
| 232 DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { | 232 DemuxerStream* FakeDemuxerStreamProvider::GetStream(DemuxerStream::Type type) { |
| 233 if (type == DemuxerStream::Type::AUDIO) | 233 if (type == DemuxerStream::Type::AUDIO) |
| 234 return nullptr; | 234 return nullptr; |
| 235 return &fake_video_stream_; | 235 return &fake_video_stream_; |
| 236 }; | 236 }; |
| 237 | 237 |
| 238 } // namespace media | 238 } // namespace media |
| OLD | NEW |