Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
f10471de
Commit
f10471de
authored
Apr 28, 2016
by
Gautier Pelloux-Prayer
Browse files
player_tester.c: fix test on ios
parent
bc80229e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
18 deletions
+9
-18
mediastreamer2
mediastreamer2
+1
-1
tester/player_tester.c
tester/player_tester.c
+8
-17
No files found.
mediastreamer2
@
43d32a44
Subproject commit
375b7f3cfeb3fa878ed797d8663dceb5caf6679f
Subproject commit
43d32a4441e27af0e39906e0712e1c5c809a1ab6
tester/player_tester.c
View file @
f10471de
...
...
@@ -33,19 +33,14 @@ static void eof_callback(LinphonePlayer *player, void *user_data) {
}
static
void
play_file
(
const
char
*
filename
,
bool_t
supported_format
,
const
char
*
audio_mime
,
const
char
*
video_mime
)
{
LinphoneCoreManager
*
lc_manager
;
LinphoneCoreManager
*
lc_manager
=
linphone_core_manager_new
(
"marie_rc"
)
;
LinphonePlayer
*
player
;
int
res
,
time
=
0
;
int
res
,
time
r
=
0
;
bool_t
eof
=
FALSE
;
bool_t
audio_codec_supported
;
bool_t
video_codec_supported
;
lc_manager
=
linphone_core_manager_new
(
"marie_rc"
);
BC_ASSERT_PTR_NOT_NULL
(
lc_manager
);
if
(
lc_manager
==
NULL
)
return
;
audio_codec_supported
=
(
audio_mime
&&
ms_factory_get_decoder
(
linphone_core_get_ms_factory
((
void
*
)
lc_manager
->
lc
),
audio_mime
));
video_codec_supported
=
(
video_mime
&&
ms_factory_get_decoder
(
linphone_core_get_ms_factory
((
void
*
)
lc_manager
->
lc
),
video_mime
));
bool_t
audio_codec_supported
=
(
audio_mime
&&
ms_factory_get_decoder
(
linphone_core_get_ms_factory
((
void
*
)
lc_manager
->
lc
),
audio_mime
));
bool_t
video_codec_supported
=
(
video_mime
&&
ms_factory_get_decoder
(
linphone_core_get_ms_factory
((
void
*
)
lc_manager
->
lc
),
video_mime
));
int
expected_res
=
(
supported_format
&&
(
audio_codec_supported
||
video_codec_supported
))
?
0
:
-
1
;
player
=
linphone_core_create_local_player
(
lc_manager
->
lc
,
ms_snd_card_manager_get_default_card
(
ms_factory_get_snd_card_manager
(
linphone_core_get_ms_factory
((
void
*
)
lc_manager
->
lc
))),
...
...
@@ -54,19 +49,15 @@ static void play_file(const char *filename, bool_t supported_format, const char
if
(
player
==
NULL
)
goto
fail
;
res
=
linphone_player_open
(
player
,
filename
,
eof_callback
,
&
eof
);
if
(
supported_format
&&
(
audio_codec_supported
||
video_codec_supported
))
{
BC_ASSERT_EQUAL
(
res
,
0
,
int
,
"%d"
);
}
else
{
BC_ASSERT_EQUAL
(
res
,
-
1
,
int
,
"%d"
);
}
BC_ASSERT_EQUAL
(
res
,
expected_res
,
int
,
"%d"
);
if
(
res
==
-
1
)
goto
fail
;
res
=
linphone_player_start
(
player
);
BC_ASSERT_EQUAL
(
res
,
0
,
int
,
"%d"
);
if
(
res
==
-
1
)
goto
fail
;
BC_ASSERT_TRUE
(
wait_for_eof
(
&
eof
,
&
time
,
100
,
(
int
)(
linphone_player_get_duration
(
player
)
*
1
.
05
)));
BC_ASSERT_TRUE
(
wait_for_eof
(
&
eof
,
&
time
r
,
100
,
(
int
)(
linphone_player_get_duration
(
player
)
*
1
.
05
)));
linphone_player_close
(
player
);
...
...
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