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

Unified Diff: ppapi/proxy/ppp_content_decryptor_private_proxy.cc

Issue 11028087: Add decoder de-initialize and reset to the Pepper CDM API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments with the exception of renaming Deinit 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 6d8436f82aef039e2eb3dff953bb8a4bb031a8dd..415180d53f45210a605b067f535c354562dfadbc 100644
--- a/ppapi/proxy/ppp_content_decryptor_private_proxy.cc
+++ b/ppapi/proxy/ppp_content_decryptor_private_proxy.cc
@@ -238,6 +238,40 @@ void InitializeVideoDecoder(
}
+void DeinitializeDecoder(PP_Instance instance,
+ PP_DecryptorStreamType decoder_type,
+ uint32_t request_id) {
+ HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
+ if (!dispatcher) {
+ NOTREACHED();
+ return;
+ }
+
+ dispatcher->Send(
+ new PpapiMsg_PPPContentDecryptor_DeinitializeDecoder(
+ API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE,
+ instance,
+ decoder_type,
+ request_id));
+}
+
+void ResetDecoder(PP_Instance instance,
+ PP_DecryptorStreamType decoder_type,
+ uint32_t request_id) {
+ HostDispatcher* dispatcher = HostDispatcher::GetForInstance(instance);
+ if (!dispatcher) {
+ NOTREACHED();
+ return;
+ }
+
+ dispatcher->Send(
+ new PpapiMsg_PPPContentDecryptor_ResetDecoder(
+ API_ID_PPP_CONTENT_DECRYPTOR_PRIVATE,
+ instance,
+ decoder_type,
+ request_id));
+}
+
void DecryptAndDecodeFrame(
PP_Instance instance,
PP_Resource encrypted_frame,
@@ -278,6 +312,8 @@ static const PPP_ContentDecryptor_Private content_decryptor_interface = {
&CancelKeyRequest,
&Decrypt,
&InitializeVideoDecoder,
+ &DeinitializeDecoder,
+ &ResetDecoder,
&DecryptAndDecodeFrame
};
@@ -317,6 +353,10 @@ bool PPP_ContentDecryptor_Private_Proxy::OnMessageReceived(
OnMsgDecrypt)
IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_InitializeVideoDecoder,
OnMsgInitializeVideoDecoder)
+ IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DeinitializeDecoder,
+ OnMsgDeinitializeDecoder)
+ IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_ResetDecoder,
+ OnMsgResetDecoder)
IPC_MESSAGE_HANDLER(PpapiMsg_PPPContentDecryptor_DecryptAndDecodeFrame,
OnMsgDecryptAndDecodeFrame)
IPC_MESSAGE_UNHANDLED(handled = false)
@@ -406,6 +446,32 @@ void PPP_ContentDecryptor_Private_Proxy::OnMsgInitializeVideoDecoder(
}
}
+void PPP_ContentDecryptor_Private_Proxy::OnMsgDeinitializeDecoder(
+ PP_Instance instance,
+ PP_DecryptorStreamType decoder_type,
+ uint32_t request_id) {
+ if (ppp_decryptor_impl_) {
+ CallWhileUnlocked(
+ ppp_decryptor_impl_->DeinitializeDecoder,
+ instance,
+ decoder_type,
+ request_id);
+ }
+}
+
+void PPP_ContentDecryptor_Private_Proxy::OnMsgResetDecoder(
+ PP_Instance instance,
+ PP_DecryptorStreamType decoder_type,
+ uint32_t request_id) {
+ if (ppp_decryptor_impl_) {
+ CallWhileUnlocked(
+ ppp_decryptor_impl_->ResetDecoder,
+ instance,
+ decoder_type,
+ request_id);
+ }
+}
+
void PPP_ContentDecryptor_Private_Proxy::OnMsgDecryptAndDecodeFrame(
PP_Instance instance,
const PPPDecryptor_Buffer& encrypted_frame,
« no previous file with comments | « ppapi/proxy/ppp_content_decryptor_private_proxy.h ('k') | ppapi/thunk/ppb_content_decryptor_private_thunk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698