Title: [259289] trunk/Source/WebCore
Revision
259289
Author
[email protected]
Date
2020-03-31 07:53:03 -0700 (Tue, 31 Mar 2020)

Log Message

Ensure that RealtimeMediaSource::setShouldApplyRotation is called on the main thread
https://bugs.webkit.org/show_bug.cgi?id=209797

Reviewed by Eric Carlson.

Hop to the main thread before calling setShouldApplyRotation on the source.

* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::setSource):
(WebCore::RealtimeOutgoingVideoSource::applyRotation):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (259288 => 259289)


--- trunk/Source/WebCore/ChangeLog	2020-03-31 14:52:40 UTC (rev 259288)
+++ trunk/Source/WebCore/ChangeLog	2020-03-31 14:53:03 UTC (rev 259289)
@@ -1,3 +1,16 @@
+2020-03-31  youenn fablet  <[email protected]>
+
+        Ensure that RealtimeMediaSource::setShouldApplyRotation is called on the main thread
+        https://bugs.webkit.org/show_bug.cgi?id=209797
+
+        Reviewed by Eric Carlson.
+
+        Hop to the main thread before calling setShouldApplyRotation on the source.
+
+        * platform/mediastream/RealtimeOutgoingVideoSource.cpp:
+        (WebCore::RealtimeOutgoingVideoSource::setSource):
+        (WebCore::RealtimeOutgoingVideoSource::applyRotation):
+
 2020-03-31  Andres Gonzalez  <[email protected]>
 
         The relative frame and hit test of isolated objects must be dispatched to the main thread.

Modified: trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp (259288 => 259289)


--- trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp	2020-03-31 14:52:40 UTC (rev 259288)
+++ trunk/Source/WebCore/platform/mediastream/RealtimeOutgoingVideoSource.cpp	2020-03-31 14:53:03 UTC (rev 259289)
@@ -78,6 +78,7 @@
 
 void RealtimeOutgoingVideoSource::setSource(Ref<MediaStreamTrackPrivate>&& newSource)
 {
+    ASSERT(isMainThread());
     ASSERT(!m_videoSource->hasObserver(*this));
     m_videoSource = WTFMove(newSource);
 
@@ -89,6 +90,12 @@
 
 void RealtimeOutgoingVideoSource::applyRotation()
 {
+    if (!isMainThread()) {
+        callOnMainThread([this, protectedThis = makeRef(*this)] {
+            applyRotation();
+        });
+        return;
+    }
     if (m_areSinksAskingToApplyRotation)
         return;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to