[MediaStream] Separate media capture and audio playback muting
authoreric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Oct 2016 17:53:12 +0000 (17:53 +0000)
committereric.carlson@apple.com <eric.carlson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 24 Oct 2016 17:53:12 +0000 (17:53 +0000)
commit168024df9b83f6c897f4789c64727da0a68253d0
tree1c304458c16f1cf1320f027e22a0f6c4a09715f8
parent8fdca6b42bcf506cdedf4022fabf3fa62e0123e8
[MediaStream] Separate media capture and audio playback muting
https://bugs.webkit.org/show_bug.cgi?id=163855
<rdar://problem/28827186>

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/mediastream/MediaStream-page-muted.html

Change page.muted from a bool to a bitfield so audio and media capture muted are independent.
Fix a couple of bugs in the mock media capture device uncovered by new test case.

* Modules/mediastream/MediaStream.cpp:
(WebCore::MediaStream::pageMutedStateDidChange): page.isMuted -> page.mutedState.

* Modules/webaudio/AudioContext.cpp:
(WebCore::AudioContext::pageMutedStateDidChange): Ditto.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updateVolume): Ditto.
(WebCore::HTMLMediaElement::effectiveMuted): Ditto.

* page/MediaProducer.h: Add MutedState enum.

* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::setMuted): Take MutedStateFlags instead of bool. m_muted -> m_mutedState.
* page/Page.h:

* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::MockRealtimeMediaSource::startProducingData): Call setMuted.
(WebCore::MockRealtimeMediaSource::stopProducingData): Ditto.
* platform/mock/MockRealtimeMediaSource.h:

* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::stopProducingData): Call correct base class method.

* testing/Internals.cpp:
(WebCore::Internals::setPageMuted): Change parameter from a bool to a string.
* testing/Internals.h:

* testing/Internals.idl:

Source/WebKit2:

* Shared/WebPageCreationParameters.h: Change 'muted' from bool to MutedStateFlags.

* UIProcess/API/C/WKPage.cpp: Change parameter from bool to WKMediaMutedState.
(WKPageSetMuted):
* UIProcess/API/C/WKPagePrivate.h: Define WKMediaMutedState.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setMuted): m_muted -> m_mutedState.
(WebKit::WebPageProxy::creationParameters): Ditto.
* UIProcess/WebPageProxy.h:

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::isMuted): page.isMuted -> page.mutedState.

* WebProcess/WebPage/WebPage.messages.in: Change SetMuted parameter.

LayoutTests:

* fast/mediastream/MediaStream-page-muted-expected.txt: Added.
* fast/mediastream/MediaStream-page-muted.html: Added.
* media/video-muted-after-setting-page-muted-state.html: Updated.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/mediastream/MediaStream-page-muted-expected.txt [new file with mode: 0644]
LayoutTests/fast/mediastream/MediaStream-page-muted.html [new file with mode: 0644]
LayoutTests/media/video-muted-after-setting-page-muted-state.html
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/MediaStream.cpp
Source/WebCore/Modules/webaudio/AudioContext.cpp
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/page/MediaProducer.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/platform/mediastream/RealtimeMediaSource.cpp
Source/WebCore/platform/mock/MockRealtimeMediaSource.cpp
Source/WebCore/platform/mock/MockRealtimeMediaSource.h
Source/WebCore/platform/mock/MockRealtimeVideoSource.cpp
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.h
Source/WebCore/testing/Internals.idl
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPageCreationParameters.h
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in