[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: http://svn.webkit.org/repository/webkit/trunk@207764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed