Commit 2bbda962 authored by Sandrine Avakian's avatar Sandrine Avakian

Merge branch 'master' of git.linphone.org:mediastreamer2 into dev_msfactory

parents 3e6735a3 1b124839
......@@ -4,7 +4,7 @@
dh $@ --parallel --with autotools_dev
override_dh_auto_configure:
dh_auto_configure -- --disable-video --with-srtp=none
dh_auto_configure --
override_dh_makeshlibs:
dh_makeshlibs -V
......
......@@ -30,7 +30,8 @@ extern "C"{
typedef enum _MSFormatType{
MSAudio,
MSVideo,
MSText
MSText,
MSUnknownMedia
}MSFormatType;
/**
......
......@@ -331,7 +331,7 @@ MS2_PUBLIC const char * ice_session_remote_pwd(const IceSession *session);
MS2_PUBLIC IceSessionState ice_session_state(const IceSession *session);
/**
* Gte the role of the agent for an ICE session.
* Get the role of the agent for an ICE session.
*
* @param session A pointer to a session
* @return The role of the agent for the session
......@@ -502,7 +502,7 @@ MS2_PUBLIC void ice_session_select_candidates(IceSession *session);
*
* @param session A pointer to a session
*/
MS2_PUBLIC void ice_session_restart(IceSession *session);
MS2_PUBLIC void ice_session_restart(IceSession *session, IceRole role);
/**
* Get the state of an ICE check list.
......
......@@ -351,6 +351,7 @@ const char * ms_format_type_to_string(MSFormatType type){
case MSAudio: return "MSAudio";
case MSVideo: return "MSVideo";
case MSText: return "MSText";
case MSUnknownMedia: return "MSUnknownMedia";
}
return "invalid";
}
......@@ -2414,9 +2414,10 @@ static ms_bool_t mkv_player_seek_ms(MKVPlayer *obj, int position) {
ms_error("MKVPlayer: cannot seek. No file open");
return FALSE;
}
obj->time = mkv_reader_seek(obj->reader, position);
obj->time = position>0 ? mkv_reader_seek(obj->reader, position) : 0;
for(i = 0; i < 2; i++) {
if(obj->players[i]) {
if(position == 0) mkv_track_reader_reset(obj->players[i]->track_reader);
mkv_track_player_reset(obj->players[i]);
}
}
......
......@@ -1201,12 +1201,8 @@ static void ice_send_binding_request(IceCheckList *cl, IceCandidatePair *pair, c
/* In this case we wait for the transmission timeout before creating a new binding request for the pair. */
pair->wait_transaction_timeout = FALSE;
if (pair->use_candidate == FALSE) {
if (pair->state == ICP_InProgress) {
ms_message("ice: binding request already pending for checklist [%p] on pair [%p], switching to waiting",cl,pair);
} else {
ice_pair_set_state(pair, ICP_Waiting);
ice_check_list_queue_triggered_check(cl, pair);
}
ice_pair_set_state(pair, ICP_Waiting);
ice_check_list_queue_triggered_check(cl, pair);
}
return;
}
......@@ -2771,7 +2767,7 @@ static void ice_set_lowest_componentid_pair_with_foundation_to_waiting_state(con
fc.componentID = ICE_INVALID_COMPONENTID;
fc.priority = 0;
ms_list_for_each2(cl->check_list, (void (*)(void*,void*))ice_find_lowest_componentid_pair_with_specified_foundation, &fc);
if (fc.pair != NULL && fc.pair->state != ICP_InProgress && fc.pair->state != ICP_Succeeded) { /*pair might already be in progress if binding request already received*/
if (fc.pair != NULL) {
/* Set the state of the pair to Waiting. */
ice_pair_set_state(fc.pair, ICP_Waiting);
}
......@@ -3109,8 +3105,7 @@ static void ice_check_list_restart(IceCheckList *cl)
memset(&cl->nomination_delay_start_time, 0, sizeof(cl->nomination_delay_start_time));
}
void ice_session_restart(IceSession *session)
{
void ice_session_restart(IceSession *session, IceRole role){
int i;
ms_warning("ICE session restart");
......@@ -3132,6 +3127,7 @@ void ice_session_restart(IceSession *session)
if (session->streams[i] != NULL)
ice_check_list_restart(session->streams[i]);
}
ice_session_set_role(session, role);
}
......
......@@ -415,14 +415,16 @@ bool_t media_stream_secured (const MediaStream *stream) {
return FALSE;
switch (stream->type) {
case MSAudio:
case MSText:
/*fixme need also audio stream direction to be more precise*/
return ms_media_stream_sessions_secured(&stream->sessions, MediaStreamSendRecv);
case MSVideo:{
VideoStream *vs = (VideoStream*)stream;
return ms_media_stream_sessions_secured(&stream->sessions, vs->dir);
}
case MSAudio:
case MSText:
/*fixme need also audio stream direction to be more precise*/
return ms_media_stream_sessions_secured(&stream->sessions, MediaStreamSendRecv);
case MSVideo:{
VideoStream *vs = (VideoStream*)stream;
return ms_media_stream_sessions_secured(&stream->sessions, vs->dir);
}
case MSUnknownMedia:
break;
}
return FALSE;
}
......
......@@ -74,7 +74,7 @@ static int tester_after_all(void) {
}
#define HELLO_16K_1S_FILE "sounds/hello16000-1s.wav"
#define RECORDED_16K_1S_FILE "sounds/recorded_hello16000-1s.wav"
#define RECORDED_16K_1S_FILE "recorded_hello16000-1s.wav"
typedef struct _stream_manager_t {
MSFormatType type;
......
......@@ -72,8 +72,8 @@ static int tester_after_all(void) {
#define HELLO_8K_1S_FILE "sounds/hello8000-1s.wav"
#define HELLO_16K_1S_FILE "sounds/hello16000-1s.wav"
#define RECORDED_8K_1S_FILE "sounds/recorded_hello8000-1s.wav"
#define RECORDED_16K_1S_FILE "sounds/recorded_hello16000-1s.wav"
#define RECORDED_8K_1S_FILE "recorded_hello8000-1s.wav"
#define RECORDED_16K_1S_FILE "recorded_hello16000-1s.wav"
#define MULTICAST_IP "224.1.2.3"
......@@ -148,12 +148,12 @@ static void basic_audio_stream_base_2( const char* marielle_local_ip
char* hello_file = bc_tester_res(HELLO_8K_1S_FILE);
char* recorded_file = bc_tester_file(RECORDED_8K_1S_FILE);
int marielle_rtp_sent=0;
rtp_session_set_multicast_loopback(marielle->ms.sessions.rtp_session,TRUE);
rtp_session_set_multicast_loopback(margaux->ms.sessions.rtp_session,TRUE);
rtp_session_set_rtcp_report_interval(marielle->ms.sessions.rtp_session, 1000);
rtp_session_set_rtcp_report_interval(margaux->ms.sessions.rtp_session, 1000);
reset_stats(&marielle_stats);
reset_stats(&margaux_stats);
......@@ -197,15 +197,15 @@ static void basic_audio_stream_base_2( const char* marielle_local_ip
audio_stream_get_local_rtp_stats(marielle,&marielle_stats.rtp);
audio_stream_get_local_rtp_stats(margaux,&margaux_stats.rtp);
marielle_rtp_sent = marielle_stats.rtp.sent;
if (rtp_session_rtcp_enabled(marielle->ms.sessions.rtp_session) && rtp_session_rtcp_enabled(margaux->ms.sessions.rtp_session)) {
BC_ASSERT_TRUE(rtp_session_get_round_trip_propagation(marielle->ms.sessions.rtp_session)>0);
BC_ASSERT_TRUE(rtp_session_get_stats(marielle->ms.sessions.rtp_session)->recv_rtcp_packets >0);
}
audio_stream_stop(marielle);
BC_ASSERT_TRUE(wait_for_until(&margaux->ms,NULL,(int*)&margaux_stats.rtp.hw_recv,marielle_rtp_sent*(100-lost_percentage)/100,2500));
audio_stream_stop(margaux);
......@@ -604,7 +604,7 @@ static void symetric_rtp_with_wrong_addr(void) {
, MARGAUX_RTP_PORT
, MARIELLE_RTCP_PORT
, MARGAUX_RTCP_PORT
, MARGAUX_IP
, MARIELLE_IP
, MARGAUX_RTP_PORT
......@@ -621,7 +621,7 @@ static void symetric_rtp_with_wrong_rtcp_port(void) {
, MARGAUX_RTP_PORT
, MARIELLE_RTCP_PORT
, MARGAUX_RTCP_PORT
, MARGAUX_IP
, MARIELLE_IP
, MARGAUX_RTP_PORT
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment