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/plugins/ppapi/ppapi_plugin_instance.h" | 5 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/memory/linked_ptr.h" | 10 #include "base/memory/linked_ptr.h" |
(...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1539 | 1539 |
1540 DCHECK(!ContainsKey(pending_decryption_cbs_, request_id)); | 1540 DCHECK(!ContainsKey(pending_decryption_cbs_, request_id)); |
1541 pending_decryption_cbs_.insert(std::make_pair(request_id, decrypt_cb)); | 1541 pending_decryption_cbs_.insert(std::make_pair(request_id, decrypt_cb)); |
1542 | 1542 |
1543 plugin_decryption_interface_->Decrypt(pp_instance(), | 1543 plugin_decryption_interface_->Decrypt(pp_instance(), |
1544 encrypted_resource, | 1544 encrypted_resource, |
1545 &block_info); | 1545 &block_info); |
1546 return true; | 1546 return true; |
1547 } | 1547 } |
1548 | 1548 |
| 1549 bool PluginInstance::DeinitializeDecoder() { |
| 1550 if (!LoadContentDecryptorInterface()) |
| 1551 return false; |
| 1552 |
| 1553 // TODO(tomfinegan): Add decoder deinitialize request tracking. |
| 1554 plugin_decryption_interface_->DeinitializeDecoder(pp_instance(), |
| 1555 PP_STREAMTYPE_UNKNOWN, |
| 1556 0); |
| 1557 return true; |
| 1558 } |
| 1559 |
| 1560 bool PluginInstance::ResetDecoder() { |
| 1561 if (!LoadContentDecryptorInterface()) |
| 1562 return false; |
| 1563 |
| 1564 // TODO(tomfinegan): Add decoder reset request tracking. |
| 1565 plugin_decryption_interface_->ResetDecoder(pp_instance(), |
| 1566 PP_STREAMTYPE_UNKNOWN, |
| 1567 0); |
| 1568 return true; |
| 1569 } |
| 1570 |
1549 // Note: this method can be used with an unencrypted frame. | 1571 // Note: this method can be used with an unencrypted frame. |
1550 bool PluginInstance::DecryptAndDecodeFrame( | 1572 bool PluginInstance::DecryptAndDecodeFrame( |
1551 const scoped_refptr<media::DecoderBuffer>& encrypted_frame, | 1573 const scoped_refptr<media::DecoderBuffer>& encrypted_frame, |
1552 const media::Decryptor::DecryptCB& decrypt_cb) { | 1574 const media::Decryptor::DecryptCB& decrypt_cb) { |
1553 if (!LoadContentDecryptorInterface()) | 1575 if (!LoadContentDecryptorInterface()) |
1554 return false; | 1576 return false; |
1555 | 1577 |
1556 ScopedPPResource encrypted_resource(MakeBufferResource( | 1578 ScopedPPResource encrypted_resource(MakeBufferResource( |
1557 pp_instance(), | 1579 pp_instance(), |
1558 encrypted_frame->GetData(), | 1580 encrypted_frame->GetData(), |
(...skipping 713 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2272 } | 2294 } |
2273 | 2295 |
2274 DCHECK(decryptor_client_); | 2296 DCHECK(decryptor_client_); |
2275 decryptor_client_->KeyError( | 2297 decryptor_client_->KeyError( |
2276 key_system_string->value(), | 2298 key_system_string->value(), |
2277 session_id_string->value(), | 2299 session_id_string->value(), |
2278 static_cast<media::Decryptor::KeyError>(media_error), | 2300 static_cast<media::Decryptor::KeyError>(media_error), |
2279 system_code); | 2301 system_code); |
2280 } | 2302 } |
2281 | 2303 |
| 2304 void PluginInstance::DecoderDeinitializeDone(PP_Instance instance, |
| 2305 PP_StreamType decoder_type, |
| 2306 uint32_t request_id) { |
| 2307 // TODO(tomfinegan): Add decoder stop completion handling. |
| 2308 } |
| 2309 |
| 2310 void PluginInstance::DecoderResetDone(PP_Instance instance, |
| 2311 PP_StreamType decoder_type, |
| 2312 uint32_t request_id) { |
| 2313 // TODO(tomfinegan): Add decoder reset completion handling. |
| 2314 } |
| 2315 |
2282 void PluginInstance::DeliverBlock(PP_Instance instance, | 2316 void PluginInstance::DeliverBlock(PP_Instance instance, |
2283 PP_Resource decrypted_block, | 2317 PP_Resource decrypted_block, |
2284 const PP_DecryptedBlockInfo* block_info) { | 2318 const PP_DecryptedBlockInfo* block_info) { |
2285 DCHECK(block_info); | 2319 DCHECK(block_info); |
2286 DecryptionCBMap::iterator found = pending_decryption_cbs_.find( | 2320 DecryptionCBMap::iterator found = pending_decryption_cbs_.find( |
2287 block_info->tracking_info.request_id); | 2321 block_info->tracking_info.request_id); |
2288 if (found == pending_decryption_cbs_.end()) | 2322 if (found == pending_decryption_cbs_.end()) |
2289 return; | 2323 return; |
2290 media::Decryptor::DecryptCB decrypt_cb = found->second; | 2324 media::Decryptor::DecryptCB decrypt_cb = found->second; |
2291 pending_decryption_cbs_.erase(found); | 2325 pending_decryption_cbs_.erase(found); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2708 screen_size_for_fullscreen_ = gfx::Size(); | 2742 screen_size_for_fullscreen_ = gfx::Size(); |
2709 WebElement element = container_->element(); | 2743 WebElement element = container_->element(); |
2710 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); | 2744 element.setAttribute(WebString::fromUTF8(kWidth), width_before_fullscreen_); |
2711 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); | 2745 element.setAttribute(WebString::fromUTF8(kHeight), height_before_fullscreen_); |
2712 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); | 2746 element.setAttribute(WebString::fromUTF8(kBorder), border_before_fullscreen_); |
2713 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); | 2747 element.setAttribute(WebString::fromUTF8(kStyle), style_before_fullscreen_); |
2714 } | 2748 } |
2715 | 2749 |
2716 } // namespace ppapi | 2750 } // namespace ppapi |
2717 } // namespace webkit | 2751 } // namespace webkit |
OLD | NEW |