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 <errno.h> | 5 #include <errno.h> |
6 #include <fcntl.h> | 6 #include <fcntl.h> |
7 #include <linux/videodev2.h> | 7 #include <linux/videodev2.h> |
8 #include <poll.h> | 8 #include <poll.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include <sys/eventfd.h> | 10 #include <sys/eventfd.h> |
11 #include <sys/ioctl.h> | 11 #include <sys/ioctl.h> |
12 #include <sys/mman.h> | 12 #include <sys/mman.h> |
13 | 13 |
14 #include "base/bind.h" | 14 #include "base/bind.h" |
15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
16 #include "base/callback.h" | 16 #include "base/callback.h" |
17 #include "base/numerics/safe_conversions.h" | 17 #include "base/numerics/safe_conversions.h" |
18 #include "base/thread_task_runner_handle.h" | 18 #include "base/threading/thread_task_runner_handle.h" |
19 #include "media/gpu/v4l2_image_processor.h" | 19 #include "media/gpu/v4l2_image_processor.h" |
20 | 20 |
21 #define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_str) \ | 21 #define IOCTL_OR_ERROR_RETURN_VALUE(type, arg, value, type_str) \ |
22 do { \ | 22 do { \ |
23 if (device_->Ioctl(type, arg) != 0) { \ | 23 if (device_->Ioctl(type, arg) != 0) { \ |
24 PLOG(ERROR) << __func__ << "(): ioctl() failed: " << type_str; \ | 24 PLOG(ERROR) << __func__ << "(): ioctl() failed: " << type_str; \ |
25 return value; \ | 25 return value; \ |
26 } \ | 26 } \ |
27 } while (0) | 27 } while (0) |
28 | 28 |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 return true; | 713 return true; |
714 } | 714 } |
715 | 715 |
716 void V4L2ImageProcessor::FrameReady(const FrameReadyCB& cb, | 716 void V4L2ImageProcessor::FrameReady(const FrameReadyCB& cb, |
717 int output_buffer_index) { | 717 int output_buffer_index) { |
718 DCHECK(child_task_runner_->BelongsToCurrentThread()); | 718 DCHECK(child_task_runner_->BelongsToCurrentThread()); |
719 cb.Run(output_buffer_index); | 719 cb.Run(output_buffer_index); |
720 } | 720 } |
721 | 721 |
722 } // namespace media | 722 } // namespace media |
OLD | NEW |