rtp: drop use of GSlice

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3695>
This commit is contained in:
Tim-Philipp Müller 2023-01-08 17:31:57 +00:00 committed by GStreamer Marge Bot
parent 56d3beed0b
commit e66f8cff26
4 changed files with 13 additions and 13 deletions

View file

@ -278,7 +278,7 @@ gst_rtp_mpa_robust_depay_generate_dummy_frame (GstRtpMPARobustDepay *
GstADUFrame *dummy; GstADUFrame *dummy;
GstMapInfo map; GstMapInfo map;
dummy = g_slice_dup (GstADUFrame, frame); dummy = g_memdup2 (frame, sizeof (GstADUFrame));
/* go for maximum bitrate */ /* go for maximum bitrate */
dummy->header = (frame->header & ~(0xf << 12)) | (0xe << 12); dummy->header = (frame->header & ~(0xf << 12)) | (0xe << 12);
@ -319,7 +319,7 @@ gst_rtp_mpa_robust_depay_queue_frame (GstRtpMPARobustDepay * rtpmpadepay,
if (map.size < 6) if (map.size < 6)
goto corrupt_frame; goto corrupt_frame;
frame = g_slice_new0 (GstADUFrame); frame = g_new0 (GstADUFrame, 1);
frame->header = GST_READ_UINT32_BE (map.data); frame->header = GST_READ_UINT32_BE (map.data);
size = mp3_type_frame_length_from_header (GST_ELEMENT_CAST (rtpmpadepay), size = mp3_type_frame_length_from_header (GST_ELEMENT_CAST (rtpmpadepay),
@ -377,7 +377,7 @@ corrupt_frame:
gst_buffer_unmap (buf, &map); gst_buffer_unmap (buf, &map);
gst_buffer_unref (buf); gst_buffer_unref (buf);
if (frame) if (frame)
g_slice_free (GstADUFrame, frame); g_free (frame);
return FALSE; return FALSE;
} }
} }
@ -387,7 +387,7 @@ gst_rtp_mpa_robust_depay_free_frame (GstADUFrame * frame)
{ {
if (frame->buffer) if (frame->buffer)
gst_buffer_unref (frame->buffer); gst_buffer_unref (frame->buffer);
g_slice_free (GstADUFrame, frame); g_free (frame);
} }
static inline void static inline void
@ -500,7 +500,7 @@ gst_rtp_mpa_robust_depay_push_mp3_frames (GstRtpMPARobustDepay * rtpmpadepay)
frame->buffer); frame->buffer);
frame->buffer = NULL; frame->buffer = NULL;
/* and remove it from any further consideration */ /* and remove it from any further consideration */
g_slice_free (GstADUFrame, frame); g_free (frame);
g_queue_delete_link (rtpmpadepay->adu_frames, rtpmpadepay->cur_adu_frame); g_queue_delete_link (rtpmpadepay->adu_frames, rtpmpadepay->cur_adu_frame);
rtpmpadepay->cur_adu_frame = NULL; rtpmpadepay->cur_adu_frame = NULL;
continue; continue;

View file

@ -97,13 +97,13 @@ enum
static RTPHistItem * static RTPHistItem *
rtp_hist_item_alloc (void) rtp_hist_item_alloc (void)
{ {
return g_slice_new (RTPHistItem); return g_new (RTPHistItem, 1);
} }
static void static void
rtp_hist_item_free (gpointer item) rtp_hist_item_free (gpointer item)
{ {
g_slice_free (RTPHistItem, item); g_free (item);
} }
static gint static gint

View file

@ -104,7 +104,7 @@ rtp_hist_item_init (RTPHistItem * item, GstRTPBuffer * rtp,
static RTPHistItem * static RTPHistItem *
rtp_hist_item_new (GstRTPBuffer * rtp, GstBuffer * rtp_payload) rtp_hist_item_new (GstRTPBuffer * rtp, GstBuffer * rtp_payload)
{ {
RTPHistItem *item = g_slice_new0 (RTPHistItem); RTPHistItem *item = g_new0 (RTPHistItem, 1);
rtp_hist_item_init (item, rtp, rtp_payload); rtp_hist_item_init (item, rtp, rtp_payload);
return item; return item;
} }
@ -122,7 +122,7 @@ rtp_hist_item_free (gpointer _item)
{ {
RTPHistItem *item = _item; RTPHistItem *item = _item;
gst_buffer_unref (item->payload); gst_buffer_unref (item->payload);
g_slice_free (RTPHistItem, item); g_free (item);
} }
static GstEvent * static GstEvent *

View file

@ -25,7 +25,7 @@
static RtpStorageItem * static RtpStorageItem *
rtp_storage_item_new (GstBuffer * buffer, guint8 pt, guint16 seq) rtp_storage_item_new (GstBuffer * buffer, guint8 pt, guint16 seq)
{ {
RtpStorageItem *ret = g_slice_new0 (RtpStorageItem); RtpStorageItem *ret = g_new0 (RtpStorageItem, 1);
ret->buffer = buffer; ret->buffer = buffer;
ret->pt = pt; ret->pt = pt;
ret->seq = seq; ret->seq = seq;
@ -37,7 +37,7 @@ rtp_storage_item_free (RtpStorageItem * item)
{ {
g_assert (item->buffer != NULL); g_assert (item->buffer != NULL);
gst_buffer_unref (item->buffer); gst_buffer_unref (item->buffer);
g_slice_free (RtpStorageItem, item); g_free (item);
} }
static gint static gint
@ -150,7 +150,7 @@ rtp_storage_stream_resize_and_add_item (RtpStorageStream * stream,
RtpStorageStream * RtpStorageStream *
rtp_storage_stream_new (guint32 ssrc) rtp_storage_stream_new (guint32 ssrc)
{ {
RtpStorageStream *ret = g_slice_new0 (RtpStorageStream); RtpStorageStream *ret = g_new0 (RtpStorageStream, 1);
ret->max_arrival_time = GST_CLOCK_TIME_NONE; ret->max_arrival_time = GST_CLOCK_TIME_NONE;
ret->ssrc = ssrc; ret->ssrc = ssrc;
g_mutex_init (&ret->stream_lock); g_mutex_init (&ret->stream_lock);
@ -165,7 +165,7 @@ rtp_storage_stream_free (RtpStorageStream * stream)
rtp_storage_item_free (g_queue_pop_tail (&stream->queue)); rtp_storage_item_free (g_queue_pop_tail (&stream->queue));
STREAM_UNLOCK (stream); STREAM_UNLOCK (stream);
g_mutex_clear (&stream->stream_lock); g_mutex_clear (&stream->stream_lock);
g_slice_free (RtpStorageStream, stream); g_free (stream);
} }
void void