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

Side by Side Diff: media/gpu/gpu_video_decode_accelerator_factory.cc

Issue 2398883002: Add support for multiple V4L2 video devices of the same type. (Closed)
Patch Set: comments addressed Created 4 years, 2 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "media/gpu/gpu_video_decode_accelerator_factory.h" 5 #include "media/gpu/gpu_video_decode_accelerator_factory.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "gpu/command_buffer/service/gpu_preferences.h" 8 #include "gpu/command_buffer/service/gpu_preferences.h"
9 #include "media/gpu/gpu_video_accelerator_util.h" 9 #include "media/gpu/gpu_video_accelerator_util.h"
10 #include "media/gpu/media_gpu_export.h" 10 #include "media/gpu/media_gpu_export.h"
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 return decoder; 168 return decoder;
169 } 169 }
170 #endif 170 #endif
171 171
172 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC) 172 #if defined(OS_CHROMEOS) && defined(USE_V4L2_CODEC)
173 std::unique_ptr<VideoDecodeAccelerator> 173 std::unique_ptr<VideoDecodeAccelerator>
174 GpuVideoDecodeAcceleratorFactory::CreateV4L2VDA( 174 GpuVideoDecodeAcceleratorFactory::CreateV4L2VDA(
175 const gpu::GpuDriverBugWorkarounds& workarounds, 175 const gpu::GpuDriverBugWorkarounds& workarounds,
176 const gpu::GpuPreferences& gpu_preferences) const { 176 const gpu::GpuPreferences& gpu_preferences) const {
177 std::unique_ptr<VideoDecodeAccelerator> decoder; 177 std::unique_ptr<VideoDecodeAccelerator> decoder;
178 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 178 scoped_refptr<V4L2Device> device = V4L2Device::Create();
179 if (device.get()) { 179 if (device.get()) {
180 decoder.reset(new V4L2VideoDecodeAccelerator( 180 decoder.reset(new V4L2VideoDecodeAccelerator(
181 gl::GLSurfaceEGL::GetHardwareDisplay(), get_gl_context_cb_, 181 gl::GLSurfaceEGL::GetHardwareDisplay(), get_gl_context_cb_,
182 make_context_current_cb_, device)); 182 make_context_current_cb_, device));
183 } 183 }
184 return decoder; 184 return decoder;
185 } 185 }
186 186
187 std::unique_ptr<VideoDecodeAccelerator> 187 std::unique_ptr<VideoDecodeAccelerator>
188 GpuVideoDecodeAcceleratorFactory::CreateV4L2SVDA( 188 GpuVideoDecodeAcceleratorFactory::CreateV4L2SVDA(
189 const gpu::GpuDriverBugWorkarounds& workarounds, 189 const gpu::GpuDriverBugWorkarounds& workarounds,
190 const gpu::GpuPreferences& gpu_preferences) const { 190 const gpu::GpuPreferences& gpu_preferences) const {
191 std::unique_ptr<VideoDecodeAccelerator> decoder; 191 std::unique_ptr<VideoDecodeAccelerator> decoder;
192 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 192 scoped_refptr<V4L2Device> device = V4L2Device::Create();
193 if (device.get()) { 193 if (device.get()) {
194 decoder.reset(new V4L2SliceVideoDecodeAccelerator( 194 decoder.reset(new V4L2SliceVideoDecodeAccelerator(
195 device, gl::GLSurfaceEGL::GetHardwareDisplay(), get_gl_context_cb_, 195 device, gl::GLSurfaceEGL::GetHardwareDisplay(), get_gl_context_cb_,
196 make_context_current_cb_)); 196 make_context_current_cb_));
197 } 197 }
198 return decoder; 198 return decoder;
199 } 199 }
200 #endif 200 #endif
201 201
202 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 202 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY)
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 const BindGLImageCallback& bind_image_cb, 241 const BindGLImageCallback& bind_image_cb,
242 const GetGLES2DecoderCallback& get_gles2_decoder_cb) 242 const GetGLES2DecoderCallback& get_gles2_decoder_cb)
243 : get_gl_context_cb_(get_gl_context_cb), 243 : get_gl_context_cb_(get_gl_context_cb),
244 make_context_current_cb_(make_context_current_cb), 244 make_context_current_cb_(make_context_current_cb),
245 bind_image_cb_(bind_image_cb), 245 bind_image_cb_(bind_image_cb),
246 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} 246 get_gles2_decoder_cb_(get_gles2_decoder_cb) {}
247 247
248 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} 248 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {}
249 249
250 } // namespace media 250 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698