OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/cast/test/fake_media_source.h" | 5 #include "media/cast/test/fake_media_source.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/files/scoped_file.h" | 10 #include "base/files/scoped_file.h" |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 if (!is_transcoding_audio() && !is_transcoding_video()) { | 244 if (!is_transcoding_audio() && !is_transcoding_video()) { |
245 // Send fake patterns. | 245 // Send fake patterns. |
246 task_runner_->PostTask( | 246 task_runner_->PostTask( |
247 FROM_HERE, | 247 FROM_HERE, |
248 base::Bind(&FakeMediaSource::SendNextFakeFrame, | 248 base::Bind(&FakeMediaSource::SendNextFakeFrame, |
249 weak_factory_.GetWeakPtr())); | 249 weak_factory_.GetWeakPtr())); |
250 return; | 250 return; |
251 } | 251 } |
252 | 252 |
253 // Send transcoding streams. | 253 // Send transcoding streams. |
254 audio_algo_.Initialize(source_audio_params_, std::vector<bool>()); | 254 audio_algo_.Initialize(source_audio_params_); |
255 audio_algo_.FlushBuffers(); | 255 audio_algo_.FlushBuffers(); |
256 audio_fifo_input_bus_ = AudioBus::Create( | 256 audio_fifo_input_bus_ = AudioBus::Create( |
257 source_audio_params_.channels(), | 257 source_audio_params_.channels(), |
258 source_audio_params_.frames_per_buffer()); | 258 source_audio_params_.frames_per_buffer()); |
259 // Audio FIFO can carry all data fron AudioRendererAlgorithm. | 259 // Audio FIFO can carry all data fron AudioRendererAlgorithm. |
260 audio_fifo_.reset( | 260 audio_fifo_.reset( |
261 new AudioFifo(source_audio_params_.channels(), | 261 new AudioFifo(source_audio_params_.channels(), |
262 audio_algo_.QueueCapacity())); | 262 audio_algo_.QueueCapacity())); |
263 audio_converter_.reset(new media::AudioConverter( | 263 audio_converter_.reset(new media::AudioConverter( |
264 source_audio_params_, output_audio_params_, true)); | 264 source_audio_params_, output_audio_params_, true)); |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
621 AVStream* FakeMediaSource::av_audio_stream() { | 621 AVStream* FakeMediaSource::av_audio_stream() { |
622 return av_format_context_->streams[audio_stream_index_]; | 622 return av_format_context_->streams[audio_stream_index_]; |
623 } | 623 } |
624 | 624 |
625 AVStream* FakeMediaSource::av_video_stream() { | 625 AVStream* FakeMediaSource::av_video_stream() { |
626 return av_format_context_->streams[video_stream_index_]; | 626 return av_format_context_->streams[video_stream_index_]; |
627 } | 627 } |
628 | 628 |
629 } // namespace cast | 629 } // namespace cast |
630 } // namespace media | 630 } // namespace media |
OLD | NEW |