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

Side by Side Diff: webkit/media/crypto/ppapi/clear_key_cdm.cc

Issue 10899021: Add CDM video decoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
ddorwin 2012/08/29 17:33:49 FYI, we need to init FFmpeg when the plugin is loa
Tom Finegan 2012/08/30 17:09:23 Ok-- I'll finish up my decoder init and shutdown c
Tom Finegan 2012/09/27 22:16:24 FFmpegVideoDecoder calls av_register_all(). Not su
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "webkit/media/crypto/ppapi/clear_key_cdm.h" 5 #include "webkit/media/crypto/ppapi/clear_key_cdm.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/time.h" 11 #include "base/time.h"
12 #include "media/base/decoder_buffer.h" 12 #include "media/base/decoder_buffer.h"
13 #include "webkit/media/crypto/decoders/ffmpeg_video_decoder.h"
13 14
14 static const char kClearKeyCdmVersion[] = "0.1.0.0"; 15 static const char kClearKeyCdmVersion[] = "0.1.0.0";
15 16
16 static scoped_refptr<media::DecoderBuffer> CopyDecoderBufferFrom( 17 static scoped_refptr<media::DecoderBuffer> CopyDecoderBufferFrom(
17 const cdm::InputBuffer& input_buffer) { 18 const cdm::InputBuffer& input_buffer) {
18 scoped_refptr<media::DecoderBuffer> output_buffer = 19 scoped_refptr<media::DecoderBuffer> output_buffer =
19 media::DecoderBuffer::CopyFrom(input_buffer.data, input_buffer.data_size); 20 media::DecoderBuffer::CopyFrom(input_buffer.data, input_buffer.data_size);
20 21
21 std::vector<media::SubsampleEntry> subsamples; 22 std::vector<media::SubsampleEntry> subsamples;
22 for (uint32_t i = 0; i < input_buffer.num_subsamples; ++i) { 23 for (uint32_t i = 0; i < input_buffer.num_subsamples; ++i) {
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 return cdm::kErrorNoKey; 210 return cdm::kErrorNoKey;
210 211
211 DCHECK(buffer); 212 DCHECK(buffer);
212 int data_size = buffer->GetDataSize(); 213 int data_size = buffer->GetDataSize();
213 decrypted_buffer->data = AllocateAndCopy(buffer->GetData(), data_size); 214 decrypted_buffer->data = AllocateAndCopy(buffer->GetData(), data_size);
214 decrypted_buffer->data_size = data_size; 215 decrypted_buffer->data_size = data_size;
215 decrypted_buffer->timestamp = buffer->GetTimestamp().InMicroseconds(); 216 decrypted_buffer->timestamp = buffer->GetTimestamp().InMicroseconds();
216 return cdm::kSuccess; 217 return cdm::kSuccess;
217 } 218 }
218 219
220 cdm::Status ClearKeyCdm::InitializeVideoDecoder(
221 const cdm::VideoDecoderConfig& video_decoder_config) {
222 video_decoder_.reset(new webkit_media::FFmpegVideoDecoder);
223 //video_decoder_->Initialize();
224 return cdm::kErrorUnknown;
225 }
226
227 cdm::Status ClearKeyCdm::DecryptAndDecode(
228 const cdm::InputBuffer& encrypted_buffer,
229 cdm::VideoFrame* video_frame) {
230 return cdm::kErrorUnknown;
231 }
232
219 } // namespace webkit_media 233 } // namespace webkit_media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698