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

Unified Diff: webkit/media/crypto/ppapi/clear_key_cdm.cc

Issue 11929015: Tighten up media::DecoderBuffer API contract for end of stream buffers (round 2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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/clear_key_cdm.cc
diff --git a/webkit/media/crypto/ppapi/clear_key_cdm.cc b/webkit/media/crypto/ppapi/clear_key_cdm.cc
index 53af6fd1c7a31c9c2f0f7b68136369610bdb6fbc..7c6eda5fd68f01ea5a0eaa130515b2a5b09c4e8f 100644
--- a/webkit/media/crypto/ppapi/clear_key_cdm.cc
+++ b/webkit/media/crypto/ppapi/clear_key_cdm.cc
@@ -412,12 +412,16 @@ cdm::Status ClearKeyCdm::DecryptAndDecodeFrame(
if (status != cdm::kSuccess)
return status;
- DCHECK(status == cdm::kSuccess);
- DCHECK(buffer);
- return video_decoder_->DecodeFrame(buffer.get()->GetData(),
- buffer->GetDataSize(),
- encrypted_buffer.timestamp,
- decoded_frame);
+ const uint8_t* data = NULL;
+ int32_t size = 0;
+ int64_t timestamp = 0;
+ if (!buffer->IsEndOfStream()) {
+ data = buffer->GetData();
+ size = buffer->GetDataSize();
+ timestamp = encrypted_buffer.timestamp;
+ }
+
+ return video_decoder_->DecodeFrame(data, size, timestamp, decoded_frame);
}
cdm::Status ClearKeyCdm::DecryptAndDecodeSamples(
@@ -432,12 +436,16 @@ cdm::Status ClearKeyCdm::DecryptAndDecodeSamples(
return status;
#if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER)
- DCHECK(status == cdm::kSuccess);
- DCHECK(buffer);
- return audio_decoder_->DecodeBuffer(buffer.get()->GetData(),
- buffer->GetDataSize(),
- encrypted_buffer.timestamp,
- audio_frames);
+ const uint8_t* data = NULL;
+ int32_t size = 0;
+ int64_t timestamp = 0;
+ if (!buffer->IsEndOfStream()) {
+ data = buffer->GetData();
+ size = buffer->GetDataSize();
+ timestamp = encrypted_buffer.timestamp;
+ }
+
+ return audio_decoder_->DecodeBuffer(data, size, timestamp, audio_frames);
#elif defined(CLEAR_KEY_CDM_USE_FAKE_AUDIO_DECODER)
int64 timestamp_in_microseconds = kNoTimestamp;
if (!buffer->IsEndOfStream()) {

Powered by Google App Engine
This is Rietveld 408576698