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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/memory/shared_memory.h" | 6 #include "base/memory/shared_memory.h" |
7 #include "base/numerics/safe_math.h" | 7 #include "base/numerics/safe_math.h" |
8 #include "content/common/gpu/client/command_buffer_proxy_impl.h" | 8 #include "content/common/gpu/client/command_buffer_proxy_impl.h" |
9 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h" | 9 #include "content/common/gpu/media/gpu_video_accelerator_util.h" |
10 #include "content/common/pepper_file_util.h" | 10 #include "content/common/pepper_file_util.h" |
11 #include "content/public/renderer/renderer_ppapi_host.h" | 11 #include "content/public/renderer/renderer_ppapi_host.h" |
12 #include "content/renderer/pepper/gfx_conversion.h" | 12 #include "content/renderer/pepper/gfx_conversion.h" |
13 #include "content/renderer/pepper/host_globals.h" | 13 #include "content/renderer/pepper/host_globals.h" |
14 #include "content/renderer/pepper/pepper_video_encoder_host.h" | 14 #include "content/renderer/pepper/pepper_video_encoder_host.h" |
15 #include "content/renderer/render_thread_impl.h" | 15 #include "content/renderer/render_thread_impl.h" |
16 #include "media/base/bind_to_current_loop.h" | 16 #include "media/base/bind_to_current_loop.h" |
17 #include "media/base/video_frame.h" | 17 #include "media/base/video_frame.h" |
18 #include "media/renderers/gpu_video_accelerator_factories.h" | 18 #include "media/renderers/gpu_video_accelerator_factories.h" |
19 #include "media/video/video_encode_accelerator.h" | 19 #include "media/video/video_encode_accelerator.h" |
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 } | 432 } |
433 | 433 |
434 void PepperVideoEncoderHost::GetSupportedProfiles( | 434 void PepperVideoEncoderHost::GetSupportedProfiles( |
435 std::vector<PP_VideoProfileDescription>* pp_profiles) { | 435 std::vector<PP_VideoProfileDescription>* pp_profiles) { |
436 DCHECK(RenderThreadImpl::current()); | 436 DCHECK(RenderThreadImpl::current()); |
437 | 437 |
438 if (!EnsureGpuChannel()) | 438 if (!EnsureGpuChannel()) |
439 return; | 439 return; |
440 | 440 |
441 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles = | 441 std::vector<media::VideoEncodeAccelerator::SupportedProfile> profiles = |
442 GpuVideoEncodeAcceleratorHost::ConvertGpuToMediaProfiles( | 442 GpuVideoAcceleratorUtil::ConvertGpuToMediaEncodeProfiles( |
443 channel_->gpu_info().video_encode_accelerator_supported_profiles); | 443 channel_->gpu_info().video_encode_accelerator_supported_profiles); |
444 for (media::VideoEncodeAccelerator::SupportedProfile profile : profiles) | 444 for (media::VideoEncodeAccelerator::SupportedProfile profile : profiles) |
445 pp_profiles->push_back(PP_FromVideoEncodeAcceleratorSupportedProfile( | 445 pp_profiles->push_back(PP_FromVideoEncodeAcceleratorSupportedProfile( |
446 profile, PP_HARDWAREACCELERATION_ONLY)); | 446 profile, PP_HARDWAREACCELERATION_ONLY)); |
447 | 447 |
448 // TODO(llandwerlin): add software supported profiles. | 448 // TODO(llandwerlin): add software supported profiles. |
449 } | 449 } |
450 | 450 |
451 bool PepperVideoEncoderHost::IsInitializationValid( | 451 bool PepperVideoEncoderHost::IsInitializationValid( |
452 const PP_Size& input_size, | 452 const PP_Size& input_size, |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
635 DCHECK(RenderThreadImpl::current()); | 635 DCHECK(RenderThreadImpl::current()); |
636 | 636 |
637 encoder_last_error_ = error; | 637 encoder_last_error_ = error; |
638 Close(); | 638 Close(); |
639 host()->SendUnsolicitedReply( | 639 host()->SendUnsolicitedReply( |
640 pp_resource(), | 640 pp_resource(), |
641 PpapiPluginMsg_VideoEncoder_NotifyError(encoder_last_error_)); | 641 PpapiPluginMsg_VideoEncoder_NotifyError(encoder_last_error_)); |
642 } | 642 } |
643 | 643 |
644 } // namespace content | 644 } // namespace content |
OLD | NEW |