OLD | NEW |
---|---|
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 "media/gpu/generic_v4l2_device.h" | 6 #include "media/gpu/generic_v4l2_device.h" |
7 | 7 |
8 #include <errno.h> | 8 #include <errno.h> |
9 #include <fcntl.h> | 9 #include <fcntl.h> |
10 #include <libdrm/drm_fourcc.h> | 10 #include <libdrm/drm_fourcc.h> |
(...skipping 30 matching lines...) Expand all Loading... | |
41 | 41 |
42 namespace media { | 42 namespace media { |
43 | 43 |
44 namespace { | 44 namespace { |
45 const char kDecoderDevice[] = "/dev/video-dec"; | 45 const char kDecoderDevice[] = "/dev/video-dec"; |
46 const char kEncoderDevice[] = "/dev/video-enc"; | 46 const char kEncoderDevice[] = "/dev/video-enc"; |
47 const char kImageProcessorDevice[] = "/dev/image-proc0"; | 47 const char kImageProcessorDevice[] = "/dev/image-proc0"; |
48 const char kJpegDecoderDevice[] = "/dev/jpeg-dec"; | 48 const char kJpegDecoderDevice[] = "/dev/jpeg-dec"; |
49 } | 49 } |
50 | 50 |
51 GenericV4L2Device::GenericV4L2Device(Type type) | 51 GenericV4L2Device::GenericV4L2Device(Type type) : V4L2Device(type) { |
52 : V4L2Device(type), use_libv4l2_(false) {} | 52 #if defined(USE_LIBV4L2) |
53 use_libvl2_ = false; | |
wuchengli
2016/07/15 13:16:06
s/use_libvl2_/use_libv4l2_/
Dirk Pranke
2016/07/15 19:10:07
Good catch, fixed.
| |
54 #endif | |
55 } | |
53 | 56 |
54 GenericV4L2Device::~GenericV4L2Device() { | 57 GenericV4L2Device::~GenericV4L2Device() { |
55 #if defined(USE_LIBV4L2) | 58 #if defined(USE_LIBV4L2) |
56 if (use_libv4l2_ && device_fd_.is_valid()) | 59 if (use_libv4l2_ && device_fd_.is_valid()) |
57 v4l2_close(device_fd_.release()); | 60 v4l2_close(device_fd_.release()); |
58 #endif | 61 #endif |
59 } | 62 } |
60 | 63 |
61 int GenericV4L2Device::Ioctl(int request, void* arg) { | 64 int GenericV4L2Device::Ioctl(int request, void* arg) { |
62 #if defined(USE_LIBV4L2) | 65 #if defined(USE_LIBV4L2) |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 StubPathMap paths; | 315 StubPathMap paths; |
313 paths[kModuleV4l2].push_back(kV4l2Lib); | 316 paths[kModuleV4l2].push_back(kV4l2Lib); |
314 | 317 |
315 return InitializeStubs(paths); | 318 return InitializeStubs(paths); |
316 #else | 319 #else |
317 return true; | 320 return true; |
318 #endif | 321 #endif |
319 } | 322 } |
320 | 323 |
321 } // namespace media | 324 } // namespace media |
OLD | NEW |