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 CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 6 #define CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 18 matching lines...) Expand all Loading... | |
29 | 29 |
30 // PpapiDecryptor implements media::MediaKeys and media::Decryptor and forwards | 30 // PpapiDecryptor implements media::MediaKeys and media::Decryptor and forwards |
31 // all calls to the PluginInstance. | 31 // all calls to the PluginInstance. |
32 // This class should always be created & destroyed on the main renderer thread. | 32 // This class should always be created & destroyed on the main renderer thread. |
33 class PpapiDecryptor : public media::MediaKeys, | 33 class PpapiDecryptor : public media::MediaKeys, |
34 public media::CdmContext, | 34 public media::CdmContext, |
35 public media::Decryptor { | 35 public media::Decryptor { |
36 public: | 36 public: |
37 static scoped_ptr<PpapiDecryptor> Create( | 37 static scoped_ptr<PpapiDecryptor> Create( |
38 const std::string& key_system, | 38 const std::string& key_system, |
39 bool allow_distinctive_identifier, | |
40 bool allow_persistent_state, | |
41 const GURL& security_origin, | 39 const GURL& security_origin, |
42 const CreatePepperCdmCB& create_pepper_cdm_cb, | 40 const CreatePepperCdmCB& create_pepper_cdm_cb, |
43 const media::SessionMessageCB& session_message_cb, | 41 const media::SessionMessageCB& session_message_cb, |
44 const media::SessionClosedCB& session_closed_cb, | 42 const media::SessionClosedCB& session_closed_cb, |
45 const media::LegacySessionErrorCB& legacy_session_error_cb, | 43 const media::LegacySessionErrorCB& legacy_session_error_cb, |
46 const media::SessionKeysChangeCB& session_keys_change_cb, | 44 const media::SessionKeysChangeCB& session_keys_change_cb, |
47 const media::SessionExpirationUpdateCB& session_expiration_update_cb); | 45 const media::SessionExpirationUpdateCB& session_expiration_update_cb); |
48 | 46 |
49 ~PpapiDecryptor() override; | 47 ~PpapiDecryptor() override; |
50 | 48 |
49 void InitializeCdm(const std::string& key_system, | |
sandersd (OOO until July 31)
2015/04/27 23:32:14
Perhaps this should be passed through the construc
ddorwin
2015/04/27 23:52:18
None of these values should be changeable AFTER cr
| |
50 bool allow_distinctive_identifier, | |
51 bool allow_persistent_state, | |
52 scoped_ptr<media::SimpleCdmPromise> promise); | |
ddorwin
2015/04/27 23:52:18
If this is going to be a public method, it should
| |
53 | |
51 // media::MediaKeys implementation. | 54 // media::MediaKeys implementation. |
52 void SetServerCertificate( | 55 void SetServerCertificate( |
53 const std::vector<uint8_t>& certificate, | 56 const std::vector<uint8_t>& certificate, |
54 scoped_ptr<media::SimpleCdmPromise> promise) override; | 57 scoped_ptr<media::SimpleCdmPromise> promise) override; |
55 void CreateSessionAndGenerateRequest( | 58 void CreateSessionAndGenerateRequest( |
56 SessionType session_type, | 59 SessionType session_type, |
57 media::EmeInitDataType init_data_type, | 60 media::EmeInitDataType init_data_type, |
58 const std::vector<uint8_t>& init_data, | 61 const std::vector<uint8_t>& init_data, |
59 scoped_ptr<media::NewSessionCdmPromise> promise) override; | 62 scoped_ptr<media::NewSessionCdmPromise> promise) override; |
60 void LoadSession(SessionType session_type, | 63 void LoadSession(SessionType session_type, |
(...skipping 27 matching lines...) Expand all Loading... | |
88 const scoped_refptr<media::DecoderBuffer>& encrypted, | 91 const scoped_refptr<media::DecoderBuffer>& encrypted, |
89 const AudioDecodeCB& audio_decode_cb) override; | 92 const AudioDecodeCB& audio_decode_cb) override; |
90 void DecryptAndDecodeVideo( | 93 void DecryptAndDecodeVideo( |
91 const scoped_refptr<media::DecoderBuffer>& encrypted, | 94 const scoped_refptr<media::DecoderBuffer>& encrypted, |
92 const VideoDecodeCB& video_decode_cb) override; | 95 const VideoDecodeCB& video_decode_cb) override; |
93 void ResetDecoder(StreamType stream_type) override; | 96 void ResetDecoder(StreamType stream_type) override; |
94 void DeinitializeDecoder(StreamType stream_type) override; | 97 void DeinitializeDecoder(StreamType stream_type) override; |
95 | 98 |
96 private: | 99 private: |
97 PpapiDecryptor( | 100 PpapiDecryptor( |
98 const std::string& key_system, | |
99 bool allow_distinctive_identifier, | |
100 bool allow_persistent_state, | |
101 scoped_ptr<PepperCdmWrapper> pepper_cdm_wrapper, | 101 scoped_ptr<PepperCdmWrapper> pepper_cdm_wrapper, |
102 const media::SessionMessageCB& session_message_cb, | 102 const media::SessionMessageCB& session_message_cb, |
103 const media::SessionClosedCB& session_closed_cb, | 103 const media::SessionClosedCB& session_closed_cb, |
104 const media::LegacySessionErrorCB& legacy_session_error_cb, | 104 const media::LegacySessionErrorCB& legacy_session_error_cb, |
105 const media::SessionKeysChangeCB& session_keys_change_cb, | 105 const media::SessionKeysChangeCB& session_keys_change_cb, |
106 const media::SessionExpirationUpdateCB& session_expiration_update_cb); | 106 const media::SessionExpirationUpdateCB& session_expiration_update_cb); |
107 | 107 |
108 void OnDecoderInitialized(StreamType stream_type, bool success); | 108 void OnDecoderInitialized(StreamType stream_type, bool success); |
109 | 109 |
110 // Callbacks for |plugin_cdm_delegate_| to fire session events. | 110 // Callbacks for |plugin_cdm_delegate_| to fire session events. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 | 152 |
153 // NOTE: Weak pointers must be invalidated before all other member variables. | 153 // NOTE: Weak pointers must be invalidated before all other member variables. |
154 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; | 154 base::WeakPtrFactory<PpapiDecryptor> weak_ptr_factory_; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); | 156 DISALLOW_COPY_AND_ASSIGN(PpapiDecryptor); |
157 }; | 157 }; |
158 | 158 |
159 } // namespace content | 159 } // namespace content |
160 | 160 |
161 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ | 161 #endif // CONTENT_RENDERER_MEDIA_CRYPTO_PPAPI_DECRYPTOR_H_ |
OLD | NEW |