Index: webkit/media/crypto/ppapi_decryptor.cc |
diff --git a/webkit/media/crypto/ppapi_decryptor.cc b/webkit/media/crypto/ppapi_decryptor.cc |
index 9fecb8b533d6b9e88a9e04470961c66e6aede426..8a2d7a175240553b0c03779d1a27e2625a642e89 100644 |
--- a/webkit/media/crypto/ppapi_decryptor.cc |
+++ b/webkit/media/crypto/ppapi_decryptor.cc |
@@ -36,6 +36,7 @@ PpapiDecryptor::PpapiDecryptor( |
} |
PpapiDecryptor::~PpapiDecryptor() { |
+ cdm_plugin_->set_decrypt_client(NULL); |
} |
bool PpapiDecryptor::GenerateKeyRequest(const std::string& key_system, |
@@ -105,13 +106,13 @@ void PpapiDecryptor::Decrypt( |
} |
DVLOG(3) << "Decrypt() - stream_type: " << stream_type; |
- if (!cdm_plugin_->Decrypt(encrypted, decrypt_cb)) |
+ if (!cdm_plugin_->Decrypt(stream_type, encrypted, decrypt_cb)) |
decrypt_cb.Run(kError, NULL); |
} |
void PpapiDecryptor::CancelDecrypt(StreamType stream_type) { |
DVLOG(1) << "CancelDecrypt() - stream_type: " << stream_type; |
- // TODO(xhwang): Implement CancelDecrypt() in PluginInstance and call it here. |
+ cdm_plugin_->CancelDecrypt(stream_type); |
} |
void PpapiDecryptor::InitializeAudioDecoder( |
@@ -130,19 +131,12 @@ void PpapiDecryptor::InitializeAudioDecoder( |
DCHECK(config->IsValidConfig()); |
audio_decoder_init_cb_ = init_cb; |
- // TODO(xhwang): Implement InitializeAudioDecoder() in PluginInstance and call |
- // it here. |
- NOTIMPLEMENTED(); |
-#if 0 |
if (!cdm_plugin_->InitializeAudioDecoder(*config, base::Bind( |
&PpapiDecryptor::OnDecoderInitialized, weak_this_, |
kAudio, key_added_cb))) { |
-#endif |
base::ResetAndReturn(&audio_decoder_init_cb_).Run(false); |
-#if 0 |
return; |
} |
-#endif |
} |
void PpapiDecryptor::InitializeVideoDecoder( |
@@ -180,11 +174,7 @@ void PpapiDecryptor::DecryptAndDecodeAudio( |
} |
DVLOG(1) << "DecryptAndDecodeAudio()"; |
- NOTIMPLEMENTED(); |
- // TODO(xhwang): Enable this once PluginInstance is updated. |
-#if 0 |
if (!cdm_plugin_->DecryptAndDecodeAudio(encrypted, audio_decode_cb)) |
-#endif |
audio_decode_cb.Run(kError, AudioBuffers()); |
} |
@@ -199,7 +189,7 @@ void PpapiDecryptor::DecryptAndDecodeVideo( |
} |
DVLOG(3) << "DecryptAndDecodeVideo()"; |
- if (!cdm_plugin_->DecryptAndDecode(encrypted, video_decode_cb)) |
+ if (!cdm_plugin_->DecryptAndDecodeVideo(encrypted, video_decode_cb)) |
video_decode_cb.Run(kError, NULL); |
} |
@@ -211,8 +201,7 @@ void PpapiDecryptor::ResetDecoder(StreamType stream_type) { |
} |
DVLOG(2) << "ResetDecoder() - stream_type: " << stream_type; |
- // TODO(xhwang): Support stream type in PluginInstance. |
- cdm_plugin_->ResetDecoder(); |
+ cdm_plugin_->ResetDecoder(stream_type); |
} |
void PpapiDecryptor::DeinitializeDecoder(StreamType stream_type) { |
@@ -222,8 +211,7 @@ void PpapiDecryptor::DeinitializeDecoder(StreamType stream_type) { |
return; |
} |
DVLOG(2) << "DeinitializeDecoder() - stream_type: " << stream_type; |
- // TODO(xhwang): Support stream type in PluginInstance. |
- cdm_plugin_->DeinitializeDecoder(); |
+ cdm_plugin_->DeinitializeDecoder(stream_type); |
} |
void PpapiDecryptor::ReportFailureToCallPlugin(const std::string& key_system, |