New issue
Advanced search Search tips

Issue 728860 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 3
Type: Bug



Sign in to add a comment

Mac camera startup error messages not reaching log

Project Member Reported by chfremer@chromium.org, Jun 1 2017

Issue description

When starting video capture on Mac OS fails, an error message is sent out and eventually gets logged in the WebRTC logs via [2]. However, this log message is fairly generic and we would like to get a more detailed error description.

Even though more detailed error strings are generated inside VideoCaptureDeviceAVFoundation::setCaptureDevice(), see [3], they do not arrive at the WebRTC logs.

[1] https://cs.chromium.org/chromium/src/media/capture/video/mac/video_capture_device_mac.mm?q=video_capture_device_mac.mm&dr&l=325
[2] https://cs.chromium.org/chromium/src/content/browser/renderer_host/media/media_stream_manager.cc?type=cs&q=AddLogMessageOnIOThread&l=1447
[3] https://cs.chromium.org/chromium/src/media/capture/video/mac/video_capture_device_avfoundation_mac.mm?dr=C&l=243
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jun 6 2017

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

commit 8aa0f3df4a5f4adad0bff5b47da58f14d1bb6e23
Author: Christian Fremerey <chfremer@chromium.org>
Date: Tue Jun 06 19:19:53 2017

[Video Capture] Fix mac camera startup error messages not reaching log

The invocation of method VideoCaptureDeviceAVFoundation::setCaptureDevice(), 
see [1], has a design issue. The method returns a boolean flag indicating 
success vs. failure and the invoker aborts the capture session with an generic 
error message on failure. However, the method invocation itself also tries to 
(asynchronously) abort the capture session with a more detailed error message. 
Because it is sent asynchronously, the more detailed error message arrives only 
after the session has already been aborted and is discarded.

The proposed fix is to have the method produce the more detailed error string 
synchronously as an output parameter.


BUG= 728860 
TEST=
  content_browsertests --gtest_filter="VideoCaptureBrowserTest.*"

[1] https://cs.chromium.org/chromium/src/media/capture/video/mac/video_capture_device_mac.mm?q=video_capture_device_mac.mm&dr&l=324

Change-Id: I997f73fc36fd18377a8280d5f46e7900f9622504
Reviewed-on: https://chromium-review.googlesource.com/521691
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Reviewed-by: Miguel Casas <mcasas@chromium.org>
Cr-Commit-Position: refs/heads/master@{#477367}
[modify] https://crrev.com/8aa0f3df4a5f4adad0bff5b47da58f14d1bb6e23/media/capture/video/mac/video_capture_device_avfoundation_mac.h
[modify] https://crrev.com/8aa0f3df4a5f4adad0bff5b47da58f14d1bb6e23/media/capture/video/mac/video_capture_device_avfoundation_mac.mm
[modify] https://crrev.com/8aa0f3df4a5f4adad0bff5b47da58f14d1bb6e23/media/capture/video/mac/video_capture_device_mac.mm

Status: Fixed (was: Assigned)

Sign in to add a comment