OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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/android/audio_decoder_job.h" | 5 #include "media/base/android/audio_decoder_job.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/threading/thread.h" | 9 #include "base/threading/thread.h" |
10 #include "media/base/android/media_codec_bridge.h" | 10 #include "media/base/android/media_codec_bridge.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 bytes_per_frame_ = kBytesPerAudioOutputSample * num_channels_; | 71 bytes_per_frame_ = kBytesPerAudioOutputSample * num_channels_; |
72 if (!media_codec_bridge_) | 72 if (!media_codec_bridge_) |
73 output_sampling_rate_ = config_sampling_rate_; | 73 output_sampling_rate_ = config_sampling_rate_; |
74 } | 74 } |
75 | 75 |
76 void AudioDecoderJob::SetVolume(double volume) { | 76 void AudioDecoderJob::SetVolume(double volume) { |
77 volume_ = volume; | 77 volume_ = volume; |
78 SetVolumeInternal(); | 78 SetVolumeInternal(); |
79 } | 79 } |
80 | 80 |
| 81 double AudioDecoderJob::GetVolume() const { |
| 82 return volume_; |
| 83 } |
| 84 |
81 void AudioDecoderJob::SetBaseTimestamp(base::TimeDelta base_timestamp) { | 85 void AudioDecoderJob::SetBaseTimestamp(base::TimeDelta base_timestamp) { |
82 DCHECK(!is_decoding()); | 86 DCHECK(!is_decoding()); |
83 base_timestamp_ = base_timestamp; | 87 base_timestamp_ = base_timestamp; |
84 if (audio_timestamp_helper_) | 88 if (audio_timestamp_helper_) |
85 audio_timestamp_helper_->SetBaseTimestamp(base_timestamp_); | 89 audio_timestamp_helper_->SetBaseTimestamp(base_timestamp_); |
86 } | 90 } |
87 | 91 |
88 void AudioDecoderJob::ResetTimestampHelper() { | 92 void AudioDecoderJob::ResetTimestampHelper() { |
89 if (audio_timestamp_helper_) | 93 if (audio_timestamp_helper_) |
90 base_timestamp_ = audio_timestamp_helper_->GetTimestamp(); | 94 base_timestamp_ = audio_timestamp_helper_->GetTimestamp(); |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 void AudioDecoderJob::OnOutputFormatChanged() { | 174 void AudioDecoderJob::OnOutputFormatChanged() { |
171 DCHECK(media_codec_bridge_); | 175 DCHECK(media_codec_bridge_); |
172 | 176 |
173 int old_sampling_rate = output_sampling_rate_; | 177 int old_sampling_rate = output_sampling_rate_; |
174 output_sampling_rate_ = media_codec_bridge_->GetOutputSamplingRate(); | 178 output_sampling_rate_ = media_codec_bridge_->GetOutputSamplingRate(); |
175 if (output_sampling_rate_ != old_sampling_rate) | 179 if (output_sampling_rate_ != old_sampling_rate) |
176 ResetTimestampHelper(); | 180 ResetTimestampHelper(); |
177 } | 181 } |
178 | 182 |
179 } // namespace media | 183 } // namespace media |
OLD | NEW |