| 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 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 scoped_refptr<gpu::GpuChannelHost> channel = | 522 scoped_refptr<gpu::GpuChannelHost> channel = |
| 523 RenderThreadImpl::current()->EstablishGpuChannelSync( | 523 RenderThreadImpl::current()->EstablishGpuChannelSync( |
| 524 CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE); | 524 CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE); |
| 525 if (!channel) | 525 if (!channel) |
| 526 return false; | 526 return false; |
| 527 | 527 |
| 528 std::vector<int32_t> attribs(1, PP_GRAPHICS3DATTRIB_NONE); | 528 std::vector<int32_t> attribs(1, PP_GRAPHICS3DATTRIB_NONE); |
| 529 command_buffer_ = channel->CreateCommandBuffer( | 529 command_buffer_ = channel->CreateCommandBuffer( |
| 530 gpu::kNullSurfaceHandle, gfx::Size(), nullptr, gpu::GPU_STREAM_DEFAULT, | 530 gpu::kNullSurfaceHandle, gfx::Size(), nullptr, gpu::GPU_STREAM_DEFAULT, |
| 531 gpu::GpuStreamPriority::NORMAL, attribs, GURL::EmptyGURL(), | 531 gpu::GpuStreamPriority::NORMAL, attribs, GURL::EmptyGURL(), |
| 532 gfx::PreferIntegratedGpu); | 532 gfx::PreferIntegratedGpu, base::ThreadTaskRunnerHandle::Get()); |
| 533 if (!command_buffer_) { | 533 if (!command_buffer_) { |
| 534 Close(); | 534 Close(); |
| 535 return false; | 535 return false; |
| 536 } | 536 } |
| 537 | 537 |
| 538 command_buffer_->SetGpuControlClient(this); | 538 command_buffer_->SetGpuControlClient(this); |
| 539 | 539 |
| 540 return true; | 540 return true; |
| 541 } | 541 } |
| 542 | 542 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 } | 676 } |
| 677 | 677 |
| 678 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) { | 678 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) { |
| 679 DCHECK(RenderThreadImpl::current()); | 679 DCHECK(RenderThreadImpl::current()); |
| 680 DCHECK_GE(buffer_id, 0); | 680 DCHECK_GE(buffer_id, 0); |
| 681 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size())); | 681 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size())); |
| 682 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); | 682 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); |
| 683 } | 683 } |
| 684 | 684 |
| 685 } // namespace content | 685 } // namespace content |
| OLD | NEW |