| 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_CDM_ADAPTER_H_ | 5 #ifndef MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ |
| 6 #define MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ | 6 #define MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 // pp::Instance implementation. | 47 // pp::Instance implementation. |
| 48 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) { | 48 virtual bool Init(uint32_t argc, const char* argn[], const char* argv[]) { |
| 49 return true; | 49 return true; |
| 50 } | 50 } |
| 51 | 51 |
| 52 // PPP_ContentDecryptor_Private implementation. | 52 // PPP_ContentDecryptor_Private implementation. |
| 53 // Note: Results of calls to these methods must be reported through the | 53 // Note: Results of calls to these methods must be reported through the |
| 54 // PPB_ContentDecryptor_Private interface. | 54 // PPB_ContentDecryptor_Private interface. |
| 55 virtual void Initialize(const std::string& key_system) OVERRIDE; | 55 virtual void Initialize(const std::string& key_system) OVERRIDE; |
| 56 virtual void CreateSession(uint32_t reference_id, | 56 virtual void CreateSession(uint32_t session_id, |
| 57 const std::string& type, | 57 const std::string& type, |
| 58 pp::VarArrayBuffer init_data) OVERRIDE; | 58 pp::VarArrayBuffer init_data) OVERRIDE; |
| 59 virtual void UpdateSession(uint32_t reference_id, | 59 virtual void UpdateSession(uint32_t session_id, |
| 60 pp::VarArrayBuffer response) OVERRIDE; | 60 pp::VarArrayBuffer response) OVERRIDE; |
| 61 virtual void ReleaseSession(uint32_t reference_id) OVERRIDE; | 61 virtual void ReleaseSession(uint32_t session_id) OVERRIDE; |
| 62 virtual void Decrypt( | 62 virtual void Decrypt( |
| 63 pp::Buffer_Dev encrypted_buffer, | 63 pp::Buffer_Dev encrypted_buffer, |
| 64 const PP_EncryptedBlockInfo& encrypted_block_info) OVERRIDE; | 64 const PP_EncryptedBlockInfo& encrypted_block_info) OVERRIDE; |
| 65 virtual void InitializeAudioDecoder( | 65 virtual void InitializeAudioDecoder( |
| 66 const PP_AudioDecoderConfig& decoder_config, | 66 const PP_AudioDecoderConfig& decoder_config, |
| 67 pp::Buffer_Dev extra_data_buffer) OVERRIDE; | 67 pp::Buffer_Dev extra_data_buffer) OVERRIDE; |
| 68 virtual void InitializeVideoDecoder( | 68 virtual void InitializeVideoDecoder( |
| 69 const PP_VideoDecoderConfig& decoder_config, | 69 const PP_VideoDecoderConfig& decoder_config, |
| 70 pp::Buffer_Dev extra_data_buffer) OVERRIDE; | 70 pp::Buffer_Dev extra_data_buffer) OVERRIDE; |
| 71 virtual void DeinitializeDecoder(PP_DecryptorStreamType decoder_type, | 71 virtual void DeinitializeDecoder(PP_DecryptorStreamType decoder_type, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 97 const char* service_id, uint32_t service_id_length, | 97 const char* service_id, uint32_t service_id_length, |
| 98 const char* challenge, uint32_t challenge_length) OVERRIDE; | 98 const char* challenge, uint32_t challenge_length) OVERRIDE; |
| 99 virtual void EnableOutputProtection( | 99 virtual void EnableOutputProtection( |
| 100 uint32_t desired_protection_mask) OVERRIDE; | 100 uint32_t desired_protection_mask) OVERRIDE; |
| 101 virtual void QueryOutputProtectionStatus() OVERRIDE; | 101 virtual void QueryOutputProtectionStatus() OVERRIDE; |
| 102 virtual void OnDeferredInitializationDone( | 102 virtual void OnDeferredInitializationDone( |
| 103 cdm::StreamType stream_type, | 103 cdm::StreamType stream_type, |
| 104 cdm::Status decoder_status) OVERRIDE; | 104 cdm::Status decoder_status) OVERRIDE; |
| 105 | 105 |
| 106 // cdm::Host_3 implementation. | 106 // cdm::Host_3 implementation. |
| 107 virtual void OnSessionCreated(uint32_t reference_id, | 107 virtual void OnSessionCreated(uint32_t session_id, |
| 108 const char* session_id, | 108 const char* web_session_id, |
| 109 uint32_t session_id_length) OVERRIDE; | 109 uint32_t web_session_id_length) OVERRIDE; |
| 110 virtual void OnSessionMessage(uint32_t reference_id, | 110 virtual void OnSessionMessage(uint32_t session_id, |
| 111 const char* message, | 111 const char* message, |
| 112 uint32_t message_length, | 112 uint32_t message_length, |
| 113 const char* destination_url, | 113 const char* destination_url, |
| 114 uint32_t destination_url_length) OVERRIDE; | 114 uint32_t destination_url_length) OVERRIDE; |
| 115 virtual void OnSessionReady(uint32_t reference_id) OVERRIDE; | 115 virtual void OnSessionReady(uint32_t session_id) OVERRIDE; |
| 116 virtual void OnSessionClosed(uint32_t reference_id) OVERRIDE; | 116 virtual void OnSessionClosed(uint32_t session_id) OVERRIDE; |
| 117 virtual void OnSessionError(uint32_t reference_id, | 117 virtual void OnSessionError(uint32_t session_id, |
| 118 cdm::MediaKeyError error_code, | 118 cdm::MediaKeyError error_code, |
| 119 uint32_t system_code) OVERRIDE; | 119 uint32_t system_code) OVERRIDE; |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 typedef linked_ptr<DecryptedBlockImpl> LinkedDecryptedBlock; | 122 typedef linked_ptr<DecryptedBlockImpl> LinkedDecryptedBlock; |
| 123 typedef linked_ptr<VideoFrameImpl> LinkedVideoFrame; | 123 typedef linked_ptr<VideoFrameImpl> LinkedVideoFrame; |
| 124 typedef linked_ptr<AudioFramesImpl> LinkedAudioFrames; | 124 typedef linked_ptr<AudioFramesImpl> LinkedAudioFrames; |
| 125 | 125 |
| 126 bool CreateCdmInstance(const std::string& key_system); | 126 bool CreateCdmInstance(const std::string& key_system); |
| 127 | 127 |
| 128 // <code>PPB_ContentDecryptor_Private</code> dispatchers. These are passed to | 128 // <code>PPB_ContentDecryptor_Private</code> dispatchers. These are passed to |
| 129 // <code>callback_factory_</code> to ensure that calls into | 129 // <code>callback_factory_</code> to ensure that calls into |
| 130 // <code>PPP_ContentDecryptor_Private</code> are asynchronous. | 130 // <code>PPP_ContentDecryptor_Private</code> are asynchronous. |
| 131 void SendSessionCreatedInternal(int32_t result, | 131 void SendSessionCreatedInternal(int32_t result, |
| 132 uint32_t reference_id, | 132 uint32_t session_id, |
| 133 const std::string& session_id); | 133 const std::string& web_session_id); |
| 134 void SendSessionMessageInternal(int32_t result, | 134 void SendSessionMessageInternal(int32_t result, |
| 135 uint32_t reference_id, | 135 uint32_t session_id, |
| 136 const std::vector<uint8>& message, | 136 const std::vector<uint8>& message, |
| 137 const std::string& default_url); | 137 const std::string& default_url); |
| 138 void SendSessionReadyInternal(int32_t result, uint32_t reference_id); | 138 void SendSessionReadyInternal(int32_t result, uint32_t session_id); |
| 139 void SendSessionClosedInternal(int32_t result, uint32_t reference_id); | 139 void SendSessionClosedInternal(int32_t result, uint32_t session_id); |
| 140 void SendSessionErrorInternal(int32_t result, | 140 void SendSessionErrorInternal(int32_t result, |
| 141 uint32_t reference_id, | 141 uint32_t session_id, |
| 142 cdm::MediaKeyError error_code, | 142 cdm::MediaKeyError error_code, |
| 143 uint32_t system_code); | 143 uint32_t system_code); |
| 144 | 144 |
| 145 void DeliverBlock(int32_t result, | 145 void DeliverBlock(int32_t result, |
| 146 const cdm::Status& status, | 146 const cdm::Status& status, |
| 147 const LinkedDecryptedBlock& decrypted_block, | 147 const LinkedDecryptedBlock& decrypted_block, |
| 148 const PP_DecryptTrackingInfo& tracking_info); | 148 const PP_DecryptTrackingInfo& tracking_info); |
| 149 void DecoderInitializeDone(int32_t result, | 149 void DecoderInitializeDone(int32_t result, |
| 150 PP_DecryptorStreamType decoder_type, | 150 PP_DecryptorStreamType decoder_type, |
| 151 uint32_t request_id, | 151 uint32_t request_id, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 uint32_t deferred_audio_decoder_config_id_; | 204 uint32_t deferred_audio_decoder_config_id_; |
| 205 bool deferred_initialize_video_decoder_; | 205 bool deferred_initialize_video_decoder_; |
| 206 uint32_t deferred_video_decoder_config_id_; | 206 uint32_t deferred_video_decoder_config_id_; |
| 207 | 207 |
| 208 DISALLOW_COPY_AND_ASSIGN(CdmAdapter); | 208 DISALLOW_COPY_AND_ASSIGN(CdmAdapter); |
| 209 }; | 209 }; |
| 210 | 210 |
| 211 } // namespace media | 211 } // namespace media |
| 212 | 212 |
| 213 #endif // MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ | 213 #endif // MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ |
| OLD | NEW |