diff options
author | Patricia Muscalu <patricia@dovakhiin.com> | 2018-02-23 14:34:32 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2018-08-14 14:10:23 +0300 |
commit | a9db3e7f092cfeb5475e9aa24b1e91906c141d52 (patch) | |
tree | f3079df4d000af43f57adf9fd1ad2a74644a61b9 /tests | |
parent | 7f0ae77e400fb8a0462a76a5dd2e63e12c4a2e52 (diff) |
rtsp-stream: Don't require address pool in the transport specific case
If "transport.client-settings" parameter is set to true, the client is
allowed to specify destination, ports and ttl.
There is no need for pre-configured address pool.
https://bugzilla.gnome.org/show_bug.cgi?id=793441
Diffstat (limited to 'tests')
-rw-r--r-- | tests/check/gst/client.c | 51 |
1 files changed, 47 insertions, 4 deletions
diff --git a/tests/check/gst/client.c b/tests/check/gst/client.c index ab95509..d4fdd9e 100644 --- a/tests/check/gst/client.c +++ b/tests/check/gst/client.c @@ -726,7 +726,8 @@ GST_START_TEST (test_client_multicast_ignore_transport_specific) GST_END_TEST; -GST_START_TEST (test_client_multicast_transport_specific) +static void +multicast_transport_specific (void) { GstRTSPClient *client; GstRTSPMessage request = { 0, }; @@ -760,7 +761,6 @@ GST_START_TEST (test_client_multicast_transport_specific) fail_unless (gst_rtsp_client_handle_message (client, &request) == GST_RTSP_OK); gst_rtsp_message_unset (&request); - expected_transport = NULL; gst_rtsp_client_set_send_func (client, test_setup_response_200_multicast, NULL, NULL); @@ -769,14 +769,44 @@ GST_START_TEST (test_client_multicast_transport_specific) fail_unless (gst_rtsp_session_pool_get_n_sessions (session_pool) == 1); g_object_unref (session_pool); - send_teardown (client); + /* send PLAY request */ + fail_unless (gst_rtsp_message_init_request (&request, GST_RTSP_PLAY, + "rtsp://localhost/test") == GST_RTSP_OK); + str = g_strdup_printf ("%d", cseq); + gst_rtsp_message_take_header (&request, GST_RTSP_HDR_CSEQ, str); + gst_rtsp_message_add_header (&request, GST_RTSP_HDR_SESSION, session_id); + gst_rtsp_client_set_send_func (client, test_response_200, NULL, NULL); + fail_unless (gst_rtsp_client_handle_message (client, + &request) == GST_RTSP_OK); + gst_rtsp_message_unset (&request); + send_teardown (client); teardown_client (client); g_object_unref (ctx.auth); gst_rtsp_token_unref (ctx.token); gst_rtsp_context_pop_current (&ctx); } +/* CASE: multicast address requested by the client exists in the address pool */ +GST_START_TEST (test_client_multicast_transport_specific) +{ + expected_transport = "RTP/AVP;multicast;destination=233.252.0.1;" + "ttl=1;port=5000-5001;mode=\"PLAY\""; + multicast_transport_specific (); + expected_transport = NULL; +} + +GST_END_TEST; + +/* CASE: multicast address requested by the client does not exist in the address pool */ +GST_START_TEST (test_client_multicast_transport_specific_no_address_in_pool) +{ + expected_transport = "RTP/AVP;multicast;destination=234.252.0.3;" + "ttl=1;port=6000-6001;mode=\"PLAY\""; + multicast_transport_specific (); + expected_transport = NULL; +} + GST_END_TEST; static gboolean @@ -1061,7 +1091,8 @@ mcast_transport_specific_two_clients (gboolean shared) g_object_unref (thread_pool); } -/* test if two multicast clients can choose different transport settings */ +/* test if two multicast clients can choose different transport settings + * CASE: media is shared */ GST_START_TEST (test_client_multicast_transport_specific_two_clients_shared_media) { mcast_transport_specific_two_clients (TRUE); @@ -1069,6 +1100,15 @@ GST_START_TEST GST_END_TEST; +/* test if two multicast clients can choose different transport settings + * CASE: media is not shared */ +GST_START_TEST (test_client_multicast_transport_specific_two_clients) +{ + mcast_transport_specific_two_clients (FALSE); +} + +GST_END_TEST; + static Suite * rtspclient_suite (void) { @@ -1091,6 +1131,9 @@ rtspclient_suite (void) tcase_add_test (tc, test_client_sdp_with_no_bitrate_tags); tcase_add_test (tc, test_client_multicast_transport_specific_two_clients_shared_media); + tcase_add_test (tc, test_client_multicast_transport_specific_two_clients); + tcase_add_test (tc, + test_client_multicast_transport_specific_no_address_in_pool); return s; } |