summaryrefslogtreecommitdiffstats
path: root/media/audio/audio_parameters.cc
diff options
context:
space:
mode:
authorannacc@chromium.org <annacc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-16 22:18:32 +0000
committerannacc@chromium.org <annacc@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-16 22:18:32 +0000
commitb630cb97c620593f9c987fdad0b3271ddbf39a3e (patch)
tree21295811329d31b302e29be7e16198fdfd5bc463 /media/audio/audio_parameters.cc
parent99d22e8b1c2c0b6f6457147ab90ce2df98ef02d3 (diff)
downloadchromium_src-b630cb97c620593f9c987fdad0b3271ddbf39a3e.zip
chromium_src-b630cb97c620593f9c987fdad0b3271ddbf39a3e.tar.gz
chromium_src-b630cb97c620593f9c987fdad0b3271ddbf39a3e.tar.bz2
Description:
This patch gets the channel layout for surround sound channel order from ffmpeg and stores it so that chromium will be able to re-order the channels for various sound cards and OSes later. - AudioParameters gets a new field (channel_layout). - channel_layout.h stores an enum that we will use in chromium for channel values. - ffmpeg_common.h gets a new method for mapping the channel layout received from ffmpeg to an internal chromium enum value. BUG=None (though storing the channel order should help us solve some other bugs soon) TEST=media_unittests Review URL: http://codereview.chromium.org/6930039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85541 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/audio/audio_parameters.cc')
-rw-r--r--media/audio/audio_parameters.cc17
1 files changed, 10 insertions, 7 deletions
diff --git a/media/audio/audio_parameters.cc b/media/audio/audio_parameters.cc
index dfe2d07..029f831 100644
--- a/media/audio/audio_parameters.cc
+++ b/media/audio/audio_parameters.cc
@@ -8,28 +8,31 @@
AudioParameters::AudioParameters()
: format(AUDIO_PCM_LINEAR),
- channels(0),
+ channel_layout(CHANNEL_LAYOUT_NONE),
sample_rate(0),
bits_per_sample(0),
- samples_per_packet(0) {
+ samples_per_packet(0),
+ channels(0) {
}
AudioParameters::AudioParameters(const media::AudioDecoderConfig& config)
: format(AUDIO_PCM_LINEAR),
- channels(config.channels_per_sample),
+ channel_layout(config.channel_layout),
sample_rate(config.sample_rate),
bits_per_sample(config.bits_per_channel),
- samples_per_packet(0) {
+ samples_per_packet(0),
+ channels(ChannelLayoutToChannelCount(config.channel_layout)) {
}
-AudioParameters::AudioParameters(Format format, int channels,
+AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout,
int sample_rate, int bits_per_sample,
int samples_per_packet)
: format(format),
- channels(channels),
+ channel_layout(channel_layout),
sample_rate(sample_rate),
bits_per_sample(bits_per_sample),
- samples_per_packet(samples_per_packet) {
+ samples_per_packet(samples_per_packet),
+ channels(ChannelLayoutToChannelCount(channel_layout)) {
}
bool AudioParameters::IsValid() const {