OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 5 #ifndef MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 6 #define MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 // Returns the number of samples generated in the |audio_frames|. | 133 // Returns the number of samples generated in the |audio_frames|. |
134 int GenerateFakeAudioFramesFromDuration(int64_t duration_in_microseconds, | 134 int GenerateFakeAudioFramesFromDuration(int64_t duration_in_microseconds, |
135 cdm::AudioFrames* audio_frames) const; | 135 cdm::AudioFrames* audio_frames) const; |
136 | 136 |
137 // Generates fake video frames given |input_timestamp|. | 137 // Generates fake video frames given |input_timestamp|. |
138 // Returns cdm::kSuccess if any audio frame is successfully generated. | 138 // Returns cdm::kSuccess if any audio frame is successfully generated. |
139 cdm::Status GenerateFakeAudioFrames(int64_t timestamp_in_microseconds, | 139 cdm::Status GenerateFakeAudioFrames(int64_t timestamp_in_microseconds, |
140 cdm::AudioFrames* audio_frames); | 140 cdm::AudioFrames* audio_frames); |
141 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER | 141 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER |
142 | 142 |
| 143 void OnUnitTestComplete(bool success); |
| 144 |
143 void StartFileIOTest(); | 145 void StartFileIOTest(); |
144 | 146 |
145 // Callback for CDM File IO test. | 147 // Callback for CDM File IO test. |
146 void OnFileIOTestComplete(bool success); | 148 void OnFileIOTestComplete(bool success); |
147 | 149 |
| 150 void StartOutputProtectionTest(); |
| 151 |
148 // Keep track of the last session created. | 152 // Keep track of the last session created. |
149 void SetSessionId(const std::string& session_id); | 153 void SetSessionId(const std::string& session_id); |
150 | 154 |
151 scoped_refptr<AesDecryptor> decryptor_; | 155 scoped_refptr<AesDecryptor> decryptor_; |
152 | 156 |
153 ClearKeyCdmHost* host_; | 157 ClearKeyCdmHost* host_; |
154 | 158 |
155 const std::string key_system_; | 159 const std::string key_system_; |
156 | 160 |
157 std::string last_session_id_; | 161 std::string last_session_id_; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER | 206 #endif // CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER |
203 | 207 |
204 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 208 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
205 std::unique_ptr<FFmpegCdmAudioDecoder> audio_decoder_; | 209 std::unique_ptr<FFmpegCdmAudioDecoder> audio_decoder_; |
206 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER | 210 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER |
207 | 211 |
208 std::unique_ptr<CdmVideoDecoder> video_decoder_; | 212 std::unique_ptr<CdmVideoDecoder> video_decoder_; |
209 | 213 |
210 std::unique_ptr<FileIOTestRunner> file_io_test_runner_; | 214 std::unique_ptr<FileIOTestRunner> file_io_test_runner_; |
211 | 215 |
| 216 bool is_running_output_protection_test_; |
| 217 |
212 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 218 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
213 }; | 219 }; |
214 | 220 |
215 } // namespace media | 221 } // namespace media |
216 | 222 |
217 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ | 223 #endif // MEDIA_CDM_PPAPI_EXTERNAL_CLEAR_KEY_CLEAR_KEY_CDM_H_ |
OLD | NEW |