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

Unified Diff: ppapi/proxy/ppp_content_decryptor_private_proxy.cc

Issue 11087044: Generalize Pepper CDM API decrypt and decode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: ppapi/proxy/ppp_content_decryptor_private_proxy.cc
diff --git a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc
index 91d81154a4658efd8ce0901ac3c3f1e6683a7ff6..f8146a9c6c9843a309b962ee1d951dbc25911442 100644
--- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc
+++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc
@@ -185,31 +185,30 @@ void Decrypt(PP_Instance instance,
serialized_block_info));
}
-void DecryptAndDecodeFrame(
- PP_Instance instance,
- PP_Resource encrypted_frame,
- const PP_EncryptedVideoFrameInfo* encrypted_video_frame_info) {
+void DecryptAndDecode(PP_Instance instance,
+ PP_Resource encrypted_buffer,
+ const PP_EncryptedMediaInfo* encrypted_media_info) {
HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
if (!dispatcher) {
NOTREACHED();
return;
}
- if (!AddRefResourceForPlugin(dispatcher, encrypted_frame)) {
+ if (!AddRefResourceForPlugin(dispatcher, encrypted_buffer)) {
NOTREACHED();
return;
}
HostResource host_resource;
- host_resource.SetHostResource(instance, encrypted_frame);
+ host_resource.SetHostResource(instance, encrypted_buffer);
uint32_t size = 0;
- if (DescribeHostBufferResource(encrypted_frame, &size) == PP_FALSE)
+ if (DescribeHostBufferResource(encrypted_buffer, &size) == PP_FALSE)
return;
base::SharedMemoryHandle handle;
if (ShareHostBufferResourceToPlugin(dispatcher,
- encrypted_frame,
+ encrypted_buffer,
&handle) == PP_FALSE)
return;
@@ -218,16 +217,16 @@ void DecryptAndDecodeFrame(
buffer.handle = handle;
buffer.size = size;
- std::string serialized_frame_info;
- if (!SerializeBlockInfo(*encrypted_video_frame_info, &serialized_frame_info))
+ std::string serialized_media_info;
+ if (!SerializeBlockInfo(*encrypted_media_info, &serialized_media_info))
return;
dispatcher->Send(
- new PpapiMsg_PPPContentDecryptor_DecryptAndDecodeFrame(
+ new PpapiMsg_PPPContentDecryptor_DecryptAndDecode(
API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE,
instance,
buffer,
- serialized_frame_info));
+ serialized_media_info));
}
static const PPP_ContentDecryptor_Private content_decryptor_interface = {
@@ -235,7 +234,7 @@ static const PPP_ContentDecryptor_Private content_decryptor_interface = {
&AddKey,
&CancelKeyRequest,
&Decrypt,
- &DecryptAndDecodeFrame
+ &DecryptAndDecode
};
} // namespace
@@ -272,8 +271,8 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived(
OnMsgCancelKeyRequest)
IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_Decrypt,
OnMsgDecrypt)
- IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DecryptAndDecodeFrame,
- OnMsgDecryptAndDecodeFrame)
+ IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DecryptAndDecode,
+ OnMsgDecryptAndDecode)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
DCHECK(handled);
@@ -335,23 +334,23 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgDecrypt(
}
}
-void PPP_ContentDecryptor_Private_Proxy::OnMsgDecryptAndDecodeFrame(
+void PPP_ContentDecryptor_Private_Proxy::OnMsgDecryptAndDecode(
PP_Instance instance,
- const PPPDecryptor_Buffer& encrypted_frame,
- const std::string& serialized_frame_info) {
+ const PPPDecryptor_Buffer& encrypted_buffer,
+ const std::string& serialized_media_info) {
if (ppp_decryptor_impl_) {
PP_Resource plugin_resource =
- PPB_Buffer_Proxy::AddProxyResource(encrypted_frame.resource,
- encrypted_frame.handle,
- encrypted_frame.size);
- PP_EncryptedVideoFrameInfo frame_info;
- if (!DeserializeBlockInfo(serialized_frame_info, &frame_info))
+ PPB_Buffer_Proxy::AddProxyResource(encrypted_buffer.resource,
+ encrypted_buffer.handle,
+ encrypted_buffer.size);
+ PP_EncryptedMediaInfo media_info;
+ if (!DeserializeBlockInfo(serialized_media_info, &media_info))
return;
CallWhileUnlocked(
- ppp_decryptor_impl_->DecryptAndDecodeFrame,
+ ppp_decryptor_impl_->DecryptAndDecode,
instance,
plugin_resource,
- const_cast<const PP_EncryptedVideoFrameInfo*>(&frame_info));
+ const_cast<const PP_EncryptedMediaInfo*>(&media_info));
}
}

Powered by Google App Engine
This is Rietveld 408576698