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

Side by Side Diff: media/base/audio_decoder_config.cc

Issue 8786013: Replace media::Limits struct with media::limits namespace and update documentation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix logic Created 9 years 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/win/audio_output_win_unittest.cc ('k') | media/base/buffers.h » ('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/base/audio_decoder_config.h" 5 #include "media/base/audio_decoder_config.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "media/base/limits.h" 9 #include "media/base/limits.h"
10 10
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 extra_data_.reset(); 93 extra_data_.reset();
94 } 94 }
95 } 95 }
96 96
97 AudioDecoderConfig::~AudioDecoderConfig() {} 97 AudioDecoderConfig::~AudioDecoderConfig() {}
98 98
99 bool AudioDecoderConfig::IsValidConfig() const { 99 bool AudioDecoderConfig::IsValidConfig() const {
100 return codec_ != kUnknownAudioCodec && 100 return codec_ != kUnknownAudioCodec &&
101 channel_layout_ != CHANNEL_LAYOUT_UNSUPPORTED && 101 channel_layout_ != CHANNEL_LAYOUT_UNSUPPORTED &&
102 bits_per_channel_ > 0 && 102 bits_per_channel_ > 0 &&
103 bits_per_channel_ <= Limits::kMaxBitsPerSample && 103 bits_per_channel_ <= limits::kMaxBitsPerSample &&
104 samples_per_second_ > 0 && 104 samples_per_second_ > 0 &&
105 samples_per_second_ <= Limits::kMaxSampleRate; 105 samples_per_second_ <= limits::kMaxSampleRate;
106 } 106 }
107 107
108 AudioCodec AudioDecoderConfig::codec() const { 108 AudioCodec AudioDecoderConfig::codec() const {
109 return codec_; 109 return codec_;
110 } 110 }
111 111
112 int AudioDecoderConfig::bits_per_channel() const { 112 int AudioDecoderConfig::bits_per_channel() const {
113 return bits_per_channel_; 113 return bits_per_channel_;
114 } 114 }
115 115
116 ChannelLayout AudioDecoderConfig::channel_layout() const { 116 ChannelLayout AudioDecoderConfig::channel_layout() const {
117 return channel_layout_; 117 return channel_layout_;
118 } 118 }
119 119
120 int AudioDecoderConfig::samples_per_second() const { 120 int AudioDecoderConfig::samples_per_second() const {
121 return samples_per_second_; 121 return samples_per_second_;
122 } 122 }
123 123
124 uint8* AudioDecoderConfig::extra_data() const { 124 uint8* AudioDecoderConfig::extra_data() const {
125 return extra_data_.get(); 125 return extra_data_.get();
126 } 126 }
127 127
128 size_t AudioDecoderConfig::extra_data_size() const { 128 size_t AudioDecoderConfig::extra_data_size() const {
129 return extra_data_size_; 129 return extra_data_size_;
130 } 130 }
131 131
132 } // namespace media 132 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/win/audio_output_win_unittest.cc ('k') | media/base/buffers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698