New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 647352 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Chrome
Pri: 3
Type: Bug

Blocked on:
issue 657323

Blocking:
issue 518807



Sign in to add a comment

Image Capture: implement GetPhotoCapabilities()/setPhotoOptions() for Linux/CrOs

Project Member Reported by mcasas@chromium.org, Sep 15 2016

Issue description

Linux's V4L2 API includes support for photo capabilities/
settings under the extended control API [1,2]. This includes,
e.g. Zoom, AutoFocus control etc.

The extra functionality was added in kernel 3.17 [3],
which is not supported in Trusty, and won't be until,
at least, 15.04 Vivid [4].

[1] https://linuxtv.org/downloads/v4l-dvb-apis/extended-controls.html#id-1.4.4.14.3
[2] https://linuxtv.org/downloads/v4l-dvb-apis/extended-controls.html#camera-controls
[3] https://linuxtv.org/downloads/v4l-dvb-apis/hist-v4l2.html#id-1.4.10.4.54
[4] https://en.wikipedia.org/wiki/Ubuntu_version_history#Table_of_versions
 

Comment 1 by mcasas@chromium.org, Sep 15 2016

Blockedon: -430105
Status: Started (was: Assigned)
Apologies, I must have jumped ahead of myself: the
Camera controls (zoom, autofocus, etc), are _not_
part of the extended controls, but of the basic ones
:P  -- so there's no need to wait for any new and
sophisticated kernel headers, what we have is more
than enough (support was added in ~2.6...).
Project Member

Comment 2 by bugdroid1@chromium.org, Sep 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f457dee66ba0bfe49b67dee35b9fb8f3ec4f17e3

commit f457dee66ba0bfe49b67dee35b9fb8f3ec4f17e3
Author: mcasas <mcasas@chromium.org>
Date: Thu Sep 22 01:27:21 2016

Image Capture Linux/CrOs: wire some capabilities set/get

This CL implements for Linux/Cros parts of the methods:
- VideoCaptureDeviceWin::GetPhotoCapabilities():
 zoom, autofocus on/off, autoexposure on/off, and
 auto whitebalance on/off
- VideoCaptureDeviceWin::SetPhotoOptions(): zoom

and adds a small VideoCaptureDeviceTest test case
to retrieve capabilities, enabled for Linux (should be
enabled for Android in another CL).

BUG= 647352 

Review-Url: https://codereview.chromium.org/2349693003
Cr-Commit-Position: refs/heads/master@{#420229}

[modify] https://crrev.com/f457dee66ba0bfe49b67dee35b9fb8f3ec4f17e3/media/capture/video/linux/v4l2_capture_delegate.cc
[modify] https://crrev.com/f457dee66ba0bfe49b67dee35b9fb8f3ec4f17e3/media/capture/video/linux/v4l2_capture_delegate.h
[modify] https://crrev.com/f457dee66ba0bfe49b67dee35b9fb8f3ec4f17e3/media/capture/video/linux/video_capture_device_linux.cc
[modify] https://crrev.com/f457dee66ba0bfe49b67dee35b9fb8f3ec4f17e3/media/capture/video/linux/video_capture_device_linux.h
[modify] https://crrev.com/f457dee66ba0bfe49b67dee35b9fb8f3ec4f17e3/media/capture/video/video_capture_device_unittest.cc

Project Member

Comment 3 by bugdroid1@chromium.org, Sep 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/8fe050afbc28a120f4322bc3f4fe05f5fcc62d76

commit 8fe050afbc28a120f4322bc3f4fe05f5fcc62d76
Author: grunell <grunell@chromium.org>
Date: Thu Sep 22 06:42:44 2016

Revert of Image Capture Linux/CrOs: wire some capabilities set/get (patchset #3 id:100001 of https://codereview.chromium.org/2349693003/ )

Reason for revert:
Broken WebRTC tests

VideoCaptureDeviceTests/VideoCaptureDeviceTest.CaptureWithSize/0
VideoCaptureDeviceTests/VideoCaptureDeviceTest.CaptureWithSize/1
VideoCaptureDeviceTest.GetPhotoCapabilities

on

https://build.chromium.org/p/chromium.webrtc/builders/Linux%20Tester
https://build.chromium.org/p/chromium.webrtc.fyi/builders/Linux%20Tester

Original issue's description:
> Image Capture Linux/CrOs: wire some capabilities set/get
>
> This CL implements for Linux/Cros parts of the methods:
> - VideoCaptureDeviceWin::GetPhotoCapabilities():
>  zoom, autofocus on/off, autoexposure on/off, and
>  auto whitebalance on/off
> - VideoCaptureDeviceWin::SetPhotoOptions(): zoom
>
> and adds a small VideoCaptureDeviceTest test case
> to retrieve capabilities, enabled for Linux (should be
> enabled for Android in another CL).
>
> BUG= 647352 
>
> Committed: https://crrev.com/f457dee66ba0bfe49b67dee35b9fb8f3ec4f17e3
> Cr-Commit-Position: refs/heads/master@{#420229}

TBR=xianglu@chromium.org,mcasas@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG= 647352 

Review-Url: https://codereview.chromium.org/2364543002
Cr-Commit-Position: refs/heads/master@{#420272}

[modify] https://crrev.com/8fe050afbc28a120f4322bc3f4fe05f5fcc62d76/media/capture/video/linux/v4l2_capture_delegate.cc
[modify] https://crrev.com/8fe050afbc28a120f4322bc3f4fe05f5fcc62d76/media/capture/video/linux/v4l2_capture_delegate.h
[modify] https://crrev.com/8fe050afbc28a120f4322bc3f4fe05f5fcc62d76/media/capture/video/linux/video_capture_device_linux.cc
[modify] https://crrev.com/8fe050afbc28a120f4322bc3f4fe05f5fcc62d76/media/capture/video/linux/video_capture_device_linux.h
[modify] https://crrev.com/8fe050afbc28a120f4322bc3f4fe05f5fcc62d76/media/capture/video/video_capture_device_unittest.cc

Comment 4 by mcasas@chromium.org, Sep 22 2016

#3: the error message was:

[154/160] FakeVideoCaptureDeviceCommandLineTest.FrameRate/3 (17 ms)
[ RUN      ] VideoCaptureDeviceTests/VideoCaptureDeviceTest.CaptureWithSize/0
../../media/capture/video/video_capture_device_unittest.cc:394: Failure
Mock function called more times than expected - returning directly.
    Function call: OnError(@0x7f5f4aec97b8 32-byte object <B5-17 7E-00 00-00 00-00 D0-1A 7E-00 00-00 00-00 22-01 00-00 00-00 00-00 23-5C 47-00 00-00 00-00>, @0x7f5f4aec9788 "VIDIOC_STREAMON failed")
         Expected: to be never called
           Actual: called once - over-saturated and active

So I guess the new GetPhotoCapabilities() implementation doesn't play
nice with the device.  Will add more logging and try relanding.
Project Member

Comment 5 by bugdroid1@chromium.org, Sep 22 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f5665dc8fa767fc1493e0549f4bd813e26d74dff

commit f5665dc8fa767fc1493e0549f4bd813e26d74dff
Author: mcasas <mcasas@chromium.org>
Date: Thu Sep 22 19:27:02 2016

VideoCaptureDeviceTest: improve error logging

Associated bug's #3 is a revert and got me thinking that we don't log
the error received in the VCDTest's MockVideoCaptureDeviceClient's, so
this CL adds a small ON_CALL for it.  The difference is that, e.g. in
the OpenInvalidDevice test case, we get an extra line with the error
origin, message and the OS/System error message, if any.

[ RUN      ] VideoCaptureDeviceTest.OpenInvalidDevice
[...]
[58186:1295:0922/102314:1087119696054855:ERROR:video_capture_device_unittest.cc(84)] AllocateAndStart@../../media/capture/video/mac/video_capture_device_mac.mm:326 Could not open capture device.: No such file or directory

BUG= 647352 

Review-Url: https://codereview.chromium.org/2359243002
Cr-Commit-Position: refs/heads/master@{#420423}

[modify] https://crrev.com/f5665dc8fa767fc1493e0549f4bd813e26d74dff/media/capture/video/video_capture_device_unittest.cc

Project Member

Comment 6 by bugdroid1@chromium.org, Sep 26 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ebcc9794508eb9a52a8fcee54b93a0794a61f6a8

commit ebcc9794508eb9a52a8fcee54b93a0794a61f6a8
Author: mcasas <mcasas@chromium.org>
Date: Mon Sep 26 23:08:11 2016

Reland: Image Capture Linux/CrOs: wire some capabilities set/get

The original CL was reverted due to some unit test
error in large bots.  An improved error logging was
introduced in https://crrev.com/2359243002, and this
CL adds more of that, plus waiting for the correct
photo-related event to happen -- as opposed to before,
where the test cases waited on WaitForCapturedFrame().

Original CL description -----------------------------------------------
Image Capture Linux/CrOs: wire some capabilities set/get

This CL implements for Linux/Cros parts of the methods:
- VideoCaptureDeviceWin::GetPhotoCapabilities():
 zoom, autofocus on/off, autoexposure on/off, and
 auto whitebalance on/off
- VideoCaptureDeviceWin::SetPhotoOptions(): zoom

and adds a small VideoCaptureDeviceTest test case
to retrieve capabilities, enabled for Linux (should be
enabled for Android in another CL).

BUG= 647352 

Review-Url: https://codereview.chromium.org/2362333002
Cr-Commit-Position: refs/heads/master@{#421031}

[modify] https://crrev.com/ebcc9794508eb9a52a8fcee54b93a0794a61f6a8/media/capture/video/android/java/src/org/chromium/media/VideoCaptureCamera2.java
[modify] https://crrev.com/ebcc9794508eb9a52a8fcee54b93a0794a61f6a8/media/capture/video/linux/v4l2_capture_delegate.cc
[modify] https://crrev.com/ebcc9794508eb9a52a8fcee54b93a0794a61f6a8/media/capture/video/linux/v4l2_capture_delegate.h
[modify] https://crrev.com/ebcc9794508eb9a52a8fcee54b93a0794a61f6a8/media/capture/video/linux/video_capture_device_linux.cc
[modify] https://crrev.com/ebcc9794508eb9a52a8fcee54b93a0794a61f6a8/media/capture/video/linux/video_capture_device_linux.h
[modify] https://crrev.com/ebcc9794508eb9a52a8fcee54b93a0794a61f6a8/media/capture/video/video_capture_device_unittest.cc

Cc: anatolid@chromium.org
Do you know what is the target milestone for this?

Comment 8 by mcasas@chromium.org, Oct 18 2016

Blocking: 518807
Blockedon: 657323
Components: -Blink>MediaStream>ImageCapture Blink>ImageCapture
Status: Fixed (was: Started)

Sign in to add a comment