GstRTSPResult res = GST_RTSP_OK;
gchar *str = NULL;
- if (method == GST_RTSP_GET_PARAMETER || method == GST_RTSP_SET_PARAMETER) {
- g_free (url);
- url = g_strdup ("rtsp://localhost/wfd1.0");
- }
-
GST_DEBUG_OBJECT (client, "Preparing request: %d", method);
/* initialize the request */
res = gst_rtsp_message_init_request (request, method, url);
- if (method == GST_RTSP_GET_PARAMETER || method == GST_RTSP_SET_PARAMETER) {
- g_free (url);
- }
-
if (res < 0) {
GST_ERROR ("init request failed");
return res;
{
GstRTSPResult res = GST_RTSP_OK;
GstRTSPMessage request = { 0 };
- GstRTSPUrl *url = NULL;
- gchar *url_str = NULL;
-
- GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client);
- GstRTSPConnection *connection =
- gst_rtsp_client_get_connection (parent_client);
-
- url = gst_rtsp_connection_get_url (connection);
- if (url == NULL) {
- GST_ERROR_OBJECT (client, "Failed to get connection URL");
- res = GST_RTSP_ERROR;
- goto error;
- }
- url_str = gst_rtsp_url_get_request_uri (url);
- if (url_str == NULL) {
- GST_ERROR_OBJECT (client, "Failed to get connection URL");
- res = GST_RTSP_ERROR;
- goto error;
- }
+ res = gst_prepare_request (client, &request, GST_RTSP_GET_PARAMETER,
+ (gchar *) "rtsp://localhost/wfd1.0");
- res = gst_prepare_request (client, &request, GST_RTSP_GET_PARAMETER, url_str);
if (GST_RTSP_OK != res) {
GST_ERROR_OBJECT (client, "Failed to prepare M3 request....\n");
goto error;
GST_DEBUG_OBJECT (client, "Sending GET_PARAMETER request message (M3)...");
gst_send_request (client, NULL, &request);
- g_free(url_str);
+
return res;
error:
- g_free(url_str);
return res;
}
{
GstRTSPResult res = GST_RTSP_OK;
GstRTSPMessage request = { 0 };
- GstRTSPUrl *url = NULL;
- gchar *url_str = NULL;
-
- GstRTSPClient *parent_client = GST_RTSP_CLIENT_CAST (client);
- GstRTSPConnection *connection =
- gst_rtsp_client_get_connection (parent_client);
-
- url = gst_rtsp_connection_get_url (connection);
- if (url == NULL) {
- GST_ERROR_OBJECT (client, "Failed to get connection URL");
- res = GST_RTSP_ERROR;
- goto error;
- }
- url_str = gst_rtsp_url_get_request_uri (url);
- if (url_str == NULL) {
- GST_ERROR_OBJECT (client, "Failed to get connection URL");
- res = GST_RTSP_ERROR;
- goto error;
- }
+ res = gst_prepare_request (client, &request, GST_RTSP_SET_PARAMETER,
+ (gchar *) "rtsp://localhost/wfd1.0");
- res = gst_prepare_request (client, &request, GST_RTSP_SET_PARAMETER, url_str);
if (GST_RTSP_OK != res) {
GST_ERROR_OBJECT (client, "Failed to prepare M4 request....\n");
goto error;
}
res = prepare_trigger_request (client, &request, type, url_str);
+ g_free (url_str);
+
if (GST_RTSP_OK != res) {
GST_ERROR_OBJECT (client, "Failed to prepare M5 request....\n");
goto error;
{
GstRTSPResult res = GST_RTSP_OK;
GstRTSPMessage request = { 0 };
- gchar *url_str = NULL;
- url_str = g_strdup ("rtsp://localhost/wfd1.0");
+ res = gst_rtsp_message_init_request (&request, GST_RTSP_GET_PARAMETER,
+ (gchar *) "rtsp://localhost/wfd1.0");
- res =
- gst_rtsp_message_init_request (&request, GST_RTSP_GET_PARAMETER, url_str);
if (res < 0) {
GST_ERROR ("init request failed");
- g_free (url_str);
return FALSE;
}
gst_send_request (client, NULL, &request);
- g_free (url_str);
return GST_RTSP_OK;
}