| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 | 235 |
| 236 void PepperVideoEncoderHost::OnGpuControlLostContext() { | 236 void PepperVideoEncoderHost::OnGpuControlLostContext() { |
| 237 #if DCHECK_IS_ON() | 237 #if DCHECK_IS_ON() |
| 238 // This should never occur more than once. | 238 // This should never occur more than once. |
| 239 DCHECK(!lost_context_); | 239 DCHECK(!lost_context_); |
| 240 lost_context_ = true; | 240 lost_context_ = true; |
| 241 #endif | 241 #endif |
| 242 NotifyPepperError(PP_ERROR_RESOURCE_FAILED); | 242 NotifyPepperError(PP_ERROR_RESOURCE_FAILED); |
| 243 } | 243 } |
| 244 | 244 |
| 245 void PepperVideoEncoderHost::OnGpuControlLostContextMaybeReentrant() { |
| 246 // No internal state to update on lost context. |
| 247 } |
| 248 |
| 245 int32_t PepperVideoEncoderHost::OnHostMsgGetSupportedProfiles( | 249 int32_t PepperVideoEncoderHost::OnHostMsgGetSupportedProfiles( |
| 246 ppapi::host::HostMessageContext* context) { | 250 ppapi::host::HostMessageContext* context) { |
| 247 std::vector<PP_VideoProfileDescription> pp_profiles; | 251 std::vector<PP_VideoProfileDescription> pp_profiles; |
| 248 GetSupportedProfiles(&pp_profiles); | 252 GetSupportedProfiles(&pp_profiles); |
| 249 | 253 |
| 250 host()->SendReply( | 254 host()->SendReply( |
| 251 context->MakeReplyMessageContext(), | 255 context->MakeReplyMessageContext(), |
| 252 PpapiPluginMsg_VideoEncoder_GetSupportedProfilesReply(pp_profiles)); | 256 PpapiPluginMsg_VideoEncoder_GetSupportedProfilesReply(pp_profiles)); |
| 253 | 257 |
| 254 return PP_OK_COMPLETIONPENDING; | 258 return PP_OK_COMPLETIONPENDING; |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 } | 679 } |
| 676 | 680 |
| 677 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) { | 681 uint8_t* PepperVideoEncoderHost::ShmHandleToAddress(int32_t buffer_id) { |
| 678 DCHECK(RenderThreadImpl::current()); | 682 DCHECK(RenderThreadImpl::current()); |
| 679 DCHECK_GE(buffer_id, 0); | 683 DCHECK_GE(buffer_id, 0); |
| 680 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size())); | 684 DCHECK_LT(buffer_id, static_cast<int32_t>(shm_buffers_.size())); |
| 681 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); | 685 return static_cast<uint8_t*>(shm_buffers_[buffer_id]->shm->memory()); |
| 682 } | 686 } |
| 683 | 687 |
| 684 } // namespace content | 688 } // namespace content |
| OLD | NEW |