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

Side by Side Diff: content/renderer/media/renderer_gpu_video_accelerator_factories.cc

Issue 795633005: Add VDA supported profile to GPUInfo. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/media/renderer_gpu_video_accelerator_factories.h" 5 #include "content/renderer/media/renderer_gpu_video_accelerator_factories.h"
6 6
7 #include <GLES2/gl2.h> 7 #include <GLES2/gl2.h>
8 #include <GLES2/gl2ext.h> 8 #include <GLES2/gl2ext.h>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
11 #include "content/child/child_thread_impl.h" 11 #include "content/child/child_thread_impl.h"
12 #include "content/common/gpu/client/context_provider_command_buffer.h" 12 #include "content/common/gpu/client/context_provider_command_buffer.h"
13 #include "content/common/gpu/client/gl_helper.h" 13 #include "content/common/gpu/client/gl_helper.h"
14 #include "content/common/gpu/client/gpu_channel_host.h" 14 #include "content/common/gpu/client/gpu_channel_host.h"
15 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h"
16 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" 15 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h"
16 #include "content/common/gpu/media/gpu_video_accelerator_util.h"
17 #include "content/renderer/render_thread_impl.h" 17 #include "content/renderer/render_thread_impl.h"
18 #include "gpu/command_buffer/client/gles2_implementation.h" 18 #include "gpu/command_buffer/client/gles2_implementation.h"
19 #include "media/video/video_decode_accelerator.h" 19 #include "media/video/video_decode_accelerator.h"
20 #include "media/video/video_encode_accelerator.h" 20 #include "media/video/video_encode_accelerator.h"
21 21
22 namespace content { 22 namespace content {
23 23
24 // static 24 // static
25 scoped_refptr<RendererGpuVideoAcceleratorFactories> 25 scoped_refptr<RendererGpuVideoAcceleratorFactories>
26 RendererGpuVideoAcceleratorFactories::Create( 26 RendererGpuVideoAcceleratorFactories::Create(
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 if (mem && !mem->Map(size)) 193 if (mem && !mem->Map(size))
194 return nullptr; 194 return nullptr;
195 return mem; 195 return mem;
196 } 196 }
197 197
198 scoped_refptr<base::SingleThreadTaskRunner> 198 scoped_refptr<base::SingleThreadTaskRunner>
199 RendererGpuVideoAcceleratorFactories::GetTaskRunner() { 199 RendererGpuVideoAcceleratorFactories::GetTaskRunner() {
200 return task_runner_; 200 return task_runner_;
201 } 201 }
202 202
203 std::vector<media::VideoEncodeAccelerator::SupportedProfile> 203 bool RendererGpuVideoAcceleratorFactories::
204 RendererGpuVideoAcceleratorFactories:: 204 GetVideoDecodeAcceleratorSupportedProfiles(std::vector<
205 GetVideoEncodeAcceleratorSupportedProfiles() { 205 media::VideoDecodeAccelerator::SupportedProfile>* supported_profiles) {
206 return GpuVideoEncodeAcceleratorHost::ConvertGpuToMediaProfiles( 206 if (gpu_channel_host_->gpu_info().support_query_video_decode_profiles) {
207 gpu_channel_host_->gpu_info() 207 *supported_profiles =
208 .video_encode_accelerator_supported_profiles); 208 GpuVideoAcceleratorUtil::ConvertGpuToMediaDecodeProfiles(
209 gpu_channel_host_->gpu_info()
210 .video_decode_accelerator_supported_profiles);
211 }
212 return gpu_channel_host_->gpu_info().support_query_video_decode_profiles;
213 }
214
215 void RendererGpuVideoAcceleratorFactories::
216 GetVideoEncodeAcceleratorSupportedProfiles(std::vector<
217 media::VideoEncodeAccelerator::SupportedProfile>* supported_profiles) {
218 *supported_profiles =
219 GpuVideoAcceleratorUtil::ConvertGpuToMediaEncodeProfiles(
220 gpu_channel_host_->gpu_info()
221 .video_encode_accelerator_supported_profiles);
209 } 222 }
210 223
211 } // namespace content 224 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698