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 #include "content/common/gpu/media/v4l2_video_encode_accelerator.h" |
| 6 |
5 #include <fcntl.h> | 7 #include <fcntl.h> |
6 #include <linux/videodev2.h> | 8 #include <linux/videodev2.h> |
7 #include <poll.h> | 9 #include <poll.h> |
8 #include <string.h> | 10 #include <string.h> |
9 #include <sys/eventfd.h> | 11 #include <sys/eventfd.h> |
10 #include <sys/ioctl.h> | 12 #include <sys/ioctl.h> |
11 #include <sys/mman.h> | 13 #include <sys/mman.h> |
| 14 |
| 15 #include <memory> |
12 #include <utility> | 16 #include <utility> |
13 | 17 |
14 #include "base/callback.h" | 18 #include "base/callback.h" |
15 #include "base/command_line.h" | 19 #include "base/command_line.h" |
16 #include "base/macros.h" | 20 #include "base/macros.h" |
17 #include "base/numerics/safe_conversions.h" | 21 #include "base/numerics/safe_conversions.h" |
18 #include "base/thread_task_runner_handle.h" | 22 #include "base/thread_task_runner_handle.h" |
19 #include "base/trace_event/trace_event.h" | 23 #include "base/trace_event/trace_event.h" |
20 #include "content/common/gpu/media/shared_memory_region.h" | 24 #include "content/common/gpu/media/shared_memory_region.h" |
21 #include "content/common/gpu/media/v4l2_video_encode_accelerator.h" | |
22 #include "media/base/bind_to_current_loop.h" | 25 #include "media/base/bind_to_current_loop.h" |
23 #include "media/base/bitstream_buffer.h" | 26 #include "media/base/bitstream_buffer.h" |
24 | 27 |
25 #define NOTIFY_ERROR(x) \ | 28 #define NOTIFY_ERROR(x) \ |
26 do { \ | 29 do { \ |
27 LOG(ERROR) << "Setting error state:" << x; \ | 30 LOG(ERROR) << "Setting error state:" << x; \ |
28 SetErrorState(x); \ | 31 SetErrorState(x); \ |
29 } while (0) | 32 } while (0) |
30 | 33 |
31 #define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_str) \ | 34 #define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_str) \ |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 reqbufs.count = 0; | 1244 reqbufs.count = 0; |
1242 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; | 1245 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; |
1243 reqbufs.memory = V4L2_MEMORY_MMAP; | 1246 reqbufs.memory = V4L2_MEMORY_MMAP; |
1244 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); | 1247 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); |
1245 | 1248 |
1246 output_buffer_map_.clear(); | 1249 output_buffer_map_.clear(); |
1247 free_output_buffers_.clear(); | 1250 free_output_buffers_.clear(); |
1248 } | 1251 } |
1249 | 1252 |
1250 } // namespace content | 1253 } // namespace content |
OLD | NEW |