Skip to content

Commit 5f7400a

Browse files
committed
Fix LibWebRTC build for GStreamer versions older than 1.20
1 parent 0bc79b4 commit 5f7400a

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -906,4 +906,13 @@ bool gstObjectHasProperty(GstPad* pad, const char* name)
906906

907907
} // namespace WebCore
908908

909+
#if !GST_CHECK_VERSION(1, 20, 0)
910+
GstBuffer* gst_buffer_new_memdup(gconstpointer data, gsize size)
911+
{
912+
gpointer data2 = g_memdup2(data, size);
913+
914+
return gst_buffer_new_wrapped_full(static_cast<GstMemoryFlags>(0), data2, size, 0, size, data2, g_free);
915+
}
916+
#endif
917+
909918
#endif // USE(GSTREAMER)

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,4 +456,8 @@ class GstIteratorAdaptor {
456456
bool m_started { false };
457457
};
458458

459+
#if !GST_CHECK_VERSION(1, 20, 0)
460+
GstBuffer* gst_buffer_new_memdup(gconstpointer data, gsize size);
461+
#endif
462+
459463
#endif // USE(GSTREAMER)

0 commit comments

Comments
 (0)