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

Side by Side Diff: content/common/gpu/media/generic_v4l2_device.cc

Issue 1125263005: MJPEG acceleration for V4L2 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix nit Created 5 years, 5 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
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/gpu/media/gpu_jpeg_decode_accelerator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 5
6 #include <fcntl.h> 6 #include <fcntl.h>
7 #include <libdrm/drm_fourcc.h> 7 #include <libdrm/drm_fourcc.h>
8 #include <linux/videodev2.h> 8 #include <linux/videodev2.h>
9 #include <poll.h> 9 #include <poll.h>
10 #include <sys/eventfd.h> 10 #include <sys/eventfd.h>
(...skipping 19 matching lines...) Expand all
30 static const base::FilePath::CharType kV4l2Lib[] = 30 static const base::FilePath::CharType kV4l2Lib[] =
31 FILE_PATH_LITERAL("/usr/lib/libv4l2.so"); 31 FILE_PATH_LITERAL("/usr/lib/libv4l2.so");
32 #endif 32 #endif
33 33
34 namespace content { 34 namespace content {
35 35
36 namespace { 36 namespace {
37 const char kDecoderDevice[] = "/dev/video-dec"; 37 const char kDecoderDevice[] = "/dev/video-dec";
38 const char kEncoderDevice[] = "/dev/video-enc"; 38 const char kEncoderDevice[] = "/dev/video-enc";
39 const char kImageProcessorDevice[] = "/dev/image-proc0"; 39 const char kImageProcessorDevice[] = "/dev/image-proc0";
40 const char kJpegDecoderDevice[] = "/dev/jpeg-dec";
40 } 41 }
41 42
42 GenericV4L2Device::GenericV4L2Device(Type type) 43 GenericV4L2Device::GenericV4L2Device(Type type)
43 : V4L2Device(type), 44 : V4L2Device(type),
44 use_libv4l2_(false) { 45 use_libv4l2_(false) {
45 } 46 }
46 47
47 GenericV4L2Device::~GenericV4L2Device() { 48 GenericV4L2Device::~GenericV4L2Device() {
48 #if defined(USE_LIBV4L2) 49 #if defined(USE_LIBV4L2)
49 if (use_libv4l2_ && device_fd_.is_valid()) 50 if (use_libv4l2_ && device_fd_.is_valid())
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 switch (type_) { 137 switch (type_) {
137 case kDecoder: 138 case kDecoder:
138 device_path = kDecoderDevice; 139 device_path = kDecoderDevice;
139 break; 140 break;
140 case kEncoder: 141 case kEncoder:
141 device_path = kEncoderDevice; 142 device_path = kEncoderDevice;
142 break; 143 break;
143 case kImageProcessor: 144 case kImageProcessor:
144 device_path = kImageProcessorDevice; 145 device_path = kImageProcessorDevice;
145 break; 146 break;
147 case kJpegDecoder:
148 device_path = kJpegDecoderDevice;
149 break;
146 } 150 }
147 151
148 DVLOG(2) << "Initialize(): opening device: " << device_path; 152 DVLOG(2) << "Initialize(): opening device: " << device_path;
149 // Open the video device. 153 // Open the video device.
150 device_fd_.reset( 154 device_fd_.reset(
151 HANDLE_EINTR(open(device_path, O_RDWR | O_NONBLOCK | O_CLOEXEC))); 155 HANDLE_EINTR(open(device_path, O_RDWR | O_NONBLOCK | O_CLOEXEC)));
152 if (!device_fd_.is_valid()) { 156 if (!device_fd_.is_valid()) {
153 return false; 157 return false;
154 } 158 }
155 #if defined(USE_LIBV4L2) 159 #if defined(USE_LIBV4L2)
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 StubPathMap paths; 295 StubPathMap paths;
292 paths[kModuleV4l2].push_back(kV4l2Lib); 296 paths[kModuleV4l2].push_back(kV4l2Lib);
293 297
294 return InitializeStubs(paths); 298 return InitializeStubs(paths);
295 #else 299 #else
296 return true; 300 return true;
297 #endif 301 #endif
298 } 302 }
299 303
300 } // namespace content 304 } // namespace content
OLDNEW
« no previous file with comments | « content/common/BUILD.gn ('k') | content/common/gpu/media/gpu_jpeg_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698