Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(302)

Side by Side Diff: media/audio/audio_parameters.cc

Issue 7796033: Replace AudioDecoderConfig with simple accessors on AudioDecoder. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: rebase Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_parameters.h ('k') | media/audio/audio_parameters_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/audio/audio_parameters.h" 5 #include "media/audio/audio_parameters.h"
6 6
7 #include "media/base/limits.h" 7 #include "media/base/limits.h"
8 8
9 AudioParameters::AudioParameters() 9 AudioParameters::AudioParameters()
10 : format(AUDIO_PCM_LINEAR), 10 : format(AUDIO_PCM_LINEAR),
11 channel_layout(CHANNEL_LAYOUT_NONE), 11 channel_layout(CHANNEL_LAYOUT_NONE),
12 sample_rate(0), 12 sample_rate(0),
13 bits_per_sample(0), 13 bits_per_sample(0),
14 samples_per_packet(0), 14 samples_per_packet(0),
15 channels(0) { 15 channels(0) {
16 } 16 }
17 17
18 AudioParameters::AudioParameters(const media::AudioDecoderConfig& config)
19 : format(AUDIO_PCM_LINEAR),
20 channel_layout(config.channel_layout),
21 sample_rate(config.sample_rate),
22 bits_per_sample(config.bits_per_channel),
23 samples_per_packet(0),
24 channels(ChannelLayoutToChannelCount(config.channel_layout)) {
25 }
26
27 AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout, 18 AudioParameters::AudioParameters(Format format, ChannelLayout channel_layout,
28 int sample_rate, int bits_per_sample, 19 int sample_rate, int bits_per_sample,
29 int samples_per_packet) 20 int samples_per_packet)
30 : format(format), 21 : format(format),
31 channel_layout(channel_layout), 22 channel_layout(channel_layout),
32 sample_rate(sample_rate), 23 sample_rate(sample_rate),
33 bits_per_sample(bits_per_sample), 24 bits_per_sample(bits_per_sample),
34 samples_per_packet(samples_per_packet), 25 samples_per_packet(samples_per_packet),
35 channels(ChannelLayoutToChannelCount(channel_layout)) { 26 channels(ChannelLayoutToChannelCount(channel_layout)) {
36 } 27 }
(...skipping 30 matching lines...) Expand all
67 if (a.sample_rate < b.sample_rate) 58 if (a.sample_rate < b.sample_rate)
68 return true; 59 return true;
69 if (a.sample_rate > b.sample_rate) 60 if (a.sample_rate > b.sample_rate)
70 return false; 61 return false;
71 if (a.bits_per_sample < b.bits_per_sample) 62 if (a.bits_per_sample < b.bits_per_sample)
72 return true; 63 return true;
73 if (a.bits_per_sample > b.bits_per_sample) 64 if (a.bits_per_sample > b.bits_per_sample)
74 return false; 65 return false;
75 return a.samples_per_packet < b.samples_per_packet; 66 return a.samples_per_packet < b.samples_per_packet;
76 } 67 }
OLDNEW
« no previous file with comments | « media/audio/audio_parameters.h ('k') | media/audio/audio_parameters_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698