Chromium Code Reviews| Index: media/base/audio_decoder_config.h |
| diff --git a/media/base/audio_decoder_config.h b/media/base/audio_decoder_config.h |
| index 2bc2487e9b7f53816dd11a77bef7aae914b471b5..6bf3bd9e4daf4f24aa47ceb8b5ef94b69d220eb8 100644 |
| --- a/media/base/audio_decoder_config.h |
| +++ b/media/base/audio_decoder_config.h |
| @@ -38,6 +38,15 @@ enum AudioCodec { |
| kAudioCodecMax = kCodecPCM_S24BE // Must equal the last "real" codec above. |
| }; |
| +enum SampleFormat { |
| + kUnknownSampleFormat = 0, |
| + kSampleFormatU8, // Unsigned 8-bit w/ bias of 128. |
| + kSampleFormatS16, // Signed 16-bit. |
| + kSampleFormatS32, // Signed 32-bit. |
| + kSampleFormatFLT, // Float. |
|
scherkus (not reviewing)
2012/12/06 17:25:32
perhaps instead of "FLT" we go with "F32" to denot
DaleCurtis
2012/12/11 03:03:44
Went with F32 an PlanarF32.
|
| + kSampleFormatFLTP, // Float planar. |
| +}; |
| + |
| // 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. |
| @@ -52,7 +61,7 @@ class MEDIA_EXPORT AudioDecoderConfig { |
| AudioDecoderConfig(AudioCodec codec, int bits_per_channel, |
|
scherkus (not reviewing)
2012/12/06 17:25:32
is bits_per_channel still worth carrying around if
DaleCurtis
2012/12/06 22:15:41
Good point, I think it's better to remove bits per
DaleCurtis
2012/12/11 03:03:44
Done.
|
| ChannelLayout channel_layout, int samples_per_second, |
| const uint8* extra_data, size_t extra_data_size, |
| - bool is_encrypted); |
| + SampleFormat sample_format, bool is_encrypted); |
| ~AudioDecoderConfig(); |
| @@ -60,7 +69,7 @@ class MEDIA_EXPORT AudioDecoderConfig { |
| void Initialize(AudioCodec codec, int bits_per_channel, |
| ChannelLayout channel_layout, int samples_per_second, |
| const uint8* extra_data, size_t extra_data_size, |
| - bool is_encrypted, |
| + SampleFormat sample_format, bool is_encrypted, |
| bool record_stats); |
| // Deep copies |audio_config|. |
| @@ -74,20 +83,21 @@ class MEDIA_EXPORT AudioDecoderConfig { |
| // Note: The contents of |extra_data_| are compared not the raw pointers. |
| bool Matches(const AudioDecoderConfig& config) const; |
| - AudioCodec codec() const; |
| - int bits_per_channel() const; |
| - ChannelLayout channel_layout() const; |
| - int samples_per_second() const; |
| + AudioCodec codec() const { return codec_; } |
| + int bits_per_channel() const { return bits_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_; } |
| // Optional byte data required to initialize audio decoders such as Vorbis |
| // codebooks. |
| - uint8* extra_data() const; |
| - size_t extra_data_size() const; |
| + uint8* extra_data() const { return extra_data_.get(); } |
| + size_t extra_data_size() const { return extra_data_size_; } |
| // Whether the audio stream is potentially encrypted. |
| // Note that in a potentially encrypted audio stream, individual buffers |
| // can be encrypted or not encrypted. |
| - bool is_encrypted() const; |
| + bool is_encrypted() const { return is_encrypted_; } |
| private: |
| AudioCodec codec_; |
| @@ -99,6 +109,7 @@ class MEDIA_EXPORT AudioDecoderConfig { |
| size_t extra_data_size_; |
| bool is_encrypted_; |
| + SampleFormat sample_format_; |
| DISALLOW_COPY_AND_ASSIGN(AudioDecoderConfig); |
| }; |