Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(494)

Side by Side Diff: media/capture/video/linux/v4l2_capture_delegate.cc

Issue 2888613002: Image Capture: fill in PhotoCapabilities.{height,width} in Linux/CrOs/Mac (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | media/capture/video/mac/video_capture_device_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | media/capture/video/mac/video_capture_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698