Title: [274787] trunk/Source/WebCore
Revision
274787
Author
[email protected]
Date
2021-03-22 13:22:14 -0700 (Mon, 22 Mar 2021)

Log Message

[GStreamer] gst_audio_format_fill_silence() is deprecated in GStreamer 1.20
https://bugs.webkit.org/show_bug.cgi?id=223562

Patch by Philippe Normand <[email protected]> on 2021-03-22
Reviewed by Xabier Rodriguez-Calvar.

Fix GStreamer deprecation warnings.

* platform/graphics/gstreamer/GStreamerCommon.h:
* platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp:
(WebCore::MockRealtimeAudioSourceGStreamer::render):
* platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
* platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
(WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (274786 => 274787)


--- trunk/Source/WebCore/ChangeLog	2021-03-22 20:15:04 UTC (rev 274786)
+++ trunk/Source/WebCore/ChangeLog	2021-03-22 20:22:14 UTC (rev 274787)
@@ -1,3 +1,20 @@
+2021-03-22  Philippe Normand  <[email protected]>
+
+        [GStreamer] gst_audio_format_fill_silence() is deprecated in GStreamer 1.20
+        https://bugs.webkit.org/show_bug.cgi?id=223562
+
+        Reviewed by Xabier Rodriguez-Calvar.
+
+        Fix GStreamer deprecation warnings.
+
+        * platform/graphics/gstreamer/GStreamerCommon.h:
+        * platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp:
+        (WebCore::MockRealtimeAudioSourceGStreamer::render):
+        * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp:
+        (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData):
+        * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp:
+        (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData):
+
 2021-03-22  Youenn Fablet  <[email protected]>
 
         Async Clipboard read prevents WebRTC IOSurfaces from being released

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h (274786 => 274787)


--- trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h	2021-03-22 20:15:04 UTC (rev 274786)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h	2021-03-22 20:22:14 UTC (rev 274787)
@@ -307,4 +307,13 @@
 #ifndef GST_BUFFER_DTS_OR_PTS
 #define GST_BUFFER_DTS_OR_PTS(buffer) (GST_BUFFER_DTS_IS_VALID(buffer) ? GST_BUFFER_DTS(buffer) : GST_BUFFER_PTS(buffer))
 #endif
+
+// In GStreamer 1.20 gst_audio_format_fill_silence() will be deprecated in favor of
+// gst_audio_format_info_fill_silence().
+#if GST_CHECK_VERSION(1, 19, 0)
+#define webkitGstAudioFormatFillSilence gst_audio_format_info_fill_silence
+#else
+#define webkitGstAudioFormatFillSilence gst_audio_format_fill_silence
+#endif
+
 #endif // USE(GSTREAMER)

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp (274786 => 274787)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp	2021-03-22 20:15:04 UTC (rev 274786)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/MockRealtimeAudioSourceGStreamer.cpp	2021-03-22 20:22:14 UTC (rev 274787)
@@ -88,7 +88,7 @@
             GstMappedBuffer map(buffer.get(), GST_MAP_WRITE);
 
             if (muted())
-                gst_audio_format_fill_silence(info.finfo, map.data(), map.size());
+                webkitGstAudioFormatFillSilence(info.finfo, map.data(), map.size());
             else {
                 memcpy(map.data(), &m_bipBopBuffer[bipBopStart], sizeof(float) * bipBopCount);
                 addHum(s_HumVolume, s_HumFrequency, sampleRate(), m_samplesRendered, reinterpret_cast<float*>(map.data()), bipBopCount);

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp (274786 => 274787)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp	2021-03-22 20:15:04 UTC (rev 274786)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp	2021-03-22 20:22:14 UTC (rev 274787)
@@ -67,7 +67,7 @@
     auto bufferSize = GST_AUDIO_INFO_BPF(&info) * numberOfFrames;
     gpointer bufferData = fastMalloc(bufferSize);
     if (muted())
-        gst_audio_format_fill_silence(info.finfo, bufferData, bufferSize);
+        webkitGstAudioFormatFillSilence(info.finfo, bufferData, bufferSize);
     else
         memcpy(bufferData, audioData, bufferSize);
 

Modified: trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp (274786 => 274787)


--- trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp	2021-03-22 20:15:04 UTC (rev 274786)
+++ trunk/Source/WebCore/platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp	2021-03-22 20:22:14 UTC (rev 274787)
@@ -108,7 +108,7 @@
         auto inBuffer = adoptGRef(gst_adapter_take_buffer(m_adapter.get(), inBufferSize));
         m_audioBuffer.grow(outBufferSize);
         if (isSilenced())
-            gst_audio_format_fill_silence(m_outputStreamDescription.finfo, m_audioBuffer.data(), outBufferSize);
+            webkitGstAudioFormatFillSilence(m_outputStreamDescription.finfo, m_audioBuffer.data(), outBufferSize);
         else {
             GstMappedBuffer inMap(inBuffer.get(), GST_MAP_READ);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to