Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "webkit/media/crypto/proxy_decryptor.h" | 5 #include "webkit/media/crypto/proxy_decryptor.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/message_loop_proxy.h" | 12 #include "base/message_loop_proxy.h" |
| 13 #include "media/base/decoder_buffer.h" | 13 #include "media/base/decoder_buffer.h" |
| 14 #include "media/base/decryptor_client.h" | 14 #include "media/base/decryptor_client.h" |
| 15 #include "media/base/video_decoder_config.h" | |
|
ddorwin
2012/09/21 00:36:08
same
xhwang
2012/09/25 23:52:32
same
| |
| 16 #include "media/base/video_frame.h" | |
| 15 #include "media/crypto/aes_decryptor.h" | 17 #include "media/crypto/aes_decryptor.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
| 17 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebString.h" |
| 18 #include "webkit/media/crypto/key_systems.h" | 20 #include "webkit/media/crypto/key_systems.h" |
| 19 #include "webkit/media/crypto/ppapi_decryptor.h" | 21 #include "webkit/media/crypto/ppapi_decryptor.h" |
| 20 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 22 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
| 21 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" | 23 #include "webkit/plugins/ppapi/ppapi_webplugin_impl.h" |
| 22 // TODO(xhwang): Put this include after "ppapi_plugin_instance.h" for definition | 24 // TODO(xhwang): Put this include after "ppapi_plugin_instance.h" for definition |
| 23 // of "uint8_t", which WebMediaPlayer.h uses without including a header for it. | 25 // of "uint8_t", which WebMediaPlayer.h uses without including a header for it. |
| 24 // See: https://bugs.webkit.org/show_bug.cgi?id=92031 | 26 // See: https://bugs.webkit.org/show_bug.cgi?id=92031 |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 178 std::swap(pending_decrypt_closures_, closures_to_run); | 180 std::swap(pending_decrypt_closures_, closures_to_run); |
| 179 } | 181 } |
| 180 | 182 |
| 181 for (std::vector<base::Closure>::iterator iter = closures_to_run.begin(); | 183 for (std::vector<base::Closure>::iterator iter = closures_to_run.begin(); |
| 182 iter != closures_to_run.end(); | 184 iter != closures_to_run.end(); |
| 183 ++iter) { | 185 ++iter) { |
| 184 iter->Run(); | 186 iter->Run(); |
| 185 } | 187 } |
| 186 } | 188 } |
| 187 | 189 |
| 190 void ProxyDecryptor::InitializeVideoDecoder( | |
| 191 const media::VideoDecoderConfig& config, | |
| 192 const InitializeCB& init_cb) { | |
| 193 NOTIMPLEMENTED(); | |
|
ddorwin
2012/09/21 00:36:08
Will be implemented or not?
xhwang
2012/09/25 23:52:32
Done.
| |
| 194 init_cb.Run(false); | |
| 195 } | |
| 196 | |
| 197 void ProxyDecryptor::DecryptAndDecodeVideo( | |
| 198 const scoped_refptr<media::DecoderBuffer>& encrypted, | |
| 199 const VideoDecodeCB& video_decode_cb) { | |
| 200 NOTIMPLEMENTED(); | |
| 201 video_decode_cb.Run(kError, NULL); | |
| 202 } | |
| 203 | |
| 204 void ProxyDecryptor::ResetVideoDecoder() { | |
| 205 NOTIMPLEMENTED(); | |
| 206 } | |
| 207 | |
| 208 void ProxyDecryptor::StopVideoDecoder() { | |
| 209 NOTIMPLEMENTED(); | |
| 210 } | |
| 211 | |
| 188 scoped_ptr<media::Decryptor> ProxyDecryptor::CreatePpapiDecryptor( | 212 scoped_ptr<media::Decryptor> ProxyDecryptor::CreatePpapiDecryptor( |
| 189 const std::string& key_system) { | 213 const std::string& key_system) { |
| 190 DCHECK(client_); | 214 DCHECK(client_); |
| 191 DCHECK(web_media_player_client_); | 215 DCHECK(web_media_player_client_); |
| 192 DCHECK(web_frame_); | 216 DCHECK(web_frame_); |
| 193 | 217 |
| 194 std::string plugin_type = GetPluginType(key_system); | 218 std::string plugin_type = GetPluginType(key_system); |
| 195 DCHECK(!plugin_type.empty()); | 219 DCHECK(!plugin_type.empty()); |
| 196 const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance = | 220 const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance = |
| 197 CreatePluginInstance(plugin_type, web_media_player_client_, web_frame_); | 221 CreatePluginInstance(plugin_type, web_media_player_client_, web_frame_); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 269 &ProxyDecryptor::DecryptOnMessageLoop, base::Unretained(this), | 293 &ProxyDecryptor::DecryptOnMessageLoop, base::Unretained(this), |
| 270 message_loop_proxy, encrypted, decrypt_cb)); | 294 message_loop_proxy, encrypted, decrypt_cb)); |
| 271 } | 295 } |
| 272 // TODO(xhwang): The same NeedKey may be fired multiple times here and also | 296 // TODO(xhwang): The same NeedKey may be fired multiple times here and also |
| 273 // in Decrypt(). While the spec says only one NeedKey should be fired. Leave | 297 // in Decrypt(). While the spec says only one NeedKey should be fired. Leave |
| 274 // them as is since the spec about this may change. | 298 // them as is since the spec about this may change. |
| 275 FireNeedKey(client_, encrypted); | 299 FireNeedKey(client_, encrypted); |
| 276 } | 300 } |
| 277 | 301 |
| 278 } // namespace webkit_media | 302 } // namespace webkit_media |
| OLD | NEW |