gboolean gst_rtsp_server_start_client (GstRTSPServer * server, GstRTSPClient *client);
gboolean gst_rtsp_server_pause_client (GstRTSPServer * server, GstRTSPClient *client);
gboolean gst_rtsp_server_resume_client (GstRTSPServer * server, GstRTSPClient *client);
+gboolean gst_rtsp_server_standby_client (GstRTSPServer * server, GstRTSPClient *client);
gboolean gst_rtsp_server_stop_client (GstRTSPServer * server, GstRTSPClient *client);
void gst_rtsp_server_set_client_params (GstRTSPServer * server, GstRTSPClient *client, int videosrc_type, gint session_mode, int videobitrate, gchar *infile);
G_END_DECLS
}
/**
+* handle_M12_message:
+* @client: client object
+*
+* Handles M12 WFD message.
+* This API will send M5 SETUP trigger message using SET_PARAMETER to WFDSink to intimate that client request SETUP now.
+*
+* Returns: a #GstRTSPResult.
+*/
+static GstRTSPResult
+handle_M12_message (GstRTSPClient * client)
+{
+ GstRTSPResult res = GST_RTSP_OK;
+ GstRTSPMessage request = { 0 };
+ GstRTSPMessage response = { 0 };
+ GstRTSPUrl *url = NULL;
+ gchar *url_str = NULL;
+ GstRTSPSession *session = NULL;
+ GstRTSPSessionMedia *media;
+ GstRTSPStatusCode code;
+
+ url = gst_rtsp_connection_get_url (client->connection);
+ if (url == NULL) {
+ GST_ERROR_OBJECT (client, "Failed to get connection URL");
+ return GST_RTSP_ERROR;
+ }
+
+ url_str = gst_rtsp_url_get_request_uri (url);
+ if (url_str == NULL) {
+ GST_ERROR_OBJECT (client, "Failed to get connection URL");
+ return GST_RTSP_ERROR;
+ }
+
+ /* prepare the request for M12 message */
+ res = prepare_request (client, &request, GST_RTSP_SET_PARAMETER, url_str, WFD_MESSAGE_12, WFD_TRIGGER_UNKNOWN);
+ if (GST_RTSP_OK != res) {
+ GST_ERROR_OBJECT (client, "Failed to prepare M12 request....\n");
+ return res;
+ }
+
+ GST_DEBUG_OBJECT (client, "Sending SET_PARAMETER request message (M12)...");
+
+ // TODO: need to add session i.e. 2nd variable
+ if (client->sessionid) {
+ session = gst_rtsp_session_pool_find (client->session_pool, client->sessionid);
+ GST_INFO_OBJECT (client, "session = %p & sessionid = %s", session, session->sessionid);
+ }
+ send_request (client, session, &request);
+
+ /* Wait for the M12 response from WFDSink */
+ res = gst_rtsp_connection_receive (client->connection, &response, NULL);
+ if (GST_RTSP_OK != res) {
+ GST_ERROR ("Failed to received response....\n");
+ return FALSE;
+ }
+
+ if (gst_debug_category_get_threshold (rtsp_client_debug) >= GST_LEVEL_LOG) {
+ gst_rtsp_message_dump (&response);
+ }
+ if (!(session = gst_rtsp_session_pool_find (client->session_pool, client->sessionID)))
+ {
+ GST_ERROR_OBJECT (client, "Failed to handle B1 message...");
+ return FALSE;
+ }
+ GST_DEBUG ("sessid = %s", client->sessionID);
+
+ media = session->medias->data;
+
+ /* unlink the all TCP callbacks */
+ unlink_session_streams (client, session, media);
+
+ /* then pause sending */
+ gst_rtsp_session_media_set_state (media, GST_STATE_PAUSED);
+
+ /* the state is now READY */
+ media->state = GST_RTSP_STATE_READY;
+
+ return res;
+
+}
+/**
* gst_rtsp_client_negotiate:
* @client: client object
*
}
gboolean
+gst_rtsp_client_standby(GstRTSPClient * client)
+{
+ GstRTSPResult res = GST_RTSP_OK;
+ res = handle_M12_message (client);
+ if (GST_RTSP_OK != res) {
+ GST_ERROR_OBJECT (client, "Failed to handle M12 message...");
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+gboolean
gst_rtsp_client_stop (GstRTSPClient * client)
{
GstRTSPResult res = GST_RTSP_OK;