| 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/base/audio_parameters.h" | 5 #include "media/base/audio_parameters.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "media/base/limits.h" | 8 #include "media/base/limits.h" |
| 9 | 9 |
| 10 namespace media { | 10 namespace media { |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 | 90 |
| 91 bool AudioParameters::Equals(const AudioParameters& other) const { | 91 bool AudioParameters::Equals(const AudioParameters& other) const { |
| 92 return format_ == other.format() && sample_rate_ == other.sample_rate() && | 92 return format_ == other.format() && sample_rate_ == other.sample_rate() && |
| 93 channel_layout_ == other.channel_layout() && | 93 channel_layout_ == other.channel_layout() && |
| 94 channels_ == other.channels() && | 94 channels_ == other.channels() && |
| 95 bits_per_sample_ == other.bits_per_sample() && | 95 bits_per_sample_ == other.bits_per_sample() && |
| 96 frames_per_buffer_ == other.frames_per_buffer() && | 96 frames_per_buffer_ == other.frames_per_buffer() && |
| 97 effects_ == other.effects() && mic_positions_ == other.mic_positions_; | 97 effects_ == other.effects() && mic_positions_ == other.mic_positions_; |
| 98 } | 98 } |
| 99 | 99 |
| 100 bool AudioParameters::IsBitstreamFormat() const { |
| 101 return format_ == AUDIO_BITSTREAM_AC3 || format_ == AUDIO_BITSTREAM_EAC3; |
| 102 } |
| 103 |
| 100 // static | 104 // static |
| 101 AudioParameters AudioParameters::UnavailableDeviceParams() { | 105 AudioParameters AudioParameters::UnavailableDeviceParams() { |
| 102 return media::AudioParameters( | 106 return media::AudioParameters( |
| 103 media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO, | 107 media::AudioParameters::AUDIO_FAKE, media::CHANNEL_LAYOUT_STEREO, |
| 104 media::AudioParameters::kAudioCDSampleRate, 16, | 108 media::AudioParameters::kAudioCDSampleRate, 16, |
| 105 media::AudioParameters::kAudioCDSampleRate / 10); | 109 media::AudioParameters::kAudioCDSampleRate / 10); |
| 106 } | 110 } |
| 107 | 111 |
| 108 } // namespace media | 112 } // namespace media |
| OLD | NEW |