Changeset 247525 in webkit
- Timestamp:
- Jul 17, 2019 11:32:23 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r247523 r247525 1 2019-07-17 Youenn Fablet <youenn@apple.com> 2 3 Hop to the main thread when doing logging in RealtimeIncomingVideoSourceCocoa 4 https://bugs.webkit.org/show_bug.cgi?id=199865 5 6 Reviewed by Darin Adler. 7 8 LoggerHelper routines allow logging messages in system console and inspector console. 9 These routines iterate through a Vector of log observers which is not thread safe. 10 Document, the main log observer, also expects to be called on the main thread. 11 Manually tested (writing a layout test for this would require more than 2 seconds). 12 13 * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: 14 (WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame): 15 1 16 2019-07-17 Commit Queue <commit-queue@webkit.org> 2 17 -
trunk/Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm
r246436 r247525 159 159 160 160 #if !RELEASE_LOG_DISABLED 161 if (!(++m_numberOfFrames % 60)) 162 ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "frame ", m_numberOfFrames); 161 if (!(++m_numberOfFrames % 60)) { 162 callOnMainThread([this, protectedThis = makeRef(*this), numberOfFrames = m_numberOfFrames] { 163 ALWAYS_LOG_IF(loggerPtr(), LOGIDENTIFIER, "frame ", numberOfFrames); 164 }); 165 } 163 166 #endif 164 167 165 168 auto pixelBuffer = pixelBufferFromVideoFrame(frame); 166 169 if (!pixelBuffer) { 167 ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "Failed to get a pixel buffer from a frame"); 170 callOnMainThread([this, protectedThis = makeRef(*this)] { 171 ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "Failed to get a pixel buffer from a frame"); 172 }); 168 173 return; 169 174 } … … 179 184 OSStatus ostatus = CMVideoFormatDescriptionCreateForImageBuffer(kCFAllocatorDefault, (CVImageBufferRef)pixelBuffer, &formatDescription); 180 185 if (ostatus != noErr) { 181 ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "Failed to initialize CMVideoFormatDescription with error ", static_cast<int>(ostatus)); 186 callOnMainThread([this, protectedThis = makeRef(*this), ostatus] { 187 ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "Failed to initialize CMVideoFormatDescription with error ", static_cast<int>(ostatus)); 188 }); 182 189 return; 183 190 } … … 187 194 CFRelease(formatDescription); 188 195 if (ostatus != noErr) { 189 ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "Failed to create the sample buffer with error ", static_cast<int>(ostatus)); 196 callOnMainThread([this, protectedThis = makeRef(*this), ostatus] { 197 ERROR_LOG_IF(loggerPtr(), LOGIDENTIFIER, "Failed to create the sample buffer with error ", static_cast<int>(ostatus)); 198 }); 190 199 return; 191 200 }
Note: See TracChangeset
for help on using the changeset viewer.