mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-11 20:01:35 +00:00
rtsp-media: Only count senders when counting blocked streams
Only sender streams sends the GstRTSPStreamBlocking message, so only these should be counted before setting media status to prepared. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/-/merge_requests/180>
This commit is contained in:
parent
d1783cf381
commit
07c009dc80
1 changed files with 13 additions and 12 deletions
|
@ -3164,19 +3164,20 @@ set_target_state (GstRTSPMedia * media, GstState state, gboolean do_state)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
stream_collect_active (GstRTSPStream * stream, guint * active_streams)
|
stream_collect_active_sender (GstRTSPStream * stream, guint * active_streams)
|
||||||
{
|
{
|
||||||
if (gst_rtsp_stream_is_complete (stream))
|
if (gst_rtsp_stream_is_complete (stream)
|
||||||
|
&& gst_rtsp_stream_is_sender (stream))
|
||||||
(*active_streams)++;
|
(*active_streams)++;
|
||||||
}
|
}
|
||||||
|
|
||||||
static guint
|
static guint
|
||||||
nbr_active_streams (GstRTSPMedia * media)
|
nbr_active_sender_streams (GstRTSPMedia * media)
|
||||||
{
|
{
|
||||||
guint ret = 0;
|
guint ret = 0;
|
||||||
|
|
||||||
g_ptr_array_foreach (media->priv->streams, (GFunc) stream_collect_active,
|
g_ptr_array_foreach (media->priv->streams,
|
||||||
&ret);
|
(GFunc) stream_collect_active_sender, &ret);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -3289,7 +3290,7 @@ default_handle_message (GstRTSPMedia * media, GstMessage * message)
|
||||||
s = gst_message_get_structure (message);
|
s = gst_message_get_structure (message);
|
||||||
if (gst_structure_has_name (s, "GstRTSPStreamBlocking")) {
|
if (gst_structure_has_name (s, "GstRTSPStreamBlocking")) {
|
||||||
gboolean is_complete = FALSE;
|
gboolean is_complete = FALSE;
|
||||||
guint n_active_streams;
|
guint n_active_sender_streams;
|
||||||
guint expected_nbr_blocking_msg;
|
guint expected_nbr_blocking_msg;
|
||||||
|
|
||||||
/* to prevent problems when some streams are complete, some are not,
|
/* to prevent problems when some streams are complete, some are not,
|
||||||
|
@ -3297,16 +3298,16 @@ default_handle_message (GstRTSPMedia * media, GstMessage * message)
|
||||||
* streams (during DESCRIBE), we will listen to all streams. */
|
* streams (during DESCRIBE), we will listen to all streams. */
|
||||||
|
|
||||||
gst_structure_get_boolean (s, "is_complete", &is_complete);
|
gst_structure_get_boolean (s, "is_complete", &is_complete);
|
||||||
n_active_streams = nbr_active_streams (media);
|
n_active_sender_streams = nbr_active_sender_streams (media);
|
||||||
expected_nbr_blocking_msg = n_active_streams;
|
expected_nbr_blocking_msg = n_active_sender_streams;
|
||||||
GST_DEBUG_OBJECT (media, "media received blocking message,"
|
GST_DEBUG_OBJECT (media, "media received blocking message,"
|
||||||
" n_active_streams = %d, is_complete = %d",
|
" n_active_sender_streams = %d, is_complete = %d",
|
||||||
n_active_streams, is_complete);
|
n_active_sender_streams, is_complete);
|
||||||
|
|
||||||
if (n_active_streams == 0 || is_complete)
|
if (n_active_sender_streams == 0 || is_complete)
|
||||||
priv->blocking_msg_received++;
|
priv->blocking_msg_received++;
|
||||||
|
|
||||||
if (n_active_streams == 0)
|
if (n_active_sender_streams == 0)
|
||||||
expected_nbr_blocking_msg = priv->streams->len;
|
expected_nbr_blocking_msg = priv->streams->len;
|
||||||
|
|
||||||
if (priv->blocked && media_streams_blocking (media) &&
|
if (priv->blocked && media_streams_blocking (media) &&
|
||||||
|
|
Loading…
Reference in a new issue