diff options
author | jrummell@chromium.org <jrummell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-12 21:42:10 +0000 |
---|---|---|
committer | jrummell@chromium.org <jrummell@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-12 21:42:10 +0000 |
commit | d1d4595ae1cee37c14b800b3cde15a2798129a39 (patch) | |
tree | ef639b5099bf86c60eccbe1fff0eb257b506fdd3 /media/base/audio_decoder_config.h | |
parent | cadd30fea95dbec58c69078b959789be93917c37 (diff) | |
download | chromium_src-d1d4595ae1cee37c14b800b3cde15a2798129a39.zip chromium_src-d1d4595ae1cee37c14b800b3cde15a2798129a39.tar.gz chromium_src-d1d4595ae1cee37c14b800b3cde15a2798129a39.tar.bz2 |
Expose SampleFormat -> bytes per frame calculations.
First part of converting audio streams to reduce copying the data.
BUG=248989
Review URL: https://chromiumcodereview.appspot.com/16404013
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media/base/audio_decoder_config.h')
-rw-r--r-- | media/base/audio_decoder_config.h | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/media/base/audio_decoder_config.h b/media/base/audio_decoder_config.h index 5b886e0..1c61e70 100644 --- a/media/base/audio_decoder_config.h +++ b/media/base/audio_decoder_config.h @@ -10,6 +10,7 @@ #include "base/basictypes.h" #include "media/base/channel_layout.h" #include "media/base/media_export.h" +#include "media/base/sample_format.h" namespace media { @@ -40,22 +41,6 @@ enum AudioCodec { kAudioCodecMax }; -enum SampleFormat { - // These values are histogrammed over time; do not change their ordinal - // values. When deleting a sample format replace it with a dummy value; when - // adding a sample format, do so at the bottom before kSampleFormatMax. - kUnknownSampleFormat = 0, - kSampleFormatU8, // Unsigned 8-bit w/ bias of 128. - kSampleFormatS16, // Signed 16-bit. - kSampleFormatS32, // Signed 32-bit. - kSampleFormatF32, // Float 32-bit. - kSampleFormatPlanarS16, // Signed 16-bit planar. - kSampleFormatPlanarF32, // Float 32-bit planar. - - // Must always be last! - kSampleFormatMax -}; - // TODO(dalecurtis): FFmpeg API uses |bytes_per_channel| instead of // |bits_per_channel|, we should switch over since bits are generally confusing // to work with. @@ -89,7 +74,8 @@ class MEDIA_EXPORT AudioDecoderConfig { bool Matches(const AudioDecoderConfig& config) const; AudioCodec codec() const { return codec_; } - int bits_per_channel() const { return bits_per_channel_; } + int bits_per_channel() const { return bytes_per_channel_ * 8; } + int bytes_per_channel() const { return bytes_per_channel_; } ChannelLayout channel_layout() const { return channel_layout_; } int samples_per_second() const { return samples_per_second_; } SampleFormat sample_format() const { return sample_format_; } @@ -110,7 +96,7 @@ class MEDIA_EXPORT AudioDecoderConfig { private: AudioCodec codec_; SampleFormat sample_format_; - int bits_per_channel_; + int bytes_per_channel_; ChannelLayout channel_layout_; int samples_per_second_; int bytes_per_frame_; |