| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 base::Unretained(this)), | 83 base::Unretained(this)), |
| 84 base::TimeDelta::FromSeconds(5)); | 84 base::TimeDelta::FromSeconds(5)); |
| 85 | 85 |
| 86 media_task_runner_factory_ = new BalancedMediaTaskRunnerFactory( | 86 media_task_runner_factory_ = new BalancedMediaTaskRunnerFactory( |
| 87 base::TimeDelta::FromMilliseconds(kMaxPtsDiffMs)); | 87 base::TimeDelta::FromMilliseconds(kMaxPtsDiffMs)); |
| 88 | 88 |
| 89 coded_frame_providers_.clear(); | 89 coded_frame_providers_.clear(); |
| 90 frame_received_count_ = 0; | 90 frame_received_count_ = 0; |
| 91 | 91 |
| 92 for (auto* stream : demuxer_streams_) { | 92 for (auto* stream : demuxer_streams_) { |
| 93 coded_frame_providers_.push_back(base::WrapUnique( | 93 coded_frame_providers_.push_back(base::MakeUnique<DemuxerStreamAdapter>( |
| 94 new DemuxerStreamAdapter(base::ThreadTaskRunnerHandle::Get(), | 94 base::ThreadTaskRunnerHandle::Get(), media_task_runner_factory_, |
| 95 media_task_runner_factory_, stream))); | 95 stream)); |
| 96 } | 96 } |
| 97 running_stream_count_ = coded_frame_providers_.size(); | 97 running_stream_count_ = coded_frame_providers_.size(); |
| 98 | 98 |
| 99 // read each stream | 99 // read each stream |
| 100 for (auto* code_frame_provider : coded_frame_providers_) { | 100 for (auto* code_frame_provider : coded_frame_providers_) { |
| 101 auto read_cb = base::Bind(&MultiDemuxerStreamAdaptersTest::OnNewFrame, | 101 auto read_cb = base::Bind(&MultiDemuxerStreamAdaptersTest::OnNewFrame, |
| 102 base::Unretained(this), | 102 base::Unretained(this), |
| 103 code_frame_provider); | 103 code_frame_provider); |
| 104 | 104 |
| 105 base::Closure task = base::Bind(&CodedFrameProvider::Read, | 105 base::Closure task = base::Bind(&CodedFrameProvider::Read, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 total_expected_frames_ = frame_count_short + frame_count_long; | 159 total_expected_frames_ = frame_count_short + frame_count_long; |
| 160 | 160 |
| 161 std::unique_ptr<base::MessageLoop> message_loop(new base::MessageLoop()); | 161 std::unique_ptr<base::MessageLoop> message_loop(new base::MessageLoop()); |
| 162 message_loop->PostTask(FROM_HERE, | 162 message_loop->PostTask(FROM_HERE, |
| 163 base::Bind(&MultiDemuxerStreamAdaptersTest::Start, | 163 base::Bind(&MultiDemuxerStreamAdaptersTest::Start, |
| 164 base::Unretained(this))); | 164 base::Unretained(this))); |
| 165 message_loop->Run(); | 165 message_loop->Run(); |
| 166 } | 166 } |
| 167 } // namespace media | 167 } // namespace media |
| 168 } // namespace chromecast | 168 } // namespace chromecast |
| OLD | NEW |