Title: [271302] trunk/Source/WebCore
- Revision
- 271302
- Author
- [email protected]
- Date
- 2021-01-08 10:01:15 -0800 (Fri, 08 Jan 2021)
Log Message
[GStreamer] Player audio sink needs to be initialized earlier
https://bugs.webkit.org/show_bug.cgi?id=220462
Patch by Philippe Normand <[email protected]> on 2021-01-08
Reviewed by Xabier Rodriguez-Calvar.
Currently the player initializes the audio sink in the load method but that's not enough in
situations where the player has an audiosourceprovider. So initialize it from the
constructor early on, to ensure that the audio provider sink bin is valid.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (271301 => 271302)
--- trunk/Source/WebCore/ChangeLog 2021-01-08 17:03:02 UTC (rev 271301)
+++ trunk/Source/WebCore/ChangeLog 2021-01-08 18:01:15 UTC (rev 271302)
@@ -1,3 +1,19 @@
+2021-01-08 Philippe Normand <[email protected]>
+
+ [GStreamer] Player audio sink needs to be initialized earlier
+ https://bugs.webkit.org/show_bug.cgi?id=220462
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Currently the player initializes the audio sink in the load method but that's not enough in
+ situations where the player has an audiosourceprovider. So initialize it from the
+ constructor early on, to ensure that the audio provider sink bin is valid.
+
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+ (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
+ (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
+ * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
+
2021-01-08 Sihui Liu <[email protected]>
[Mojave Debug] ASSERTION FAILED: !m_requests.contains(clientIdentifier) in WebKit::SpeechRecognitionServer::start()
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (271301 => 271302)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2021-01-08 17:03:02 UTC (rev 271301)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2021-01-08 18:01:15 UTC (rev 271302)
@@ -200,6 +200,8 @@
#endif
m_isPlayerShuttingDown.store(false);
+ m_audioSink = createAudioSink();
+
#if USE(WPE_VIDEO_PLANE_DISPLAY_DMABUF)
auto& sharedDisplay = PlatformDisplay::sharedDisplay();
if (is<PlatformDisplayLibWPE>(sharedDisplay))
@@ -2706,6 +2708,7 @@
GST_INFO_OBJECT(pipeline(), "Tearing down as we need to use %s now.", playbinName);
changePipelineState(GST_STATE_NULL);
m_pipeline = nullptr;
+ m_audioSink = nullptr;
}
ASSERT(!m_pipeline);
@@ -2773,7 +2776,10 @@
g_object_set(m_pipeline.get(), "text-sink", m_textAppSink.get(), nullptr);
- g_object_set(m_pipeline.get(), "audio-sink", createAudioSink(), nullptr);
+ if (!m_audioSink)
+ m_audioSink = createAudioSink();
+
+ g_object_set(m_pipeline.get(), "audio-sink", m_audioSink.get(), nullptr);
if (m_player->isVideoPlayer())
g_object_set(m_pipeline.get(), "video-sink", createVideoSink(), nullptr);
Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h (271301 => 271302)
--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h 2021-01-08 17:03:02 UTC (rev 271301)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h 2021-01-08 18:01:15 UTC (rev 271302)
@@ -355,6 +355,7 @@
#endif
GRefPtr<GstStreamVolume> m_volumeElement;
+ GRefPtr<GstElement> m_audioSink;
GRefPtr<GstElement> m_videoSink;
GRefPtr<GstElement> m_pipeline;
IntSize m_size;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes