mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
Handle state change failures better
Handle state change failures better when changing the state of the pipeline to determine the SDP.
This commit is contained in:
parent
28b65778f6
commit
6f9b659b1d
1 changed files with 11 additions and 1 deletions
|
@ -455,6 +455,7 @@ handle_describe_response (GstRTSPClient *client, const gchar *location, GstRTSPM
|
||||||
GstRTSPMediaFactory *factory;
|
GstRTSPMediaFactory *factory;
|
||||||
GstRTSPMediaBin *mediabin;
|
GstRTSPMediaBin *mediabin;
|
||||||
GstElement *pipeline;
|
GstElement *pipeline;
|
||||||
|
GstStateChangeReturn ret;
|
||||||
|
|
||||||
/* the uri contains the stream number we added in the SDP config, which is
|
/* the uri contains the stream number we added in the SDP config, which is
|
||||||
* always /stream=%d so we need to strip that off */
|
* always /stream=%d so we need to strip that off */
|
||||||
|
@ -499,7 +500,9 @@ handle_describe_response (GstRTSPClient *client, const gchar *location, GstRTSPM
|
||||||
|
|
||||||
/* now play and wait till we get the pads blocked. At that time the pipeline
|
/* now play and wait till we get the pads blocked. At that time the pipeline
|
||||||
* is prerolled and we have the caps on the streams too. */
|
* is prerolled and we have the caps on the streams too. */
|
||||||
gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
ret = gst_element_set_state (pipeline, GST_STATE_PLAYING);
|
||||||
|
if (ret == GST_STATE_CHANGE_FAILURE)
|
||||||
|
goto cant_play;
|
||||||
|
|
||||||
/* wait for state change to complete */
|
/* wait for state change to complete */
|
||||||
gst_element_get_state (pipeline, NULL, NULL, -1);
|
gst_element_get_state (pipeline, NULL, NULL, -1);
|
||||||
|
@ -646,6 +649,13 @@ no_media_bin:
|
||||||
g_object_unref (factory);
|
g_object_unref (factory);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
cant_play:
|
||||||
|
{
|
||||||
|
handle_generic_response (client, GST_RTSP_STS_SERVICE_UNAVAILABLE, request);
|
||||||
|
gst_object_unref (pipeline);
|
||||||
|
g_object_unref (factory);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in a new issue