| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Note that in a potentially encrypted audio stream, individual buffers | 81 // Note that in a potentially encrypted audio stream, individual buffers |
| 82 // can be encrypted or not encrypted. | 82 // can be encrypted or not encrypted. |
| 83 bool is_encrypted() const { return encryption_scheme_.is_encrypted(); } | 83 bool is_encrypted() const { return encryption_scheme_.is_encrypted(); } |
| 84 | 84 |
| 85 // Encryption scheme used for encrypted buffers. | 85 // Encryption scheme used for encrypted buffers. |
| 86 const EncryptionScheme& encryption_scheme() const { | 86 const EncryptionScheme& encryption_scheme() const { |
| 87 return encryption_scheme_; | 87 return encryption_scheme_; |
| 88 } | 88 } |
| 89 | 89 |
| 90 // Sets the config to be encrypted or not encrypted manually. This can be | 90 // Sets the config to be encrypted or not encrypted manually. This can be |
| 91 // useful for decryptors that decrypts an encrypted stream to a clear stream, | 91 // useful for decryptors that decrypts an encrypted stream to a clear stream. |
| 92 // or for decoder selectors that wants to select decrypting decoders instead | |
| 93 // of clear decoders. | |
| 94 void SetIsEncrypted(bool is_encrypted); | 92 void SetIsEncrypted(bool is_encrypted); |
| 95 | 93 |
| 96 private: | 94 private: |
| 97 AudioCodec codec_; | 95 AudioCodec codec_; |
| 98 SampleFormat sample_format_; | 96 SampleFormat sample_format_; |
| 99 int bytes_per_channel_; | 97 int bytes_per_channel_; |
| 100 ChannelLayout channel_layout_; | 98 ChannelLayout channel_layout_; |
| 101 int samples_per_second_; | 99 int samples_per_second_; |
| 102 int bytes_per_frame_; | 100 int bytes_per_frame_; |
| 103 std::vector<uint8_t> extra_data_; | 101 std::vector<uint8_t> extra_data_; |
| 104 EncryptionScheme encryption_scheme_; | 102 EncryptionScheme encryption_scheme_; |
| 105 | 103 |
| 106 // |seek_preroll_| is the duration of the data that the decoder must decode | 104 // |seek_preroll_| is the duration of the data that the decoder must decode |
| 107 // before the decoded data is valid. | 105 // before the decoded data is valid. |
| 108 base::TimeDelta seek_preroll_; | 106 base::TimeDelta seek_preroll_; |
| 109 | 107 |
| 110 // |codec_delay_| is the number of frames the decoder should discard before | 108 // |codec_delay_| is the number of frames the decoder should discard before |
| 111 // returning decoded data. This value can include both decoder delay as well | 109 // returning decoded data. This value can include both decoder delay as well |
| 112 // as padding added during encoding. | 110 // as padding added during encoding. |
| 113 int codec_delay_; | 111 int codec_delay_; |
| 114 | 112 |
| 115 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 113 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
| 116 // generated copy constructor and assignment operator. Since the extra data is | 114 // generated copy constructor and assignment operator. Since the extra data is |
| 117 // typically small, the performance impact is minimal. | 115 // typically small, the performance impact is minimal. |
| 118 }; | 116 }; |
| 119 | 117 |
| 120 } // namespace media | 118 } // namespace media |
| 121 | 119 |
| 122 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 120 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
| OLD | NEW |