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/ppapi_decryptor.h" | 5 #include "webkit/media/crypto/ppapi_decryptor.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
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.h" | 12 #include "base/message_loop.h" |
13 #include "base/message_loop_proxy.h" | 13 #include "base/message_loop_proxy.h" |
14 #include "media/base/decoder_buffer.h" | 14 #include "media/base/decoder_buffer.h" |
15 #include "media/base/decryptor_client.h" | 15 #include "media/base/decryptor_client.h" |
| 16 #include "media/base/video_decoder_config.h" |
| 17 #include "media/base/video_frame.h" |
16 #include "webkit/media/crypto/key_systems.h" | 18 #include "webkit/media/crypto/key_systems.h" |
17 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 19 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
18 | 20 |
19 namespace webkit_media { | 21 namespace webkit_media { |
20 | 22 |
21 PpapiDecryptor::PpapiDecryptor( | 23 PpapiDecryptor::PpapiDecryptor( |
22 media::DecryptorClient* client, | 24 media::DecryptorClient* client, |
23 const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance) | 25 const scoped_refptr<webkit::ppapi::PluginInstance>& plugin_instance) |
24 : client_(client), | 26 : client_(client), |
25 cdm_plugin_(plugin_instance), | 27 cdm_plugin_(plugin_instance), |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 return; | 95 return; |
94 } | 96 } |
95 | 97 |
96 if (!cdm_plugin_->Decrypt(encrypted, decrypt_cb)) | 98 if (!cdm_plugin_->Decrypt(encrypted, decrypt_cb)) |
97 decrypt_cb.Run(kError, NULL); | 99 decrypt_cb.Run(kError, NULL); |
98 } | 100 } |
99 | 101 |
100 void PpapiDecryptor::CancelDecrypt() { | 102 void PpapiDecryptor::CancelDecrypt() { |
101 } | 103 } |
102 | 104 |
| 105 void PpapiDecryptor::InitializeVideoDecoder( |
| 106 const media::VideoDecoderConfig& config, |
| 107 const DecoderInitCB& init_cb) { |
| 108 // TODO(xhwang): Implement this! |
| 109 NOTIMPLEMENTED(); |
| 110 init_cb.Run(false); |
| 111 } |
| 112 |
| 113 void PpapiDecryptor::DecryptAndDecodeVideo( |
| 114 const scoped_refptr<media::DecoderBuffer>& encrypted, |
| 115 const VideoDecodeCB& video_decode_cb) { |
| 116 // TODO(xhwang): Implement this! |
| 117 NOTIMPLEMENTED(); |
| 118 video_decode_cb.Run(kError, NULL); |
| 119 } |
| 120 |
| 121 void PpapiDecryptor::CancelDecryptAndDecodeVideo() { |
| 122 // TODO(xhwang): Implement this! |
| 123 NOTIMPLEMENTED(); |
| 124 } |
| 125 |
| 126 void PpapiDecryptor::StopVideoDecoder() { |
| 127 // TODO(xhwang): Implement this! |
| 128 NOTIMPLEMENTED(); |
| 129 } |
| 130 |
103 void PpapiDecryptor::ReportFailureToCallPlugin(const std::string& key_system, | 131 void PpapiDecryptor::ReportFailureToCallPlugin(const std::string& key_system, |
104 const std::string& session_id) { | 132 const std::string& session_id) { |
105 DVLOG(1) << "Failed to call plugin."; | 133 DVLOG(1) << "Failed to call plugin."; |
106 client_->KeyError(key_system, session_id, kUnknownError, 0); | 134 client_->KeyError(key_system, session_id, kUnknownError, 0); |
107 } | 135 } |
108 | 136 |
109 } // namespace webkit_media | 137 } // namespace webkit_media |
OLD | NEW |