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
mediastreamer2
Commits
00ab040a
Commit
00ab040a
authored
Feb 25, 2015
by
Ghislain MARY
Browse files
Check that the decoder has been changed successfully for the codec change tests.
parent
938c6e4c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
tester/mediastreamer2_audio_stream_tester.c
tester/mediastreamer2_audio_stream_tester.c
+1
-0
tester/mediastreamer2_video_stream_tester.c
tester/mediastreamer2_video_stream_tester.c
+13
-4
No files found.
tester/mediastreamer2_audio_stream_tester.c
View file @
00ab040a
...
...
@@ -385,6 +385,7 @@ static void codec_change_for_audio_stream(void) {
/* No packet loss is assumed */
CU_ASSERT_EQUAL
(
marielle_stats
.
rtp
.
sent
+
marielle_rtp_sent
,
margaux_stats
.
rtp
.
recv
);
CU_ASSERT_EQUAL
(
strcasecmp
(
margaux
->
ms
.
decoder
->
desc
->
enc_fmt
,
"pcma"
),
0
);
audio_stream_stop
(
marielle
);
audio_stream_stop
(
margaux
);
...
...
tester/mediastreamer2_video_stream_tester.c
View file @
00ab040a
...
...
@@ -36,8 +36,9 @@ extern MSWebCamDesc mire_desc;
#define VP8_PAYLOAD_TYPE 103
#define H264_PAYLOAD_TYPE 104
#define VP8_PAYLOAD_TYPE 103
#define H264_PAYLOAD_TYPE 104
#define MP4V_PAYLOAD_TYPE 105
static
int
tester_init
(
void
)
{
MSWebCam
*
cam
;
...
...
@@ -46,6 +47,7 @@ static int tester_init(void) {
ortp_init
();
rtp_profile_set_payload
(
&
rtp_profile
,
VP8_PAYLOAD_TYPE
,
&
payload_type_vp8
);
rtp_profile_set_payload
(
&
rtp_profile
,
H264_PAYLOAD_TYPE
,
&
payload_type_h264
);
rtp_profile_set_payload
(
&
rtp_profile
,
MP4V_PAYLOAD_TYPE
,
&
payload_type_mp4v
);
cam
=
ms_web_cam_new
(
&
mire_desc
);
ms_web_cam_manager_add_cam
(
ms_web_cam_manager_get
(),
cam
);
return
0
;
...
...
@@ -328,16 +330,23 @@ static void codec_change_for_video_stream(void) {
video_stream_tester_t
*
margaux
=
video_stream_tester_new
();
bool_t
vp8_supported
=
ms_filter_codec_supported
(
"vp8"
);
bool_t
h264_supported
=
ms_filter_codec_supported
(
"h264"
);
bool_t
mp4v_supported
=
ms_filter_codec_supported
(
"mp4v-es"
);
if
(
vp8_supported
)
{
init_video_streams
(
marielle
,
margaux
,
FALSE
,
FALSE
,
NULL
,
VP8_PAYLOAD_TYPE
);
CU_ASSERT_TRUE
(
wait_for_until
(
&
marielle
->
vs
->
ms
,
&
margaux
->
vs
->
ms
,
&
marielle
->
stats
.
number_of_decoder_first_image_decoded
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_until
(
&
marielle
->
vs
->
ms
,
&
margaux
->
vs
->
ms
,
&
margaux
->
stats
.
number_of_decoder_first_image_decoded
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_until_with_parse_events
(
&
marielle
->
vs
->
ms
,
&
margaux
->
vs
->
ms
,
&
marielle
->
stats
.
number_of_SR
,
2
,
15000
,
event_queue_cb
,
&
marielle
->
stats
,
event_queue_cb
,
&
margaux
->
stats
));
if
(
h264_supported
)
{
change_codec
(
marielle
,
margaux
,
H264_PAYLOAD_TYPE
);
if
(
h264_supported
||
mp4v_supported
)
{
if
(
h264_supported
)
change_codec
(
marielle
,
margaux
,
H264_PAYLOAD_TYPE
);
else
change_codec
(
marielle
,
margaux
,
MP4V_PAYLOAD_TYPE
);
CU_ASSERT_TRUE
(
wait_for_until
(
&
marielle
->
vs
->
ms
,
&
margaux
->
vs
->
ms
,
&
margaux
->
stats
.
number_of_decoder_first_image_decoded
,
2
,
2000
));
CU_ASSERT_TRUE
(
wait_for_until_with_parse_events
(
&
marielle
->
vs
->
ms
,
&
margaux
->
vs
->
ms
,
&
marielle
->
stats
.
number_of_SR
,
2
,
15000
,
event_queue_cb
,
&
marielle
->
stats
,
event_queue_cb
,
&
margaux
->
stats
));
if
(
h264_supported
)
{
CU_ASSERT_EQUAL
(
strcasecmp
(
margaux
->
vs
->
ms
.
decoder
->
desc
->
enc_fmt
,
"h264"
),
0
);
}
else
{
CU_ASSERT_EQUAL
(
strcasecmp
(
margaux
->
vs
->
ms
.
decoder
->
desc
->
enc_fmt
,
"mp4v-es"
),
0
);
}
}
else
{
ms_error
(
"H264 codec is not supported!"
);
}
...
...
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