Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 5 #ifndef MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
| 6 #define MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 6 #define MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 73 // Note: The contents of |extra_data_| are compared not the raw pointers. | 73 // Note: The contents of |extra_data_| are compared not the raw pointers. |
| 74 bool Matches(const AudioDecoderConfig& config) const; | 74 bool Matches(const AudioDecoderConfig& config) const; |
| 75 | 75 |
| 76 AudioCodec codec() const { return codec_; } | 76 AudioCodec codec() const { return codec_; } |
| 77 int bits_per_channel() const { return bytes_per_channel_ * 8; } | 77 int bits_per_channel() const { return bytes_per_channel_ * 8; } |
| 78 int bytes_per_channel() const { return bytes_per_channel_; } | 78 int bytes_per_channel() const { return bytes_per_channel_; } |
| 79 ChannelLayout channel_layout() const { return channel_layout_; } | 79 ChannelLayout channel_layout() const { return channel_layout_; } |
| 80 int samples_per_second() const { return samples_per_second_; } | 80 int samples_per_second() const { return samples_per_second_; } |
| 81 SampleFormat sample_format() const { return sample_format_; } | 81 SampleFormat sample_format() const { return sample_format_; } |
| 82 int bytes_per_frame() const { return bytes_per_frame_; } | 82 int bytes_per_frame() const { return bytes_per_frame_; } |
| 83 int64 seek_pre_roll() const { return seek_pre_roll_; } | |
| 84 void set_seek_pre_roll(int64 seek_pre_roll) { | |
| 85 seek_pre_roll_ = seek_pre_roll; | |
| 86 } | |
| 87 int64 codec_delay() const { return codec_delay_; } | |
| 88 void set_codec_delay(int64 codec_delay) { codec_delay_ = codec_delay; } | |
| 83 | 89 |
| 84 // Optional byte data required to initialize audio decoders such as Vorbis | 90 // Optional byte data required to initialize audio decoders such as Vorbis |
| 85 // codebooks. | 91 // codebooks. |
| 86 const uint8* extra_data() const { | 92 const uint8* extra_data() const { |
| 87 return extra_data_.empty() ? NULL : &extra_data_[0]; | 93 return extra_data_.empty() ? NULL : &extra_data_[0]; |
| 88 } | 94 } |
| 89 size_t extra_data_size() const { return extra_data_.size(); } | 95 size_t extra_data_size() const { return extra_data_.size(); } |
| 90 | 96 |
| 91 // Whether the audio stream is potentially encrypted. | 97 // Whether the audio stream is potentially encrypted. |
| 92 // Note that in a potentially encrypted audio stream, individual buffers | 98 // Note that in a potentially encrypted audio stream, individual buffers |
| 93 // can be encrypted or not encrypted. | 99 // can be encrypted or not encrypted. |
| 94 bool is_encrypted() const { return is_encrypted_; } | 100 bool is_encrypted() const { return is_encrypted_; } |
| 95 | 101 |
| 96 private: | 102 private: |
| 97 AudioCodec codec_; | 103 AudioCodec codec_; |
| 98 SampleFormat sample_format_; | 104 SampleFormat sample_format_; |
| 99 int bytes_per_channel_; | 105 int bytes_per_channel_; |
| 100 ChannelLayout channel_layout_; | 106 ChannelLayout channel_layout_; |
| 101 int samples_per_second_; | 107 int samples_per_second_; |
| 102 int bytes_per_frame_; | 108 int bytes_per_frame_; |
| 103 std::vector<uint8> extra_data_; | 109 std::vector<uint8> extra_data_; |
| 104 bool is_encrypted_; | 110 bool is_encrypted_; |
| 111 int64 seek_pre_roll_; | |
| 112 int64 codec_delay_; | |
|
fgalligan1
2013/08/26 21:10:06
I think you need to add comments about what these
vignesh
2013/08/26 21:44:23
Done.
| |
| 105 | 113 |
| 106 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 114 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
| 107 // generated copy constructor and assignment operator. Since the extra data is | 115 // generated copy constructor and assignment operator. Since the extra data is |
| 108 // typically small, the performance impact is minimal. | 116 // typically small, the performance impact is minimal. |
| 109 }; | 117 }; |
| 110 | 118 |
| 111 } // namespace media | 119 } // namespace media |
| 112 | 120 |
| 113 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 121 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
| OLD | NEW |