5 * Copyright (C) <2005> Thomas Vander Stichele <thomas at apestaart dot org>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
17 * You should have received a copy of the GNU Library General Public
18 * License along with this library; if not, write to the
19 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
20 * Boston, MA 02111-1307, USA.
28 # include <valgrind/valgrind.h>
33 #include <gst/check/gstcheck.h>
35 static GMainLoop *main_loop;
38 message_received (GstBus * bus, GstMessage * message, GstPipeline * bin)
40 GST_INFO ("bus message from \"%" GST_PTR_FORMAT "\": %" GST_PTR_FORMAT,
41 GST_MESSAGE_SRC (message), message);
43 switch (message->type) {
45 g_main_loop_quit (main_loop);
47 case GST_MESSAGE_WARNING:{
51 gst_message_parse_warning (message, &gerror, &debug);
52 gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
53 g_error_free (gerror);
57 case GST_MESSAGE_ERROR:{
61 gst_message_parse_error (message, &gerror, &debug);
62 gst_object_default_error (GST_MESSAGE_SRC (message), gerror, debug);
63 g_error_free (gerror);
65 g_main_loop_quit (main_loop);
74 static GstFormat format = GST_FORMAT_UNDEFINED;
75 static gint64 position = -1;
78 test_event_message_received (GstBus * bus, GstMessage * message,
81 GST_INFO ("bus message from \"%" GST_PTR_FORMAT "\": %" GST_PTR_FORMAT,
82 GST_MESSAGE_SRC (message), message);
84 switch (message->type) {
85 case GST_MESSAGE_SEGMENT_DONE:
86 gst_message_parse_segment_done (message, &format, &position);
87 GST_INFO ("received segment_done : %" G_GINT64_FORMAT, position);
88 g_main_loop_quit (main_loop);
91 g_assert_not_reached ();
97 GST_START_TEST (test_event)
99 GstElement *bin, *src1, *src2, *adder, *sink;
101 GstEvent *seek_event;
104 GST_INFO ("preparing test");
107 bin = gst_pipeline_new ("pipeline");
108 bus = gst_element_get_bus (bin);
109 gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH);
111 /* FIXME, fakesrc with default setting will produce 0 sized
112 * buffers and incompatible caps for adder that will make
113 * adder EOS and error out */
114 src1 = gst_element_factory_make ("audiotestsrc", "src1");
115 g_object_set (src1, "wave", 4, NULL); /* silence */
116 src2 = gst_element_factory_make ("audiotestsrc", "src2");
117 g_object_set (src2, "wave", 4, NULL); /* silence */
118 adder = gst_element_factory_make ("adder", "adder");
119 sink = gst_element_factory_make ("fakesink", "sink");
120 gst_bin_add_many (GST_BIN (bin), src1, src2, adder, sink, NULL);
122 res = gst_element_link (src1, adder);
123 fail_unless (res == TRUE, NULL);
124 res = gst_element_link (src2, adder);
125 fail_unless (res == TRUE, NULL);
126 res = gst_element_link (adder, sink);
127 fail_unless (res == TRUE, NULL);
129 seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
130 GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_FLUSH,
131 GST_SEEK_TYPE_SET, (GstClockTime) 0,
132 GST_SEEK_TYPE_SET, (GstClockTime) 2 * GST_SECOND);
134 format = GST_FORMAT_UNDEFINED;
137 main_loop = g_main_loop_new (NULL, FALSE);
138 g_signal_connect (bus, "message::segment-done",
139 (GCallback) test_event_message_received, bin);
140 g_signal_connect (bus, "message::error", (GCallback) message_received, bin);
141 g_signal_connect (bus, "message::warning", (GCallback) message_received, bin);
142 g_signal_connect (bus, "message::eos", (GCallback) message_received, bin);
144 GST_INFO ("starting test");
146 /* prepare playing */
147 res = gst_element_set_state (bin, GST_STATE_PAUSED);
148 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
150 /* wait for completion */
151 res = gst_element_get_state (bin, NULL, NULL, GST_CLOCK_TIME_NONE);
152 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
154 res = gst_element_send_event (bin, seek_event);
155 fail_unless (res == TRUE, NULL);
158 res = gst_element_set_state (bin, GST_STATE_PLAYING);
159 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
161 g_main_loop_run (main_loop);
163 res = gst_element_set_state (bin, GST_STATE_NULL);
164 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
166 fail_unless (position == 2 * GST_SECOND, NULL);
169 g_main_loop_unref (main_loop);
170 gst_object_unref (G_OBJECT (bus));
171 gst_object_unref (G_OBJECT (bin));
176 static guint play_count = 0;
177 static GstEvent *play_seek_event = NULL;
180 test_play_twice_message_received (GstBus * bus, GstMessage * message,
185 GST_INFO ("bus message from \"%" GST_PTR_FORMAT "\": %" GST_PTR_FORMAT,
186 GST_MESSAGE_SRC (message), message);
188 switch (message->type) {
189 case GST_MESSAGE_SEGMENT_DONE:
191 if (play_count == 1) {
192 res = gst_element_set_state (GST_ELEMENT (bin), GST_STATE_READY);
193 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
195 /* prepare playing again */
196 res = gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PAUSED);
197 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
199 /* wait for completion */
201 gst_element_get_state (GST_ELEMENT (bin), NULL, NULL,
202 GST_CLOCK_TIME_NONE);
203 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
205 res = gst_element_send_event (GST_ELEMENT (bin),
206 gst_event_ref (play_seek_event));
207 fail_unless (res == TRUE, NULL);
209 res = gst_element_set_state (GST_ELEMENT (bin), GST_STATE_PLAYING);
210 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
212 g_main_loop_quit (main_loop);
216 g_assert_not_reached ();
222 GST_START_TEST (test_play_twice)
224 GstElement *bin, *src1, *src2, *adder, *sink;
228 GST_INFO ("preparing test");
231 bin = gst_pipeline_new ("pipeline");
232 bus = gst_element_get_bus (bin);
233 gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH);
235 src1 = gst_element_factory_make ("audiotestsrc", "src1");
236 g_object_set (src1, "wave", 4, NULL); /* silence */
237 src2 = gst_element_factory_make ("audiotestsrc", "src2");
238 g_object_set (src2, "wave", 4, NULL); /* silence */
239 adder = gst_element_factory_make ("adder", "adder");
240 sink = gst_element_factory_make ("fakesink", "sink");
241 gst_bin_add_many (GST_BIN (bin), src1, src2, adder, sink, NULL);
243 res = gst_element_link (src1, adder);
244 fail_unless (res == TRUE, NULL);
245 res = gst_element_link (src2, adder);
246 fail_unless (res == TRUE, NULL);
247 res = gst_element_link (adder, sink);
248 fail_unless (res == TRUE, NULL);
250 play_seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
251 GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_FLUSH,
252 GST_SEEK_TYPE_SET, (GstClockTime) 0,
253 GST_SEEK_TYPE_SET, (GstClockTime) 2 * GST_SECOND);
257 main_loop = g_main_loop_new (NULL, FALSE);
258 g_signal_connect (bus, "message::segment-done",
259 (GCallback) test_play_twice_message_received, bin);
260 g_signal_connect (bus, "message::error", (GCallback) message_received, bin);
261 g_signal_connect (bus, "message::warning", (GCallback) message_received, bin);
262 g_signal_connect (bus, "message::eos", (GCallback) message_received, bin);
264 GST_INFO ("starting test");
266 /* prepare playing */
267 res = gst_element_set_state (bin, GST_STATE_PAUSED);
268 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
270 /* wait for completion */
272 gst_element_get_state (GST_ELEMENT (bin), NULL, NULL,
273 GST_CLOCK_TIME_NONE);
274 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
276 res = gst_element_send_event (bin, gst_event_ref (play_seek_event));
277 fail_unless (res == TRUE, NULL);
282 res = gst_element_set_state (bin, GST_STATE_PLAYING);
283 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
285 g_main_loop_run (main_loop);
287 res = gst_element_set_state (bin, GST_STATE_NULL);
288 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
290 fail_unless (play_count == 2, NULL);
293 g_main_loop_unref (main_loop);
294 gst_event_ref (play_seek_event);
295 gst_object_unref (G_OBJECT (bus));
296 gst_object_unref (G_OBJECT (bin));
301 GST_START_TEST (test_play_twice_then_add_and_play_again)
303 GstElement *bin, *src1, *src2, *src3, *adder, *sink;
308 GST_INFO ("preparing test");
311 bin = gst_pipeline_new ("pipeline");
312 bus = gst_element_get_bus (bin);
313 gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH);
315 src1 = gst_element_factory_make ("audiotestsrc", "src1");
316 g_object_set (src1, "wave", 4, NULL); /* silence */
317 src2 = gst_element_factory_make ("audiotestsrc", "src2");
318 g_object_set (src2, "wave", 4, NULL); /* silence */
319 adder = gst_element_factory_make ("adder", "adder");
320 sink = gst_element_factory_make ("fakesink", "sink");
321 gst_bin_add_many (GST_BIN (bin), src1, src2, adder, sink, NULL);
323 res = gst_element_link (src1, adder);
324 fail_unless (res == TRUE, NULL);
325 res = gst_element_link (src2, adder);
326 fail_unless (res == TRUE, NULL);
327 res = gst_element_link (adder, sink);
328 fail_unless (res == TRUE, NULL);
330 play_seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
331 GST_SEEK_FLAG_SEGMENT | GST_SEEK_FLAG_FLUSH,
332 GST_SEEK_TYPE_SET, (GstClockTime) 0,
333 GST_SEEK_TYPE_SET, (GstClockTime) 2 * GST_SECOND);
335 main_loop = g_main_loop_new (NULL, FALSE);
336 g_signal_connect (bus, "message::segment-done",
337 (GCallback) test_play_twice_message_received, bin);
338 g_signal_connect (bus, "message::error", (GCallback) message_received, bin);
339 g_signal_connect (bus, "message::warning", (GCallback) message_received, bin);
340 g_signal_connect (bus, "message::eos", (GCallback) message_received, bin);
343 for (i = 0; i < 2; i++) {
346 GST_INFO ("starting test-loop %d", i);
348 /* prepare playing */
349 res = gst_element_set_state (bin, GST_STATE_PAUSED);
350 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
352 /* wait for completion */
354 gst_element_get_state (GST_ELEMENT (bin), NULL, NULL,
355 GST_CLOCK_TIME_NONE);
356 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
358 res = gst_element_send_event (bin, gst_event_ref (play_seek_event));
359 fail_unless (res == TRUE, NULL);
364 res = gst_element_set_state (bin, GST_STATE_PLAYING);
365 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
367 g_main_loop_run (main_loop);
369 res = gst_element_set_state (bin, GST_STATE_READY);
370 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
372 fail_unless (play_count == 2, NULL);
374 /* plug another source */
376 src3 = gst_element_factory_make ("audiotestsrc", "src3");
377 g_object_set (src3, "wave", 4, NULL); /* silence */
378 gst_bin_add (GST_BIN (bin), src3);
380 res = gst_element_link (src3, adder);
381 fail_unless (res == TRUE, NULL);
385 res = gst_element_set_state (bin, GST_STATE_NULL);
386 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
389 g_main_loop_unref (main_loop);
390 gst_event_ref (play_seek_event);
391 gst_object_unref (G_OBJECT (bus));
392 gst_object_unref (G_OBJECT (bin));
399 test_live_seeking_eos_message_received (GstBus * bus, GstMessage * message,
402 GST_INFO ("bus message from \"%" GST_PTR_FORMAT "\": %" GST_PTR_FORMAT,
403 GST_MESSAGE_SRC (message), message);
405 switch (message->type) {
406 case GST_MESSAGE_EOS:
407 g_main_loop_quit (main_loop);
410 g_assert_not_reached ();
416 /* test failing seeks on live-sources */
417 GST_START_TEST (test_live_seeking)
419 GstElement *bin, *src1, *src2, *ac1, *ac2, *adder, *sink;
424 GST_INFO ("preparing test");
427 bin = gst_pipeline_new ("pipeline");
428 bus = gst_element_get_bus (bin);
429 gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH);
431 /* normal audiosources behave differently than audiotestsrc */
433 src1 = gst_element_factory_make ("audiotestsrc", "src1");
434 g_object_set (src1, "wave", 4, "is-live", TRUE, NULL); /* silence */
436 src1 = gst_element_factory_make ("alsasrc", "src1");
438 GST_INFO ("no audiosrc, skipping");
440 /* live sources ignore seeks, force eos after 2 sec (4 buffers half second
441 * each) - don't use autoaudiosrc, as then we can't set anything here */
442 g_object_set (src1, "num-buffers", 4, "blocksize", 44100, NULL);
444 ac1 = gst_element_factory_make ("audioconvert", "ac1");
445 src2 = gst_element_factory_make ("audiotestsrc", "src2");
446 g_object_set (src2, "wave", 4, NULL); /* silence */
447 ac2 = gst_element_factory_make ("audioconvert", "ac2");
448 adder = gst_element_factory_make ("adder", "adder");
449 sink = gst_element_factory_make ("fakesink", "sink");
450 gst_bin_add_many (GST_BIN (bin), src1, ac1, src2, ac2, adder, sink, NULL);
452 res = gst_element_link (src1, ac1);
453 fail_unless (res == TRUE, NULL);
454 res = gst_element_link (ac1, adder);
455 fail_unless (res == TRUE, NULL);
456 res = gst_element_link (src2, ac2);
457 fail_unless (res == TRUE, NULL);
458 res = gst_element_link (ac2, adder);
459 fail_unless (res == TRUE, NULL);
460 res = gst_element_link (adder, sink);
461 fail_unless (res == TRUE, NULL);
463 play_seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME,
465 GST_SEEK_TYPE_SET, (GstClockTime) 0,
466 GST_SEEK_TYPE_SET, (GstClockTime) 2 * GST_SECOND);
468 main_loop = g_main_loop_new (NULL, FALSE);
469 g_signal_connect (bus, "message::error", (GCallback) message_received, bin);
470 g_signal_connect (bus, "message::warning", (GCallback) message_received, bin);
471 g_signal_connect (bus, "message::eos",
472 (GCallback) test_live_seeking_eos_message_received, bin);
475 for (i = 0; i < 2; i++) {
477 GST_INFO ("starting test-loop %d", i);
479 /* prepare playing */
480 res = gst_element_set_state (bin, GST_STATE_PAUSED);
481 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
483 /* wait for completion */
485 gst_element_get_state (GST_ELEMENT (bin), NULL, NULL,
486 GST_CLOCK_TIME_NONE);
487 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
489 res = gst_element_send_event (bin, gst_event_ref (play_seek_event));
491 fail_unless (res == TRUE, NULL);
493 /* adder is picky, if a single seek fails it totaly fails */
494 fail_unless (res == FALSE, NULL);
500 res = gst_element_set_state (bin, GST_STATE_PLAYING);
501 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
503 GST_INFO ("playing");
505 g_main_loop_run (main_loop);
507 res = gst_element_set_state (bin, GST_STATE_NULL);
508 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
512 g_main_loop_unref (main_loop);
513 gst_event_unref (play_seek_event);
514 gst_object_unref (G_OBJECT (bus));
515 gst_object_unref (G_OBJECT (bin));
520 /* check if adding pads work as expected */
521 GST_START_TEST (test_add_pad)
523 GstElement *bin, *src1, *src2, *adder, *sink;
527 GST_INFO ("preparing test");
530 bin = gst_pipeline_new ("pipeline");
531 bus = gst_element_get_bus (bin);
532 gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH);
534 src1 = gst_element_factory_make ("audiotestsrc", "src1");
535 g_object_set (src1, "num-buffers", 4, NULL);
536 g_object_set (src1, "wave", 4, NULL); /* silence */
537 src2 = gst_element_factory_make ("audiotestsrc", "src2");
538 /* one buffer less, we connect with 1 buffer of delay */
539 g_object_set (src2, "num-buffers", 3, NULL);
540 g_object_set (src2, "wave", 4, NULL); /* silence */
541 adder = gst_element_factory_make ("adder", "adder");
542 sink = gst_element_factory_make ("fakesink", "sink");
543 gst_bin_add_many (GST_BIN (bin), src1, adder, sink, NULL);
545 res = gst_element_link (src1, adder);
546 fail_unless (res == TRUE, NULL);
547 res = gst_element_link (adder, sink);
548 fail_unless (res == TRUE, NULL);
550 main_loop = g_main_loop_new (NULL, FALSE);
551 g_signal_connect (bus, "message::segment-done", (GCallback) message_received,
553 g_signal_connect (bus, "message::error", (GCallback) message_received, bin);
554 g_signal_connect (bus, "message::warning", (GCallback) message_received, bin);
555 g_signal_connect (bus, "message::eos", (GCallback) message_received, bin);
557 GST_INFO ("starting test");
559 /* prepare playing */
560 res = gst_element_set_state (bin, GST_STATE_PAUSED);
561 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
563 /* wait for completion */
565 gst_element_get_state (GST_ELEMENT (bin), NULL, NULL,
566 GST_CLOCK_TIME_NONE);
567 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
569 /* add other element */
570 gst_bin_add_many (GST_BIN (bin), src2, NULL);
572 /* now link the second element */
573 res = gst_element_link (src2, adder);
574 fail_unless (res == TRUE, NULL);
576 /* set to PAUSED as well */
577 res = gst_element_set_state (src2, GST_STATE_PAUSED);
580 res = gst_element_set_state (bin, GST_STATE_PLAYING);
581 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
583 g_main_loop_run (main_loop);
585 res = gst_element_set_state (bin, GST_STATE_NULL);
586 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
589 g_main_loop_unref (main_loop);
590 gst_object_unref (G_OBJECT (bus));
591 gst_object_unref (G_OBJECT (bin));
596 /* check if removing pads work as expected */
597 GST_START_TEST (test_remove_pad)
599 GstElement *bin, *src, *adder, *sink;
604 GST_INFO ("preparing test");
607 bin = gst_pipeline_new ("pipeline");
608 bus = gst_element_get_bus (bin);
609 gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH);
611 src = gst_element_factory_make ("audiotestsrc", "src");
612 g_object_set (src, "num-buffers", 4, NULL);
613 g_object_set (src, "wave", 4, NULL);
614 adder = gst_element_factory_make ("adder", "adder");
615 sink = gst_element_factory_make ("fakesink", "sink");
616 gst_bin_add_many (GST_BIN (bin), src, adder, sink, NULL);
618 res = gst_element_link (src, adder);
619 fail_unless (res == TRUE, NULL);
620 res = gst_element_link (adder, sink);
621 fail_unless (res == TRUE, NULL);
623 /* create an unconnected sinkpad in adder */
624 pad = gst_element_get_request_pad (adder, "sink%d");
625 fail_if (pad == NULL, NULL);
627 main_loop = g_main_loop_new (NULL, FALSE);
628 g_signal_connect (bus, "message::segment-done", (GCallback) message_received,
630 g_signal_connect (bus, "message::error", (GCallback) message_received, bin);
631 g_signal_connect (bus, "message::warning", (GCallback) message_received, bin);
632 g_signal_connect (bus, "message::eos", (GCallback) message_received, bin);
634 GST_INFO ("starting test");
636 /* prepare playing, this will not preroll as adder is waiting
637 * on the unconnected sinkpad. */
638 res = gst_element_set_state (bin, GST_STATE_PAUSED);
639 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
641 /* wait for completion for one second, will return ASYNC */
642 res = gst_element_get_state (GST_ELEMENT (bin), NULL, NULL, GST_SECOND);
643 fail_unless (res == GST_STATE_CHANGE_ASYNC, NULL);
645 /* get rid of the pad now, adder should stop waiting on it and
646 * continue the preroll */
647 gst_element_release_request_pad (adder, pad);
648 gst_object_unref (pad);
650 /* wait for completion, should work now */
652 gst_element_get_state (GST_ELEMENT (bin), NULL, NULL,
653 GST_CLOCK_TIME_NONE);
654 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
657 res = gst_element_set_state (bin, GST_STATE_PLAYING);
658 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
660 g_main_loop_run (main_loop);
662 res = gst_element_set_state (bin, GST_STATE_NULL);
663 fail_unless (res != GST_STATE_CHANGE_FAILURE, NULL);
666 g_main_loop_unref (main_loop);
667 gst_object_unref (G_OBJECT (bus));
668 gst_object_unref (G_OBJECT (bin));
677 Suite *s = suite_create ("adder");
678 TCase *tc_chain = tcase_create ("general");
680 suite_add_tcase (s, tc_chain);
681 tcase_add_test (tc_chain, test_event);
682 tcase_add_test (tc_chain, test_play_twice);
683 tcase_add_test (tc_chain, test_play_twice_then_add_and_play_again);
684 tcase_add_test (tc_chain, test_live_seeking);
685 tcase_add_test (tc_chain, test_add_pad);
686 tcase_add_test (tc_chain, test_remove_pad);
688 /* Use a longer timeout */
690 if (RUNNING_ON_VALGRIND) {
691 tcase_set_timeout (tc_chain, 5 * 60);
695 /* this is shorter than the default 60 seconds?! (tpm) */
696 /* tcase_set_timeout (tc_chain, 6); */
703 main (int argc, char **argv)
707 Suite *s = adder_suite ();
708 SRunner *sr = srunner_create (s);
710 gst_check_init (&argc, &argv);
712 srunner_run_all (sr, CK_NORMAL);
713 nf = srunner_ntests_failed (sr);