Title: [275421] trunk/Source/WebKit
Revision
275421
Author
[email protected]
Date
2021-04-02 07:56:02 -0700 (Fri, 02 Apr 2021)

Log Message

Do not send samples to GPUProcess if mediastream video is not playing
https://bugs.webkit.org/show_bug.cgi?id=224100
<rdar://74809558>

Reviewed by Eric Carlson.

In case video is paused, there is no need to send samples to GPUProcess.
Instead, we can just exit early.
This fixes the issue of freezing camera in case a hidden video element tries to play the camera feed.
Manually tested.

* WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
(WebKit::SampleBufferDisplayLayer::play):
(WebKit::SampleBufferDisplayLayer::pause):
(WebKit::SampleBufferDisplayLayer::enqueueSample):
* WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (275420 => 275421)


--- trunk/Source/WebKit/ChangeLog	2021-04-02 14:06:16 UTC (rev 275420)
+++ trunk/Source/WebKit/ChangeLog	2021-04-02 14:56:02 UTC (rev 275421)
@@ -1,3 +1,22 @@
+2021-04-02  Youenn Fablet  <[email protected]>
+
+        Do not send samples to GPUProcess if mediastream video is not playing
+        https://bugs.webkit.org/show_bug.cgi?id=224100
+        <rdar://74809558>
+
+        Reviewed by Eric Carlson.
+
+        In case video is paused, there is no need to send samples to GPUProcess.
+        Instead, we can just exit early.
+        This fixes the issue of freezing camera in case a hidden video element tries to play the camera feed.
+        Manually tested.
+
+        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp:
+        (WebKit::SampleBufferDisplayLayer::play):
+        (WebKit::SampleBufferDisplayLayer::pause):
+        (WebKit::SampleBufferDisplayLayer::enqueueSample):
+        * WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h:
+
 2021-04-02  John Wilander  <[email protected]>
 
         PCM: PrivateClickMeasurementManager::getTokenPublicKey() should not use PrivateClickMeasurement::PcmDataCarried::PersonallyIdentifiable when validating the token before the attribution report is sent

Modified: trunk/Source/WebKit/WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp (275420 => 275421)


--- trunk/Source/WebKit/WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp	2021-04-02 14:06:16 UTC (rev 275420)
+++ trunk/Source/WebKit/WebProcess/GPU/webrtc/SampleBufferDisplayLayer.cpp	2021-04-02 14:56:02 UTC (rev 275421)
@@ -30,6 +30,7 @@
 
 #include "GPUProcessConnection.h"
 #include "LayerHostingContext.h"
+#include "Logging.h"
 #include "RemoteSampleBufferDisplayLayerManagerMessages.h"
 #include "RemoteSampleBufferDisplayLayerManagerMessagesReplies.h"
 #include "RemoteSampleBufferDisplayLayerMessages.h"
@@ -105,16 +106,20 @@
 
 void SampleBufferDisplayLayer::play()
 {
+    m_paused = false;
     m_connection->send(Messages::RemoteSampleBufferDisplayLayer::Play { }, m_identifier);
 }
 
 void SampleBufferDisplayLayer::pause()
 {
+    m_paused = true;
     m_connection->send(Messages::RemoteSampleBufferDisplayLayer::Pause { }, m_identifier);
 }
 
 void SampleBufferDisplayLayer::enqueueSample(MediaSample& sample)
 {
+    if (m_paused)
+        return;
     if (auto remoteSample = RemoteVideoSample::create(sample))
         m_connection->send(Messages::RemoteSampleBufferDisplayLayer::EnqueueSample { *remoteSample }, m_identifier);
 }

Modified: trunk/Source/WebKit/WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h (275420 => 275421)


--- trunk/Source/WebKit/WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h	2021-04-02 14:06:16 UTC (rev 275420)
+++ trunk/Source/WebKit/WebProcess/GPU/webrtc/SampleBufferDisplayLayer.h	2021-04-02 14:56:02 UTC (rev 275421)
@@ -70,6 +70,7 @@
 
     PlatformLayerContainer m_videoLayer;
     bool m_didFail { false };
+    bool m_paused { false };
 };
 
 }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to