Commit 10032381 authored by Sandrine Avakian's avatar Sandrine Avakian

Modifying conference files msconference.h and audioconference.h.

Taking out the in_resampler and out_resampler filter creation from the ms_audio_endpoint_new function
because the factory is needed in this case. Instead, the creation is done in ms_audio_endpoint_get_from_stream
and ms_audio_endpoint_new_recorder.
parent 9f7e7fe3
......@@ -177,7 +177,7 @@ MS2_PUBLIC void ms_audio_endpoint_release_from_stream(MSAudioEndpoint *obj);
/**
* Creates an audio endpoint (or virtual participant) to record the conference into a wav file.
**/
MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_new_recorder(void);
MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_new_recorder(MSFactory* factory);
/**
* Start audio recording.
......
......@@ -221,10 +221,17 @@ void ms_audio_conference_destroy(MSAudioConference *obj){
ms_free(obj);
}
//MSAudioEndpoint *ms_audio_endpoint_new(void){
// MSAudioEndpoint *ep=ms_new0(MSAudioEndpoint,1);
// ep->in_resampler=ms_filter_new(MS_RESAMPLE_ID);
// ep->out_resampler=ms_filter_new(MS_RESAMPLE_ID);
// ep->samplerate=8000;
// return ep;
//}
MSAudioEndpoint *ms_audio_endpoint_new(void){
MSAudioEndpoint *ep=ms_new0(MSAudioEndpoint,1);
ep->in_resampler=ms_filter_new(MS_RESAMPLE_ID);
ep->out_resampler=ms_filter_new(MS_RESAMPLE_ID);
ep->samplerate=8000;
return ep;
}
......@@ -232,6 +239,8 @@ MSAudioEndpoint *ms_audio_endpoint_new(void){
MSAudioEndpoint * ms_audio_endpoint_get_from_stream(AudioStream *st, bool_t is_remote){
MSAudioEndpoint *ep=ms_audio_endpoint_new();
ep->st=st;
ep->in_resampler=ms_factory_create_filter(st->ms.factory, MS_RESAMPLE_ID);
ep->out_resampler=ms_factory_create_filter(st->ms.factory, MS_RESAMPLE_ID);
cut_audio_stream_graph(ep,is_remote);
return ep;
}
......@@ -249,10 +258,10 @@ void ms_audio_endpoint_destroy(MSAudioEndpoint *ep){
ms_free(ep);
}
MSAudioEndpoint * ms_audio_endpoint_new_recorder(){
MSAudioEndpoint * ms_audio_endpoint_new_recorder(MSFactory* factory){
MSAudioEndpoint *ep=ms_audio_endpoint_new();
ep->recorder=ms_filter_new(MS_FILE_REC_ID);
ep->player=ms_filter_new(MS_FILE_PLAYER_ID);
ep->recorder=ms_factory_create_filter(factory, MS_FILE_REC_ID);
ep->player=ms_factory_create_filter(factory, MS_FILE_PLAYER_ID);
ep->mixer_out.filter=ep->recorder;
ep->mixer_in.filter=ep->player;
ep->samplerate=-1;
......
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