Commit bca01be1 authored by Simon Morlat's avatar Simon Morlat
Browse files

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

parents 1c3ccbb0 7fd4a003
......@@ -42,6 +42,10 @@ extern MSFilterDesc ms_vfw_desc;
extern MSFilterDesc ms_ice_desc;
extern MSFilterDesc ms_equalizer_desc;
extern MSFilterDesc ms_dd_display_desc;
extern MSFilterDesc ms_itc_source_desc;
extern MSFilterDesc ms_itc_sink_desc;
extern MSFilterDesc ms_audio_mixer_desc;
MSFilterDesc * ms_filter_descs[]={
&ms_alaw_dec_desc,
&ms_alaw_enc_desc,
......@@ -87,6 +91,9 @@ MSFilterDesc * ms_filter_descs[]={
&ms_ice_desc,
&ms_equalizer_desc,
&ms_dd_display_desc,
&ms_itc_source_desc,
&ms_itc_sink_desc,
&ms_audio_mixer_desc,
NULL
};
......@@ -197,10 +197,18 @@
RelativePath="..\..\src\alaw.c"
>
</File>
<File
RelativePath="..\..\src\audiomixer.c"
>
</File>
<File
RelativePath="..\..\src\audiostream.c"
>
</File>
<File
RelativePath="..\..\src\chanadapt.c"
>
</File>
<File
RelativePath="..\..\src\drawdib-display.c"
>
......@@ -221,6 +229,10 @@
RelativePath="..\..\src\equalizer.c"
>
</File>
<File
RelativePath="..\..\src\eventqueue.c"
>
</File>
<File
RelativePath="..\..\src\gsm.c"
>
......@@ -229,6 +241,10 @@
RelativePath="..\..\src\ice.c"
>
</File>
<File
RelativePath="..\..\src\itc.c"
>
</File>
<File
RelativePath="..\..\src\kiss_fft.c"
>
......@@ -423,10 +439,22 @@
RelativePath="..\..\include\mediastreamer2\mediastream.h"
>
</File>
<File
RelativePath="..\..\include\mediastreamer2\msaudiomixer.h"
>
</File>
<File
RelativePath="..\..\include\mediastreamer2\mschanadapter.h"
>
</File>
<File
RelativePath="..\..\include\mediastreamer2\mscommon.h"
>
</File>
<File
RelativePath="..\..\include\mediastreamer2\mseventqueue.h"
>
</File>
<File
RelativePath="..\..\include\mediastreamer2\msfileplayer.h"
>
......@@ -443,6 +471,10 @@
RelativePath="..\..\include\mediastreamer2\msinterfaces.h"
>
</File>
<File
RelativePath="..\..\include\mediastreamer2\msitc.h"
>
</File>
<File
RelativePath="..\..\include\mediastreamer2\msqueue.h"
>
......
......@@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msaudiomixer.h"
#include "mediastreamer2/msticker.h"
#ifdef _MSC_VER
#include <malloc.h>
#define alloca _alloca
#endif
#define MIXER_MAX_CHANNELS 20
#define MAX_LATENCY 0.08
......@@ -58,9 +62,9 @@ static void mixer_uninit(MSFilter *f){
static void mixer_preprocess(MSFilter *f){
MixerState *s=(MixerState *)f->data;
s->purgeoffset=MAX_LATENCY*(float)(2*s->nchannels*s->rate);
s->purgeoffset=(int)(MAX_LATENCY*(float)(2*s->nchannels*s->rate));
s->bytespertick=(2*s->nchannels*s->rate*f->ticker->interval)/1000;
s->sum=ms_malloc0((s->bytespertick/2)*sizeof(int32_t));
s->sum=(int32_t*)ms_malloc0((s->bytespertick/2)*sizeof(int32_t));
}
static void mixer_postprocess(MSFilter *f){
......@@ -79,7 +83,7 @@ static void accumulate(int32_t *sum, int16_t* contrib, int nwords){
static void accumulate_mpy(int32_t *sum, int16_t* contrib, int nwords, float gain){
int i;
for(i=0;i<nwords;++i){
sum[i]+=gain*(float)contrib[i];
sum[i]+=(int32_t)(gain*(float)contrib[i]);
}
}
......@@ -102,7 +106,7 @@ static void mixer_process(MSFilter *f){
MixerState *s=(MixerState *)f->data;
int i;
int nwords=s->bytespertick/2;
uint8_t *tmpbuf=alloca(s->bytespertick);
uint8_t *tmpbuf=(uint8_t *)alloca(s->bytespertick);
bool_t got_something=FALSE;
memset(s->sum,0,nwords*sizeof(int32_t));
......
......@@ -125,12 +125,12 @@ MSFilterDesc ms_itc_source_desc={
#endif
static void itc_sink_preprocess(MSFilter *f){
MSFilter *other=f->data;
MSFilter *other=(MSFilter *)f->data;
ms_filter_notify(other,MS_ITC_SOURCE_UPDATED,NULL);
}
static void itc_sink_process(MSFilter *f){
MSFilter *other=f->data;
MSFilter *other=(MSFilter *)f->data;
mblk_t *im;
while((im=ms_queue_get(f->inputs[0]))!=NULL){
itc_source_queue_packet(other,im);
......@@ -143,7 +143,7 @@ static int itc_sink_connect(MSFilter *f, void *data){
}
static int itc_sink_set_nchannels(MSFilter *f , void *data){
MSFilter *other=f->data;
MSFilter *other=(MSFilter *)f->data;
if (other==NULL){
ms_error("MSItcSink not connected to any source !");
return -1;
......@@ -153,7 +153,7 @@ static int itc_sink_set_nchannels(MSFilter *f , void *data){
}
static int itc_sink_set_sr(MSFilter *f , void *data){
MSFilter *other=f->data;
MSFilter *other=(MSFilter *)f->data;
if (other==NULL){
ms_error("MSItcSink not connected to any source !");
return -1;
......@@ -163,7 +163,7 @@ static int itc_sink_set_sr(MSFilter *f , void *data){
}
static int itc_sink_get_nchannels(MSFilter *f , void *data){
MSFilter *other=f->data;
MSFilter *other=(MSFilter *)f->data;
if (other==NULL){
ms_error("MSItcSink not connected to any source !");
return -1;
......@@ -172,7 +172,7 @@ static int itc_sink_get_nchannels(MSFilter *f , void *data){
}
static int itc_sink_get_sr(MSFilter *f , void *data){
MSFilter *other=f->data;
MSFilter *other=(MSFilter *)f->data;
if (other==NULL){
ms_error("MSItcSink not connected to any source !");
return -1;
......
......@@ -608,7 +608,7 @@ void ms_sleep(int seconds){
void ms_usleep(uint64_t usec){
#ifdef WIN32
Sleep(usec/1000);
Sleep((DWORD)(usec/1000));
#else
struct timespec ts,rem;
int err;
......
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