예제 #1
0
파일: ortp.c 프로젝트: Distrotech/oRTP
/**
 * Display global statistics (cumulative for all RtpSession)
**/
void ortp_global_stats_display()
{
	rtp_stats_display(&ortp_global_stats,"Global statistics");
#ifdef ENABLE_MEMCHECK
	printf("Unfreed allocations: %i\n",ortp_allocations);
#endif
}
예제 #2
0
void audio_stream_stop(AudioStream * stream)
{
	if (stream->ticker){
		MSConnectionHelper h;
#ifdef ENABLE_UDT
		if (stream->udt) ms_ticker_detach (stream->ticker, stream->udt);
#endif // ENABLE_UDT
		ms_ticker_detach(stream->ticker,stream->soundread);
		ms_ticker_detach(stream->ticker,stream->rtprecv);

		rtp_stats_display(rtp_session_get_stats(stream->session),"Audio session's RTP statistics");

		/*dismantle the outgoing graph*/
		ms_connection_helper_start(&h);
		ms_connection_helper_unlink(&h,stream->soundread,-1,0);
		if (stream->read_resampler!=NULL)
			ms_connection_helper_unlink(&h,stream->read_resampler,0,0);
#ifndef ENABLED_MCU_MEDIA_SERVER
		if (stream->ec!=NULL)
			ms_connection_helper_unlink(&h,stream->ec,1,1);
		if (stream->volsend!=NULL)
			ms_connection_helper_unlink(&h,stream->volsend,0,0);
#endif // ENABLED_MCU_MEDIA_SERVER
		if (stream->dtmfgen_rtp)
			ms_connection_helper_unlink(&h,stream->dtmfgen_rtp,0,0);
		ms_connection_helper_unlink(&h,stream->encoder,0,0);
		ms_connection_helper_unlink(&h,stream->rtpsend,0,-1);

		/*dismantle the receiving graph*/
		ms_connection_helper_start(&h);
		ms_connection_helper_unlink(&h,stream->rtprecv,-1,0);
		ms_connection_helper_unlink(&h,stream->decoder,0,0);
		ms_connection_helper_unlink(&h,stream->dtmfgen,0,0);
#ifndef ENABLED_MCU_MEDIA_SERVER
		if (stream->equalizer)
			ms_connection_helper_unlink(&h,stream->equalizer,0,0);
		if (stream->volrecv!=NULL)
			ms_connection_helper_unlink(&h,stream->volrecv,0,0);
		if (stream->ec!=NULL)
			ms_connection_helper_unlink(&h,stream->ec,0,0);
#endif // ENABLED_MCU_MEDIA_SERVER
		if (stream->write_resampler!=NULL)
			ms_connection_helper_unlink(&h,stream->write_resampler,0,0);

		if(stream->mic_tee && stream->recordmixer)
			ms_filter_unlink(stream->spk_tee,1,stream->recordmixer,1);
		if(stream->spk_tee)
			ms_connection_helper_unlink(&h,stream->spk_tee,0,0);

		if (stream->tee2){
			ms_connection_helper_unlink(&h,stream->tee2,0,0);
			if(stream->audio_record)
				ms_filter_unlink(stream->tee2,1,stream->audio_record,0);
		}

		ms_connection_helper_unlink(&h,stream->soundwrite,0,-1);

	}
	audio_stream_free(stream);
}
void text_stream_stop(TextStream *stream) {
	if (stream->ms.sessions.ticker) {
		if (stream->ms.state == MSStreamPreparing) {
			text_stream_unprepare_text(stream);
		} else if (stream->ms.state == MSStreamStarted) {
			MSConnectionHelper h;
			stream->ms.state = MSStreamStopped;
			ms_ticker_detach(stream->ms.sessions.ticker, stream->rttsource);
			ms_ticker_detach(stream->ms.sessions.ticker, stream->ms.rtprecv);
			
			if (stream->ms.ice_check_list != NULL) {
				ice_check_list_print_route(stream->ms.ice_check_list, "Text session's route");
				stream->ms.ice_check_list = NULL;
			}
			
			rtp_stats_display(rtp_session_get_stats(stream->ms.sessions.rtp_session),
					"             TEXT SESSION'S RTP STATISTICS                ");
			
			ms_connection_helper_start(&h);
			ms_connection_helper_unlink(&h, stream->rttsource, -1, 0);
			ms_connection_helper_unlink(&h, stream->ms.rtpsend, 0, -1);
			ms_connection_helper_start(&h);
			ms_connection_helper_unlink(&h, stream->ms.rtprecv, -1, 0);
			ms_connection_helper_unlink(&h, stream->rttsink, 0, -1);
		}
	}
	
	text_stream_free(stream);
	ms_filter_log_statistics();
}
예제 #4
0
void video_stream_recv_only_stop (VideoStream * stream){
	if (stream->ticker!=NULL){
		ms_ticker_detach(stream->ticker, stream->rtprecv);
		rtp_stats_display(rtp_session_get_stats(stream->session),"Video session's RTP statistics");
		ms_filter_unlink(stream->rtprecv, 0, stream->decoder, 0);
		ms_filter_unlink(stream->decoder,0,stream->output,0);
	}
	video_stream_free (stream);
}
예제 #5
0
void audio_stream_stop(AudioStream * stream)
{
	if (stream->ticker){
		MSConnectionHelper h;

		if(stream->record_enabled) audio_stream_record_stop(stream);

		ms_ticker_detach(stream->ticker,stream->soundread);
		ms_ticker_detach(stream->ticker,stream->rtprecv);

		rtp_stats_display(rtp_session_get_stats(stream->session),"Audio session's RTP statistics");

		/*dismantle the outgoing graph*/
		ms_connection_helper_start(&h);
		ms_connection_helper_unlink(&h,stream->soundread,-1,0);
		if (stream->read_resampler!=NULL)
			ms_connection_helper_unlink(&h,stream->read_resampler,0,0);
		if (stream->ec!=NULL)
			ms_connection_helper_unlink(&h,stream->ec,1,1);
		if (stream->volsend!=NULL)
			ms_connection_helper_unlink(&h,stream->volsend,0,0);
		if(stream->mic_tee && stream->recordmixer)
			ms_filter_unlink(stream->mic_tee,1,stream->recordmixer,0);
		if(stream->mic_tee)
			ms_connection_helper_unlink(&h,stream->mic_tee,0,0);
		ms_connection_helper_unlink(&h,stream->encoder,0,0);
		ms_connection_helper_unlink(&h,stream->rtpsend,0,-1);

		/*dismantle the receiving graph*/
		ms_connection_helper_start(&h);
		ms_connection_helper_unlink(&h,stream->rtprecv,-1,0);
		ms_connection_helper_unlink(&h,stream->decoder,0,0);
		ms_connection_helper_unlink(&h,stream->dtmfgen,0,0);
		if (stream->equalizer)
			ms_connection_helper_unlink(&h,stream->equalizer,0,0);
		if (stream->volrecv!=NULL)
			ms_connection_helper_unlink(&h,stream->volrecv,0,0);
		if (stream->ec!=NULL)
			ms_connection_helper_unlink(&h,stream->ec,0,0);
		if (stream->write_resampler!=NULL)
			ms_connection_helper_unlink(&h,stream->write_resampler,0,0);
		if(stream->mic_tee && stream->recordmixer)
			ms_filter_unlink(stream->spk_tee,1,stream->recordmixer,1);
		if(stream->spk_tee)
			ms_connection_helper_unlink(&h,stream->spk_tee,0,0);
		ms_connection_helper_unlink(&h,stream->soundwrite,0,-1);

	}
	audio_stream_free(stream);
}
예제 #6
0
void
video_stream_stop (VideoStream * stream)
{
	stream->eventcb = NULL;
	stream->event_pointer = NULL;
	if (stream->ticker){
		if (stream->voidsink) {
			stop_preload_graph(stream);
		} else {
			if (stream->source)
				ms_ticker_detach(stream->ticker,stream->source);
			if (stream->rtprecv)
				ms_ticker_detach(stream->ticker,stream->rtprecv);

			if (stream->ice_check_list != NULL) {
				ice_check_list_print_route(stream->ice_check_list, "Video session's route");
				stream->ice_check_list = NULL;
			}
			rtp_stats_display(rtp_session_get_stats(stream->session),"Video session's RTP statistics");

			if (stream->source){
				ms_filter_unlink(stream->source,0,stream->pixconv,0);
				ms_filter_unlink (stream->pixconv, 0, stream->sizeconv, 0);
				ms_filter_unlink (stream->sizeconv, 0, stream->tee, 0);
				ms_filter_unlink(stream->tee,0,stream->encoder,0);
				ms_filter_unlink(stream->encoder, 0, stream->rtpsend,0);
				if (stream->output2){
					ms_filter_unlink(stream->tee,1,stream->output2,0);
				}
			}
			if (stream->rtprecv){
				MSConnectionHelper h;
				ms_connection_helper_start (&h);
				ms_connection_helper_unlink (&h,stream->rtprecv,-1,0);
				ms_connection_helper_unlink (&h,stream->decoder,0,0);
				if (stream->tee2){
					ms_connection_helper_unlink (&h,stream->tee2,0,0);
					ms_filter_unlink(stream->tee2,1,stream->jpegwriter,0);
				}
				if(stream->output)
					ms_connection_helper_unlink (&h,stream->output,0,-1);
				if (stream->tee && stream->output && stream->output2==NULL)
					ms_filter_unlink(stream->tee,1,stream->output,1);
			}
		}
	}
	video_stream_free (stream);
}
예제 #7
0
void
video_stream_stop (VideoStream * stream)
{
	if (stream->ticker){
		ms_ticker_detach(stream->ticker,stream->source);
	
		rtp_stats_display(rtp_session_get_stats(stream->session),"Video session's RTP statistics");
		
		ms_filter_unlink(stream->source,0,stream->pixconv,0);
		ms_filter_unlink (stream->pixconv, 0, stream->sizeconv, 0);
		ms_filter_unlink (stream->sizeconv, 0, stream->tee, 0);
		ms_filter_unlink(stream->tee,0,stream->encoder,0);
		ms_filter_unlink(stream->encoder, 0, stream->rtpsend,0);
		ms_filter_unlink(stream->rtprecv, 0, stream->decoder, 0);
		ms_filter_unlink(stream->decoder,0,stream->output,0);
		ms_filter_unlink(stream->tee,1,stream->output,1);
	}
	video_stream_free (stream);
}
예제 #8
0
void
video_stream_stop (VideoStream * stream)
{
	if (stream->ticker){
		if (stream->source)
			ms_ticker_detach(stream->ticker,stream->source);
		if (stream->rtprecv)
			ms_ticker_detach(stream->ticker,stream->rtprecv);
	
		rtp_stats_display(rtp_session_get_stats(stream->session),"Video session's RTP statistics");

		if (stream->source){
			ms_filter_unlink(stream->source,0,stream->pixconv,0);
			ms_filter_unlink (stream->pixconv, 0, stream->sizeconv, 0);
			ms_filter_unlink (stream->sizeconv, 0, stream->tee, 0);
			ms_filter_unlink(stream->tee,0,stream->encoder,0);
			ms_filter_unlink(stream->encoder, 0, stream->rtpsend,0);
			if (stream->output2){
				ms_filter_unlink(stream->tee,1,stream->output2,0);
			}
		}
		if (stream->rtprecv){
			MSConnectionHelper h;
			ms_connection_helper_start (&h);
			ms_connection_helper_unlink (&h,stream->rtprecv,-1,0);
			ms_connection_helper_unlink (&h,stream->decoder,0,0);
			if (stream->tee2){
				ms_connection_helper_unlink (&h,stream->tee2,0,0);
				ms_filter_unlink(stream->tee2,1,stream->jpegwriter,0);
				if(stream->video_record)
					ms_filter_unlink(stream->tee2,2,stream->video_record,0);
			}
			ms_connection_helper_unlink (&h,stream->output,0,-1);
			if (stream->tee && stream->output2==NULL && ms_filter_get_id(stream->output)!=MS_CONF_ITC_SINK_ID)
				ms_filter_unlink(stream->tee,1,stream->output,1);
		}
	}

	video_stream_free (stream);
}
예제 #9
0
void audio_stream_stop(AudioStream * stream)
{
	if (stream->ticker){
		ms_ticker_detach(stream->ticker,stream->soundread);
		ms_ticker_detach(stream->ticker,stream->rtprecv);
		
		rtp_stats_display(rtp_session_get_stats(stream->session),"Audio session's RTP statistics");
		
		if (stream->ec!=NULL){
			ms_filter_unlink(stream->soundread,0,stream->ec,1);
			ms_filter_unlink(stream->ec,1,stream->encoder,0);
			ms_filter_unlink(stream->dtmfgen,0,stream->ec,0);
			ms_filter_unlink(stream->ec,0,stream->soundwrite,0);
		}else{
			ms_filter_unlink(stream->soundread,0,stream->encoder,0);
			ms_filter_unlink(stream->dtmfgen,0,stream->soundwrite,0);
		}
		
		ms_filter_unlink(stream->encoder,0,stream->rtpsend,0);
		ms_filter_unlink(stream->rtprecv,0,stream->decoder,0);
		ms_filter_unlink(stream->decoder,0,stream->dtmfgen,0);
	}
	audio_stream_free(stream);
}
예제 #10
0
void audio_stream_stop(AudioStream * stream)
{
	if (stream->ms.ticker){
		MSConnectionHelper h;
		
		if (stream->dummy){
			stop_preload_graph(stream);
		}else if (stream->ms.start_time!=0){
		
			ms_ticker_detach(stream->ms.ticker,stream->soundread);
			ms_ticker_detach(stream->ms.ticker,stream->ms.rtprecv);

			if (stream->ms.ice_check_list != NULL) {
				ice_check_list_print_route(stream->ms.ice_check_list, "Audio session's route");
				stream->ms.ice_check_list = NULL;
			}
			rtp_stats_display(rtp_session_get_stats(stream->ms.session),
				"             AUDIO SESSION'S RTP STATISTICS                ");

			/*dismantle the outgoing graph*/
			ms_connection_helper_start(&h);
			ms_connection_helper_unlink(&h,stream->soundread,-1,0);
			if (stream->read_resampler!=NULL)
				ms_connection_helper_unlink(&h,stream->read_resampler,0,0);
			if (stream->ec!=NULL)
				ms_connection_helper_unlink(&h,stream->ec,1,1);
			if (stream->volsend!=NULL)
				ms_connection_helper_unlink(&h,stream->volsend,0,0);
			if (stream->dtmfgen_rtp)
				ms_connection_helper_unlink(&h,stream->dtmfgen_rtp,0,0);
			if (stream->send_tee)
				ms_connection_helper_unlink(&h,stream->send_tee,0,0);
			ms_connection_helper_unlink(&h,stream->ms.encoder,0,0);
			ms_connection_helper_unlink(&h,stream->ms.rtpsend,0,-1);

			/*dismantle the receiving graph*/
			ms_connection_helper_start(&h);
			ms_connection_helper_unlink(&h,stream->ms.rtprecv,-1,0);
			ms_connection_helper_unlink(&h,stream->ms.decoder,0,0);
			if (stream->plc!=NULL)
				ms_connection_helper_unlink(&h,stream->plc,0,0);
			if (stream->dtmfgen!=NULL)
				ms_connection_helper_unlink(&h,stream->dtmfgen,0,0);
			if (stream->volrecv!=NULL)
				ms_connection_helper_unlink(&h,stream->volrecv,0,0);
			if (stream->recv_tee)
				ms_connection_helper_unlink(&h,stream->recv_tee,0,0);
			if (stream->equalizer!=NULL)
				ms_connection_helper_unlink(&h,stream->equalizer,0,0);
			if (stream->ec!=NULL)
				ms_connection_helper_unlink(&h,stream->ec,0,0);
			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);
				ms_filter_unlink(stream->recv_tee,1,stream->recorder_mixer,1);
				ms_filter_unlink(stream->recorder_mixer,0,stream->recorder,0);
			}
		}
	}
	audio_stream_free(stream);
	ms_filter_log_statistics();
}
예제 #11
0
void
video_stream_stop (VideoStream * stream)
{
	stream->eventcb = NULL;
	stream->event_pointer = NULL;
	if (stream->ms.ticker){
		if (stream->prepare_ongoing == TRUE) {
			stop_preload_graph(stream);
		} else {
			if (stream->source)
				ms_ticker_detach(stream->ms.ticker,stream->source);
			if (stream->ms.rtprecv)
				ms_ticker_detach(stream->ms.ticker,stream->ms.rtprecv);

			if (stream->ms.ice_check_list != NULL) {
				ice_check_list_print_route(stream->ms.ice_check_list, "Video session's route");
				stream->ms.ice_check_list = NULL;
			}
			rtp_stats_display(rtp_session_get_stats(stream->ms.session),
				"             VIDEO SESSION'S RTP STATISTICS                ");

			if (stream->source){
				MSConnectionHelper ch;
				ms_connection_helper_start(&ch);
				ms_connection_helper_unlink(&ch, stream->source, -1, 0);
				if (stream->pixconv) {
					ms_connection_helper_unlink(&ch, stream->pixconv, 0, 0);
				}
				if (stream->sizeconv) {
					ms_connection_helper_unlink(&ch, stream->sizeconv, 0, 0);
				}
				ms_connection_helper_unlink(&ch, stream->tee, 0, 0);
				if (stream->source_performs_encoding == FALSE) {
					ms_connection_helper_unlink(&ch, stream->ms.encoder, 0, 0);
				}
				ms_connection_helper_unlink(&ch, stream->ms.rtpsend, 0, -1);
				if (stream->output2){
					ms_filter_unlink(stream->tee,1,stream->output2,0);
				}
			}
			if (stream->ms.voidsink) {
				ms_filter_unlink(stream->ms.rtprecv, 0, stream->ms.voidsink, 0);
			} else if (stream->ms.rtprecv){
				MSConnectionHelper h;
				ms_connection_helper_start (&h);
				ms_connection_helper_unlink (&h,stream->ms.rtprecv,-1,0);
				if (stream->output_performs_decoding == FALSE) {
					ms_connection_helper_unlink (&h,stream->ms.decoder,0,0);
				}
				if (stream->tee2){
					ms_connection_helper_unlink (&h,stream->tee2,0,0);
					ms_filter_unlink(stream->tee2,1,stream->jpegwriter,0);
				}
				if(stream->output)
					ms_connection_helper_unlink (&h,stream->output,0,-1);
				if (stream->tee && stream->output && stream->output2==NULL)
					ms_filter_unlink(stream->tee,1,stream->output,1);
			}
		}
	}
	video_stream_free (stream);
}
예제 #12
0
파일: ortp.c 프로젝트: gabrieldelsaint/UIM
void ortp_session_stats_display(RtpSession *ses)
{
	printf("Statictics for payload type %d\n", ses->rcv.payload_type);
	rtp_stats_display( rtp_session_get_stats(ses), "Session statistics");
}