Changeset 250918 in webkit
- Timestamp:
- Oct 9, 2019 11:10:11 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r250917 r250918 1 2019-10-09 Eric Carlson <eric.carlson@apple.com> 2 3 [ Mac WK2 ] Layout Test fast/mediastream/MediaStreamTrack-getSettings.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=196400 5 <rdar://problem/49567579> 6 7 Reviewed by Youenn Fablet. 8 9 * fast/mediastream/MediaStreamTrack-getSettings.html: Cleanup test. 10 * platform/mac-wk2/TestExpectations: Unskip test. 11 1 12 2019-10-09 Dean Jackson <dino@apple.com> 2 13 -
trunk/LayoutTests/fast/mediastream/MediaStreamTrack-getSettings.html
r193389 r250918 5 5 <script src="./resources/getUserMedia-helper.js"></script> 6 6 <script> 7 var mediaStream; 8 var track; 7 let track; 9 8 10 9 function limitPrecision(value, precision) … … 15 14 } 16 15 16 function forEachNativeProperty(list, func) 17 { 18 for (let property in list) { 19 if (list.hasOwnProperty(property, list[property]) || list.__proto__.hasOwnProperty(property)) 20 func(property, list[property]); 21 } 22 } 23 17 24 function listTrackSettings(track) 18 25 { 19 26 debug(`${track.kind} track settings:`); 20 settings = track.getSettings(); 21 for (var property in settings) { 22 if (settings.hasOwnProperty(property) || settings.__proto__.hasOwnProperty(property)) { 23 if (property == "deviceId") 24 value = "<UUID>"; 25 else 26 value = limitPrecision(settings[property], 3); 27 debug(` settings.${property} = ${value}`); 28 } 29 } 27 forEachNativeProperty(track.getSettings(), (property, value) => { 28 if (property == "deviceId") 29 value = "<UUID>"; 30 else 31 value = limitPrecision(value, 3); 32 debug(` settings.${property} = ${value}`); 33 }); 30 34 31 35 debug(""); … … 35 39 { 36 40 track = t; 37 38 capabilities = track.getCapabilities(); 39 settings = track.getSettings(); 40 for (var property in settings) { 41 if (settings.hasOwnProperty(property) || settings.__proto__.hasOwnProperty(property)) { 42 shouldBeTrue(`"${property}" in track.getCapabilities()`); 43 } 44 } 41 forEachNativeProperty(track.getSettings(), (property, value) => { 42 shouldBeTrue(`"${property}" in track.getCapabilities()`); 43 }); 45 44 } 46 45 47 function gotStream(stream)46 async function start() 48 47 { 49 mediaStream = stream; 48 description("Tests MediaStreamTrack.getSettings."); 49 let stream = await navigator.mediaDevices.getUserMedia({audio:true, video:true}); 50 50 51 listTrackSettings( mediaStream.getVideoTracks()[0]);52 listTrackSettings( mediaStream.getAudioTracks()[0]);51 listTrackSettings(stream.getVideoTracks()[0]); 52 listTrackSettings(stream.getAudioTracks()[0]); 53 53 54 54 debug('According to the spec: "[every setting] MUST be a member of the set defined for that property by getCapabilities()"<br>'); 55 checkTrackSettings( mediaStream.getVideoTracks()[0]);56 checkTrackSettings( mediaStream.getAudioTracks()[0]);55 checkTrackSettings(stream.getVideoTracks()[0]); 56 checkTrackSettings(stream.getAudioTracks()[0]); 57 57 finishJSTest(); 58 }59 60 function start()61 {62 description("Tests MediaStreamTrack.getSettings.");63 getUserMedia("allow", {audio:true, video:true}, gotStream);64 58 } 65 59 -
trunk/LayoutTests/platform/mac-wk2/TestExpectations
r250589 r250918 908 908 webkit.org/b/194916 fast/mediastream/MediaStream-video-element.html [ Pass Failure ] 909 909 910 webkit.org/b/196400 fast/mediastream/MediaStreamTrack-getSettings.html [ Pass Failure ]911 912 910 webkit.org/b/196403 imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop.html [ Pass Failure ] 913 911 -
trunk/Source/WebCore/ChangeLog
r250916 r250918 1 2019-10-09 Eric Carlson <eric.carlson@apple.com> 2 3 [ Mac WK2 ] Layout Test fast/mediastream/MediaStreamTrack-getSettings.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=196400 5 <rdar://problem/49567579> 6 7 Reviewed by Youenn Fablet. 8 9 No new tests, this fixes a broken test. 10 11 * platform/mediastream/mac/MockRealtimeAudioSourceMac.h: 12 * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: 13 (WebCore::MockRealtimeAudioSourceMac::reconfigure): Reconfigure buffers as well. 14 (WebCore::MockRealtimeAudioSourceMac::render): Call reconfigure if the buffer isn't 15 configured correctly. 16 (WebCore::MockRealtimeAudioSourceMac::settingsDidChange): Call reconfigure. 17 18 * platform/mock/MockRealtimeAudioSource.cpp: 19 (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Set sample rate to default. 20 1 21 2019-10-09 Chris Dumez <cdumez@apple.com> 2 22 -
trunk/Source/WebCore/platform/mediastream/mac/MockRealtimeAudioSourceMac.mm
r248846 r250918 124 124 { 125 125 ASSERT(!isMainThread()); 126 m_maximiumFrameCount = WTF::roundUpToPowerOfTwo(renderInterval().seconds() * sampleRate() * 2); 126 127 auto rate = sampleRate(); 128 ASSERT(rate); 129 130 m_maximiumFrameCount = WTF::roundUpToPowerOfTwo(renderInterval().seconds() * rate * 2); 127 131 ASSERT(m_maximiumFrameCount); 128 132 … … 133 137 const bool isBigEndian = false; 134 138 const bool isNonInterleaved = true; 135 FillOutASBDForLPCM(m_streamFormat, sampleRate(), channelCount, bitsPerByte * bytesPerFloat, bitsPerByte * bytesPerFloat, isFloat, isBigEndian, isNonInterleaved);139 FillOutASBDForLPCM(m_streamFormat, rate, channelCount, bitsPerByte * bytesPerFloat, bitsPerByte * bytesPerFloat, isFloat, isBigEndian, isNonInterleaved); 136 140 137 141 m_audioBufferList = makeUnique<WebAudioBufferList>(m_streamFormat, m_streamFormat.mBytesPerFrame * m_maximiumFrameCount); … … 140 144 CMAudioFormatDescriptionCreate(NULL, &m_streamFormat, 0, NULL, 0, NULL, NULL, &formatDescription); 141 145 m_formatDescription = adoptCF(formatDescription); 146 147 size_t sampleCount = 2 * rate; 148 m_bipBopBuffer.resize(sampleCount); 149 m_bipBopBuffer.fill(0); 150 151 size_t bipBopSampleCount = ceil(BipBopDuration * rate); 152 size_t bipStart = 0; 153 size_t bopStart = rate; 154 155 addHum(BipBopVolume, BipFrequency, rate, 0, m_bipBopBuffer.data() + bipStart, bipBopSampleCount); 156 addHum(BipBopVolume, BopFrequency, rate, 0, m_bipBopBuffer.data() + bopStart, bipBopSampleCount); 142 157 } 143 158 … … 145 160 { 146 161 ASSERT(!isMainThread()); 147 if (!m_audioBufferList )162 if (!m_audioBufferList || !m_bipBopBuffer.size()) 148 163 reconfigure(); 149 164 … … 174 189 if (settings.contains(RealtimeMediaSourceSettings::Flag::SampleRate)) { 175 190 m_workQueue->dispatch([this, protectedThis = makeRef(*this)] { 176 m_formatDescription = nullptr; 177 m_audioBufferList = nullptr; 178 179 auto rate = sampleRate(); 180 size_t sampleCount = 2 * rate; 181 182 m_bipBopBuffer.grow(sampleCount); 183 m_bipBopBuffer.fill(0); 184 185 size_t bipBopSampleCount = ceil(BipBopDuration * rate); 186 size_t bipStart = 0; 187 size_t bopStart = rate; 188 189 addHum(BipBopVolume, BipFrequency, rate, 0, m_bipBopBuffer.data() + bipStart, bipBopSampleCount); 190 addHum(BipBopVolume, BopFrequency, rate, 0, m_bipBopBuffer.data() + bopStart, bipBopSampleCount); 191 reconfigure(); 191 192 }); 192 193 } -
trunk/Source/WebCore/platform/mock/MockRealtimeAudioSource.cpp
r248046 r250918 69 69 ASSERT(device); 70 70 m_device = *device; 71 72 setSampleRate(WTF::get<MockMicrophoneProperties>(m_device.properties).defaultSampleRate); 71 73 } 72 74
Note: See TracChangeset
for help on using the changeset viewer.