mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-10-03 01:02:19 +00:00
client: error out on non-aggregate control
We require aggregate control (for now) for PLAY, PAUSE and TEARDOWN.
This commit is contained in:
parent
9182263532
commit
a1e5bde58d
1 changed files with 31 additions and 0 deletions
|
@ -727,6 +727,10 @@ handle_teardown_request (GstRTSPClient * client, GstRTSPClientState * state)
|
||||||
if (!sessmedia)
|
if (!sessmedia)
|
||||||
goto not_found;
|
goto not_found;
|
||||||
|
|
||||||
|
/* only aggregate control for now.. */
|
||||||
|
if (path[matched] != '\0')
|
||||||
|
goto no_aggregate;
|
||||||
|
|
||||||
state->sessmedia = sessmedia;
|
state->sessmedia = sessmedia;
|
||||||
|
|
||||||
/* we emit the signal before closing the connection */
|
/* we emit the signal before closing the connection */
|
||||||
|
@ -775,6 +779,13 @@ not_found:
|
||||||
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state);
|
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
no_aggregate:
|
||||||
|
{
|
||||||
|
GST_ERROR ("client %p: no aggregate path %s", client, path);
|
||||||
|
send_generic_response (client,
|
||||||
|
GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, state);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstRTSPResult
|
static GstRTSPResult
|
||||||
|
@ -894,6 +905,9 @@ handle_pause_request (GstRTSPClient * client, GstRTSPClientState * state)
|
||||||
if (!sessmedia)
|
if (!sessmedia)
|
||||||
goto not_found;
|
goto not_found;
|
||||||
|
|
||||||
|
if (path[matched] != '\0')
|
||||||
|
goto no_aggregate;
|
||||||
|
|
||||||
state->sessmedia = sessmedia;
|
state->sessmedia = sessmedia;
|
||||||
|
|
||||||
rtspstate = gst_rtsp_session_media_get_rtsp_state (sessmedia);
|
rtspstate = gst_rtsp_session_media_get_rtsp_state (sessmedia);
|
||||||
|
@ -942,6 +956,13 @@ not_found:
|
||||||
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state);
|
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
no_aggregate:
|
||||||
|
{
|
||||||
|
GST_ERROR ("client %p: no aggregate path %s", client, path);
|
||||||
|
send_generic_response (client,
|
||||||
|
GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, state);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
invalid_state:
|
invalid_state:
|
||||||
{
|
{
|
||||||
GST_ERROR ("client %p: not PLAYING or RECORDING", client);
|
GST_ERROR ("client %p: not PLAYING or RECORDING", client);
|
||||||
|
@ -981,6 +1002,9 @@ handle_play_request (GstRTSPClient * client, GstRTSPClientState * state)
|
||||||
if (!sessmedia)
|
if (!sessmedia)
|
||||||
goto not_found;
|
goto not_found;
|
||||||
|
|
||||||
|
if (path[matched] != '\0')
|
||||||
|
goto no_aggregate;
|
||||||
|
|
||||||
state->sessmedia = sessmedia;
|
state->sessmedia = sessmedia;
|
||||||
state->media = media = gst_rtsp_session_media_get_media (sessmedia);
|
state->media = media = gst_rtsp_session_media_get_media (sessmedia);
|
||||||
|
|
||||||
|
@ -1089,6 +1113,13 @@ not_found:
|
||||||
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state);
|
send_generic_response (client, GST_RTSP_STS_NOT_FOUND, state);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
no_aggregate:
|
||||||
|
{
|
||||||
|
GST_ERROR ("client %p: no aggregate path %s", client, path);
|
||||||
|
send_generic_response (client,
|
||||||
|
GST_RTSP_STS_ONLY_AGGREGATE_OPERATION_ALLOWED, state);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
invalid_state:
|
invalid_state:
|
||||||
{
|
{
|
||||||
GST_ERROR ("client %p: not PLAYING or READY", client);
|
GST_ERROR ("client %p: not PLAYING or READY", client);
|
||||||
|
|
Loading…
Reference in a new issue