OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/renderer/pepper/pepper_video_encoder_host.h" | 5 #include "content/renderer/pepper/pepper_video_encoder_host.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 scoped_refptr<gpu::GpuChannelHost> channel = | 523 scoped_refptr<gpu::GpuChannelHost> channel = |
524 RenderThreadImpl::current()->EstablishGpuChannelSync( | 524 RenderThreadImpl::current()->EstablishGpuChannelSync( |
525 CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE); | 525 CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE); |
526 if (!channel) | 526 if (!channel) |
527 return false; | 527 return false; |
528 | 528 |
529 command_buffer_ = gpu::CommandBufferProxyImpl::Create( | 529 command_buffer_ = gpu::CommandBufferProxyImpl::Create( |
530 std::move(channel), gpu::kNullSurfaceHandle, gfx::Size(), nullptr, | 530 std::move(channel), gpu::kNullSurfaceHandle, gfx::Size(), nullptr, |
531 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, | 531 gpu::GPU_STREAM_DEFAULT, gpu::GpuStreamPriority::NORMAL, |
532 gpu::gles2::ContextCreationAttribHelper(), GURL::EmptyGURL(), | 532 gpu::gles2::ContextCreationAttribHelper(), GURL::EmptyGURL(), |
533 gfx::PreferIntegratedGpu, base::ThreadTaskRunnerHandle::Get()); | 533 gl::PreferIntegratedGpu, base::ThreadTaskRunnerHandle::Get()); |
534 if (!command_buffer_) { | 534 if (!command_buffer_) { |
535 Close(); | 535 Close(); |
536 return false; | 536 return false; |
537 } | 537 } |
538 | 538 |
539 command_buffer_->SetGpuControlClient(this); | 539 command_buffer_->SetGpuControlClient(this); |
540 | 540 |
541 return true; | 541 return true; |
542 } | 542 } |
543 | 543 |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 } | 677 } |
678 | 678 |
679 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) { | 679 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) { |
680 DCHECK(RenderThreadImpl::current()); | 680 DCHECK(RenderThreadImpl::current()); |
681 DCHECK_GE(buffer_id, 0); | 681 DCHECK_GE(buffer_id, 0); |
682 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size())); | 682 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size())); |
683 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); | 683 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); |
684 } | 684 } |
685 | 685 |
686 } // namespace content | 686 } // namespace content |
OLD | NEW |