Commit 863d7300 authored by Ghislain MARY's avatar Ghislain MARY

Stricter compilation options + new compilation error fixes.

parent 0b60a94e
......@@ -529,7 +529,7 @@ else()
list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds")
endif()
if(ENABLE_STRICT)
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-fno-strict-aliasing")
list(APPEND STRICT_OPTIONS_CPP "-Werror" "-Wextra" "-Wno-unused-parameter" "-fno-strict-aliasing")
endif()
endif()
if(STRICT_OPTIONS_CPP)
......
......@@ -82,7 +82,7 @@ case "$target_os" in
esac
if test "$strictness" = "yes" ; then
STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wno-error=strict-prototypes"
STRICT_OPTIONS="$STRICT_OPTIONS -Werror -Wextra -Wno-unused-parameter -Wno-error=strict-prototypes"
CFLAGS="$CFLAGS -fno-strict-aliasing"
fi
AC_SUBST(STRICT_OPTIONS)
......
......@@ -61,7 +61,7 @@ typedef int (*MSFilterMethodFunc)(struct _MSFilter *f, void *arg);
typedef void (*MSFilterNotifyFunc)(void *userdata, struct _MSFilter *f, unsigned int id, void *arg);
struct _MSFilterMethod{
int id;
unsigned int id;
MSFilterMethodFunc method;
};
......
......@@ -64,9 +64,7 @@ static MS2_INLINE mblk_t *ms_queue_peek_first(MSQueue *q){
return qbegin(&q->q);
}
static MS2_INLINE mblk_t *ms_queue_next(MSQueue *q, mblk_t *m){
return m->b_next;
}
#define ms_queue_next(q, m) (m)->b_next
static MS2_INLINE bool_t ms_queue_end(MSQueue *q, mblk_t *m){
return qend(&q->q,m);
......
......@@ -52,7 +52,7 @@ static void alaw_enc_process(MSFilter *obj){
MSBufferizer *bz=dt->bz;
uint8_t buffer[2240];
int frame_per_packet=2;
int size_of_pcm=320;
size_t size_of_pcm=320;
mblk_t *m;
......@@ -73,7 +73,7 @@ static void alaw_enc_process(MSFilter *obj){
}
while (ms_bufferizer_read(bz,buffer,size_of_pcm)==size_of_pcm){
mblk_t *o=allocb(size_of_pcm/2,0);
int i;
size_t i;
for (i=0;i<size_of_pcm/2;i++){
*o->b_wptr=Snack_Lin2Alaw(((int16_t*)buffer)[i]);
o->b_wptr++;
......
......@@ -173,10 +173,10 @@ JNIEXPORT void JNICALL Java_org_linphone_mediastream_MediastreamerAndroidContext
#else
static SoundDeviceDescription devices[]={
{ NULL, NULL, NULL, 0, 0, 0}
{ NULL, NULL, NULL, 0, 0, 0, NULL }
};
SoundDeviceDescription genericSoundDeviceDescriptor={"Generic", "Generic", "Generic", 0, 0, 0};
SoundDeviceDescription genericSoundDeviceDescriptor={"Generic", "Generic", "Generic", 0, 0, 0, NULL};
#endif
......
......@@ -93,7 +93,7 @@ static void enc_process(MSFilter *f)
int nbytes;
uint8_t *buf;
int frame_per_packet=1;
int chunksize;
size_t chunksize;
if(s->ptime>=10)
frame_per_packet = s->ptime/10;
......
......@@ -42,7 +42,7 @@ typedef struct {
} generic_plc_struct;
const static unsigned int MAX_PLC_COUNT = UINT32_MAX;
static const unsigned int MAX_PLC_COUNT = UINT32_MAX;
static void generic_plc_init(MSFilter *f) {
generic_plc_struct *mgps = (generic_plc_struct*) ms_new0(generic_plc_struct, 1);
......
......@@ -258,7 +258,7 @@ static void enc_process(MSFilter *f){
while((im=ms_queue_get(f->inputs[0]))!=NULL){
ms_bufferizer_put(s->bufferizer,im);
}
while(ms_bufferizer_read(s->bufferizer,buf,nbytes*frame_per_packet)==nbytes*frame_per_packet){
while(ms_bufferizer_read(s->bufferizer,buf,nbytes*frame_per_packet)==(size_t)(nbytes*frame_per_packet)){
mblk_t *om=allocb(nbytes*frame_per_packet,0);//too large...
int k;
SpeexBits bits;
......
......@@ -175,9 +175,10 @@ static float volume_agc_process(Volume *v, mblk_t *om) {
// target is: 1
float gain_reduct = (agc_threshold + v->level_pk) / 1;
/* actual gain ramp timing the same as with echo limiter process */
if (!(++counter % 20))
if (!(++counter % 20)) {
ms_debug("_level=%f, gain reduction=%f, gain=%f, ng_gain=%f %f %f",
v->level_pk, gain_reduct, v->gain, v->ng_gain, v->ng_threshold, v->static_gain);
}
return gain_reduct;
}
......@@ -230,9 +231,10 @@ static float volume_echo_avoider_process(Volume *v, mblk_t *om) {
v->fast_upramp=TRUE;
}
}
if (!(++counter % 20))
if (!(++counter % 20)) {
ms_debug("volume_echo_avoider_process(): mic_en=%f, peer_e=%f, target_g=%f, gain=%f, spk_peak=%f",
v->energy, peer_e, v->target_gain, v->gain, v->lt_speaker_en);
}
return v->target_gain;
}
......@@ -253,9 +255,10 @@ static void volume_noise_gate_process(Volume *v , float energy, mblk_t *om){
/* simple averaging computation is adequate here: fast rise, relatively slower decrease */
/* of gain - ears impression */
v->ng_gain = v->ng_gain*0.75f + tgain*0.25f;
if (!(++counter % 10))
if (!(++counter % 10)) {
ms_debug("%d: nglevel=%f, energy=%f, tgain=%f, ng_gain=%f",
(v->peer!=NULL)?1:0, energy, v->energy, tgain, v->ng_gain);
}
}
static int volume_set_db_gain(MSFilter *f, void *gain){
......
......@@ -307,7 +307,7 @@ typedef struct _Stream{
uint64_t last_flowcontrol_op;
int underflow_notifs;
int overflow_notifs;
int min_buffer_size;
size_t min_buffer_size;
}Stream;
static void stream_disconnect(Stream *s);
......@@ -363,14 +363,14 @@ static size_t stream_play(Stream *s, size_t nbytes) {
avail = ms_bufferizer_get_avail(&s->bufferizer);
if (avail > 0) {
uint8_t *data;
int buffer_size;
size_t buffer_size;
if (nbytes > avail)
nbytes = avail;
data = ms_new(uint8_t, nbytes);
ms_mutex_lock(&s->mutex);
ms_bufferizer_read(&s->bufferizer, data, nbytes);
buffer_size = ms_bufferizer_get_avail(&s->bufferizer);
if(s->min_buffer_size == -1 || buffer_size < s->min_buffer_size) {
if(s->min_buffer_size == (size_t)-1 || buffer_size < s->min_buffer_size) {
s->min_buffer_size = buffer_size;
}
ms_mutex_unlock(&s->mutex);
......@@ -409,7 +409,7 @@ static bool_t stream_connect(Stream *s) {
pa_buffer_attr attr;
pa_cvolume volume, *volume_ptr = NULL;
s->min_buffer_size = -1;
s->min_buffer_size = (size_t)-1;
attr.maxlength = -1;
attr.fragsize = pa_usec_to_bytes(targeted_latency * 1000, &s->sampleSpec);
......@@ -751,14 +751,14 @@ static void pulse_write_process(MSFilter *f){
if (s->last_flowcontrol_op == (uint64_t)-1) {
s->last_flowcontrol_op = f->ticker->time;
} else if(f->ticker->time - s->last_flowcontrol_op >= flow_control_op_interval) {
} else if((int)(f->ticker->time - s->last_flowcontrol_op) >= flow_control_op_interval) {
size_t threshold_bytes = pa_usec_to_bytes(flow_control_threshold * 1000, &s->sampleSpec);
ms_mutex_lock(&s->mutex);
if(s->min_buffer_size >= threshold_bytes) {
size_t nbytes_to_drop = s->min_buffer_size - threshold_bytes/4;
ms_warning("pulseaudio: too much data waiting in the writing buffer. Droping %i bytes", (int)nbytes_to_drop);
ms_bufferizer_skip_bytes(&s->bufferizer, nbytes_to_drop);
s->min_buffer_size = -1;
s->min_buffer_size = (size_t)-1;
}
ms_mutex_unlock(&s->mutex);
s->last_flowcontrol_op = f->ticker->time;
......
......@@ -257,7 +257,7 @@ static void speex_ec_process(MSFilter *f){
ref=(uint8_t*)alloca(nbytes);
echo=(uint8_t*)alloca(nbytes);
while (ms_bufferizer_read(&s->echo,echo,nbytes)==nbytes){
while ((int)ms_bufferizer_read(&s->echo,echo,nbytes)==nbytes){
mblk_t *oecho=allocb(nbytes,0);
int avail;
int avail_samples;
......
......@@ -53,7 +53,7 @@ static void ulaw_enc_process(MSFilter *obj){
MSBufferizer *bz=dt->bz;
uint8_t buffer[2240];
int frame_per_packet=2;
int size_of_pcm=320;
size_t size_of_pcm=320;
mblk_t *m;
if (dt->ptime>=10){
......@@ -73,7 +73,7 @@ static void ulaw_enc_process(MSFilter *obj){
while (ms_bufferizer_read(bz,buffer,size_of_pcm)==size_of_pcm){
mblk_t *o=allocb(size_of_pcm/2,0);
int i;
size_t i;
for (i=0;i<size_of_pcm/2;i++){
*o->b_wptr=Snack_Lin2Mulaw(((int16_t*)buffer)[i]);
o->b_wptr++;
......
......@@ -598,7 +598,7 @@ int ms_factory_load_plugins(MSFactory *factory, const char *dir){
#endif
(strstr(de->d_name, "libms") == de->d_name) && ((ext=strstr(de->d_name,PLUGINS_EXT))!=NULL)) {
void *handle;
snprintf(plugin_name, MIN(sizeof(plugin_name), ext - de->d_name + 1), "%s", de->d_name);
snprintf(plugin_name, MIN(sizeof(plugin_name), (size_t)(ext - de->d_name + 1)), "%s", de->d_name);
if (bctbx_list_find_custom(loaded_plugins, (bctbx_compare_func)strcmp, plugin_name) != NULL) continue;
loaded_plugins = bctbx_list_append(loaded_plugins, ms_strdup(plugin_name));
fullpath=ms_strdup_printf("%s/%s",dir,de->d_name);
......
......@@ -206,7 +206,7 @@ int ms_ticker_detach(MSTicker *ticker,MSFilter *f){
}
static bool_t filter_can_process(MSFilter *f, int tick){
static bool_t filter_can_process(MSFilter *f, uint32_t tick){
/* look if filters before this one have run */
int i;
MSQueue *l;
......
......@@ -161,7 +161,7 @@ static int _process_on_receive(RtpSession* session,MSSrtpStreamContext *ctx, mbl
return err;
}else{
rtcp_common_header_t *rtcp=(rtcp_common_header_t*)m->b_rptr;
if (err<(sizeof(rtcp_common_header_t)+4) || rtcp->version!=2 )
if (err<(int)(sizeof(rtcp_common_header_t)+4) || rtcp->version!=2 )
return err;
}
......@@ -301,7 +301,7 @@ static int ms_add_srtp_stream(srtp_t srtp, MSCryptoSuite suite, uint32_t ssrc, c
return -1;
}
/* check if key length match given policy */
if (key_length != policy.rtp.cipher_key_len) {
if ((int)key_length != policy.rtp.cipher_key_len) {
ms_error("Key size (%i) doesn't match the selected srtp profile (required %d)", (int)key_length, policy.rtp.cipher_key_len);
return -1;
}
......@@ -309,7 +309,7 @@ static int ms_add_srtp_stream(srtp_t srtp, MSCryptoSuite suite, uint32_t ssrc, c
if (ms_set_srtp_crypto_policy(suite, &policy.rtcp) != 0) {
return -1;
}
if (key_length != policy.rtcp.cipher_key_len) {
if ((int)key_length != policy.rtcp.cipher_key_len) {
ms_error("Key size (%i) doesn't match the selected srtp profile (required %d)", (int)key_length, policy.rtcp.cipher_key_len);
return -1;
}
......
......@@ -663,7 +663,7 @@ static bool_t receiver_check_payload_type(MSFilter *f, ReceiverData *d, mblk_t *
uint8_t *data=NULL;
int datasize=rtp_get_payload(m, &data);
if (data){
if (datasize<= sizeof(cngdata.data)){
if (datasize<= (int)sizeof(cngdata.data)){
memcpy(cngdata.data, data, datasize);
cngdata.datasize=datasize;
ms_filter_notify(f, MS_RTP_RECV_GENERIC_CN_RECEIVED, &cngdata);
......
......@@ -264,7 +264,8 @@ MSFilterDesc ms_rtt_4103_source_desc = {
ms_rtt_4103_source_process,
ms_rtt_4103_source_postprocess,
ms_rtt_4103_source_uninit,
ms_rtt_4103_source_methods
ms_rtt_4103_source_methods,
0
};
MS_FILTER_DESC_EXPORT(ms_rtt_4103_source_desc)
......
......@@ -57,8 +57,9 @@ int ms_bits_reader_n_bits(MSBitsReader *reader, int count, unsigned int *ret, co
tmp=tmp & ((1<<count)-1);
reader->bit_index+=count;
if (symbol_name)
if (symbol_name) {
ms_debug(".%s (u(%d)) : 0x%x | %u", symbol_name, count, tmp, tmp);
}
if (ret)
*ret=tmp;
return 0;
......@@ -76,8 +77,9 @@ int ms_bits_reader_ue(MSBitsReader *reader, unsigned int* ret, const char* symbo
} while (r == 0);
if (leading_zeros_cnt == 0) {
if (symbol_name)
if (symbol_name) {
ms_debug(".%s (ue) : 0x%x", symbol_name, 0);
}
if (ret)
*ret = 0;
} else {
......@@ -85,8 +87,9 @@ int ms_bits_reader_ue(MSBitsReader *reader, unsigned int* ret, const char* symbo
if (ms_bits_reader_n_bits(reader, leading_zeros_cnt, &trail, 0) != 0)
return -1;
value = (unsigned int)pow(2, leading_zeros_cnt) - 1 + trail;
if (symbol_name)
if (symbol_name) {
ms_debug(".%s (ue) : 0x%x | %u", symbol_name, value, value);
}
if (ret)
*ret = value;
}
......@@ -104,8 +107,9 @@ int ms_bits_reader_se(MSBitsReader *reader, int* ret, const char* symbol_name) {
sign = (code_num % 2) ? 1 : -1;
value = (int)(sign * ceil(code_num / 2.0f));
if (symbol_name)
if (symbol_name) {
ms_debug(".%s (se) : 0x%x | %d [%x", symbol_name, value, value, code_num);
}
if (ret)
*ret = value;
return 0;
......
......@@ -541,8 +541,8 @@ static bool_t update_textures_with_yuv(struct opengles_display* gldisp, enum Ima
aligned_yuv_h = align_on_power_of_2(yuvbuf.h);
/* check if we need to adjust texture sizes */
if (aligned_yuv_w != gldisp->allocatedTexturesSize[type].width ||
aligned_yuv_h != gldisp->allocatedTexturesSize[type].height) {
if (aligned_yuv_w != (unsigned int)gldisp->allocatedTexturesSize[type].width ||
aligned_yuv_h != (unsigned int)gldisp->allocatedTexturesSize[type].height) {
allocate_gl_textures(gldisp, aligned_yuv_w, aligned_yuv_h, type);
}
gldisp->uvx[type] = yuvbuf.w / (float)(gldisp->allocatedTexturesSize[type].width+1);
......
......@@ -142,7 +142,8 @@ MSFilterDesc ms_mire_desc={
mire_process,
mire_postprocess,
mire_uninit,
mire_methods
mire_methods,
0
};
MS_FILTER_DESC_EXPORT(ms_mire_desc)
......@@ -162,6 +163,7 @@ MSWebCamDesc ms_mire_webcam_desc={
&mire_detect,
&mire_cam_init,
&mire_create_reader,
NULL,
NULL
};
......
......@@ -1885,7 +1885,7 @@ fail:
}
static void recorder_request_fir(MSFilter *f, MKVRecorder *obj) {
if(obj->lastFirTime == -1 || obj->lastFirTime + 2000 < f->ticker->time) {
if(obj->lastFirTime == (uint64_t)-1 || obj->lastFirTime + 2000 < f->ticker->time) {
obj->lastFirTime = f->ticker->time;
ms_filter_notify_no_arg(f, MS_RECORDER_NEEDS_FIR);
}
......@@ -2130,7 +2130,7 @@ static int recorder_set_input_fmt(MSFilter *f, void *arg) {
const MSPinFormat *pinFmt = (const MSPinFormat *)arg;
ms_filter_lock(f);
if(pinFmt->pin < 0 || pinFmt->pin >= f->desc->ninputs) {
if(pinFmt->pin >= f->desc->ninputs) {
ms_error("MKVRecorder: could not set pin #%d. Invalid pin number", pinFmt->pin);
goto fail;
}
......@@ -2637,7 +2637,7 @@ static int player_get_output_fmt(MSFilter *f, void *arg) {
ms_error("MKVPlayer: cannot get pin format when player is closed");
goto fail;
}
if(pinFmt->pin < 0 || pinFmt->pin >= f->desc->noutputs) {
if(pinFmt->pin >= f->desc->noutputs) {
ms_error("MKVPlayer: pin #%d does not exist", pinFmt->pin);
goto fail;
}
......
......@@ -118,7 +118,7 @@ static bool_t v4lv2_try_format( int fd, struct v4l2_format *fmt, int fmtid){
ms_message("VIDIOC_TRY_FMT: %s",strerror(errno));
return FALSE;
}
if(fmt->fmt.pix.pixelformat != fmtid) {
if((int)fmt->fmt.pix.pixelformat != fmtid) {
ms_message("VIDIOC_TRY_FMT: got different format");
return FALSE;
}
......@@ -240,7 +240,7 @@ static const V4L2FormatDescription* query_format_description_for_size(int fd, MS
while (v4l2_ioctl(fd, VIDIOC_ENUM_FMT, &fmt) >= 0) {
for (i=0; i<POSSIBLE_FORMATS_COUNT; i++) {
if (fmt.pixelformat == formats[i].pixel_format) {
if ((int)fmt.pixelformat == formats[i].pixel_format) {
#ifdef VIDIOC_ENUM_FRAMEINTERVALS
formats[i].max_fps = query_max_fps_for_format_resolution(fd, fmt.pixelformat, vsize);
#endif
......@@ -482,7 +482,7 @@ static int msv4l2_do_mmap(V4l2State *s){
return -1;
}
for (i=0; i<req.count; ++i) {
for (i=0; i<(int)req.count; ++i) {
struct v4l2_buffer buf;
mblk_t *msg;
void *start;
......@@ -565,7 +565,7 @@ static mblk_t *v4l2_dequeue_ready_buffer(V4l2State *s, int poll_timeout_ms){
/*decrement ref count of dequeued buffer */
ret=s->frames[buf.index];
dec_ref(ret);
if (buf.index >= s->frame_max){
if ((int)buf.index >= s->frame_max){
ms_error("buf.index>=s->max_frames !");
return NULL;
}
......@@ -585,7 +585,7 @@ static mblk_t *v4l2_dequeue_ready_buffer(V4l2State *s, int poll_timeout_ms){
static mblk_t * v4lv2_grab_image(V4l2State *s, int poll_timeout_ms){
struct v4l2_buffer buf;
unsigned int k;
int k;
bool_t no_slot_available = TRUE;
mblk_t *ret=NULL;
......@@ -869,6 +869,7 @@ MSWebCamDesc v4l2_card_desc={
&msv4l2_detect,
&msv4l2_cam_init,
&msv4l2_create_reader,
NULL,
NULL
};
......
......@@ -404,7 +404,7 @@ void static_image_preprocess(MSFilter *f){
void static_image_process(MSFilter *f){
SIData *d=(SIData*)f->data;
int frame_interval=(int)(1000/d->fps);
uint64_t frame_interval=(uint64_t)(1000/d->fps);
/*output a frame whenever needed, i.e. respect the FPS parameter */
if ((f->ticker->time - d->lasttime>frame_interval) || d->lasttime==0){
ms_mutex_lock(&f->lock);
......@@ -510,7 +510,8 @@ MSFilterDesc ms_static_image_desc={
static_image_process,
static_image_postprocess,
static_image_uninit,
static_image_methods
static_image_methods,
0
};
MS_FILTER_DESC_EXPORT(ms_static_image_desc)
......@@ -534,6 +535,7 @@ MSWebCamDesc static_image_desc={
&static_image_detect,
&static_image_cam_init,
&static_image_create_reader,
NULL,
NULL
};
......
......@@ -860,7 +860,7 @@ typedef struct DecState {
uint64_t last_error_reported_time;
mblk_t *yuv_msg;
MSPicture outbuf;
int yuv_width, yuv_height;
unsigned int yuv_width, yuv_height;
MSQueue q;
MSAverageFPS fps;
bool_t first_image_decoded;
......
......@@ -170,7 +170,7 @@ static void x11video_prepare(MSFilter *f){
unsigned int nadaptors;
int i;
XvAdaptorInfo *xai=NULL;
XvPortID port=-1;
XvPortID port=(XvPortID)-1;
int imgfmt_id=0;
XShmSegmentInfo *shminfo=&s->shminfo;
XWindowAttributes wa = {0};
......@@ -204,7 +204,7 @@ static void x11video_prepare(MSFilter *f){
s->fbuf.w=s->vsize.width;
s->fbuf.h=s->vsize.height;
s->port=-1;
s->port=(XvPortID)-1;
if (XvQueryExtension(s->display, &n, &n, &n, &n, &n)!=0){
ms_error("Fail to query xv extension");
return;
......@@ -221,7 +221,7 @@ static void x11video_prepare(MSFilter *f){
return;
}
for (n=0;n<nadaptors && port==-1;++n){
for (n=0;n<nadaptors && port==(XvPortID)-1;++n){
XvAdaptorInfo *ai=&xai[n];
XvImageFormatValues *imgfmt;
int nimgfmt=0;
......@@ -235,13 +235,13 @@ static void x11video_prepare(MSFilter *f){
ms_message("type=%s/%s id=%s",
imgfmt[i].type == XvYUV ? "YUV" : "RGB",
imgfmt[i].format==XvPlanar ? "Planar" : "Packed",fcc);
if (port==-1 && imgfmt[i].format==XvPlanar && strcasecmp(fcc,"YV12")==0){
int k;
if (port==(XvPortID)-1 && imgfmt[i].format==XvPlanar && strcasecmp(fcc,"YV12")==0){
unsigned int k;
/*we found a format interesting to us*/
for(k=0;k<ai->num_ports;++k){
if (XvGrabPort(s->display,ai->base_id+k,CurrentTime)==0){
ms_message("Grabbed port %i",(int)ai->base_id+k);
port=ai->base_id+k;
port=(XvPortID)(ai->base_id+k);
imgfmt_id=imgfmt[i].id;
break;
}
......@@ -251,7 +251,7 @@ static void x11video_prepare(MSFilter *f){
if (imgfmt) XFree(imgfmt);
}
XvFreeAdaptorInfo(xai);
if (port==-1){
if (port==(XvPortID)-1){
ms_error("Could not find suitable format or Xv port to work with.");
return;
}
......@@ -312,10 +312,10 @@ static void x11video_prepare(MSFilter *f){
static void x11video_unprepare(MSFilter *f){
X11Video *s=(X11Video*)f->data;
if (s->port!=-1){
if (s->port!=(XvPortID)-1){
XvStopVideo(s->display,s->port, s->window_id);
XvUngrabPort(s->display,s->port,CurrentTime);
s->port=-1;
s->port=(XvPortID)-1;
}
if (s->shminfo.shmaddr!=NULL){
XShmDetach(s->display,&s->shminfo);
......
......@@ -1669,8 +1669,6 @@ static void ice_send_error_response(const RtpSession *rtp_session, const OrtpEve
char tr_id_str[25];
UInt96 tr_id;
if (socket < 0) return;
memset(&dest_addr, 0, dest_addrlen);
memset(&source_addr, 0, source_addrlen);
ice_get_transport_from_rtp_session(rtp_session, evt_data, &rtptp);
......
......@@ -30,7 +30,7 @@ void ms_iframe_requests_limiter_request_iframe(MSIFrameRequestsLimiterCtx *obj)
}
bool_t ms_iframe_requests_limiter_iframe_requested(const MSIFrameRequestsLimiterCtx *obj, uint64_t curtime) {
return obj->iframe_required && ( obj->last_sent_iframe_time == (uint64_t)-1 || (curtime - obj->last_sent_iframe_time) > obj->min_iframe_interval);
return obj->iframe_required && ( obj->last_sent_iframe_time == (uint64_t)-1 || (int)(curtime - obj->last_sent_iframe_time) > obj->min_iframe_interval);
}
void ms_iframe_requests_limiter_notify_iframe_sent(MSIFrameRequestsLimiterCtx *obj, uint64_t curtime) {
......
......@@ -862,8 +862,8 @@ bool_t ms_video_capture_new_frame(MSFrameRateController* ctrl, uint64_t current_
}
void ms_average_fps_init(MSAverageFPS* afps, const char* ctx) {
afps->last_frame_time = -1;
afps->last_print_time = -1;
afps->last_frame_time = (uint64_t)-1;
afps->last_print_time = (uint64_t)-1;
afps->mean_inter_frame = 0;
afps->context = ctx;
if (!ctx || strstr(ctx, "%f") == 0) {
......@@ -877,7 +877,7 @@ void ms_video_init_average_fps(MSAverageFPS* afps, const char* ctx){
}
bool_t ms_average_fps_update(MSAverageFPS* afps, uint64_t current_time) {
if (afps->last_frame_time!=-1){
if (afps->last_frame_time!=(uint64_t)-1){
float frame_interval=(float)(current_time - afps->last_frame_time)/1000.0f;
if (afps->mean_inter_frame==0){
afps->mean_inter_frame=frame_interval;
......
......@@ -164,8 +164,9 @@ static void rfc3984_pack_mode_1(Rfc3984Context *ctx, MSQueue *naluq, MSQueue *rt
/*send prevm packet: either single nal or STAP-A*/
if (prevm->b_cont!=NULL){
ms_debug("Sending STAP-A");
}else
}else {
ms_debug("Sending previous msg as single NAL");
}
send_packet(ctx, rtpq,ts,prevm,FALSE);
prevm=NULL;
prevsz=0;
......
......@@ -557,22 +557,22 @@ static void adaptive_vp8_lossy_congestion() {
static test_t tests[] = {
{ "Packet duplication", packet_duplication},
{ "Upload bandwidth computation", upload_bandwidth_computation },
{ "Loss rate estimation", loss_rate_estimation },
{ "Loss rate estimationBV16", loss_rate_estimation_bv16 },
TEST_NO_TAG("Packet duplication", packet_duplication),
TEST_NO_TAG("Upload bandwidth computation", upload_bandwidth_computation),
TEST_NO_TAG("Loss rate estimation", loss_rate_estimation),
TEST_NO_TAG("Loss rate estimationBV16", loss_rate_estimation_bv16),
{ "Upload bitrate [pcma] - 3g", upload_bitrate_pcma_3g },
{ "Upload bitrate [speex] - low", upload_bitrate_speex_low },
{ "Upload bitrate [speex] - 3g", upload_bitrate_speex_3g },
{ "Upload bitrate [opus] - edge", upload_bitrate_opus_edge },
{ "Upload bitrate [opus] - 3g", upload_bitrate_opus_3g },
TEST_NO_TAG("Upload bitrate [pcma] - 3g", upload_bitrate_pcma_3g),
TEST_NO_TAG("Upload bitrate [speex] - low", upload_bitrate_speex_low),
TEST_NO_TAG("Upload bitrate [speex] - 3g", upload_bitrate_speex_3g),
TEST_NO_TAG("Upload bitrate [opus] - edge", upload_bitrate_opus_edge),
TEST_NO_TAG("Upload bitrate [opus] - 3g", upload_bitrate_opus_3g),
#if VIDEO_ENABLED && 0
{ "Network detection [VP8] - ideal", adaptive_vp8_ideal },
{ "Network detection [VP8] - lossy", adaptive_vp8_lossy },
{ "Network detection [VP8] - congested", adaptive_vp8_congestion },
{ "Network detection [VP8] - lossy congested", adaptive_vp8_lossy_congestion },
TEST_NO_TAG("Network detection [VP8] - ideal", adaptive_vp8_ideal),
TEST_NO_TAG("Network detection [VP8] - lossy", adaptive_vp8_lossy),
TEST_NO_TAG("Network detection [VP8] - congested", adaptive_vp8_congestion),
TEST_NO_TAG("Network detection [VP8] - lossy congested", adaptive_vp8_lossy_congestion),
#endif
};
......
......@@ -665,19 +665,19 @@ static void symetric_rtp_with_wrong_rtcp_port(void) {
static test_t tests[] = {
{ "Basic audio stream", basic_audio_stream },
{ "Multicast audio stream", multicast_audio_stream },
{ "Encrypted audio stream", encrypted_audio_stream },
{ "Encrypted audio stream with 2 srtp context", encrypted_audio_stream_with_2_srtp_stream },
{ "Encrypted audio stream with 2 srtp context, recv first", encrypted_audio_stream_with_2_srtp_stream_recv_first },
{ "Encrypted audio stream with ssrc changes", encrypted_audio_stream_with_ssrc_change },
{ "Encrypted audio stream with key change", encrypted_audio_stream_with_key_change },
{ "Encrypted audio stream, encryption mandatory", encrypted_audio_stream_encryption_mandatory },
{ "Encrypted audio stream with key change + encryption mandatory", encrypted_audio_stream_with_key_change_encryption_mandatory},
{ "Codec change for audio stream", codec_change_for_audio_stream },
{ "TMMBR feedback for audio stream", tmmbr_feedback_for_audio_stream },
{ "Symetric rtp with wrong address", symetric_rtp_with_wrong_addr },
{ "Symetric rtp with wrong rtcp port", symetric_rtp_with_wrong_rtcp_port },
TEST_NO_TAG("Basic audio stream", basic_audio_stream),
TEST_NO_TAG("Multicast audio stream", multicast_audio_stream),
TEST_NO_TAG("Encrypted audio stream", encrypted_audio_stream),
TEST_NO_TAG("Encrypted audio stream with 2 srtp context", encrypted_audio_stream_with_2_srtp_stream),
TEST_NO_TAG("Encrypted audio stream with 2 srtp context, recv first", encrypted_audio_stream_with_2_srtp_stream_recv_first),
TEST_NO_TAG("Encrypted audio stream with ssrc changes", encrypted_audio_stream_with_ssrc_change),
TEST_NO_TAG("Encrypted audio stream with key change", encrypted_audio_stream_with_key_change),
TEST_NO_TAG("Encrypted audio stream, encryption mandatory", encrypted_audio_stream_encryption_mandatory),
TEST_NO_TAG("Encrypted audio stream with key change + encryption mandatory", encrypted_audio_stream_with_key_change_encryption_mandatory),
TEST_NO_TAG("Codec change for audio stream", codec_change_for_audio_stream),
TEST_NO_TAG("TMMBR feedback for audio stream", tmmbr_feedback_for_audio_stream),
TEST_NO_TAG("Symetric rtp with wrong address", symetric_rtp_with_wrong_addr),
TEST_NO_TAG("Symetric rtp with wrong rtcp port", symetric_rtp_with_wrong_rtcp_port),
};
test_suite_t audio_stream_test_suite = {
......
......@@ -405,15 +405,15 @@ static void dtmfgen_filerec_fileplay_tonedet(void) {
test_t basic_audio_tests[] = {
{ "dtmfgen-tonedet", dtmfgen_tonedet },
{ "dtmfgen-enc-dec-tonedet-bv16", dtmfgen_enc_dec_tonedet_bv16 },
{ "dtmfgen-enc-dec-tonedet-pcmu", dtmfgen_enc_dec_tonedet_pcmu },
{ "dtmfgen-enc-dec-tonedet-isac", dtmfgen_enc_dec_tonedet_isac },
TEST_NO_TAG("dtmfgen-tonedet", dtmfgen_tonedet),
TEST_NO_TAG("dtmfgen-enc-dec-tonedet-bv16", dtmfgen_enc_dec_tonedet_bv16),
TEST_NO_TAG("dtmfgen-enc-dec-tonedet-pcmu", dtmfgen_enc_dec_tonedet_pcmu),
TEST_NO_TAG("dtmfgen-enc-dec-tonedet-isac", dtmfgen_enc_dec_tonedet_isac),
#if HAVE_OPUS
{ "dtmfgen-enc-dec-tonedet-opus", dtmfgen_enc_dec_tonedet_opus },
TEST_NO_TAG("dtmfgen-enc-dec-tonedet-opus", dtmfgen_enc_dec_tonedet_opus),
#endif
{ "dtmfgen-enc-rtp-dec-tonedet", dtmfgen_enc_rtp_dec_tonedet },
{ "dtmfgen-filerec-fileplay-tonedet", dtmfgen_filerec_fileplay_tonedet }
TEST_NO_TAG("dtmfgen-enc-rtp-dec-tonedet", dtmfgen_enc_rtp_dec_tonedet),
TEST_NO_TAG("dtmfgen-filerec-fileplay-tonedet", dtmfgen_filerec_fileplay_tonedet)
};
test_suite_t basic_audio_test_suite = {
......
......@@ -546,24 +546,24 @@ static void test_filterdesc_enable_disable(void) {
test_filterdesc_enable_disable_base("pcma", "MSAlawEnc", TRUE);
}
static test_t tests[] = {
{ "Multiple ms_voip_init", filter_register_tester },
{ "Is multicast", test_is_multicast},
{ "FilterDesc enabling/disabling", test_filterdesc_enable_disable},
TEST_NO_TAG("Multiple ms_voip_init", filter_register_tester),