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

Issue 885256 link

Starred by 3 users

Issue metadata

Status: Started
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

[Video Capture Service] Adding/removing virtual devices does not trigger MediaDevices.ondevicechange

Project Member Reported by chfremer@chromium.org, Sep 18

Issue description

Currently, the mechanism that monitors video capture devices is orthogonal to the video capture service. As a result, the adding or removing virtual devices to/from the video capture service currently does not trigger a MediaDevices.ondevicechange event on the JavaScript side.

We should find a way to trigger this event when adding or removing virtual devices, since JavaScript apps may naturally be looking for this event to trigger certain updates or actions.
 
Status: Started (was: Assigned)
CLs with a solution for this are up for review.
https://chromium-review.googlesource.com/c/chromium/src/+/1237378
https://chromium-review.googlesource.com/c/chromium/src/+/1237379
Cc: bmayer@chromium.org z...@chromium.org chfremer@chromium.org
 Issue 876892  has been merged into this issue.
Project Member

Comment 3 by bugdroid1@chromium.org, Sep 25

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

commit f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4
Author: Christian Fremerey <chfremer@chromium.org>
Date: Tue Sep 25 18:20:37 2018

[Video Capture Service] Add observer API for adding/removing virtual devices

Add an API to the video capture service that allows observers to register and receive events whenever virtual devices are added or removed.

Design Doc: https://docs.google.com/document/d/1CW6wslQFvV9FMIMkpyCzh2TcASr7LLXrawAtlgSecg8/edit?usp=sharing

Test: services_unittests --gtest_filter=VideoCaptureServiceDeviceFactoryProviderTest*
Bug: 885256
Change-Id: I49dfe298bc4d19d9b4b417ec658b899b4898ce1f
Reviewed-on: https://chromium-review.googlesource.com/1237378
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Reviewed-by: Emircan Uysaler <emircan@chromium.org>
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594014}
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/content/browser/renderer_host/media/service_video_capture_device_launcher_unittest.cc
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/content/browser/renderer_host/media/service_video_capture_provider_unittest.cc
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/BUILD.gn
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/device_factory_media_to_mojo_adapter.cc
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/device_factory_media_to_mojo_adapter.h
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/public/mojom/device_factory.mojom
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/test/device_factory_provider_test.cc
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/test/device_factory_provider_test.h
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/test/device_factory_provider_unittest.cc
[add] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/test/mock_devices_changed_observer.cc
[add] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/test/mock_devices_changed_observer.h
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/virtual_device_enabled_device_factory.cc
[modify] https://crrev.com/f7bfcc51a05d3ebf17ae4dbc0b5c26c74d280aa4/services/video_capture/virtual_device_enabled_device_factory.h

Project Member

Comment 4 by bugdroid1@chromium.org, Jan 19 (4 days ago)

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

commit 8cd2484dd8874fb052efa89d7e1692e86c825cc9
Author: Christian Fremerey <chfremer@chromium.org>
Date: Sat Jan 19 02:01:33 2019

[Video Capture Service] Trigger MediaDevices.ondevicechange event when adding/removing virtual devices

Register class content::ServiceVideoCaptureProvider as a DeviceChangedObserver with the
video_capture service and have it propagate events when virtual devices are added or
removed. Since the video_capture service may be started by clients other than the browser
process, register a ServiceManagerListener to listen for service starts and automatically
register as DeviceChangedObserver when the service is started.

In order to mitigate raciness of an external client starting the service and adding
virtual devices vs. the browser process seeing the service start and registering as
DeviceChangedObserver, ask the service to immediately raise an event if virtual devices
have already been present at time of registration.

Design Doc: https://docs.google.com/document/d/1CW6wslQFvV9FMIMkpyCzh2TcASr7LLXrawAtlgSecg8/edit?usp=sharing

Test: content_browsertests --gtest_filter=*AddingAndRemovingVirtualDeviceTriggersMediaElementOnDeviceChange
Bug: 885256
Change-Id: I17c73507061a2313d8f3661344268f733da13920
Reviewed-on: https://chromium-review.googlesource.com/c/1237379
Reviewed-by: Ken Rockot <rockot@google.com>
Reviewed-by: Emircan Uysaler <emircan@chromium.org>
Reviewed-by: Guido Urdaneta <guidou@chromium.org>
Reviewed-by: Mustafa Emre Acer <meacer@chromium.org>
Commit-Queue: Christian Fremerey <chfremer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#624413}
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/BUILD.gn
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/media_stream_manager.cc
[add] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/ref_counted_video_capture_factory.cc
[add] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/ref_counted_video_capture_factory.h
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/service_video_capture_device_launcher.cc
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/service_video_capture_device_launcher.h
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/service_video_capture_device_launcher_unittest.cc
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/service_video_capture_provider.cc
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/service_video_capture_provider.h
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/service_video_capture_provider_unittest.cc
[delete] https://crrev.com/fe53869f430bce36d38c3b946ec07d14d6ed7d81/content/browser/renderer_host/media/video_capture_factory_delegate.cc
[delete] https://crrev.com/fe53869f430bce36d38c3b946ec07d14d6ed7d81/content/browser/renderer_host/media/video_capture_factory_delegate.h
[add] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/virtual_video_capture_devices_changed_observer.cc
[add] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/renderer_host/media/virtual_video_capture_devices_changed_observer.h
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/browser/webrtc/webrtc_video_capture_service_enumeration_browsertest.cc
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/test/BUILD.gn
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/content/test/data/media/video_capture_test.js
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/services/video_capture/device_factory_media_to_mojo_adapter.cc
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/services/video_capture/device_factory_media_to_mojo_adapter.h
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/services/video_capture/public/cpp/mock_device_factory.h
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/services/video_capture/public/mojom/device_factory.mojom
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/services/video_capture/test/device_factory_provider_connectortest.cc
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/services/video_capture/test/device_factory_provider_unittest.cc
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/services/video_capture/virtual_device_enabled_device_factory.cc
[modify] https://crrev.com/8cd2484dd8874fb052efa89d7e1692e86c825cc9/services/video_capture/virtual_device_enabled_device_factory.h

Sign in to add a comment