remove audio_stream_process_rtcp method's body since its a duplication of media_stream_process_rtcp

parent e0d80e11
......@@ -122,25 +122,6 @@ static void audio_stream_configure_resampler(MSFilter *resampler,MSFilter *from,
}
static void audio_stream_process_rtcp(MediaStream *media_stream, mblk_t *m){
AudioStream *stream=(AudioStream*)media_stream;
do{
const report_block_t *rb=NULL;
if (rtcp_is_SR(m)){
rb=rtcp_SR_get_report_block(m,0);
}else if (rtcp_is_RR(m)){
rb=rtcp_RR_get_report_block(m,0);
}
if (rb){
unsigned int ij;
float rt=rtp_session_get_round_trip_propagation(stream->ms.sessions.rtp_session);
float flost;
ij=report_block_get_interarrival_jitter(rb);
flost=(float)(100.0*report_block_get_fraction_lost(rb)/256.0);
ms_message("audio_stream_iterate[%p]: remote statistics available\n\tremote's interarrival jitter=%u\n"
"\tremote's lost packets percentage since last report=%f\n\tround trip time=%f seconds",stream,ij,flost,rt);
}
}while(rtcp_next_packet(m));
}
void audio_stream_iterate(AudioStream *stream){
......@@ -158,7 +139,7 @@ static mblk_t* audio_stream_payload_picker(MSRtpPayloadPickerContext* context,u
static void stop_preload_graph(AudioStream *stream){
ms_ticker_detach(stream->ms.sessions.ticker,stream->dummy);
if (stream->ms.voidsink) {
ms_filter_unlink(stream->dummy,0,stream->ms.voidsink,0);
ms_filter_destroy(stream->ms.voidsink);
......@@ -240,15 +221,15 @@ static void player_callback(void *ud, MSFilter *f, unsigned int id, void *arg){
static void setup_local_player(AudioStream *stream, int samplerate, int channels){
MSConnectionHelper cnx;
int master=0;
stream->local_player=ms_filter_new(MS_FILE_PLAYER_ID);
stream->local_player_resampler=ms_filter_new(MS_RESAMPLE_ID);
ms_connection_helper_start(&cnx);
ms_connection_helper_link(&cnx,stream->local_player,-1,0);
ms_connection_helper_link(&cnx,stream->local_player_resampler,0,0);
ms_connection_helper_link(&cnx,stream->local_mixer,1,-1);
ms_filter_call_method(stream->local_player_resampler,MS_FILTER_SET_OUTPUT_SAMPLE_RATE,&samplerate);
ms_filter_call_method(stream->local_player_resampler,MS_FILTER_SET_OUTPUT_NCHANNELS,&channels);
ms_filter_call_method(stream->local_mixer,MS_FILTER_SET_SAMPLE_RATE,&samplerate);
......@@ -379,7 +360,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
} else {
stream->dtmfgen_rtp=NULL;
}
if (ms_filter_call_method(stream->ms.rtpsend,MS_FILTER_GET_SAMPLE_RATE,&sample_rate)!=0){
ms_error("Sample rate is unknown for RTP side !");
return -1;
......@@ -406,7 +387,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
ms_error("audio_stream_start_full: No decoder or encoder available for payload %s.",pt->mime_type);
return -1;
}
/* check echo canceller max frequency and adjust sampling rate if needed when codec used is opus */
if (stream->ec!=NULL) {
if ((ms_filter_get_id(stream->ms.encoder) == MS_OPUS_ENC_ID) && (ms_filter_get_id(stream->ec) == MS_WEBRTC_AEC_ID)) { /* AECM allow 8000 or 16000 Hz or it will be bypassed */
......@@ -419,7 +400,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
/*hack for opus, that claims stereo all the time, but we can't support stereo yet*/
if (strcasecmp(pt->mime_type,"opus")==0)
nchannels=1;
if (ms_filter_has_method(stream->ms.decoder, MS_FILTER_SET_RTP_PAYLOAD_PICKER)) {
ms_message("Decoder has FEC capabilities");
picker_context.filter_graph_manager=stream;
......@@ -436,7 +417,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
stream->volrecv=NULL;
audio_stream_enable_echo_limiter(stream,stream->el_type);
audio_stream_enable_noise_gate(stream,stream->use_ng);
if (ms_filter_implements_interface(stream->soundread,MSFilterPlayerInterface) && infile){
audio_stream_play(stream,infile);
}
......@@ -484,7 +465,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
}
ms_filter_call_method(stream->ec,MS_FILTER_SET_SAMPLE_RATE,&sample_rate);
}
if (stream->features & AUDIO_STREAM_FEATURE_MIXED_RECORDING){
int val=0;
int pin=1;
......@@ -499,7 +480,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
ms_filter_call_method(stream->send_tee,MS_TEE_MUTE,&pin);
ms_filter_call_method(stream->recorder,MS_FILTER_SET_SAMPLE_RATE,&sample_rate);
ms_filter_call_method(stream->recorder,MS_FILTER_SET_NCHANNELS,&nchannels);
}
/* give the encoder/decoder some parameters*/
......@@ -538,7 +519,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
}
}else
stream->equalizer=NULL;
/*configure resamplers if needed*/
if (stream->read_resampler){
audio_stream_configure_resampler(stream->read_resampler,stream->soundread,stream->ms.encoder,8000,pt->clock_rate);
......@@ -547,11 +528,11 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
if (stream->write_resampler){
audio_stream_configure_resampler(stream->write_resampler,stream->ms.decoder,stream->soundwrite,pt->clock_rate,8000);
}
if (stream->ms.use_rc){
stream->ms.rc=ms_audio_bitrate_controller_new(stream->ms.sessions.rtp_session,stream->ms.encoder,0);
}
/* Create generic PLC if not handled by the decoder directly*/
if ((stream->features & AUDIO_STREAM_FEATURE_PLC) != 0) {
int decoder_have_plc = 0;
......@@ -573,7 +554,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
} else {
stream->plc = NULL;
}
if (stream->features & AUDIO_STREAM_FEATURE_LOCAL_PLAYING){
stream->local_mixer=ms_filter_new(MS_AUDIO_MIXER_ID);
}
......@@ -584,7 +565,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
/*we were using the dummy preload graph, destroy it but keep sound filters*/
_audio_stream_unprepare_sound(stream,TRUE);
}
/* and then connect all */
/* tip: draw yourself the picture if you don't understand */
......@@ -634,7 +615,7 @@ int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char
ms_filter_link(stream->recv_tee,1,stream->recorder_mixer,1);
ms_filter_link(stream->recorder_mixer,0,stream->recorder,0);
}
/*to make sure all preprocess are done before befre processing audio*/
ms_ticker_attach_multiple(stream->ms.sessions.ticker
,stream->soundread
......@@ -775,7 +756,7 @@ void audio_stream_set_features(AudioStream *st, uint32_t features){
AudioStream *audio_stream_new_with_sessions(const MSMediaStreamSessions *sessions){
AudioStream *stream=(AudioStream *)ms_new0(AudioStream,1);
MSFilterDesc *ec_desc=ms_filter_lookup_by_name("MSOslec");
ms_filter_enable_statistics(TRUE);
ms_filter_reset_statistics();
......@@ -904,11 +885,11 @@ static void dismantle_local_player(AudioStream *stream){
void audio_stream_stop(AudioStream * stream){
if (stream->ms.sessions.ticker){
MSConnectionHelper h;
if (stream->ms.state==MSStreamPreparing){
audio_stream_unprepare_sound(stream);
}else if (stream->ms.state==MSStreamStarted){
ms_ticker_detach(stream->ms.sessions.ticker,stream->soundread);
ms_ticker_detach(stream->ms.sessions.ticker,stream->ms.rtprecv);
......@@ -958,7 +939,7 @@ void audio_stream_stop(AudioStream * stream){
if (stream->write_resampler!=NULL)
ms_connection_helper_unlink(&h,stream->write_resampler,0,0);
ms_connection_helper_unlink(&h,stream->soundwrite,0,-1);
/*dismantle the call recording */
if (stream->recorder){
ms_filter_unlink(stream->send_tee,1,stream->recorder_mixer,0);
......@@ -982,7 +963,7 @@ int audio_stream_send_dtmf(AudioStream *stream, char dtmf)
return 0;
}
void audio_stream_mute_rtp(AudioStream *stream, bool_t val)
void audio_stream_mute_rtp(AudioStream *stream, bool_t val)
{
if (stream->ms.rtpsend){
if (val)
......
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