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" | 25 #include "content/common/gpu/media/v4l2_video_encode_accelerator.h" |
no sievers
2016/04/18 21:05:33
remove this since you added it up there
Mostyn Bramley-Moore
2016/04/18 21:47:01
Done.
| |
22 #include "media/base/bind_to_current_loop.h" | 26 #include "media/base/bind_to_current_loop.h" |
23 #include "media/base/bitstream_buffer.h" | 27 #include "media/base/bitstream_buffer.h" |
24 | 28 |
25 #define NOTIFY_ERROR(x) \ | 29 #define NOTIFY_ERROR(x) \ |
26 do { \ | 30 do { \ |
27 LOG(ERROR) << "Setting error state:" << x; \ | 31 LOG(ERROR) << "Setting error state:" << x; \ |
28 SetErrorState(x); \ | 32 SetErrorState(x); \ |
29 } while (0) | 33 } while (0) |
30 | 34 |
31 #define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_str) \ | 35 #define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_str) \ |
(...skipping 1210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1242 reqbufs.count = 0; | 1246 reqbufs.count = 0; |
1243 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; | 1247 reqbufs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE; |
1244 reqbufs.memory = V4L2_MEMORY_MMAP; | 1248 reqbufs.memory = V4L2_MEMORY_MMAP; |
1245 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); | 1249 IOCTL_OR_LOG_ERROR(VIDIOC_REQBUFS, &reqbufs); |
1246 | 1250 |
1247 output_buffer_map_.clear(); | 1251 output_buffer_map_.clear(); |
1248 free_output_buffers_.clear(); | 1252 free_output_buffers_.clear(); |
1249 } | 1253 } |
1250 | 1254 |
1251 } // namespace content | 1255 } // namespace content |
OLD | NEW |