Changeset 208778 in webkit
- Timestamp:
- Nov 15, 2016 6:55:22 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r208775 r208778 1 2016-11-15 Jon Lee <jonlee@apple.com> 2 3 Report active video and audio capture devices separately 4 https://bugs.webkit.org/show_bug.cgi?id=164769 5 6 Reviewed by Eric Carlson. 7 8 * fast/mediastream/MediaStream-page-muted-expected.txt: Update test. 9 * fast/mediastream/MediaStream-page-muted.html: 10 1 11 2016-11-15 Ryan Haddad <ryanhaddad@apple.com> 2 12 -
trunk/LayoutTests/fast/mediastream/MediaStream-page-muted-expected.txt
r208735 r208778 8 8 PASS mediaStream is an instance of Object 9 9 PASS mediaStream.getTracks().length is 2 10 PASS window.internals.pageMediaState().includes('HasActive MediaCaptureDevice') became true10 PASS window.internals.pageMediaState().includes('HasActiveAudioCaptureDevice') && window.internals.pageMediaState().includes('HasActiveVideoCaptureDevice') became true 11 11 12 12 *** Muting capture devices … … 16 16 PASS muteChangedEvent.target.muted is true 17 17 18 PASS window.internals.pageMediaState().includes('HasActive MediaCaptureDevice') became false18 PASS window.internals.pageMediaState().includes('HasActiveAudioCaptureDevice') && window.internals.pageMediaState().includes('HasActiveVideoCaptureDevice') became false 19 19 20 20 *** Unmuting capture devices … … 24 24 PASS muteChangedEvent.target.muted is false 25 25 26 PASS window.internals.pageMediaState().includes('HasActive MediaCaptureDevice') became true26 PASS window.internals.pageMediaState().includes('HasActiveAudioCaptureDevice') && window.internals.pageMediaState().includes('HasActiveVideoCaptureDevice') became true 27 27 PASS successfullyParsed is true 28 28 -
trunk/LayoutTests/fast/mediastream/MediaStream-page-muted.html
r208735 r208778 29 29 debug(""); 30 30 let shouldBeActive = muteChangedEvent.type == "mute" ? "false" : "true"; 31 shouldBecomeEqual("window.internals.pageMediaState().includes('HasActive MediaCaptureDevice')", shouldBeActive, nextStep);31 shouldBecomeEqual("window.internals.pageMediaState().includes('HasActiveAudioCaptureDevice') && window.internals.pageMediaState().includes('HasActiveVideoCaptureDevice')", shouldBeActive, nextStep); 32 32 } 33 33 } … … 54 54 } 55 55 56 shouldBecomeEqual("window.internals.pageMediaState().includes('HasActive MediaCaptureDevice')", "true", muteCaptureDevices);56 shouldBecomeEqual("window.internals.pageMediaState().includes('HasActiveAudioCaptureDevice') && window.internals.pageMediaState().includes('HasActiveVideoCaptureDevice')", "true", muteCaptureDevices); 57 57 }) 58 58 .catch((err) => { -
trunk/Source/WebCore/ChangeLog
r208776 r208778 1 2016-11-15 Jon Lee <jonlee@apple.com> 2 3 Report active video and audio capture devices separately 4 https://bugs.webkit.org/show_bug.cgi?id=164769 5 6 Reviewed by Eric Carlson. 7 8 For UI purposes, separate the notion of any active capture device to 9 an active audio and video capture device. 10 11 * page/MediaProducer.h: Replace HasActiveMediaCaptureDevice with 12 HasActiveAudioCaptureDevice and HasActiveVideoCaptureDevice. 13 14 * Modules/mediastream/MediaStream.cpp: 15 (WebCore::MediaStream::mediaState): Update the logic for mediaState(). 16 Since it is possible to arbitrarily add tracks from various sources, 17 check specifically for a local AV source (meaning a capture device) that 18 is producing data. 19 * platform/mediastream/MediaStreamPrivate.cpp: 20 (WebCore::MediaStreamPrivate::hasLocalVideoSource): Iterate over the tracks 21 and look for video sources that are not remote. 22 (WebCore::MediaStreamPrivate::hasLocalAudioSource): Ditto for audio. 23 * platform/mediastream/MediaStreamPrivate.h: 24 * testing/Internals.cpp: 25 (WebCore::Internals::pageMediaState): Update internals reporting. 26 1 27 2016-11-15 Chris Dumez <cdumez@apple.com> 2 28 -
trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp
r208735 r208778 313 313 return state; 314 314 315 if (m_private->isProducingData()) 316 state |= HasActiveMediaCaptureDevice; 317 318 if (m_private->hasAudio() || m_private->hasVideo()) 315 if (m_private->hasAudio()) { 319 316 state |= HasAudioOrVideo; 317 if (m_private->hasLocalAudioSource() && m_private->isProducingData()) 318 state |= HasActiveAudioCaptureDevice; 319 } 320 321 if (m_private->hasVideo()) { 322 state |= HasAudioOrVideo; 323 if (m_private->hasLocalVideoSource() && m_private->isProducingData()) 324 state |= HasActiveVideoCaptureDevice; 325 } 320 326 321 327 return state; -
trunk/Source/WebCore/page/MediaProducer.h
r208735 r208778 43 43 HasPlaybackTargetAvailabilityListener = 1 << 9, 44 44 HasAudioOrVideo = 1 << 10, 45 HasActiveMediaCaptureDevice = 1 << 11, 45 HasActiveAudioCaptureDevice = 1 << 11, 46 HasActiveVideoCaptureDevice = 1 << 12, 46 47 }; 47 48 typedef unsigned MediaStateFlags; -
trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
r208687 r208778 200 200 } 201 201 202 bool MediaStreamPrivate::hasLocalVideoSource() const 203 { 204 for (auto& track : m_trackSet.values()) { 205 if (track->type() == RealtimeMediaSource::Type::Video && !track->remote()) 206 return true; 207 } 208 return false; 209 } 210 211 bool MediaStreamPrivate::hasLocalAudioSource() const 212 { 213 for (auto& track : m_trackSet.values()) { 214 if (track->type() == RealtimeMediaSource::Type::Audio && !track->remote()) 215 return true; 216 } 217 return false; 218 } 219 202 220 bool MediaStreamPrivate::muted() const 203 221 { -
trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h
r208687 r208778 102 102 bool muted() const; 103 103 104 bool hasLocalVideoSource() const; 105 bool hasLocalAudioSource() const; 106 104 107 FloatSize intrinsicSize() const; 105 108 -
trunk/Source/WebCore/testing/Internals.cpp
r208735 r208778 3011 3011 if (state & MediaProducer::HasAudioOrVideo) 3012 3012 string.append("HasAudioOrVideo,"); 3013 if (state & MediaProducer::HasActiveMediaCaptureDevice) 3014 string.append("HasActiveMediaCaptureDevice,"); 3013 if (state & MediaProducer::HasActiveAudioCaptureDevice) 3014 string.append("HasActiveAudioCaptureDevice,"); 3015 if (state & MediaProducer::HasActiveVideoCaptureDevice) 3016 string.append("HasActiveVideoCaptureDevice,"); 3015 3017 3016 3018 if (string.isEmpty()) -
trunk/Source/WebKit2/ChangeLog
r208748 r208778 1 2016-11-15 Jon Lee <jonlee@apple.com> 2 3 Report active video and audio capture devices separately 4 https://bugs.webkit.org/show_bug.cgi?id=164769 5 6 Reviewed by Eric Carlson. 7 8 Replace kWKMediaHasActiveCaptureDevice with kWKMediaHasActiveAudioCaptureDevice and 9 kWKMediaHasActiveVideoCaptureDevice 10 11 * UIProcess/API/C/WKPage.cpp: 12 (WKPageGetMediaState): 13 * UIProcess/API/C/WKPagePrivate.h: 14 * UIProcess/WebPageProxy.cpp: 15 (WebKit::WebPageProxy::isPlayingMediaDidChange): Update the mask to include the two 16 bits. 17 1 18 2016-11-14 Simon Fraser <simon.fraser@apple.com> 2 19 -
trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp
r208735 r208778 2749 2749 if (coreState & WebCore::MediaProducer::IsPlayingVideo) 2750 2750 state |= kWKMediaIsPlayingVideo; 2751 if (coreState & WebCore::MediaProducer::HasActiveMediaCaptureDevice) 2752 state |= kWKMediaHasActiveCaptureDevice; 2751 if (coreState & WebCore::MediaProducer::HasActiveAudioCaptureDevice) 2752 state |= kWKMediaHasActiveAudioCaptureDevice; 2753 if (coreState & WebCore::MediaProducer::HasActiveVideoCaptureDevice) 2754 state |= kWKMediaHasActiveVideoCaptureDevice; 2753 2755 2754 2756 return state; -
trunk/Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
r208735 r208778 134 134 kWKMediaIsPlayingAudio = 1 << 0, 135 135 kWKMediaIsPlayingVideo = 1 << 1, 136 kWKMediaHasActiveCaptureDevice = 1 << 2, 136 kWKMediaHasActiveAudioCaptureDevice = 1 << 2, 137 kWKMediaHasActiveVideoCaptureDevice = 1 << 3, 137 138 }; 138 139 typedef uint32_t WKMediaState; -
trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp
r208727 r208778 6389 6389 activityStateDidChange(ActivityState::IsAudible); 6390 6390 6391 playingMediaMask |= MediaProducer::HasActive MediaCaptureDevice;6391 playingMediaMask |= MediaProducer::HasActiveAudioCaptureDevice | MediaProducer::HasActiveVideoCaptureDevice; 6392 6392 if ((oldState & playingMediaMask) != (m_mediaState & playingMediaMask)) 6393 6393 m_uiClient->isPlayingAudioDidChange(*this);
Note: See TracChangeset
for help on using the changeset viewer.