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_CLEAR_KEY_CDM_H_ | 5 #ifndef MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ |
6 #define MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ | 6 #define MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 10 matching lines...) Expand all Loading... |
21 #if 0 | 21 #if 0 |
22 #define CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER | 22 #define CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER |
23 #endif | 23 #endif |
24 | 24 |
25 namespace media { | 25 namespace media { |
26 class CdmVideoDecoder; | 26 class CdmVideoDecoder; |
27 class DecoderBuffer; | 27 class DecoderBuffer; |
28 class FFmpegCdmAudioDecoder; | 28 class FFmpegCdmAudioDecoder; |
29 | 29 |
30 // Clear key implementation of the cdm::ContentDecryptionModule interface. | 30 // Clear key implementation of the cdm::ContentDecryptionModule interface. |
31 class ClearKeyCdm : public cdm::ContentDecryptionModule_1 { | 31 class ClearKeyCdm : public cdm::ContentDecryptionModule_2 { |
32 public: | 32 public: |
33 explicit ClearKeyCdm(cdm::Host* host); | 33 explicit ClearKeyCdm(cdm::Host* host); |
34 virtual ~ClearKeyCdm(); | 34 virtual ~ClearKeyCdm(); |
35 | 35 |
36 // ContentDecryptionModule implementation. | 36 // ContentDecryptionModule implementation. |
37 virtual cdm::Status GenerateKeyRequest( | 37 virtual cdm::Status GenerateKeyRequest( |
38 const char* type, int type_size, | 38 const char* type, int type_size, |
39 const uint8_t* init_data, int init_data_size) OVERRIDE; | 39 const uint8_t* init_data, int init_data_size) OVERRIDE; |
40 virtual cdm::Status AddKey(const char* session_id, int session_id_size, | 40 virtual cdm::Status AddKey(const char* session_id, int session_id_size, |
41 const uint8_t* key, int key_size, | 41 const uint8_t* key, int key_size, |
42 const uint8_t* key_id, int key_id_size) OVERRIDE; | 42 const uint8_t* key_id, int key_id_size) OVERRIDE; |
43 virtual cdm::Status CancelKeyRequest(const char* session_id, | 43 virtual cdm::Status CancelKeyRequest(const char* session_id, |
44 int session_id_size) OVERRIDE; | 44 int session_id_size) OVERRIDE; |
45 virtual void TimerExpired(void* context) OVERRIDE; | 45 virtual void TimerExpired(void* context) OVERRIDE; |
46 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, | 46 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, |
47 cdm::DecryptedBlock* decrypted_block) OVERRIDE; | 47 cdm::DecryptedBlock* decrypted_block) OVERRIDE; |
48 virtual cdm::Status InitializeAudioDecoder( | 48 virtual cdm::Status InitializeAudioDecoder( |
49 const cdm::AudioDecoderConfig& audio_decoder_config) OVERRIDE; | 49 const cdm::AudioDecoderConfig& audio_decoder_config) OVERRIDE; |
50 virtual cdm::Status InitializeVideoDecoder( | 50 virtual cdm::Status InitializeVideoDecoder( |
51 const cdm::VideoDecoderConfig& video_decoder_config) OVERRIDE; | 51 const cdm::VideoDecoderConfig& video_decoder_config) OVERRIDE; |
52 virtual void DeinitializeDecoder(cdm::StreamType decoder_type) OVERRIDE; | 52 virtual void DeinitializeDecoder(cdm::StreamType decoder_type) OVERRIDE; |
53 virtual void ResetDecoder(cdm::StreamType decoder_type) OVERRIDE; | 53 virtual void ResetDecoder(cdm::StreamType decoder_type) OVERRIDE; |
54 virtual cdm::Status DecryptAndDecodeFrame( | 54 virtual cdm::Status DecryptAndDecodeFrame( |
55 const cdm::InputBuffer& encrypted_buffer, | 55 const cdm::InputBuffer& encrypted_buffer, |
56 cdm::VideoFrame* video_frame) OVERRIDE; | 56 cdm::VideoFrame* video_frame) OVERRIDE; |
57 virtual cdm::Status DecryptAndDecodeSamples( | 57 virtual cdm::Status DecryptAndDecodeSamples( |
58 const cdm::InputBuffer& encrypted_buffer, | 58 const cdm::InputBuffer& encrypted_buffer, |
59 cdm::AudioFrames_1* audio_frames) OVERRIDE; | 59 cdm::AudioFrames* audio_frames) OVERRIDE; |
60 virtual void Destroy() OVERRIDE; | 60 virtual void Destroy() OVERRIDE; |
| 61 virtual void OnPlatformChallengeResponse( |
| 62 const cdm::PlatformChallengeResponse& response) OVERRIDE; |
| 63 virtual void OnQueryOutputProtectionStatus( |
| 64 uint32_t link_mask, uint32_t output_protection_mask) OVERRIDE; |
61 | 65 |
62 private: | 66 private: |
63 // TODO(xhwang): After we removed DecryptorClient. We probably can also remove | 67 // TODO(xhwang): After we removed DecryptorClient. We probably can also remove |
64 // this Client class as well. Investigate this possibility. | 68 // this Client class as well. Investigate this possibility. |
65 class Client { | 69 class Client { |
66 public: | 70 public: |
67 enum Status { | 71 enum Status { |
68 kKeyAdded, | 72 kKeyAdded, |
69 kKeyError, | 73 kKeyError, |
70 kKeyMessage | 74 kKeyMessage |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER | 161 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER |
158 | 162 |
159 scoped_ptr<CdmVideoDecoder> video_decoder_; | 163 scoped_ptr<CdmVideoDecoder> video_decoder_; |
160 | 164 |
161 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 165 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
162 }; | 166 }; |
163 | 167 |
164 } // namespace media | 168 } // namespace media |
165 | 169 |
166 #endif // MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ | 170 #endif // MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ |
OLD | NEW |