Commit a7e40577 authored by Ghislain MARY's avatar Ghislain MARY

Fix build for Windows 10.

parent 4d7f2571
......@@ -276,7 +276,7 @@ MS2_PUBLIC void ms_yuv_buf_allocator_free(MSYuvBufAllocator *obj);
MS2_PUBLIC void ms_rgb_to_yuv(const uint8_t rgb[3], uint8_t yuv[3]);
#if defined(__arm__) || defined(__arm64__)
#ifdef MS_HAS_ARM
MS2_PUBLIC void rotate_plane_neon_clockwise(int wDest, int hDest, int full_width, const uint8_t* src, uint8_t* dst);
MS2_PUBLIC void rotate_plane_neon_anticlockwise(int wDest, int hDest, int full_width, const uint8_t* src, uint8_t* dst);
MS2_PUBLIC void deinterlace_and_rotate_180_neon(const uint8_t* ysrc, const uint8_t* cbcrsrc, uint8_t* ydst, uint8_t* udst, uint8_t* vdst, int w, int h, int y_byte_per_row,int cbcr_byte_per_row);
......
......@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msasync.h"
#include "asyncrw.h"
#include "mediastreamer2/msqueue.h"
#include <bctoolbox/bc_vfs.h>
struct _MSAsyncReader{
......@@ -29,7 +29,7 @@ struct _MSAsyncReader{
MSBufferizer buf;
int fd;
int ntasks_pending;
int blocksize;
size_t blocksize;
off_t seekoff;
int moving;
bool_t eof;
......@@ -59,14 +59,14 @@ void ms_async_reader_destroy(MSAsyncReader *obj){
static void async_reader_fill(void *data){
MSAsyncReader *obj = (MSAsyncReader*) data;
mblk_t *m = allocb(obj->blocksize, 0);
int err = read(obj->fd, m->b_wptr, obj->blocksize);
int err = (int)bctbx_read(obj->fd, m->b_wptr, obj->blocksize);
ms_mutex_lock(&obj->mutex);
if (err >= 0){
if (err > 0){
m->b_wptr += err;
ms_bufferizer_put(&obj->buf, m);
}else freemsg(m);
if (err < obj->blocksize){
if ((size_t)err < obj->blocksize){
obj->eof = TRUE;
}
}else if (err == -1){
......@@ -79,26 +79,27 @@ static void async_reader_fill(void *data){
int ms_async_reader_read(MSAsyncReader *obj, uint8_t *buf, size_t size){
int err;
size_t ret;
ms_mutex_lock(&obj->mutex);
if (obj->moving){
err = -EWOULDBLOCK;
goto end;
}
err = ms_bufferizer_get_avail(&obj->buf);
if (err < size && obj->ntasks_pending){
ret = ms_bufferizer_get_avail(&obj->buf);
if (ret < size && obj->ntasks_pending){
err = -EWOULDBLOCK;
goto end;
}
/*eventually ask to fill the bufferizer*/
if (obj->ntasks_pending == 0){
if (err < obj->blocksize){
if (ret < obj->blocksize){
obj->ntasks_pending++;
ms_worker_thread_add_task(obj->wth, async_reader_fill, obj);
}
}
/*and finally return the datas*/
err = ms_bufferizer_read(&obj->buf, buf, size);
err = (int)ms_bufferizer_read(&obj->buf, buf, size);
end:
ms_mutex_unlock(&obj->mutex);
return err;
......@@ -132,7 +133,7 @@ struct _MSAsyncWriter{
MSBufferizer buf;
uint8_t *wbuf;
int fd;
int blocksize;
size_t blocksize;
};
MSAsyncWriter *ms_async_writer_new(int fd){
......@@ -164,7 +165,7 @@ static void async_writer_write(void *data){
}
ms_mutex_unlock(&obj->mutex);
if (ok){
if (write(obj->fd, obj->wbuf, size) == -1){
if (bctbx_write(obj->fd, obj->wbuf, size) == -1){
ms_error("async_writer_write(): %s", strerror(errno));
}
}
......
......@@ -20,6 +20,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#ifndef asyncrw_h
#define asyncrw_h
#ifndef _WIN32_CE
#include <sys/types.h>
#endif
typedef struct _MSAsyncReader MSAsyncReader;
typedef struct _MSAsyncWriter MSAsyncWriter;
......
......@@ -37,7 +37,7 @@ plc_context_t *generic_plc_create_context(int sample_rate) {
* - the second TRANSITION_DELAY ms are mixed for smooth transition with the begining of arrived frame
*/
context->continuity_buffer = ms_malloc0(2*sample_rate*sizeof(int16_t)*TRANSITION_DELAY/1000); /* continuity buffer introduce a TRANSITION_DELAY ms delay */
context->plc_buffer_len = sample_rate*sizeof(int16_t)*PLC_BUFFER_LEN; /* length in bytes of the plc_buffer */
context->plc_buffer_len = (uint16_t)(sample_rate*sizeof(int16_t)*PLC_BUFFER_LEN); /* length in bytes of the plc_buffer */
context->plc_buffer = ms_malloc0(context->plc_buffer_len);
context->hamming_window = ms_malloc0(sample_rate*PLC_BUFFER_LEN*sizeof(float));
context->plc_out_buffer = ms_malloc0(2*context->plc_buffer_len);
......
......@@ -80,11 +80,11 @@ static void enc_process(MSFilter *f){
while(ms_bufferizer_get_avail(s->bufferizer)>=s->nbytes) {
mblk_t *om=allocb(s->nbytes,0);
om->b_wptr+=ms_bufferizer_read(s->bufferizer,om->b_wptr,s->nbytes);
host_to_network((int16_t*)om->b_rptr,s->nbytes/2);
host_to_network((int16_t*)om->b_rptr,(int)(s->nbytes/2));
ms_bufferizer_fill_current_metas(s->bufferizer, om);
mblk_set_timestamp_info(om,s->ts);
ms_queue_put(f->outputs[0],om);
s->ts += s->nbytes/(2*s->nchannels);
s->ts += (uint32_t)(s->nbytes/(2*s->nchannels));
}
ms_filter_unlock(f);
};
......
......@@ -238,7 +238,7 @@ static void dec_process(MSFilter *f) {
om=allocb(msg_size*4,0);
mblk_meta_copy(im, om);
if ((declen = g722_decode(s->dec_state,(int16_t *)om->b_wptr, im->b_rptr, msg_size))<0) {
if ((declen = g722_decode(s->dec_state,(int16_t *)om->b_wptr, im->b_rptr, (int)msg_size))<0) {
ms_warning("g722_decode error!");
freemsg(om);
} else {
......@@ -282,7 +282,7 @@ static void dec_process(MSFilter *f) {
om = allocb(buff_size, 0);
mblk_set_plc_flag(om, 1);
generic_plc_generate_samples(s->plc_context, (int16_t *)om->b_wptr, buff_size/sizeof(int16_t));
generic_plc_generate_samples(s->plc_context, (int16_t *)om->b_wptr, (uint16_t)(buff_size/sizeof(int16_t)));
/* store the generated samples into plc_buffer */
generic_plc_update_plc_buffer(s->plc_context, om->b_wptr, buff_size);
......
......@@ -137,7 +137,7 @@ static void generic_plc_process(MSFilter *f) {
mblk_set_cng_flag(m, 1);
}else{ /* plc */
mblk_set_plc_flag(m, 1);
generic_plc_generate_samples(plc_context, (int16_t *)m->b_wptr, buff_size/sizeof(int16_t));
generic_plc_generate_samples(plc_context, (int16_t *)m->b_wptr, (uint16_t)(buff_size/sizeof(int16_t)));
/* store the generated samples into plc_buffer */
generic_plc_update_plc_buffer(plc_context, m->b_wptr, buff_size);
//memset(m->b_wptr, 0, buff_size);
......
......@@ -84,7 +84,7 @@ void ms_worker_thread_add_task(MSWorkerThread *obj, MSTaskFunc func, void *data)
MSTask *task = ms_task_new(func, data);
ms_mutex_lock(&obj->mutex);
obj->tasks = bctbx_list_append(obj->tasks, task);
if (obj->inwait) pthread_cond_signal(&obj->cond);
if (obj->inwait) ms_cond_signal(&obj->cond);
ms_mutex_unlock(&obj->mutex);
}
......@@ -92,7 +92,7 @@ void ms_worker_thread_destroy(MSWorkerThread *obj, bool_t finish_tasks){
ms_mutex_lock(&obj->mutex);
obj->finish_tasks = finish_tasks;
obj->running = FALSE;
if (obj->inwait) pthread_cond_signal(&obj->cond);
if (obj->inwait) ms_cond_signal(&obj->cond);
ms_mutex_unlock(&obj->mutex);
ms_thread_join(obj->thread, NULL);
if (obj->tasks){
......
......@@ -429,7 +429,7 @@ static int ms_dtls_srtp_rtp_DTLSread (void *ctx, unsigned char *buf, size_t len)
ms_free(context->rtp_incoming_buffer);
context->rtp_incoming_buffer = next_packet;
return dataLength;
return (int)dataLength;
}
}
......@@ -447,7 +447,7 @@ static int ms_dtls_srtp_rtcp_DTLSread (void *ctx, unsigned char *buf, size_t len
ms_free(context->rtcp_incoming_buffer);
context->rtcp_incoming_buffer = next_packet;
return dataLength;
return (int)dataLength;
}
}
......@@ -472,12 +472,12 @@ static int ms_dtls_srtp_rtp_process_on_receive(struct _RtpTransportModifier *t,
/* check if we have an on-going handshake */
if (ctx->rtp_channel_status == DTLS_STATUS_CONTEXT_NOT_READY) {
return msgLength;
return (int)msgLength;
}
// check incoming message length
if (msgLength<RTP_FIXED_HEADER_SIZE) {
return msgLength;
return (int)msgLength;
}
/* check if it is a DTLS packet and process it */
......@@ -540,7 +540,7 @@ static int ms_dtls_srtp_rtp_process_on_receive(struct _RtpTransportModifier *t,
}
return 0;
}
return msgLength;
return (int)msgLength;
}
static int ms_dtls_srtp_rtcp_process_on_receive(struct _RtpTransportModifier *t, mblk_t *msg) {
......@@ -551,12 +551,12 @@ static int ms_dtls_srtp_rtcp_process_on_receive(struct _RtpTransportModifier *t,
// check incoming message length
if (msgLength<RTP_FIXED_HEADER_SIZE) {
return msgLength;
return (int)msgLength;
}
/* check if we have an on-going handshake */
if (ctx->rtp_channel_status == DTLS_STATUS_CONTEXT_NOT_READY) {
return msgLength;
return (int)msgLength;
}
/* check if it is a DTLS packet and process it */
......@@ -620,14 +620,14 @@ static int ms_dtls_srtp_rtcp_process_on_receive(struct _RtpTransportModifier *t,
return 0;
}
return msgdsize(msg);
return (int)msgdsize(msg);
}
static int ms_dtls_srtp_rtp_process_on_send(struct _RtpTransportModifier *t, mblk_t *msg){
return msgdsize(msg);
return (int)msgdsize(msg);
}
static int ms_dtls_srtp_rtcp_process_on_send(struct _RtpTransportModifier *t, mblk_t *msg) {
return msgdsize(msg);
return (int)msgdsize(msg);
}
/**************************************/
......
......@@ -300,7 +300,7 @@ static int ms_zrtp_loadCache(void *zidCacheData, uint8_t** output, uint32_t *out
return -1;
}
*output=(uint8_t*)ms_load_file_content(CACHEFD, &nbytes);
*outputSize = nbytes+1;
*outputSize = (uint32_t)(nbytes+1);
*cb=ms_free;
fclose(CACHEFD);
return *outputSize;
......@@ -319,7 +319,7 @@ static int ms_zrtp_writeCache(void *zidCacheData, const uint8_t* input, uint32_t
char *filename = userData->zidFilename;
FILE *CACHEFD = fopen(filename, "w+");
int retval = fwrite(input, 1, inputSize, CACHEFD);
int retval = (int)fwrite(input, 1, inputSize, CACHEFD);
fclose(CACHEFD);
return retval;
......@@ -368,10 +368,10 @@ static int ms_zrtp_addExportedKeysInZidCache(void *zidCacheData, void *clientDat
/**** Transport Modifier Sender/Receiver functions ****/
static int ms_zrtp_rtp_process_on_send(struct _RtpTransportModifier *t, mblk_t *msg){
return msgdsize(msg);
return (int)msgdsize(msg);
}
static int ms_zrtp_rtcp_process_on_send(struct _RtpTransportModifier *t, mblk_t *msg) {
return msgdsize(msg);
return (int)msgdsize(msg);
}
static int ms_zrtp_rtp_process_on_receive(struct _RtpTransportModifier *t, mblk_t *msg){
......@@ -381,7 +381,7 @@ static int ms_zrtp_rtp_process_on_receive(struct _RtpTransportModifier *t, mblk_
bzrtpContext_t *zrtpContext = userData->zrtpContext;
uint8_t* rtp;
int rtpVersion;
int msgLength = msgdsize(msg);
int msgLength = (int)msgdsize(msg);
// send a timer tick to the zrtp engine
bzrtp_iterate(zrtpContext, userData->self_ssrc, get_timeval_in_millis());
......@@ -415,7 +415,7 @@ static int ms_zrtp_rtp_process_on_receive(struct _RtpTransportModifier *t, mblk_
/* Nothing to do on rtcp packets, just return packet length */
static int ms_zrtp_rtcp_process_on_receive(struct _RtpTransportModifier *t, mblk_t *msg) {
return msgdsize(msg);
return (int)msgdsize(msg);
}
......
......@@ -64,7 +64,7 @@ static void send_stun_packet(SenderData *d, bool_t enable_rtp, bool_t enable_rtc
mblk_t *mp;
RtpSession *s = d->session;
char *buf = NULL;
int len;
size_t len;
if (!d->stun_enabled) return;
if (ms_is_multicast_addr((const struct sockaddr *)&s->rtcp.gs.loc_addr)) {
......
......@@ -99,7 +99,7 @@ static void insert_lost_char(uint8_t *p){
}
static int read_t140_data(RealTimeTextSinkData *stream, uint8_t *data, int readsize) {
int buf_size = (int)TS_INBUF_SIZE - stream->inbufsize;
int buf_size = (int)TS_INBUF_SIZE - (int)stream->inbufsize;
if (readsize < 0) {
ms_warning("corrupt packet (readsize<0)");
return -1;
......@@ -193,7 +193,7 @@ static void process_red_packet(RealTimeTextSinkData *stream, mblk_t *packet) {
for (pos = 0; pos < (redgen - redneeded) * 4; pos += 4) {
readstart += (((uint32_t)payload[pos + 2] << 8) | (uint32_t)payload[pos + 3]) & 0x3FF;
}
if (read_t140_data(stream, &payload[readstart], payloadsize - readstart)) {
if (read_t140_data(stream, &payload[readstart], (int)payloadsize - readstart)) {
ms_debug("error reading");
return; /* return without updating seqno */
}
......
......@@ -33,7 +33,7 @@ int ms_bits_reader_n_bits(MSBitsReader *reader, int count, unsigned int *ret, co
unsigned int tmp;
size_t byte_index=reader->bit_index/8;
size_t bit_index=reader->bit_index % 8;
int shift=32-bit_index-count;
int shift=(int)(32-bit_index-count);
if (count>=24){
ms_error("This bit reader cannot read more than 24 bits at once.");
......@@ -132,7 +132,7 @@ int ms_bits_writer_n_bits(MSBitsWriter *writer, int count, unsigned int value, c
/* resize if necessary */
if ((size_t)(writer->bit_index + count) > writer->buf_size * 8) {
int old_size = writer->buf_size;
size_t old_size = writer->buf_size;
writer->buf_size = MAX(2 * (writer->buf_size + 1), writer->buf_size + count / 8);
writer->buffer = (uint8_t*) realloc(writer->buffer, writer->buf_size);
memset(&writer->buffer[old_size], 0, writer->buf_size - old_size);
......
......@@ -82,7 +82,7 @@ static void _mkv_track_reader_edit_seek(MKVTrackReader *obj);
MKVReader *mkv_reader_open(const char *filename) {
MKVReader *obj = (MKVReader *)ms_new0(MKVReader, 1);
tchar_t *fname = NULL;
int err;
err_t err;
ParserContext_Init(&obj->p, NULL, NULL, NULL);
_load_modules((nodemodule *)&obj->p);
......@@ -94,7 +94,7 @@ MKVReader *mkv_reader_open(const char *filename) {
#ifdef UNICODE
fname = ms_malloc0((strlen(filename) + 1) * sizeof(tchar_t));
#ifdef _WIN32
MultiByteToWideChar(CP_UTF8, 0, filename, -1, fname, strlen(filename));
MultiByteToWideChar(CP_UTF8, 0, filename, -1, fname, (int)strlen(filename));
#else
mbstowcs(fname, filename, strlen(filename));
#endif
......@@ -344,7 +344,7 @@ static int _parse_headers(MKVReader *obj) {
ebml_parser_context pctx, seg_pctx;
tchar_t doc_type[9];
int doc_type_version;
int err;
err_t err;
int upper_level = 0;
bool_t cluster_found = FALSE;
bool_t level1_found = FALSE;
......
......@@ -213,15 +213,15 @@ static int nalusToFrame(DecData *d, MSQueue *naluq, bool_t *new_sps_pps){
end=d->bitstream+d->bitstream_size;
while((im=ms_queue_get(naluq))!=NULL){
src=im->b_rptr;
nal_len=im->b_wptr-src;
nal_len=(int)(im->b_wptr-src);
if (dst+nal_len+100>end){
int pos=dst-d->bitstream;
int pos=(int)(dst-d->bitstream);
enlarge_bitstream(d, d->bitstream_size+nal_len+100);
dst=d->bitstream+pos;
end=d->bitstream+d->bitstream_size;
}
if (src[0]==0 && src[1]==0 && src[2]==0 && src[3]==1){
int size=im->b_wptr-src;
int size=(int)(im->b_wptr-src);
/*workaround for stupid RTP H264 sender that includes nal markers */
memcpy(dst,src,size);
dst+=size;
......@@ -256,7 +256,7 @@ static int nalusToFrame(DecData *d, MSQueue *naluq, bool_t *new_sps_pps){
}
freemsg(im);
}
return dst-d->bitstream;
return (int)(dst-d->bitstream);
}
static void dec_process(MSFilter *f){
......@@ -306,7 +306,7 @@ static void dec_process(MSFilter *f){
av_frame_unref(d->orig);
av_init_packet(&pkt);
pkt.data = p;
pkt.size = end-p;
pkt.size = (int)(end-p);
#if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(50,43,0) // backward compatibility with Debian Squeeze (6.0)
pkt.pts = frame_ts;
#endif
......
......@@ -119,7 +119,7 @@ static void jpg_process(MSFilter *f){
mblk_t *m=ms_queue_peek_last(f->inputs[0]);
if (ms_yuv_buf_init_from_mblk(&yuvbuf,m)==0){
int error,got_pict;
int comp_buf_sz=msgdsize(m);
size_t comp_buf_sz=msgdsize(m);
uint8_t *comp_buf=(uint8_t*)ms_malloc0(comp_buf_sz);
mblk_t *jpegm;
struct SwsContext *sws_ctx;
......@@ -165,7 +165,7 @@ static void jpg_process(MSFilter *f){
av_frame_unref(s->pict);
avpicture_fill((AVPicture*)s->pict,(uint8_t*)jpegm->b_rptr,avctx->pix_fmt,avctx->width,avctx->height);
packet.data=comp_buf;
packet.size=comp_buf_sz;
packet.size=(int)comp_buf_sz;
error=avcodec_encode_video2(avctx, &packet, s->pict, &got_pict);
if (error<0){
ms_error("Could not encode jpeg picture.");
......
......@@ -121,7 +121,7 @@ static void H264Private_serialize(const H264Private *obj, uint8_t **data, size_t
uint8_t nbSPS, nbPPS;
bctbx_list_t *it = NULL;
uint8_t *result = NULL;
int i;
size_t i;
nbSPS = (uint8_t)bctbx_list_size(obj->sps_list);
nbPPS = (uint8_t)bctbx_list_size(obj->pps_list);
......@@ -161,7 +161,7 @@ static void H264Private_serialize(const H264Private *obj, uint8_t **data, size_t
for(it = obj->pps_list; it != NULL; it = it->next) {
mblk_t *buff = (mblk_t *)(it->data);
int buff_size = msgdsize(buff);
size_t buff_size = msgdsize(buff);
uint16_t buff_size_be = htons((uint16_t)buff_size);
memcpy(&result[i], &buff_size_be, sizeof(buff_size_be));
i += sizeof(buff_size_be);
......@@ -291,7 +291,7 @@ static void nalus_to_frame(mblk_t *buffer, mblk_t **frame, bctbx_list_t **spsLis
default:
{
uint32_t bufferSize = htonl(msgdsize(buff));
uint32_t bufferSize = htonl((uint32_t)msgdsize(buff));
mblk_t *size = allocb(4, 0);
if(type == 5) {
......@@ -1088,7 +1088,7 @@ static int matroska_open_file(Matroska *obj, const char *path, MatroskaOpenMode
switch(mode) {
case MKV_OPEN_CREATE:
if((obj->output = StreamOpen(obj->p, path, SFLAG_WRONLY | SFLAG_CREATE)) == NULL) {
if((obj->output = StreamOpen(obj->p, (tchar_t *)path, SFLAG_WRONLY | SFLAG_CREATE)) == NULL) {
err = -2;
break;
}
......@@ -1098,7 +1098,7 @@ static int matroska_open_file(Matroska *obj, const char *path, MatroskaOpenMode
break;
case MKV_OPEN_APPEND:
if((obj->output = StreamOpen(obj->p, path, SFLAG_REOPEN)) == NULL) {
if((obj->output = StreamOpen(obj->p, (tchar_t *)path, SFLAG_REOPEN)) == NULL) {
err = -2;
break;
}
......@@ -1117,7 +1117,7 @@ static int matroska_open_file(Matroska *obj, const char *path, MatroskaOpenMode
break;
case MKV_OPEN_RO:
if((obj->output = StreamOpen(obj->p, path, SFLAG_RDONLY)) == NULL) {
if((obj->output = StreamOpen(obj->p, (tchar_t *)path, SFLAG_RDONLY)) == NULL) {
err = -2;
break;
}
......@@ -1822,7 +1822,7 @@ static matroska_block *write_frame(MKVRecorder *obj, mblk_t *buffer, uint16_t pi
frame = module_process(obj->modulesList[pin], buffer, &isKeyFrame, &isVisible, &codecPrivateData, &codecPrivateSize);
m_frame.Timecode = ((int64_t)mblk_get_timestamp_info(frame)) * 1000000LL;
m_frame.Size = msgdsize(frame);
m_frame.Size = (uint32_t)msgdsize(frame);
m_frame.Data = frame->b_rptr;
if(matroska_clusters_count(&obj->file) == 0) {
......
......@@ -122,7 +122,9 @@ static int dec_add_fmtp(MSFilter *f, void *data){
char config[512];
if (fmtp_get_value(fmtp,"config",config,sizeof(config))){
/*convert hexa decimal config string into a bitstream */
int i,j,max=strlen(config);
size_t i;
int j;
size_t max = strlen(config);
char octet[3];
octet[2]=0;
for(i=0,j=0;i<max;i+=2,++j){
......
......@@ -603,7 +603,7 @@ static void mjpeg_fragment_and_send(MSFilter *f,EncState *s,mblk_t *frame, uint3
struct jpeghdr jpghdr;
struct jpeghdr_rst rsthdr;
struct jpeghdr_qtable qtblhdr;
int bytes_left = msgdsize(frame);
int bytes_left = (int)msgdsize(frame);
int data_len;
mblk_t *packet;
......
......@@ -1267,7 +1267,7 @@ static IceStunServerRequestTransaction * ice_send_stun_request(RtpTransport *rtp
{
IceStunServerRequestTransaction *transaction = NULL;
char *buf = NULL;
int len;
size_t len;
char source_addr_str[64];
char dest_addr_str[64];
char tr_id_str[25];
......@@ -1291,7 +1291,7 @@ static IceStunServerRequestTransaction * ice_send_stun_server_binding_request(Ic
{
IceStunServerRequestTransaction *transaction = NULL;
MSStunMessage *msg = ms_stun_binding_request_create();
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, request->source_ai->ai_addrlen, server, addrlen, msg, "STUN binding request");
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, (socklen_t)request->source_ai->ai_addrlen, server, addrlen, msg, "STUN binding request");
ms_stun_message_destroy(msg);
return transaction;
}
......@@ -1322,7 +1322,7 @@ static IceStunServerRequestTransaction * ice_send_turn_server_allocate_request(I
MSStunMessage *msg = ms_turn_allocate_request_create();
stun_message_fill_authentication_from_turn_context(msg, request->turn_context);
request->stun_method = ms_stun_message_get_method(msg);
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, request->source_ai->ai_addrlen, server, addrlen, msg, "TURN allocate request");
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, (socklen_t)request->source_ai->ai_addrlen, server, addrlen, msg, "TURN allocate request");
ms_stun_message_destroy(msg);
return transaction;
}
......@@ -1333,7 +1333,7 @@ static IceStunServerRequestTransaction * ice_send_turn_server_refresh_request(Ic
MSStunMessage *msg = ms_turn_refresh_request_create(ms_turn_context_get_lifetime(request->turn_context));
stun_message_fill_authentication_from_turn_context(msg, request->turn_context);
request->stun_method = ms_stun_message_get_method(msg);
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, request->source_ai->ai_addrlen, server, addrlen, msg, "TURN refresh request");
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, (socklen_t)request->source_ai->ai_addrlen, server, addrlen, msg, "TURN refresh request");
ms_stun_message_destroy(msg);
}
return transaction;
......@@ -1344,7 +1344,7 @@ static IceStunServerRequestTransaction * ice_send_turn_server_create_permission_
MSStunMessage *msg = ms_turn_create_permission_request_create(request->peer_address);
stun_message_fill_authentication_from_turn_context(msg, request->turn_context);
request->stun_method = ms_stun_message_get_method(msg);
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, request->source_ai->ai_addrlen, server, addrlen, msg, "TURN create permission request");
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, (socklen_t)request->source_ai->ai_addrlen, server, addrlen, msg, "TURN create permission request");
ms_stun_message_destroy(msg);
return transaction;
}
......@@ -1354,7 +1354,7 @@ static IceStunServerRequestTransaction * ice_send_turn_server_channel_bind_reque
MSStunMessage *msg = ms_turn_channel_bind_request_create(request->peer_address, request->channel_number);
stun_message_fill_authentication_from_turn_context(msg, request->turn_context);
request->stun_method = ms_stun_message_get_method(msg);
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, request->source_ai->ai_addrlen, server, addrlen, msg, "TURN channel bind request");
transaction = ice_send_stun_request(request->rtptp, request->source_ai->ai_addr, (socklen_t)request->source_ai->ai_addrlen, server, addrlen, msg, "TURN channel bind request");
ms_stun_message_destroy(msg);
return transaction;
}
......@@ -1392,7 +1392,7 @@ static void ice_send_binding_request(IceCheckList *cl, IceCandidatePair *pair, c
char *username;
IceTransaction *transaction;
char *buf = NULL;
int len;
size_t len;
RtpTransport *rtptp;
char local_addr_str[64];
char remote_addr_str[64];
......@@ -1567,7 +1567,7 @@ static void ice_send_binding_response(IceCheckList *cl, const RtpSession *rtp_se
MSStunMessage *response;
char *buf = NULL;
char *username;
int len;
size_t len;
RtpTransport *rtptp = NULL;
struct sockaddr_storage dest_addr;
socklen_t dest_addrlen = sizeof(dest_addr);
......@@ -1627,7 +1627,7 @@ static void ice_send_error_response(const RtpSession *rtp_session, const OrtpEve
{
MSStunMessage *response;
char *buf = NULL;
int len;
size_t len;
RtpTransport* rtptp;
struct sockaddr_storage dest_addr;
socklen_t dest_addrlen = sizeof(dest_addr);
......@@ -1671,7 +1671,7 @@ static void ice_send_indication(const IceCandidatePair *pair, const RtpSession *
MSStunAddress source;
MSStunAddress dest;
char *buf = NULL;
int len;
size_t len;
RtpTransport *rtptp;
char local_addr_str[64];
char remote_addr_str[64];
......@@ -2894,7 +2894,7 @@ void ice_add_losing_pair(IceCheckList *cl, uint16_t componentID, int family, con
static int ice_check_list_nb_losing_pairs(const IceCheckList *cl)
{
return bctbx_list_size(cl->losing_pairs);
return (int)bctbx_list_size(cl->losing_pairs);
}
int ice_session_nb_losing_pairs(const IceSession *session)
......@@ -3187,7 +3187,7 @@ static void ice_prune_candidate_pairs(IceCheckList *cl)
bctbx_list_for_each2(cl->pairs, (void (*)(void*,void*))ice_create_check_list, cl);
/* Limit the number of connectivity checks. */
nb_pairs = bctbx_list_size(cl->check_list);
nb_pairs = (int)bctbx_list_size(cl->check_list);
if (nb_pairs > cl->session->max_connectivity_checks) {
nb_pairs_to_remove = nb_pairs - cl->session->max_connectivity_checks;
list = cl->check_list;
......
......@@ -465,7 +465,7 @@ static double compute_available_bw(MSStatefulQosAnalyzer *obj){
double mean_bw = 0.;
bctbx_list_t *current = obj->rtcpstatspoint;
bctbx_list_t *last = current;
int size = bctbx_list_size(obj->rtcpstatspoint);
size_t size = bctbx_list_size(obj->rtcpstatspoint);
if (current == NULL){
ms_message("MSStatefulQosAnalyzer[%p]: no points available for estimation", obj);
return -1;
......@@ -569,7 +569,7 @@ static void stateful_analyzer_suggest_action(MSQosAnalyzer *objbase, MSRateContr
curbw = obj->latest ? obj->latest->bandwidth : 0.;
bw = compute_available_bw(obj);
greatest_pt = bctbx_list_size(obj->rtcpstatspoint) ?
(rtcpstatspoint_t*)bctbx_list_nth_data(obj->rtcpstatspoint, bctbx_list_size(obj->rtcpstatspoint)-1)
(rtcpstatspoint_t*)bctbx_list_nth_data(obj->rtcpstatspoint, (int)bctbx_list_size(obj->rtcpstatspoint)-1)
: NULL;
/*try a burst every 50 seconds (10 RTCP packets)*/
......
......@@ -357,7 +357,7 @@ static uint64_t decode64(StunMessageDecoder *decoder) {
static const void * decode(StunMessageDecoder *decoder, size_t len) {
const void *value = decoder->ptr;
decoder->ptr += len;
decoder->remaining -= len;
decoder->remaining -= (ssize_t)len;
if (decoder->remaining < 0) decoder->error = TRUE;
return value;
}
......@@ -1515,7 +1515,7 @@ static int ms_turn_rtp_endpoint_sendto(RtpTransport *rtptp, mblk_t *msg, int fla
/* Use a TURN send indication to encapsulate the data to be sent */
MSStunAddress stun_addr;
char *buf = NULL;
int len;
size_t len;
uint8_t *data;
uint16_t datalen;
msgpullup(msg, -1);
......
......@@ -207,7 +207,7 @@ static int vp8_decode_value(BOOL_DECODER *br, int bits)
static mblk_t * concat_packets_of_partition(Vp8RtpFmtPartition *partition) {
Vp8RtpFmtPacket *packet;
int nb_packets = bctbx_list_size(partition->packets_list);
int nb_packets = (int)bctbx_list_size(partition->packets_list);
int i;
if (partition->m != NULL) return partition->m;
......@@ -515,14 +515,14 @@ static void check_frame_partitions_have_start(Vp8RtpFmtUnpackerCtx *ctx, Vp8RtpF
Vp8RtpFmtPacket *packet;
Vp8RtpFmtPartition *partition;
int i;
size_t j;
int j;
if (frame->unnumbered_partitions == TRUE) return;
for (i = 0; i <= frame->partitions_info.nb_partitions; i++) {
partition = frame->partitions[i];
if (partition == NULL) continue;
for (j = 0; j < bctbx_list_size(partition->packets_list); j++) {
for (j = 0; j < (int)bctbx_list_size(partition->packets_list); j++) {
packet = (Vp8RtpFmtPacket *)bctbx_list_nth_data(partition->packets_list, j);
if ((j == 0) && !partition->has_start && !packet->cseq_inconsistency) {
/**
......@@ -723,7 +723,7 @@ static void output_partitions_of_frame(Vp8RtpFmtUnpackerCtx *ctx, MSQueue *out,
static int output_valid_partitions(Vp8RtpFmtUnpackerCtx *ctx, MSQueue *out) {
Vp8RtpFmtFrame *frame;
int nb_frames = bctbx_list_size(ctx->frames_list);
size_t nb_frames = bctbx_list_size(ctx->frames_list);
if (nb_frames == 0) return -1;
frame = (Vp8RtpFmtFrame *)bctbx_list_nth_data(ctx->frames_list, 0);
......
......@@ -164,7 +164,7 @@ static void basic_text_stream(void) {
text_stream_putchar32(margaux->ts, (uint32_t)c);
}
BC_ASSERT_TRUE(wait_for_until(&marielle->ts->ms, &margaux->ts->ms, &marielle->stats.number_of_received_char, strlen(helloworld), 5000));
BC_ASSERT_TRUE(wait_for_until(&marielle->ts->ms, &margaux->ts->ms, &marielle->stats.number_of_received_char, (int)strlen(helloworld), 5000));
ms_message("Received message is: %s", marielle->stats.received_chars);
strcmpresult = strcmp(marielle->stats.received_chars, helloworld);
BC_ASSERT_EQUAL(strcmpresult, 0, int, "%d");
......@@ -190,7 +190,7 @@ static void basic_text_stream2(void) {
wait_for_until(&marielle->ts->ms, &margaux->ts->ms, &dummy, 1, 500);
}
BC_ASSERT_TRUE(wait_for_until(&marielle->ts->ms, &margaux->ts->ms, &marielle->stats.number_of_received_char, strlen(helloworld), 1000));
BC_ASSERT_TRUE(wait_for_until(&marielle->ts->ms, &margaux->ts->ms, &marielle->stats.number_of_received_char, (int)strlen(helloworld), 1000));
ms_message("Received message is: %s", marielle->stats.received_chars);
strcmpresult = strcmp(marielle->stats.received_chars, helloworld);
BC_ASSERT_EQUAL(strcmpresult, 0, int, "%d");
......@@ -214,7 +214,7 @@ static void copy_paste_text_longer_than_rtt_buffer(void) {
text_stream_putchar32(margaux->ts, (uint32_t)c);
}
BC_ASSERT_FALSE(wait_for_until(&marielle->ts->ms, &margaux->ts->ms, &marielle->stats.number_of_received_char, strlen(helloworld), 5000));
BC_ASSERT_FALSE(wait_for_until(&marielle->ts->ms, &margaux->ts->ms, &marielle->stats.number_of_received_char, (int)strlen(helloworld), 5000));
ms_message("Received message is: %s"