Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(417)

Side by Side Diff: media/cdm/ppapi/cdm_adapter.h

Issue 1023003002: Add support for cdm::ContentDecryptionModule_8, remove CDM_6 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new bug # Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « DEPS ('k') | media/cdm/ppapi/cdm_adapter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 19 matching lines...) Expand all
30 30
31 namespace media { 31 namespace media {
32 32
33 // GetCdmHostFunc implementation. 33 // GetCdmHostFunc implementation.
34 void* GetCdmHost(int host_interface_version, void* user_data); 34 void* GetCdmHost(int host_interface_version, void* user_data);
35 35
36 // An adapter class for abstracting away PPAPI interaction and threading for a 36 // An adapter class for abstracting away PPAPI interaction and threading for a
37 // Content Decryption Module (CDM). 37 // Content Decryption Module (CDM).
38 class CdmAdapter : public pp::Instance, 38 class CdmAdapter : public pp::Instance,
39 public pp::ContentDecryptor_Private, 39 public pp::ContentDecryptor_Private,
40 public cdm::Host_6, 40 public cdm::Host_7,
41 public cdm::Host_7 { 41 public cdm::Host_8 {
42 public: 42 public:
43 CdmAdapter(PP_Instance instance, pp::Module* module); 43 CdmAdapter(PP_Instance instance, pp::Module* module);
44 virtual ~CdmAdapter(); 44 virtual ~CdmAdapter();
45 45
46 // pp::Instance implementation. 46 // pp::Instance implementation.
47 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[]) {
48 return true; 48 return true;
49 } 49 }
50 50
51 // PPP_ContentDecryptor_Private implementation. 51 // PPP_ContentDecryptor_Private implementation.
(...skipping 25 matching lines...) Expand all
77 pp::Buffer_Dev extra_data_buffer) override; 77 pp::Buffer_Dev extra_data_buffer) override;
78 void DeinitializeDecoder(PP_DecryptorStreamType decoder_type, 78 void DeinitializeDecoder(PP_DecryptorStreamType decoder_type,
79 uint32_t request_id) override; 79 uint32_t request_id) override;
80 void ResetDecoder(PP_DecryptorStreamType decoder_type, 80 void ResetDecoder(PP_DecryptorStreamType decoder_type,
81 uint32_t request_id) override; 81 uint32_t request_id) override;
82 void DecryptAndDecode( 82 void DecryptAndDecode(
83 PP_DecryptorStreamType decoder_type, 83 PP_DecryptorStreamType decoder_type,
84 pp::Buffer_Dev encrypted_buffer, 84 pp::Buffer_Dev encrypted_buffer,
85 const PP_EncryptedBlockInfo& encrypted_block_info) override; 85 const PP_EncryptedBlockInfo& encrypted_block_info) override;
86 86
87 // cdm::Host_6 and cdm::Host_7 implementation. 87 // cdm::Host_7 and cdm::Host_8 implementation.
88 cdm::Buffer* Allocate(uint32_t capacity) override; 88 cdm::Buffer* Allocate(uint32_t capacity) override;
89 void SetTimer(int64_t delay_ms, void* context) override; 89 void SetTimer(int64_t delay_ms, void* context) override;
90 cdm::Time GetCurrentWallTime() override; 90 cdm::Time GetCurrentWallTime() override;
91 void OnResolveNewSessionPromise(uint32_t promise_id, 91 void OnResolveNewSessionPromise(uint32_t promise_id,
92 const char* session_id, 92 const char* session_id,
93 uint32_t session_id_size) override; 93 uint32_t session_id_size) override;
94 void OnResolvePromise(uint32_t promise_id) override; 94 void OnResolvePromise(uint32_t promise_id) override;
95 void OnRejectPromise(uint32_t promise_id, 95 void OnRejectPromise(uint32_t promise_id,
96 cdm::Error error, 96 cdm::Error error,
97 uint32_t system_code, 97 uint32_t system_code,
98 const char* error_message, 98 const char* error_message,
99 uint32_t error_message_size) override; 99 uint32_t error_message_size) override;
100 void OnExpirationChange(const char* session_id,
101 uint32_t session_id_size,
102 cdm::Time new_expiry_time) override;
103 void OnSessionClosed(const char* session_id,
104 uint32_t session_id_size) override;
105 void SendPlatformChallenge(const char* service_id,
106 uint32_t service_id_size,
107 const char* challenge,
108 uint32_t challenge_size) override;
109 void EnableOutputProtection(uint32_t desired_protection_mask) override;
110 void QueryOutputProtectionStatus() override;
111 void OnDeferredInitializationDone(cdm::StreamType stream_type,
112 cdm::Status decoder_status) override;
113 cdm::FileIO* CreateFileIO(cdm::FileIOClient* client) override;
114
115 // cdm::Host_7 implementation.
116 void OnSessionMessage(const char* session_id, 100 void OnSessionMessage(const char* session_id,
117 uint32_t session_id_size, 101 uint32_t session_id_size,
118 cdm::MessageType message_type, 102 cdm::MessageType message_type,
119 const char* message, 103 const char* message,
120 uint32_t message_size, 104 uint32_t message_size,
121 const char* legacy_destination_url, 105 const char* legacy_destination_url,
122 uint32_t legacy_destination_url_size) override; 106 uint32_t legacy_destination_url_size) override;
123 void OnSessionKeysChange(const char* session_id, 107 void OnSessionKeysChange(const char* session_id,
124 uint32_t session_id_size, 108 uint32_t session_id_size,
125 bool has_additional_usable_key, 109 bool has_additional_usable_key,
126 const cdm::KeyInformation* keys_info, 110 const cdm::KeyInformation* keys_info,
127 uint32_t keys_info_count) override; 111 uint32_t keys_info_count) override;
112 void OnExpirationChange(const char* session_id,
113 uint32_t session_id_size,
114 cdm::Time new_expiry_time) override;
115 void OnSessionClosed(const char* session_id,
116 uint32_t session_id_size) override;
128 void OnLegacySessionError(const char* session_id, 117 void OnLegacySessionError(const char* session_id,
129 uint32_t session_id_size, 118 uint32_t session_id_size,
130 cdm::Error error, 119 cdm::Error error,
131 uint32_t system_code, 120 uint32_t system_code,
132 const char* error_message, 121 const char* error_message,
133 uint32_t error_message_size) override; 122 uint32_t error_message_size) override;
134 123 void SendPlatformChallenge(const char* service_id,
135 // cdm::Host_6 implementation. 124 uint32_t service_id_size,
136 void OnResolveKeyIdsPromise(uint32_t promise_id, 125 const char* challenge,
137 const cdm::BinaryData* usable_key_ids, 126 uint32_t challenge_size) override;
138 uint32_t usable_key_ids_size) override; 127 void EnableOutputProtection(uint32_t desired_protection_mask) override;
139 void OnSessionMessage(const char* session_id, 128 void QueryOutputProtectionStatus() override;
140 uint32_t session_id_size, 129 void OnDeferredInitializationDone(cdm::StreamType stream_type,
141 const char* message, 130 cdm::Status decoder_status) override;
142 uint32_t message_size, 131 cdm::FileIO* CreateFileIO(cdm::FileIOClient* client) override;
143 const char* destination_url,
144 uint32_t destination_url_size) override;
145 void OnSessionUsableKeysChange(const char* session_id,
146 uint32_t session_id_size,
147 bool has_additional_usable_key) override;
148 void OnSessionError(const char* session_id,
149 uint32_t session_id_size,
150 cdm::Error error,
151 uint32_t system_code,
152 const char* error_message,
153 uint32_t error_message_size) override;
154 132
155 private: 133 private:
156 // These are reported to UMA server. Do not change the existing values! 134 // These are reported to UMA server. Do not change the existing values!
157 enum OutputProtectionStatus { 135 enum OutputProtectionStatus {
158 OUTPUT_PROTECTION_QUERIED = 0, 136 OUTPUT_PROTECTION_QUERIED = 0,
159 OUTPUT_PROTECTION_NO_EXTERNAL_LINK = 1, 137 OUTPUT_PROTECTION_NO_EXTERNAL_LINK = 1,
160 OUTPUT_PROTECTION_ALL_EXTERNAL_LINKS_PROTECTED = 2, 138 OUTPUT_PROTECTION_ALL_EXTERNAL_LINKS_PROTECTED = 2,
161 OUTPUT_PROTECTION_MAX = 3 139 OUTPUT_PROTECTION_MAX = 3
162 }; 140 };
163 141
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 281
304 uint32_t last_read_file_size_kb_; 282 uint32_t last_read_file_size_kb_;
305 bool file_size_uma_reported_; 283 bool file_size_uma_reported_;
306 284
307 DISALLOW_COPY_AND_ASSIGN(CdmAdapter); 285 DISALLOW_COPY_AND_ASSIGN(CdmAdapter);
308 }; 286 };
309 287
310 } // namespace media 288 } // namespace media
311 289
312 #endif // MEDIA_CDM_PPAPI_CDM_ADAPTER_H_ 290 #endif // MEDIA_CDM_PPAPI_CDM_ADAPTER_H_
OLDNEW
« no previous file with comments | « DEPS ('k') | media/cdm/ppapi/cdm_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698