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

Unified Diff: webkit/media/crypto/ppapi/cdm_wrapper.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: webkit/media/crypto/ppapi/cdm_wrapper.cc
diff --git a/webkit/media/crypto/ppapi/cdm_wrapper.cc b/webkit/media/crypto/ppapi/cdm_wrapper.cc
index 679abafc7ecbb2a8751313931f7a4f44002cfb4e..29a038b40140a9de977b03d4e0d9a7187520a7dc 100644
--- a/webkit/media/crypto/ppapi/cdm_wrapper.cc
+++ b/webkit/media/crypto/ppapi/cdm_wrapper.cc
@@ -378,9 +378,9 @@ class CdmWrapper : public pp::Instance,
virtual void Decrypt(
pp::Buffer_Dev encrypted_buffer,
const PP_EncryptedBlockInfo& encrypted_block_info) OVERRIDE;
- virtual void DecryptAndDecodeFrame(
+ virtual void DecryptAndDecode(
pp::Buffer_Dev encrypted_frame,
- const PP_EncryptedVideoFrameInfo& encrypted_video_frame_info) OVERRIDE;
+ const PP_EncryptedMediaInfo& encrypted_media_info) OVERRIDE;
private:
typedef linked_ptr<DecryptedBlockImpl> LinkedDecryptedBlock;
@@ -530,27 +530,33 @@ void CdmWrapper::Decrypt(pp::Buffer_Dev encrypted_buffer,
encrypted_block_info.tracking_info));
}
-void CdmWrapper::DecryptAndDecodeFrame(
+void CdmWrapper::DecryptAndDecode(
pp::Buffer_Dev encrypted_frame,
- const PP_EncryptedVideoFrameInfo& encrypted_video_frame_info) {
+ const PP_EncryptedMediaInfo& encrypted_media_info) {
PP_DCHECK(!encrypted_frame.is_null());
PP_DCHECK(cdm_);
cdm::InputBuffer input_buffer;
std::vector<cdm::SubsampleEntry> subsamples;
ConfigureInputBuffer(encrypted_frame,
- encrypted_video_frame_info.encryption_info,
+ encrypted_media_info.encryption_info,
&subsamples,
&input_buffer);
+ // TODO(tomfinegan): Remove this check when audio decoding is added.
+ if (encrypted_media_info.media_type == PP_STREAMTYPE_VIDEO) {
Ami GONE FROM CHROMIUM 2012/10/10 07:30:26 s/VIDEO/AUDIO/ but actually see below
Tom Finegan 2012/10/10 08:26:06 Done.
+ PP_DCHECK(false);
Ami GONE FROM CHROMIUM 2012/10/10 07:30:26 DCHECKs shouldn't be handled. I'd replace l547-550
Tom Finegan 2012/10/10 08:26:06 Done.
+ return;
+ }
+
LinkedVideoFrame video_frame(new VideoFrameImpl());
cdm::Status status = cdm_->DecryptAndDecodeFrame(input_buffer,
- video_frame.get());
+ video_frame.get());
CallOnMain(callback_factory_.NewCallback(
&CdmWrapper::DeliverFrame,
status,
video_frame,
- encrypted_video_frame_info.encryption_info.tracking_info));
+ encrypted_media_info.encryption_info.tracking_info));
}
void CdmWrapper::KeyAdded(int32_t result, const std::string& session_id) {
@@ -612,6 +618,7 @@ void CdmWrapper::DeliverFrame(
const cdm::Status& status,
const LinkedVideoFrame& video_frame,
const PP_DecryptTrackingInfo& tracking_info) {
+ PP_DCHECK(result == PP_OK);
PP_DecryptedFrameInfo decrypted_frame_info;
decrypted_frame_info.tracking_info = tracking_info;

Powered by Google App Engine
This is Rietveld 408576698