Report active video and audio capture devices separately
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2016 02:55:22 +0000 (02:55 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2016 02:55:22 +0000 (02:55 +0000)
commit9f66c87ea0930264c24e9e46528e357155735b4a
tree33c9cd915bc0ef9fe762fa51d8840d9d866409bc
parentc6b6babfea16de4ca4fcc7ba326547232784e835
Report active video and audio capture devices separately
https://bugs.webkit.org/show_bug.cgi?id=164769

Reviewed by Eric Carlson.

Source/WebCore:

For UI purposes, separate the notion of any active capture device to
an active audio and video capture device.

* page/MediaProducer.h: Replace HasActiveMediaCaptureDevice with
HasActiveAudioCaptureDevice and HasActiveVideoCaptureDevice.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::mediaState): Update the logic for mediaState().
Since it is possible to arbitrarily add tracks from various sources,
check specifically for a local AV source (meaning a capture device) that
is producing data.
* platform/mediastream/MediaStreamPrivate.cpp:
(WebCore::MediaStreamPrivate::hasLocalVideoSource): Iterate over the tracks
and look for video sources that are not remote.
(WebCore::MediaStreamPrivate::hasLocalAudioSource): Ditto for audio.
* platform/mediastream/MediaStreamPrivate.h:
* testing/Internals.cpp:
(WebCore::Internals::pageMediaState): Update internals reporting.

Source/WebKit2:

Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and
kWKMediaHasActiveVideoCaptureDevice

* UIProcess/API/C/WKPage.cpp:
(WKPageGetMediaState):
* UIProcess/API/C/WKPagePrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two
bits.

LayoutTests:

* fast/mediastream/MediaStream-page-muted-expected.txt: Update test.
* fast/mediastream/MediaStream-page-muted.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208778 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/MediaStream-page-muted-expected.txt
LayoutTests/fast/mediastream/MediaStream-page-muted.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/page/MediaProducer.h
Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
Source/WebCore/platform/mediastream/MediaStreamPrivate.h
Source/WebCore/testing/Internals.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
Source/WebKit2/UIProcess/WebPageProxy.cpp