| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 320 | 321 |
| 321 static unsigned char color = 0; | 322 static unsigned char color = 0; |
| 322 color += 10; | 323 color += 10; |
| 323 | 324 |
| 324 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), | 325 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), |
| 325 color, frame_size); | 326 color, frame_size); |
| 326 } | 327 } |
| 327 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER | 328 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER |
| 328 | 329 |
| 329 } // namespace webkit_media | 330 } // namespace webkit_media |
| OLD | NEW |