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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 // Whether the audio stream is potentially encrypted. | 80 // Whether the audio stream is potentially encrypted. |
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 |
| 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); |
| 95 |
90 private: | 96 private: |
91 AudioCodec codec_; | 97 AudioCodec codec_; |
92 SampleFormat sample_format_; | 98 SampleFormat sample_format_; |
93 int bytes_per_channel_; | 99 int bytes_per_channel_; |
94 ChannelLayout channel_layout_; | 100 ChannelLayout channel_layout_; |
95 int samples_per_second_; | 101 int samples_per_second_; |
96 int bytes_per_frame_; | 102 int bytes_per_frame_; |
97 std::vector<uint8_t> extra_data_; | 103 std::vector<uint8_t> extra_data_; |
98 EncryptionScheme encryption_scheme_; | 104 EncryptionScheme encryption_scheme_; |
99 | 105 |
100 // |seek_preroll_| is the duration of the data that the decoder must decode | 106 // |seek_preroll_| is the duration of the data that the decoder must decode |
101 // before the decoded data is valid. | 107 // before the decoded data is valid. |
102 base::TimeDelta seek_preroll_; | 108 base::TimeDelta seek_preroll_; |
103 | 109 |
104 // |codec_delay_| is the number of frames the decoder should discard before | 110 // |codec_delay_| is the number of frames the decoder should discard before |
105 // returning decoded data. This value can include both decoder delay as well | 111 // returning decoded data. This value can include both decoder delay as well |
106 // as padding added during encoding. | 112 // as padding added during encoding. |
107 int codec_delay_; | 113 int codec_delay_; |
108 | 114 |
109 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 115 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
110 // generated copy constructor and assignment operator. Since the extra data is | 116 // generated copy constructor and assignment operator. Since the extra data is |
111 // typically small, the performance impact is minimal. | 117 // typically small, the performance impact is minimal. |
112 }; | 118 }; |
113 | 119 |
114 } // namespace media | 120 } // namespace media |
115 | 121 |
116 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ | 122 #endif // MEDIA_BASE_AUDIO_DECODER_CONFIG_H_ |
OLD | NEW |