| 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 "content/common/gpu/media/gpu_video_decode_accelerator.h" | 5 #include "content/common/gpu/media/gpu_video_decode_accelerator.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 485 } | 485 } |
| 486 | 486 |
| 487 void GpuVideoDecodeAccelerator::OnSetCdm(int cdm_id) { | 487 void GpuVideoDecodeAccelerator::OnSetCdm(int cdm_id) { |
| 488 DCHECK(video_decode_accelerator_); | 488 DCHECK(video_decode_accelerator_); |
| 489 video_decode_accelerator_->SetCdm(cdm_id); | 489 video_decode_accelerator_->SetCdm(cdm_id); |
| 490 } | 490 } |
| 491 | 491 |
| 492 // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is | 492 // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is |
| 493 // true, otherwise on the main thread. | 493 // true, otherwise on the main thread. |
| 494 void GpuVideoDecodeAccelerator::OnDecode( | 494 void GpuVideoDecodeAccelerator::OnDecode( |
| 495 const AcceleratedVideoDecoderMsg_Decode_Params& params) { | 495 const media::BitstreamBuffer& bitstream_buffer) { |
| 496 DCHECK(video_decode_accelerator_); | 496 DCHECK(video_decode_accelerator_); |
| 497 media::BitstreamBuffer bitstream_buffer(params.bitstream_buffer_id, | |
| 498 params.buffer_handle, params.size, | |
| 499 params.presentation_timestamp); | |
| 500 if (!params.key_id.empty()) { | |
| 501 bitstream_buffer.SetDecryptConfig( | |
| 502 media::DecryptConfig(params.key_id, params.iv, params.subsamples)); | |
| 503 } | |
| 504 | |
| 505 video_decode_accelerator_->Decode(bitstream_buffer); | 497 video_decode_accelerator_->Decode(bitstream_buffer); |
| 506 } | 498 } |
| 507 | 499 |
| 508 void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( | 500 void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( |
| 509 const std::vector<int32_t>& buffer_ids, | 501 const std::vector<int32_t>& buffer_ids, |
| 510 const std::vector<uint32_t>& texture_ids) { | 502 const std::vector<uint32_t>& texture_ids) { |
| 511 if (buffer_ids.size() != texture_ids.size()) { | 503 if (buffer_ids.size() != texture_ids.size()) { |
| 512 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); | 504 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); |
| 513 return; | 505 return; |
| 514 } | 506 } |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 uncleared_textures_.erase(it); | 614 uncleared_textures_.erase(it); |
| 623 } | 615 } |
| 624 | 616 |
| 625 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, | 617 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, |
| 626 bool succeeded) { | 618 bool succeeded) { |
| 627 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); | 619 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); |
| 628 Send(message); | 620 Send(message); |
| 629 } | 621 } |
| 630 | 622 |
| 631 } // namespace content | 623 } // namespace content |
| OLD | NEW |