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_PPAPI_CDM_ADAPTER_H_ | 5 #ifndef MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ |
6 #define MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ | 6 #define MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 namespace media { | 32 namespace media { |
33 | 33 |
34 // GetCdmHostFunc implementation. | 34 // GetCdmHostFunc implementation. |
35 void* GetCdmHost(int host_interface_version, void* user_data); | 35 void* GetCdmHost(int host_interface_version, void* user_data); |
36 | 36 |
37 // An adapter class for abstracting away PPAPI interaction and threading for a | 37 // An adapter class for abstracting away PPAPI interaction and threading for a |
38 // Content Decryption Module (CDM). | 38 // Content Decryption Module (CDM). |
39 class PpapiCdmAdapter : public pp::Instance, | 39 class PpapiCdmAdapter : public pp::Instance, |
40 public pp::ContentDecryptor_Private, | 40 public pp::ContentDecryptor_Private, |
41 public cdm::Host_7, | |
42 public cdm::Host_8 { | 41 public cdm::Host_8 { |
43 public: | 42 public: |
44 PpapiCdmAdapter(PP_Instance instance, pp::Module* module); | 43 PpapiCdmAdapter(PP_Instance instance, pp::Module* module); |
45 virtual ~PpapiCdmAdapter(); | 44 virtual ~PpapiCdmAdapter(); |
46 | 45 |
47 // pp::Instance implementation. | 46 // pp::Instance implementation. |
48 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) { | 47 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) { |
49 return true; | 48 return true; |
50 } | 49 } |
51 | 50 |
(...skipping 27 matching lines...) Expand all Loading... |
79 pp::Buffer_Dev extra_data_buffer) override; | 78 pp::Buffer_Dev extra_data_buffer) override; |
80 void DeinitializeDecoder(PP_DecryptorStreamType decoder_type, | 79 void DeinitializeDecoder(PP_DecryptorStreamType decoder_type, |
81 uint32_t request_id) override; | 80 uint32_t request_id) override; |
82 void ResetDecoder(PP_DecryptorStreamType decoder_type, | 81 void ResetDecoder(PP_DecryptorStreamType decoder_type, |
83 uint32_t request_id) override; | 82 uint32_t request_id) override; |
84 void DecryptAndDecode( | 83 void DecryptAndDecode( |
85 PP_DecryptorStreamType decoder_type, | 84 PP_DecryptorStreamType decoder_type, |
86 pp::Buffer_Dev encrypted_buffer, | 85 pp::Buffer_Dev encrypted_buffer, |
87 const PP_EncryptedBlockInfo& encrypted_block_info) override; | 86 const PP_EncryptedBlockInfo& encrypted_block_info) override; |
88 | 87 |
89 // cdm::Host_7 and cdm::Host_8 implementation. | 88 // cdm::Host_8 implementation. |
90 cdm::Buffer* Allocate(uint32_t capacity) override; | 89 cdm::Buffer* Allocate(uint32_t capacity) override; |
91 void SetTimer(int64_t delay_ms, void* context) override; | 90 void SetTimer(int64_t delay_ms, void* context) override; |
92 cdm::Time GetCurrentWallTime() override; | 91 cdm::Time GetCurrentWallTime() override; |
93 void OnResolveNewSessionPromise(uint32_t promise_id, | 92 void OnResolveNewSessionPromise(uint32_t promise_id, |
94 const char* session_id, | 93 const char* session_id, |
95 uint32_t session_id_size) override; | 94 uint32_t session_id_size) override; |
96 void OnResolvePromise(uint32_t promise_id) override; | 95 void OnResolvePromise(uint32_t promise_id) override; |
97 void OnRejectPromise(uint32_t promise_id, | 96 void OnRejectPromise(uint32_t promise_id, |
98 cdm::Error error, | 97 cdm::Error error, |
99 uint32_t system_code, | 98 uint32_t system_code, |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 | 284 |
286 uint32_t last_read_file_size_kb_; | 285 uint32_t last_read_file_size_kb_; |
287 bool file_size_uma_reported_; | 286 bool file_size_uma_reported_; |
288 | 287 |
289 DISALLOW_COPY_AND_ASSIGN(PpapiCdmAdapter); | 288 DISALLOW_COPY_AND_ASSIGN(PpapiCdmAdapter); |
290 }; | 289 }; |
291 | 290 |
292 } // namespace media | 291 } // namespace media |
293 | 292 |
294 #endif // MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ | 293 #endif // MEDIA_CDM_PPAPI_PPAPI_CDM_ADAPTER_H_ |
OLD | NEW |