Skip to content

Commit

Permalink
Send correct video timestamps from the Pepper CDM video decoder.
Browse files Browse the repository at this point in the history
CdmWrapper was using the input timestamp for the output timestamp in
DeliverFrame().

The video decoder now copies the output timestamp from FFmpeg to the
cdm::VideoFrame it populates, and DeliverFrame() uses the timestamp
stored in the in cdm::VideoFrame.

TEST=Encrypted MP4 video plays using the External Clear Key decoder.


Review URL: https://chromiumcodereview.appspot.com/11342030

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164855 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tomfinegan@chromium.org committed Oct 30, 2012
1 parent 9fd3acb commit 749576f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 3 additions & 4 deletions webkit/media/crypto/ppapi/cdm_wrapper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,7 @@ void CdmWrapper::DeliverFrame(
const PP_DecryptTrackingInfo& tracking_info) {
PP_DCHECK(result == PP_OK);
PP_DecryptedFrameInfo decrypted_frame_info;
decrypted_frame_info.tracking_info = tracking_info;
decrypted_frame_info.tracking_info.request_id = tracking_info.request_id;
decrypted_frame_info.result = CdmStatusToPpDecryptResult(status);

pp::Buffer_Dev buffer;
Expand All @@ -910,6 +910,7 @@ void CdmWrapper::DeliverFrame(
} else {
buffer = static_cast<PpbBuffer*>(
video_frame->frame_buffer())->buffer_dev();
decrypted_frame_info.tracking_info.timestamp = video_frame->timestamp();
decrypted_frame_info.width = video_frame->size().width;
decrypted_frame_info.height = video_frame->size().height;
decrypted_frame_info.plane_offsets[PP_DECRYPTEDFRAMEPLANES_Y] =
Expand All @@ -935,11 +936,9 @@ void CdmWrapper::DeliverSamples(int32_t result,
const LinkedAudioFrames& audio_frames,
const PP_DecryptTrackingInfo& tracking_info) {
PP_DCHECK(result == PP_OK);
// TODO(tomfinegan): Add PP_DecryptedSamplesInfo (or better name) for
// cdm::AudioFrames.

PP_DecryptedBlockInfo decrypted_block_info;
decrypted_block_info.tracking_info = tracking_info;
// TODO(tomfinegan): Remove this after PP_DecryptedSamplesInfo is added.
decrypted_block_info.tracking_info.timestamp = 0;
decrypted_block_info.result = CdmStatusToPpDecryptResult(status);

Expand Down
2 changes: 2 additions & 0 deletions webkit/media/crypto/ppapi/ffmpeg_cdm_video_decoder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,8 @@ bool FFmpegCdmVideoDecoder::CopyAvFrameTo(cdm::VideoFrame* cdm_video_frame) {
cdm_video_frame->set_stride(cdm::VideoFrame::kUPlane, uv_stride);
cdm_video_frame->set_stride(cdm::VideoFrame::kVPlane, uv_stride);

cdm_video_frame->set_timestamp(av_frame_->reordered_opaque);

return true;
}

Expand Down

0 comments on commit 749576f

Please sign in to comment.