mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +00:00
multihandlesink: Remove useless streamheader storage
We don't do anything with it but always get them from the caps anyway, so stop storing them and having complicated logic around that. https://bugzilla.gnome.org/show_bug.cgi?id=763278
This commit is contained in:
parent
1d4fb48718
commit
65390b5129
4 changed files with 11 additions and 38 deletions
|
@ -1959,32 +1959,15 @@ gst_multi_handle_sink_render (GstBaseSink * bsink, GstBuffer * buf)
|
||||||
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
|
GST_TIME_ARGS (GST_BUFFER_TIMESTAMP (buf)),
|
||||||
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
|
GST_TIME_ARGS (GST_BUFFER_DURATION (buf)));
|
||||||
|
|
||||||
/* if we get IN_CAPS buffers, but the previous buffer was not IN_CAPS,
|
/* if the incoming buffer is a streamheader from the caps, then we assume for now
|
||||||
* it means we're getting new streamheader buffers, and we should clear
|
* it's a streamheader that needs to be sent to each new client.
|
||||||
* the old ones */
|
|
||||||
if (is_header && !sink->previous_buffer_is_header) {
|
|
||||||
GST_DEBUG_OBJECT (sink,
|
|
||||||
"receiving new HEADER buffers, clearing old streamheader");
|
|
||||||
g_slist_foreach (sink->streamheader, (GFunc) gst_mini_object_unref, NULL);
|
|
||||||
g_slist_free (sink->streamheader);
|
|
||||||
sink->streamheader = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* save the current in_caps */
|
|
||||||
sink->previous_buffer_is_header = is_header;
|
|
||||||
|
|
||||||
/* if the incoming buffer is marked as IN CAPS, then we assume for now
|
|
||||||
* it's a streamheader that needs to be sent to each new client, so we
|
|
||||||
* put it on our internal list of streamheader buffers.
|
|
||||||
* FIXME: we could check if the buffer's contents are in fact part of the
|
|
||||||
* current streamheader.
|
|
||||||
*
|
*
|
||||||
* We don't send the buffer to the client, since streamheaders are sent
|
* We don't send the buffer to the client, since streamheaders are sent
|
||||||
* separately when necessary. */
|
* separately when necessary. */
|
||||||
if (in_caps) {
|
if (in_caps) {
|
||||||
GST_DEBUG_OBJECT (sink, "appending HEADER buffer with length %"
|
GST_DEBUG_OBJECT (sink, "ignoring HEADER buffer with length %"
|
||||||
G_GSIZE_FORMAT " to streamheader", gst_buffer_get_size (buf));
|
G_GSIZE_FORMAT, gst_buffer_get_size (buf));
|
||||||
sink->streamheader = g_slist_append (sink->streamheader, buf);
|
gst_buffer_unref (buf);
|
||||||
} else {
|
} else {
|
||||||
/* queue the buffer, this is a regular data buffer. */
|
/* queue the buffer, this is a regular data buffer. */
|
||||||
gst_multi_handle_sink_queue_buffer (sink, buf);
|
gst_multi_handle_sink_queue_buffer (sink, buf);
|
||||||
|
@ -2162,7 +2145,6 @@ gst_multi_handle_sink_start (GstBaseSink * bsink)
|
||||||
if (!mhsclass->start_pre (mhsink))
|
if (!mhsclass->start_pre (mhsink))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
mhsink->streamheader = NULL;
|
|
||||||
mhsink->bytes_to_serve = 0;
|
mhsink->bytes_to_serve = 0;
|
||||||
mhsink->bytes_served = 0;
|
mhsink->bytes_served = 0;
|
||||||
|
|
||||||
|
@ -2207,12 +2189,6 @@ gst_multi_handle_sink_stop (GstBaseSink * bsink)
|
||||||
/* free the clients */
|
/* free the clients */
|
||||||
mhclass->clear (GST_MULTI_HANDLE_SINK (mhsink));
|
mhclass->clear (GST_MULTI_HANDLE_SINK (mhsink));
|
||||||
|
|
||||||
if (mhsink->streamheader) {
|
|
||||||
g_slist_foreach (mhsink->streamheader, (GFunc) gst_mini_object_unref, NULL);
|
|
||||||
g_slist_free (mhsink->streamheader);
|
|
||||||
mhsink->streamheader = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mhclass->close)
|
if (mhclass->close)
|
||||||
mhclass->close (mhsink);
|
mhclass->close (mhsink);
|
||||||
|
|
||||||
|
|
|
@ -202,9 +202,6 @@ struct _GstMultiHandleSink {
|
||||||
GMainContext *main_context;
|
GMainContext *main_context;
|
||||||
GCancellable *cancellable;
|
GCancellable *cancellable;
|
||||||
|
|
||||||
GSList *streamheader; /* GSList of GstBuffers to use as streamheader */
|
|
||||||
gboolean previous_buffer_is_header;
|
|
||||||
|
|
||||||
gint qos_dscp;
|
gint qos_dscp;
|
||||||
|
|
||||||
GArray *bufqueue; /* global queue of buffers */
|
GArray *bufqueue; /* global queue of buffers */
|
||||||
|
|
|
@ -400,9 +400,9 @@ GST_START_TEST (test_change_streamheader)
|
||||||
|
|
||||||
/* change the streamheader */
|
/* change the streamheader */
|
||||||
|
|
||||||
/* before we change, multifdsink still has a list of the old streamheaders */
|
/* only we have a reference to the streamheaders now */
|
||||||
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 2);
|
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 1);
|
||||||
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 2);
|
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 1);
|
||||||
gst_buffer_unref (hbuf1);
|
gst_buffer_unref (hbuf1);
|
||||||
gst_buffer_unref (hbuf2);
|
gst_buffer_unref (hbuf2);
|
||||||
|
|
||||||
|
|
|
@ -542,9 +542,9 @@ GST_START_TEST (test_change_streamheader)
|
||||||
|
|
||||||
/* change the streamheader */
|
/* change the streamheader */
|
||||||
|
|
||||||
/* before we change, multisocketsink still has a list of the old streamheaders */
|
/* only we have a reference to the streamheaders now */
|
||||||
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 2);
|
ASSERT_BUFFER_REFCOUNT (hbuf1, "hbuf1", 1);
|
||||||
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 2);
|
ASSERT_BUFFER_REFCOUNT (hbuf2, "hbuf2", 1);
|
||||||
gst_buffer_unref (hbuf1);
|
gst_buffer_unref (hbuf1);
|
||||||
gst_buffer_unref (hbuf2);
|
gst_buffer_unref (hbuf2);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue