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 <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 25 matching lines...) Expand all Loading... |
36 | 36 |
37 namespace content { | 37 namespace content { |
38 | 38 |
39 namespace { | 39 namespace { |
40 const char kDecoderDevice[] = "/dev/video-dec"; | 40 const char kDecoderDevice[] = "/dev/video-dec"; |
41 const char kEncoderDevice[] = "/dev/video-enc"; | 41 const char kEncoderDevice[] = "/dev/video-enc"; |
42 const char kImageProcessorDevice[] = "/dev/gsc0"; | 42 const char kImageProcessorDevice[] = "/dev/gsc0"; |
43 } | 43 } |
44 | 44 |
45 GenericV4L2Device::GenericV4L2Device(Type type) | 45 GenericV4L2Device::GenericV4L2Device(Type type) |
46 : type_(type), | 46 : V4L2Device(type), |
47 device_fd_(-1), | 47 device_fd_(-1), |
48 device_poll_interrupt_fd_(-1) {} | 48 device_poll_interrupt_fd_(-1) {} |
49 | 49 |
50 GenericV4L2Device::~GenericV4L2Device() { | 50 GenericV4L2Device::~GenericV4L2Device() { |
51 if (device_poll_interrupt_fd_ != -1) { | 51 if (device_poll_interrupt_fd_ != -1) { |
52 close(device_poll_interrupt_fd_); | 52 close(device_poll_interrupt_fd_); |
53 device_poll_interrupt_fd_ = -1; | 53 device_poll_interrupt_fd_ = -1; |
54 } | 54 } |
55 if (device_fd_ != -1) { | 55 if (device_fd_ != -1) { |
56 v4l2_close(device_fd_); | 56 v4l2_close(device_fd_); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 StubPathMap paths; | 289 StubPathMap paths; |
290 paths[kModuleV4l2].push_back(kV4l2Lib); | 290 paths[kModuleV4l2].push_back(kV4l2Lib); |
291 | 291 |
292 return InitializeStubs(paths); | 292 return InitializeStubs(paths); |
293 #else | 293 #else |
294 return true; | 294 return true; |
295 #endif | 295 #endif |
296 } | 296 } |
297 | 297 |
298 } // namespace content | 298 } // namespace content |
OLD | NEW |