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
39ca1605
Commit
39ca1605
authored
Sep 28, 2015
by
François Grisez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the Player testers when the audio and video codecs are not supported by ms2
parent
c29d018b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
10 deletions
+13
-10
tester/player_tester.c
tester/player_tester.c
+13
-10
No files found.
tester/player_tester.c
View file @
39ca1605
...
...
@@ -32,29 +32,32 @@ static void eof_callback(LinphonePlayer *player, void *user_data) {
*
eof
=
TRUE
;
}
static
void
play_file
(
const
char
*
filename
,
bool_t
un
supported_format
,
const
char
*
audio_mime
,
const
char
*
video_mime
)
{
static
void
play_file
(
const
char
*
filename
,
bool_t
supported_format
,
const
char
*
audio_mime
,
const
char
*
video_mime
)
{
LinphoneCoreManager
*
lc_manager
;
LinphonePlayer
*
player
;
int
res
,
time
=
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_filter_codec_supported
(
audio_mime
));
video_codec_supported
=
(
video_mime
&&
ms_filter_codec_supported
(
video_mime
));
player
=
linphone_core_create_local_player
(
lc_manager
->
lc
,
ms_snd_card_manager_get_default_card
(
ms_snd_card_manager_get
()),
video_stream_get_default_video_renderer
(),
0
);
BC_ASSERT_PTR_NOT_NULL
(
player
);
if
(
player
==
NULL
)
goto
fail
;
res
=
linphone_player_open
(
player
,
filename
,
eof_callback
,
&
eof
);
if
(
unsupported_format
||
(
audio_mime
==
NULL
&&
video_mime
==
NULL
)
||
(
video_mime
==
NULL
&&
audio_mime
&&
!
ms_filter_codec_supported
(
audio_mime
))
||
(
audio_mime
==
NULL
&&
video_mime
&&
!
ms_filter_codec_supported
(
video_mime
)))
{
BC_ASSERT_EQUAL
(
res
,
-
1
,
int
,
"%d"
);
}
else
{
if
(
supported_format
&&
(
audio_codec_supported
||
video_codec_supported
))
{
BC_ASSERT_EQUAL
(
res
,
0
,
int
,
"%d"
);
}
else
{
BC_ASSERT_EQUAL
(
res
,
-
1
,
int
,
"%d"
);
}
if
(
res
==
-
1
)
goto
fail
;
res
=
linphone_player_start
(
player
);
...
...
@@ -74,7 +77,7 @@ static void sintel_trailer_opus_h264_test(void) {
char
*
filename
=
bc_tester_res
(
"sounds/sintel_trailer_opus_h264.mkv"
);
const
char
*
audio_mime
=
"opus"
;
const
char
*
video_mime
=
"H264"
;
play_file
(
filename
,
!
linphone_local_player_matroska_supported
(),
audio_mime
,
video_mime
);
play_file
(
filename
,
linphone_local_player_matroska_supported
(),
audio_mime
,
video_mime
);
ms_free
(
filename
);
}
...
...
@@ -82,7 +85,7 @@ static void sintel_trailer_pcmu_h264_test(void) {
char
*
filename
=
bc_tester_res
(
"sounds/sintel_trailer_pcmu_h264.mkv"
);
const
char
*
audio_mime
=
"pcmu"
;
const
char
*
video_mime
=
"H264"
;
play_file
(
filename
,
!
linphone_local_player_matroska_supported
(),
audio_mime
,
video_mime
);
play_file
(
filename
,
linphone_local_player_matroska_supported
(),
audio_mime
,
video_mime
);
ms_free
(
filename
);
}
...
...
@@ -90,7 +93,7 @@ static void sintel_trailer_opus_vp8_test(void) {
char
*
filename
=
bc_tester_res
(
"sounds/sintel_trailer_opus_vp8.mkv"
);
const
char
*
audio_mime
=
"opus"
;
const
char
*
video_mime
=
"VP8"
;
play_file
(
filename
,
!
linphone_local_player_matroska_supported
(),
audio_mime
,
video_mime
);
play_file
(
filename
,
linphone_local_player_matroska_supported
(),
audio_mime
,
video_mime
);
ms_free
(
filename
);
}
...
...
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