| 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" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 return cdm::kSessionError; | 276 return cdm::kSessionError; |
| 277 | 277 |
| 278 return cdm::kSuccess; | 278 return cdm::kSuccess; |
| 279 #elif defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER) | 279 #elif defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER) |
| 280 video_size_ = video_decoder_config.coded_size; | 280 video_size_ = video_decoder_config.coded_size; |
| 281 return cdm::kSuccess; | 281 return cdm::kSuccess; |
| 282 #else | 282 #else |
| 283 NOTIMPLEMENTED(); | 283 NOTIMPLEMENTED(); |
| 284 return cdm::kSessionError; | 284 return cdm::kSessionError; |
| 285 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER | 285 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER |
| 286 | |
| 287 } | 286 } |
| 288 | 287 |
| 289 void ClearKeyCdm::ResetDecoder(cdm::StreamType decoder_type) { | 288 void ClearKeyCdm::ResetDecoder(cdm::StreamType decoder_type) { |
| 290 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 289 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
| 291 DCHECK(decoder_type == cdm::kStreamTypeVideo); | 290 if (decoder_type == cdm::kStreamTypeVideo) |
| 292 video_decoder_->Reset(); | 291 video_decoder_->Reset(); |
| 293 #endif | 292 #endif |
| 294 } | 293 } |
| 295 | 294 |
| 296 void ClearKeyCdm::DeinitializeDecoder(cdm::StreamType decoder_type) { | 295 void ClearKeyCdm::DeinitializeDecoder(cdm::StreamType decoder_type) { |
| 297 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) | 296 #if defined(CLEAR_KEY_CDM_USE_FFMPEG_DECODER) |
| 298 DCHECK(decoder_type == cdm::kStreamTypeVideo); | 297 if (decoder_type == cdm::kStreamTypeVideo) |
| 299 video_decoder_->Deinitialize(); | 298 video_decoder_->Deinitialize(); |
| 300 #endif | 299 #endif |
| 301 } | 300 } |
| 302 | 301 |
| 303 cdm::Status ClearKeyCdm::DecryptAndDecodeFrame( | 302 cdm::Status ClearKeyCdm::DecryptAndDecodeFrame( |
| 304 const cdm::InputBuffer& encrypted_buffer, | 303 const cdm::InputBuffer& encrypted_buffer, |
| 305 cdm::VideoFrame* decoded_frame) { | 304 cdm::VideoFrame* decoded_frame) { |
| 306 DVLOG(1) << "DecryptAndDecodeFrame()"; | 305 DVLOG(1) << "DecryptAndDecodeFrame()"; |
| 307 | 306 |
| 308 scoped_refptr<media::DecoderBuffer> buffer; | 307 scoped_refptr<media::DecoderBuffer> buffer; |
| 309 cdm::Status status = DecryptToMediaDecoderBuffer(encrypted_buffer, &buffer); | 308 cdm::Status status = DecryptToMediaDecoderBuffer(encrypted_buffer, &buffer); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 static unsigned char color = 0; | 399 static unsigned char color = 0; |
| 401 color += 10; | 400 color += 10; |
| 402 | 401 |
| 403 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), | 402 memset(reinterpret_cast<void*>(video_frame->frame_buffer()->data()), |
| 404 color, frame_size); | 403 color, frame_size); |
| 405 } | 404 } |
| 406 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER | 405 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER |
| 407 | 406 |
| 408 cdm::Status ClearKeyCdm::DecryptAndDecodeSamples( | 407 cdm::Status ClearKeyCdm::DecryptAndDecodeSamples( |
| 409 const cdm::InputBuffer& encrypted_buffer, | 408 const cdm::InputBuffer& encrypted_buffer, |
| 410 cdm::Buffer* sample_buffer) { | 409 cdm::AudioFrames* audio_frames) { |
| 411 NOTIMPLEMENTED(); | 410 NOTIMPLEMENTED(); |
| 412 return cdm::kDecryptError; | 411 return cdm::kDecryptError; |
| 413 } | 412 } |
| 414 | 413 |
| 415 } // namespace webkit_media | 414 } // namespace webkit_media |
| OLD | NEW |