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 "chromecast/media/cma/pipeline/audio_pipeline_impl.h" | 5 #include "chromecast/media/cma/pipeline/audio_pipeline_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chromecast/media/cma/backend/audio_pipeline_device.h" | 8 #include "chromecast/media/cma/backend/audio_pipeline_device.h" |
9 #include "chromecast/media/cma/base/buffering_defs.h" | 9 #include "chromecast/media/cma/base/buffering_defs.h" |
10 #include "chromecast/media/cma/base/cma_logging.h" | 10 #include "chromecast/media/cma/base/cma_logging.h" |
11 #include "chromecast/media/cma/base/coded_frame_provider.h" | 11 #include "chromecast/media/cma/base/coded_frame_provider.h" |
12 #include "chromecast/media/cma/pipeline/av_pipeline_impl.h" | 12 #include "chromecast/media/cma/pipeline/av_pipeline_impl.h" |
13 #include "media/base/audio_decoder_config.h" | 13 #include "media/base/audio_decoder_config.h" |
14 | 14 |
15 namespace chromecast { | 15 namespace chromecast { |
16 namespace media { | 16 namespace media { |
17 | 17 |
18 namespace { | 18 namespace { |
19 const size_t kMaxAudioFrameSize = 32 * 1024; | 19 const size_t kMaxAudioFrameSize = 32 * 1024; |
20 } | 20 } |
21 | 21 |
22 AudioPipelineImpl::AudioPipelineImpl(AudioPipelineDevice* audio_device) | 22 AudioPipelineImpl::AudioPipelineImpl(AudioPipelineDevice* audio_device) |
23 : audio_device_(audio_device), | 23 : audio_device_(audio_device), |
24 weak_factory_(this) { | 24 weak_factory_(this) { |
25 av_pipeline_impl_.reset(new AvPipelineImpl( | 25 av_pipeline_impl_ = new AvPipelineImpl( |
26 audio_device_, | 26 audio_device_, |
27 base::Bind(&AudioPipelineImpl::OnUpdateConfig, base::Unretained(this)))); | 27 base::Bind(&AudioPipelineImpl::OnUpdateConfig, base::Unretained(this))); |
28 weak_this_ = weak_factory_.GetWeakPtr(); | 28 weak_this_ = weak_factory_.GetWeakPtr(); |
29 } | 29 } |
30 | 30 |
31 AudioPipelineImpl::~AudioPipelineImpl() { | 31 AudioPipelineImpl::~AudioPipelineImpl() { |
32 } | 32 } |
33 | 33 |
34 void AudioPipelineImpl::SetCodedFrameProvider( | 34 void AudioPipelineImpl::SetCodedFrameProvider( |
35 scoped_ptr<CodedFrameProvider> frame_provider) { | 35 scoped_ptr<CodedFrameProvider> frame_provider) { |
36 av_pipeline_impl_->SetCodedFrameProvider( | 36 av_pipeline_impl_->SetCodedFrameProvider( |
37 frame_provider.Pass(), kAppAudioBufferSize, kMaxAudioFrameSize); | 37 frame_provider.Pass(), kAppAudioBufferSize, kMaxAudioFrameSize); |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 delta_stats.audio_bytes_decoded = | 148 delta_stats.audio_bytes_decoded = |
149 current_stats.audio_bytes_decoded - previous_stats_.audio_bytes_decoded; | 149 current_stats.audio_bytes_decoded - previous_stats_.audio_bytes_decoded; |
150 | 150 |
151 previous_stats_ = current_stats; | 151 previous_stats_ = current_stats; |
152 | 152 |
153 audio_client_.statistics_cb.Run(delta_stats); | 153 audio_client_.statistics_cb.Run(delta_stats); |
154 } | 154 } |
155 | 155 |
156 } // namespace media | 156 } // namespace media |
157 } // namespace chromecast | 157 } // namespace chromecast |
OLD | NEW |