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

Side by Side Diff: content/common/gpu/media/gpu_video_decode_accelerator.cc

Issue 1422643002: Pass DecryptConfig parameters over IPC and use it in AVDA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
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 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 profiles = VTVideoDecodeAccelerator::GetSupportedProfiles(); 424 profiles = VTVideoDecodeAccelerator::GetSupportedProfiles();
425 #elif defined(OS_ANDROID) 425 #elif defined(OS_ANDROID)
426 profiles = AndroidVideoDecodeAccelerator::GetSupportedProfiles(); 426 profiles = AndroidVideoDecodeAccelerator::GetSupportedProfiles();
427 #endif 427 #endif
428 return GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeProfiles(profiles); 428 return GpuVideoAcceleratorUtil::ConvertMediaToGpuDecodeProfiles(profiles);
429 } 429 }
430 430
431 // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is 431 // Runs on IO thread if video_decode_accelerator_->CanDecodeOnIOThread() is
432 // true, otherwise on the main thread. 432 // true, otherwise on the main thread.
433 void GpuVideoDecodeAccelerator::OnDecode( 433 void GpuVideoDecodeAccelerator::OnDecode(
434 base::SharedMemoryHandle handle, 434 const AcceleratedVideoDecoderMsg_Decode_Params& params) {
435 int32 id,
436 uint32 size,
437 base::TimeDelta presentation_timestamp) {
438 DCHECK(video_decode_accelerator_.get()); 435 DCHECK(video_decode_accelerator_.get());
439 if (id < 0) { 436 if (params.bitstream_buffer_id < 0) {
440 DLOG(ERROR) << "BitstreamBuffer id " << id << " out of range"; 437 DLOG(ERROR) << "BitstreamBuffer id " << params.bitstream_buffer_id
438 << " out of range";
441 if (child_task_runner_->BelongsToCurrentThread()) { 439 if (child_task_runner_->BelongsToCurrentThread()) {
442 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); 440 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT);
443 } else { 441 } else {
444 child_task_runner_->PostTask( 442 child_task_runner_->PostTask(
445 FROM_HERE, 443 FROM_HERE,
446 base::Bind(&GpuVideoDecodeAccelerator::NotifyError, 444 base::Bind(&GpuVideoDecodeAccelerator::NotifyError,
447 base::Unretained(this), 445 base::Unretained(this),
448 media::VideoDecodeAccelerator::INVALID_ARGUMENT)); 446 media::VideoDecodeAccelerator::INVALID_ARGUMENT));
449 } 447 }
450 return; 448 return;
451 } 449 }
452 video_decode_accelerator_->Decode( 450
453 media::BitstreamBuffer(id, handle, size, presentation_timestamp)); 451 media::BitstreamBuffer bitstream_buffer(params.bitstream_buffer_id,
452 params.buffer_handle, params.size,
453 params.presentation_timestamp);
454 if (!params.key_id.empty()) {
455 bitstream_buffer.SetDecryptParams(
456 media::DecryptConfig(params.key_id, params.iv, params.subsamples));
457 }
458
459 video_decode_accelerator_->Decode(bitstream_buffer);
454 } 460 }
455 461
456 void GpuVideoDecodeAccelerator::OnAssignPictureBuffers( 462 void GpuVideoDecodeAccelerator::OnAssignPictureBuffers(
457 const std::vector<int32>& buffer_ids, 463 const std::vector<int32>& buffer_ids,
458 const std::vector<uint32>& texture_ids) { 464 const std::vector<uint32>& texture_ids) {
459 if (buffer_ids.size() != texture_ids.size()) { 465 if (buffer_ids.size() != texture_ids.size()) {
460 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT); 466 NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT);
461 return; 467 return;
462 } 468 }
463 469
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 return stub_->channel()->Send(message); 624 return stub_->channel()->Send(message);
619 } 625 }
620 626
621 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message, 627 void GpuVideoDecodeAccelerator::SendCreateDecoderReply(IPC::Message* message,
622 bool succeeded) { 628 bool succeeded) {
623 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded); 629 GpuCommandBufferMsg_CreateVideoDecoder::WriteReplyParams(message, succeeded);
624 Send(message); 630 Send(message);
625 } 631 }
626 632
627 } // namespace content 633 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698