Skip to content

Commit 09f6529

Browse files
philnmagomez
authored andcommitted
[GStreamer] Error building with libwebrtc enabled with gstreamer 1.18
https://bugs.webkit.org/show_bug.cgi?id=275657 Reviewed by Xabier Rodriguez-Calvar. Fix LibWebRTC build for GStreamer versions older than 1.20. * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp: (gst_buffer_new_memdup): * Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h: Canonical link: https://commits.webkit.org/280247@main
1 parent 595cc81 commit 09f6529

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1399,4 +1399,13 @@ GRefPtr<GstBuffer> wrapSpanData(const std::span<const uint8_t>& span)
13991399

14001400
#undef IS_GST_FULL_1_18
14011401

1402+
#if !GST_CHECK_VERSION(1, 20, 0)
1403+
GstBuffer* gst_buffer_new_memdup(gconstpointer data, gsize size)
1404+
{
1405+
gpointer copiedData = g_memdup2(data, size);
1406+
1407+
return gst_buffer_new_wrapped_full(static_cast<GstMemoryFlags>(0), copiedData, size, 0, size, copiedData, g_free);
1408+
}
1409+
#endif
1410+
14021411
#endif // USE(GSTREAMER)

Source/WebCore/platform/graphics/gstreamer/GStreamerCommon.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -408,4 +408,8 @@ class GstIteratorAdaptor {
408408
bool m_started { false };
409409
};
410410

411+
#if !GST_CHECK_VERSION(1, 20, 0)
412+
GstBuffer* gst_buffer_new_memdup(gconstpointer data, gsize size);
413+
#endif
414+
411415
#endif // USE(GSTREAMER)

0 commit comments

Comments
 (0)