Changeset 214980 in webkit
- Timestamp:
- Apr 5, 2017, 5:03:44 PM (8 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r214976 r214980 1 2017-04-05 Eric Carlson <eric.carlson@apple.com> 2 3 [MediaStream] Host application should be able to mute and unmute media streams 4 https://bugs.webkit.org/show_bug.cgi?id=170519 5 <rdar://problem/31174326> 6 7 Unreviewed, address review comments missed in the initial checkin. 8 9 * Modules/mediastream/MediaStream.cpp: 10 (WebCore::MediaStream::MediaStream): Mute the private stream if the page doesn't allow 11 capture. 12 (WebCore::MediaStream::pageMutedStateDidChange): setMuted -> setCaptureTracksMuted. 13 14 * platform/mediastream/MediaStreamPrivate.cpp: 15 (WebCore::MediaStreamPrivate::addTrack): Don't track muted state, the capture source already does. 16 (WebCore::MediaStreamPrivate::startProducingData): Ditto. 17 (WebCore::MediaStreamPrivate::setCaptureTracksMuted): Renamed from setMuted. 18 (WebCore::MediaStreamPrivate::setMuted): Deleted. 19 * platform/mediastream/MediaStreamPrivate.h: 20 1 21 2017-04-05 Eric Carlson <eric.carlson@apple.com> 2 22 -
trunk/Source/WebCore/Modules/mediastream/MediaStream.cpp
r214976 r214980 91 91 { 92 92 ASSERT(m_private); 93 93 94 setIsActive(m_private->active()); 95 if (document()->page()->isMediaCaptureMuted()) 96 m_private->setCaptureTracksMuted(true); 94 97 m_private->addObserver(*this); 95 98 MediaStreamRegistry::shared().registerStream(*this); … … 301 304 return; 302 305 303 m_private->set Muted(document->page()->isMediaCaptureMuted());306 m_private->setCaptureTracksMuted(document->page()->isMediaCaptureMuted()); 304 307 } 305 308 -
trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.cpp
r214976 r214980 135 135 return; 136 136 137 if (m_muted)138 track->stopProducingData();139 140 137 track->addObserver(*this); 141 138 m_trackSet.add(track->id(), track); … … 166 163 void MediaStreamPrivate::startProducingData() 167 164 { 168 if (m_muted)169 return;170 171 165 for (auto& track : m_trackSet.values()) 172 166 track->startProducingData(); … … 188 182 } 189 183 190 void MediaStreamPrivate::setMuted(bool muted) 191 { 192 if (m_muted == muted) 193 return; 194 195 m_muted = muted; 184 void MediaStreamPrivate::setCaptureTracksMuted(bool muted) 185 { 196 186 for (auto& track : m_trackSet.values()) { 197 187 if (track->isCaptureTrack()) -
trunk/Source/WebCore/platform/mediastream/MediaStreamPrivate.h
r214976 r214980 96 96 bool hasVideo() const; 97 97 bool hasAudio() const; 98 99 void setMuted(bool);100 98 bool muted() const; 101 99 102 100 bool hasCaptureVideoSource() const; 103 101 bool hasCaptureAudioSource() const; 102 void setCaptureTracksMuted(bool); 104 103 105 104 FloatSize intrinsicSize() const; … … 137 136 HashMap<String, RefPtr<MediaStreamTrackPrivate>> m_trackSet; 138 137 bool m_isActive { false }; 139 bool m_muted { false };140 138 }; 141 139
Note:
See TracChangeset
for help on using the changeset viewer.