Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
2acee668
Commit
2acee668
authored
Oct 02, 2014
by
François Grisez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a tester for the media file player
parent
90933e5e
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
2 deletions
+61
-2
mediastreamer2
mediastreamer2
+1
-1
tester/Makefile.am
tester/Makefile.am
+2
-1
tester/liblinphone_tester.h
tester/liblinphone_tester.h
+1
-0
tester/player_tester.c
tester/player_tester.c
+56
-0
tester/sounds/hello_opus_h264.mkv
tester/sounds/hello_opus_h264.mkv
+0
-0
tester/tester.c
tester/tester.c
+1
-0
No files found.
mediastreamer2
@
e87f1b6a
Subproject commit
cc5da3abb97767b04ffb1bcd6b246be556aa54f1
Subproject commit
e87f1b6af632cfca73b8ca963c8136c3f75c6f52
tester/Makefile.am
View file @
2acee668
...
...
@@ -22,7 +22,8 @@ liblinphonetester_la_SOURCES = tester.c \
stun_tester.c
\
remote_provisioning_tester.c
\
quality_reporting_tester.c
\
transport_tester.c
transport_tester.c
\
player_tester.c
liblinphonetester_la_LDFLAGS
=
-no-undefined
liblinphonetester_la_LIBADD
=
../coreapi/liblinphone.la
$(CUNIT_LIBS)
...
...
tester/liblinphone_tester.h
View file @
2acee668
...
...
@@ -59,6 +59,7 @@ extern test_suite_t stun_test_suite;
extern
test_suite_t
remote_provisioning_test_suite
;
extern
test_suite_t
quality_reporting_test_suite
;
extern
test_suite_t
transport_test_suite
;
extern
test_suite_t
player_test_suite
;
extern
int
liblinphone_tester_nb_test_suites
(
void
);
...
...
tester/player_tester.c
0 → 100644
View file @
2acee668
#include "liblinphone_tester.h"
static
bool_t
wait_for_eof
(
bool_t
*
eof
,
int
*
time
,
int
time_refresh
,
int
timeout
)
{
while
(
*
time
<
timeout
&&
!*
eof
)
{
usleep
(
time_refresh
*
1000U
);
*
time
+=
time_refresh
;
}
return
*
time
<
timeout
;
}
static
void
eof_callback
(
LinphonePlayer
*
player
,
void
*
user_data
)
{
bool_t
*
eof
=
(
bool_t
*
)
user_data
;
*
eof
=
TRUE
;
}
static
void
playing_test
(
void
)
{
LinphoneCoreManager
*
lc_manager
;
LinphonePlayer
*
player
;
const
char
*
filename
=
"sounds/hello_opus_h264.mkv"
;
int
res
,
time
=
0
;
bool_t
eof
=
FALSE
;
lc_manager
=
linphone_core_manager_new
(
"marie_rc"
);
CU_ASSERT_PTR_NOT_NULL
(
lc_manager
);
if
(
lc_manager
==
NULL
)
return
;
player
=
linphone_core_create_file_player
(
lc_manager
->
lc
,
ms_snd_card_manager_get_default_card
(
ms_snd_card_manager_get
()),
video_stream_get_default_video_renderer
());
CU_ASSERT_PTR_NOT_NULL
(
player
);
if
(
player
==
NULL
)
goto
fail
;
CU_ASSERT_EQUAL
((
res
=
linphone_player_open
(
player
,
filename
,
eof_callback
,
&
eof
)),
0
);
if
(
res
==
-
1
)
goto
fail
;
CU_ASSERT_EQUAL
((
res
=
linphone_player_start
(
player
)),
0
);
if
(
res
==
-
1
)
goto
fail
;
CU_ASSERT_TRUE
(
wait_for_eof
(
&
eof
,
&
time
,
100
,
13000
));
linphone_player_close
(
player
);
fail:
if
(
player
)
file_player_destroy
(
player
);
if
(
lc_manager
)
linphone_core_manager_destroy
(
lc_manager
);
}
test_t
player_tests
[]
=
{
{
"Playing"
,
playing_test
}
};
test_suite_t
player_test_suite
=
{
"Player"
,
NULL
,
NULL
,
sizeof
(
player_tests
)
/
sizeof
(
test_t
),
player_tests
};
tester/sounds/hello_opus_h264.mkv
0 → 100644
View file @
2acee668
File added
tester/tester.c
View file @
2acee668
...
...
@@ -388,6 +388,7 @@ void liblinphone_tester_init(void) {
add_test_suite
(
&
remote_provisioning_test_suite
);
add_test_suite
(
&
quality_reporting_test_suite
);
add_test_suite
(
&
transport_test_suite
);
add_test_suite
(
&
player_test_suite
);
}
void
liblinphone_tester_uninit
(
void
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment