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/renderers/audio_renderer_impl.h" | 5 #include "media/renderers/audio_renderer_impl.h" |
6 | 6 |
7 #include <math.h> | 7 #include <math.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <utility> | 10 #include <utility> |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "media/base/timestamp_constants.h" | 30 #include "media/base/timestamp_constants.h" |
31 #include "media/filters/audio_clock.h" | 31 #include "media/filters/audio_clock.h" |
32 #include "media/filters/decrypting_demuxer_stream.h" | 32 #include "media/filters/decrypting_demuxer_stream.h" |
33 | 33 |
34 namespace media { | 34 namespace media { |
35 | 35 |
36 AudioRendererImpl::AudioRendererImpl( | 36 AudioRendererImpl::AudioRendererImpl( |
37 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, | 37 const scoped_refptr<base::SingleThreadTaskRunner>& task_runner, |
38 media::AudioRendererSink* sink, | 38 media::AudioRendererSink* sink, |
39 const CreateAudioDecodersCB& create_audio_decoders_cb, | 39 const CreateAudioDecodersCB& create_audio_decoders_cb, |
40 const scoped_refptr<MediaLog>& media_log) | 40 MediaLog* media_log) |
41 : task_runner_(task_runner), | 41 : task_runner_(task_runner), |
42 expecting_config_changes_(false), | 42 expecting_config_changes_(false), |
43 sink_(sink), | 43 sink_(sink), |
44 media_log_(media_log), | 44 media_log_(media_log), |
45 client_(nullptr), | 45 client_(nullptr), |
46 tick_clock_(new base::DefaultTickClock()), | 46 tick_clock_(new base::DefaultTickClock()), |
47 last_audio_memory_usage_(0), | 47 last_audio_memory_usage_(0), |
48 last_decoded_sample_rate_(0), | 48 last_decoded_sample_rate_(0), |
49 last_decoded_channel_layout_(CHANNEL_LAYOUT_NONE), | 49 last_decoded_channel_layout_(CHANNEL_LAYOUT_NONE), |
50 playback_rate_(0.0), | 50 playback_rate_(0.0), |
(...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1009 // All channels with a zero mix are muted and can be ignored. | 1009 // All channels with a zero mix are muted and can be ignored. |
1010 std::vector<bool> channel_mask(audio_parameters_.channels(), false); | 1010 std::vector<bool> channel_mask(audio_parameters_.channels(), false); |
1011 for (size_t ch = 0; ch < matrix.size(); ++ch) { | 1011 for (size_t ch = 0; ch < matrix.size(); ++ch) { |
1012 channel_mask[ch] = std::any_of(matrix[ch].begin(), matrix[ch].end(), | 1012 channel_mask[ch] = std::any_of(matrix[ch].begin(), matrix[ch].end(), |
1013 [](float mix) { return !!mix; }); | 1013 [](float mix) { return !!mix; }); |
1014 } | 1014 } |
1015 algorithm_->SetChannelMask(std::move(channel_mask)); | 1015 algorithm_->SetChannelMask(std::move(channel_mask)); |
1016 } | 1016 } |
1017 | 1017 |
1018 } // namespace media | 1018 } // namespace media |
OLD | NEW |