| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "media/capture/video/linux/v4l2_capture_delegate.h" | 5 #include "media/capture/video/linux/v4l2_capture_delegate.h" |
| 6 | 6 |
| 7 #include <linux/version.h> | 7 #include <linux/version.h> |
| 8 #include <linux/videodev2.h> | 8 #include <linux/videodev2.h> |
| 9 #include <poll.h> | 9 #include <poll.h> |
| 10 #include <sys/fcntl.h> | 10 #include <sys/fcntl.h> |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 612 v4l2_control white_balance_current = {}; | 612 v4l2_control white_balance_current = {}; |
| 613 white_balance_current.id = V4L2_CID_AUTO_WHITE_BALANCE; | 613 white_balance_current.id = V4L2_CID_AUTO_WHITE_BALANCE; |
| 614 if (HANDLE_EINTR(ioctl(device_fd_.get(), VIDIOC_G_CTRL, | 614 if (HANDLE_EINTR(ioctl(device_fd_.get(), VIDIOC_G_CTRL, |
| 615 &white_balance_current)) >= 0) { | 615 &white_balance_current)) >= 0) { |
| 616 photo_capabilities->current_white_balance_mode = | 616 photo_capabilities->current_white_balance_mode = |
| 617 white_balance_current.value ? MeteringMode::CONTINUOUS | 617 white_balance_current.value ? MeteringMode::CONTINUOUS |
| 618 : MeteringMode::MANUAL; | 618 : MeteringMode::MANUAL; |
| 619 } | 619 } |
| 620 | 620 |
| 621 photo_capabilities->iso = mojom::Range::New(); | 621 photo_capabilities->iso = mojom::Range::New(); |
| 622 photo_capabilities->height = mojom::Range::New(); | 622 photo_capabilities->height = mojom::Range::New( |
| 623 photo_capabilities->width = mojom::Range::New(); | 623 capture_format_.frame_size.height(), capture_format_.frame_size.height(), |
| 624 capture_format_.frame_size.height(), 0 /* step */); |
| 625 photo_capabilities->width = mojom::Range::New( |
| 626 capture_format_.frame_size.width(), capture_format_.frame_size.width(), |
| 627 capture_format_.frame_size.width(), 0 /* step */); |
| 624 photo_capabilities->exposure_compensation = mojom::Range::New(); | 628 photo_capabilities->exposure_compensation = mojom::Range::New(); |
| 625 photo_capabilities->red_eye_reduction = mojom::RedEyeReduction::NEVER; | 629 photo_capabilities->red_eye_reduction = mojom::RedEyeReduction::NEVER; |
| 626 photo_capabilities->torch = false; | 630 photo_capabilities->torch = false; |
| 627 | 631 |
| 628 photo_capabilities->brightness = | 632 photo_capabilities->brightness = |
| 629 RetrieveUserControlRange(device_fd_.get(), V4L2_CID_BRIGHTNESS); | 633 RetrieveUserControlRange(device_fd_.get(), V4L2_CID_BRIGHTNESS); |
| 630 photo_capabilities->contrast = | 634 photo_capabilities->contrast = |
| 631 RetrieveUserControlRange(device_fd_.get(), V4L2_CID_CONTRAST); | 635 RetrieveUserControlRange(device_fd_.get(), V4L2_CID_CONTRAST); |
| 632 photo_capabilities->saturation = | 636 photo_capabilities->saturation = |
| 633 RetrieveUserControlRange(device_fd_.get(), V4L2_CID_SATURATION); | 637 RetrieveUserControlRange(device_fd_.get(), V4L2_CID_SATURATION); |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 850 DLOG(ERROR) << "Error mmap()ing a V4L2 buffer into userspace"; | 854 DLOG(ERROR) << "Error mmap()ing a V4L2 buffer into userspace"; |
| 851 return false; | 855 return false; |
| 852 } | 856 } |
| 853 start_ = static_cast<uint8_t*>(start); | 857 start_ = static_cast<uint8_t*>(start); |
| 854 length_ = buffer.length; | 858 length_ = buffer.length; |
| 855 payload_size_ = 0; | 859 payload_size_ = 0; |
| 856 return true; | 860 return true; |
| 857 } | 861 } |
| 858 | 862 |
| 859 } // namespace media | 863 } // namespace media |
| OLD | NEW |