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

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: Fixes for image processor. 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 =
179 V4L2Device::Create(V4L2Device::Type::kDecoder);
179 if (device.get()) { 180 if (device.get()) {
180 decoder.reset(new V4L2VideoDecodeAccelerator( 181 decoder.reset(new V4L2VideoDecodeAccelerator(
181 gl::GLSurfaceEGL::GetHardwareDisplay(), get_gl_context_cb_, 182 gl::GLSurfaceEGL::GetHardwareDisplay(), get_gl_context_cb_,
182 make_context_current_cb_, device)); 183 make_context_current_cb_, device));
183 } 184 }
184 return decoder; 185 return decoder;
185 } 186 }
186 187
187 std::unique_ptr<VideoDecodeAccelerator> 188 std::unique_ptr<VideoDecodeAccelerator>
188 GpuVideoDecodeAcceleratorFactory::CreateV4L2SVDA( 189 GpuVideoDecodeAcceleratorFactory::CreateV4L2SVDA(
189 const gpu::GpuDriverBugWorkarounds& workarounds, 190 const gpu::GpuDriverBugWorkarounds& workarounds,
190 const gpu::GpuPreferences& gpu_preferences) const { 191 const gpu::GpuPreferences& gpu_preferences) const {
191 std::unique_ptr<VideoDecodeAccelerator> decoder; 192 std::unique_ptr<VideoDecodeAccelerator> decoder;
192 scoped_refptr<V4L2Device> device = V4L2Device::Create(V4L2Device::kDecoder); 193 scoped_refptr<V4L2Device> device =
194 V4L2Device::Create(V4L2Device::Type::kDecoder);
193 if (device.get()) { 195 if (device.get()) {
194 decoder.reset(new V4L2SliceVideoDecodeAccelerator( 196 decoder.reset(new V4L2SliceVideoDecodeAccelerator(
195 device, gl::GLSurfaceEGL::GetHardwareDisplay(), get_gl_context_cb_, 197 device, gl::GLSurfaceEGL::GetHardwareDisplay(), get_gl_context_cb_,
196 make_context_current_cb_)); 198 make_context_current_cb_));
197 } 199 }
198 return decoder; 200 return decoder;
199 } 201 }
200 #endif 202 #endif
201 203
202 #if defined(OS_CHROMEOS) && defined(ARCH_CPU_X86_FAMILY) 204 #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, 243 const BindGLImageCallback& bind_image_cb,
242 const GetGLES2DecoderCallback& get_gles2_decoder_cb) 244 const GetGLES2DecoderCallback& get_gles2_decoder_cb)
243 : get_gl_context_cb_(get_gl_context_cb), 245 : get_gl_context_cb_(get_gl_context_cb),
244 make_context_current_cb_(make_context_current_cb), 246 make_context_current_cb_(make_context_current_cb),
245 bind_image_cb_(bind_image_cb), 247 bind_image_cb_(bind_image_cb),
246 get_gles2_decoder_cb_(get_gles2_decoder_cb) {} 248 get_gles2_decoder_cb_(get_gles2_decoder_cb) {}
247 249
248 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {} 250 GpuVideoDecodeAcceleratorFactory::~GpuVideoDecodeAcceleratorFactory() {}
249 251
250 } // namespace media 252 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698