| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 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 | 13 |
| 14 static const char kClearKeyCdmVersion[] = "0.1.0.0"; | 14 static const char kClearKeyCdmVersion[] = "0.1.0.0"; |
| 15 | 15 |
| 16 static scoped_refptr<media::DecoderBuffer> CopyDecoderBufferFrom( | 16 static scoped_refptr<media::DecoderBuffer> CopyDecoderBufferFrom( |
| 17 const cdm::InputBuffer& input_buffer) { | 17 const cdm::InputBuffer& input_buffer) { |
| 18 DCHECK(input_buffer.data); |
| 18 // TODO(tomfinegan): Get rid of this copy. | 19 // TODO(tomfinegan): Get rid of this copy. |
| 19 scoped_refptr<media::DecoderBuffer> output_buffer = | 20 scoped_refptr<media::DecoderBuffer> output_buffer = |
| 20 media::DecoderBuffer::CopyFrom(input_buffer.data, input_buffer.data_size); | 21 media::DecoderBuffer::CopyFrom(input_buffer.data, input_buffer.data_size); |
| 21 | 22 |
| 22 std::vector<media::SubsampleEntry> subsamples; | 23 std::vector<media::SubsampleEntry> subsamples; |
| 23 for (int32_t i = 0; i < input_buffer.num_subsamples; ++i) { | 24 for (int32_t i = 0; i < input_buffer.num_subsamples; ++i) { |
| 24 media::SubsampleEntry subsample; | 25 media::SubsampleEntry subsample; |
| 25 subsample.clear_bytes = input_buffer.subsamples[i].clear_bytes; | 26 subsample.clear_bytes = input_buffer.subsamples[i].clear_bytes; |
| 26 subsample.cypher_bytes = input_buffer.subsamples[i].cipher_bytes; | 27 subsample.cypher_bytes = input_buffer.subsamples[i].cipher_bytes; |
| 27 subsamples.push_back(subsample); | 28 subsamples.push_back(subsample); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 } | 249 } |
| 249 | 250 |
| 250 cdm::Status ClearKeyCdm::DecryptAndDecodeFrame( | 251 cdm::Status ClearKeyCdm::DecryptAndDecodeFrame( |
| 251 const cdm::InputBuffer& encrypted_buffer, | 252 const cdm::InputBuffer& encrypted_buffer, |
| 252 cdm::VideoFrame* video_frame) { | 253 cdm::VideoFrame* video_frame) { |
| 253 NOTIMPLEMENTED(); | 254 NOTIMPLEMENTED(); |
| 254 return cdm::kDecryptError; | 255 return cdm::kDecryptError; |
| 255 } | 256 } |
| 256 | 257 |
| 257 } // namespace webkit_media | 258 } // namespace webkit_media |
| OLD | NEW |