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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 104 | 104 |
| 105 // Optional byte data required to initialize audio decoders such as Vorbis | 105 // Optional byte data required to initialize audio decoders such as Vorbis |
| 106 // codebooks. | 106 // codebooks. |
| 107 const std::vector<uint8_t>& extra_data() const { return extra_data_; } | 107 const std::vector<uint8_t>& extra_data() const { return extra_data_; } |
| 108 | 108 |
| 109 // Whether the audio stream is potentially encrypted. | 109 // Whether the audio stream is potentially encrypted. |
| 110 // Note that in a potentially encrypted audio stream, individual buffers | 110 // Note that in a potentially encrypted audio stream, individual buffers |
| 111 // can be encrypted or not encrypted. | 111 // can be encrypted or not encrypted. |
| 112 bool is_encrypted() const { return is_encrypted_; } | 112 bool is_encrypted() const { return is_encrypted_; } |
| 113 | 113 |
| 114 // Modifies sampling rate. Used by decoders based on Android MediaCodec. | |
|
DaleCurtis
2016/02/04 23:15:31
We don't have setters for any other values; if pos
Tima Vaisburd
2016/02/11 20:23:22
Changed the code not to support sample rate change
| |
| 115 void set_samples_per_second(int value) { samples_per_second_ = value; } | |
| 116 | |
| 114 private: | 117 private: |
| 115 AudioCodec codec_; | 118 AudioCodec codec_; |
| 116 SampleFormat sample_format_; | 119 SampleFormat sample_format_; |
| 117 int bytes_per_channel_; | 120 int bytes_per_channel_; |
| 118 ChannelLayout channel_layout_; | 121 ChannelLayout channel_layout_; |
| 119 int samples_per_second_; | 122 int samples_per_second_; |
| 120 int bytes_per_frame_; | 123 int bytes_per_frame_; |
| 121 std::vector<uint8_t> extra_data_; | 124 std::vector<uint8_t> extra_data_; |
| 122 bool is_encrypted_; | 125 bool is_encrypted_; |
| 123 | 126 |
| 124 // |seek_preroll_| is the duration of the data that the decoder must decode | 127 // |seek_preroll_| is the duration of the data that the decoder must decode |
| 125 // before the decoded data is valid. | 128 // before the decoded data is valid. |
| 126 base::TimeDelta seek_preroll_; | 129 base::TimeDelta seek_preroll_; |
| 127 | 130 |
| 128 // |codec_delay_| is the number of frames the decoder should discard before | 131 // |codec_delay_| is the number of frames the decoder should discard before |
| 129 // returning decoded data. This value can include both decoder delay as well | 132 // returning decoded data. This value can include both decoder delay as well |
| 130 // as padding added during encoding. | 133 // as padding added during encoding. |
| 131 int codec_delay_; | 134 int codec_delay_; |
| 132 | 135 |
| 133 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 136 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
| 134 // generated copy constructor and assignment operator. Since the extra data is | 137 // generated copy constructor and assignment operator. Since the extra data is |
| 135 // typically small, the performance impact is minimal. | 138 // typically small, the performance impact is minimal. |
| 136 }; | 139 }; |
| 137 | 140 |
| 138 } // namespace media | 141 } // namespace media |
| 139 | 142 |
| 140 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 143 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
| OLD | NEW |