rtmp2: 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 18:39:59 +00:00 committed by GStreamer Marge Bot
parent 71890cc2f1
commit 3d9f3bfd66
7 changed files with 17 additions and 17 deletions

View file

@ -2,7 +2,7 @@
deleting and recreating stream, which drops clients.
- Move AMF parser/serializer to GstRtmpMeta?
- Move AMF nodes from g_slice to GstMiniObject?
- Move AMF nodes to GstMiniObject?
- First video frame that comes from Wowza seems to be out-of-order; librtmp
does not have this problem

View file

@ -156,7 +156,7 @@ node_new (GstAmfType type)
init_static ();
node = g_slice_alloc0 (sizeof *node);
node = g_malloc0 (sizeof *node);
node->type = type;
switch (type) {
@ -295,7 +295,7 @@ gst_amf_node_free (gpointer ptr)
break;
}
g_slice_free (GstAmfNode, node);
g_free (node);
}
GstAmfType

View file

@ -690,7 +690,7 @@ gst_rtmp_chunk_streams_new (void)
init_debug ();
cstreams = g_slice_new (GstRtmpChunkStreams);
cstreams = g_new (GstRtmpChunkStreams, 1);
cstreams->array = g_array_new (FALSE, TRUE, sizeof (GstRtmpChunkStream));
g_array_set_clear_func (cstreams->array,
(GDestroyNotify) gst_rtmp_chunk_stream_clear);
@ -702,7 +702,7 @@ gst_rtmp_chunk_streams_free (gpointer ptr)
{
GstRtmpChunkStreams *cstreams = ptr;
g_clear_pointer (&cstreams->array, g_array_unref);
g_slice_free (GstRtmpChunkStreams, cstreams);
g_free (cstreams);
}
GstRtmpChunkStream *

View file

@ -336,7 +336,7 @@ typedef struct
static ConnectTaskData *
connect_task_data_new (const GstRtmpLocation * location)
{
ConnectTaskData *data = g_slice_new0 (ConnectTaskData);
ConnectTaskData *data = g_new0 (ConnectTaskData, 1);
gst_rtmp_location_copy (&data->location, location);
return data;
}
@ -351,7 +351,7 @@ connect_task_data_free (gpointer ptr)
g_signal_handler_disconnect (data->connection, data->error_handler_id);
}
g_clear_object (&data->connection);
g_slice_free (ConnectTaskData, data);
g_free (data);
}
static GRegex *auth_regex = NULL;
@ -1074,7 +1074,7 @@ static StreamTaskData *
stream_task_data_new (GstRtmpConnection * connection, const gchar * stream,
gboolean publish)
{
StreamTaskData *data = g_slice_new0 (StreamTaskData);
StreamTaskData *data = g_new0 (StreamTaskData, 1);
data->connection = g_object_ref (connection);
data->stream = g_strdup (stream);
data->publish = publish;
@ -1090,7 +1090,7 @@ stream_task_data_free (gpointer ptr)
g_signal_handler_disconnect (data->connection, data->error_handler_id);
}
g_clear_object (&data->connection);
g_slice_free (StreamTaskData, data);
g_free (data);
}
static void

View file

@ -156,7 +156,7 @@ static Transaction *
transaction_new (gdouble transaction_id, GstRtmpCommandCallback func,
gpointer user_data)
{
Transaction *data = g_slice_new (Transaction);
Transaction *data = g_new (Transaction, 1);
data->transaction_id = transaction_id;
data->func = func;
data->user_data = user_data;
@ -167,7 +167,7 @@ static void
transaction_free (gpointer ptr)
{
Transaction *data = ptr;
g_slice_free (Transaction, data);
g_free (data);
}
typedef struct
@ -182,7 +182,7 @@ static ExpectedCommand *
expected_command_new (guint32 stream_id, const gchar * command_name,
GstRtmpCommandCallback func, gpointer user_data)
{
ExpectedCommand *data = g_slice_new (ExpectedCommand);
ExpectedCommand *data = g_new (ExpectedCommand, 1);
data->stream_id = stream_id;
data->command_name = g_strdup (command_name);
data->func = func;
@ -195,7 +195,7 @@ expected_command_free (gpointer ptr)
{
ExpectedCommand *data = ptr;
g_free (data->command_name);
g_slice_free (ExpectedCommand, data);
g_free (data);
}
enum

View file

@ -93,7 +93,7 @@ handshake_random_data (void)
static HandshakeData *
handshake_data_new (gboolean strict)
{
HandshakeData *data = g_slice_new0 (HandshakeData);
HandshakeData *data = g_new0 (HandshakeData, 1);
data->random_bytes = handshake_random_data ();
data->strict = strict;
return data;
@ -104,7 +104,7 @@ handshake_data_free (gpointer ptr)
{
HandshakeData *data = ptr;
g_clear_pointer (&data->random_bytes, g_bytes_unref);
g_slice_free (HandshakeData, data);
g_free (data);
}
static gboolean

View file

@ -167,7 +167,7 @@ typedef struct
static WriteAllBufferData *
write_all_buffer_data_new (GstBuffer * buffer)
{
WriteAllBufferData *data = g_slice_new0 (WriteAllBufferData);
WriteAllBufferData *data = g_new0 (WriteAllBufferData, 1);
data->buffer = gst_buffer_ref (buffer);
return data;
}
@ -180,7 +180,7 @@ write_all_buffer_data_free (gpointer ptr)
gst_buffer_unmap (data->buffer, &data->map);
}
g_clear_pointer (&data->buffer, gst_buffer_unref);
g_slice_free (WriteAllBufferData, data);
g_free (data);
}
void