From d7aa4332dae06ae890053dd13239ddabee46b86c Mon Sep 17 00:00:00 2001 From: Riza Sulistyo Date: Wed, 19 Jun 2013 06:47:43 +0000 Subject: Re #1680: Add initial support for Win64 git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4537 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/build/pjmedia.vcproj | 3499 ++++++++++++++++++++----- pjmedia/build/pjmedia_audiodev.vcproj | 936 ++++++- pjmedia/build/pjmedia_codec.vcproj | 648 ++++- pjmedia/build/pjmedia_test.vcproj | 1528 ++++++++--- pjmedia/build/pjmedia_videodev.vcproj | 360 +++ pjmedia/include/pjmedia-audiodev/config.h | 1 + pjmedia/include/pjmedia/circbuf.h | 7 +- pjmedia/include/pjmedia/frame.h | 6 +- pjmedia/src/pjmedia-audiodev/errno.c | 2 +- pjmedia/src/pjmedia-audiodev/wmme_dev.c | 4 +- pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c | 15 +- pjmedia/src/pjmedia-codec/gsm.c | 2 +- pjmedia/src/pjmedia-codec/h263_packetizer.c | 6 +- pjmedia/src/pjmedia-codec/h264_packetizer.c | 16 +- pjmedia/src/pjmedia-codec/ilbc.c | 2 +- pjmedia/src/pjmedia-codec/speex_codec.c | 6 +- pjmedia/src/pjmedia-videodev/avi_dev.c | 2 +- pjmedia/src/pjmedia-videodev/dshow_dev.c | 2 +- pjmedia/src/pjmedia-videodev/ffmpeg_dev.c | 3 +- pjmedia/src/pjmedia/avi_player.c | 4 +- pjmedia/src/pjmedia/conference.c | 6 +- pjmedia/src/pjmedia/endpoint.c | 4 +- pjmedia/src/pjmedia/ffmpeg_util.c | 2 +- pjmedia/src/pjmedia/format.c | 4 +- pjmedia/src/pjmedia/g711.c | 4 +- pjmedia/src/pjmedia/jbuf.c | 8 +- pjmedia/src/pjmedia/resample_port.c | 2 +- pjmedia/src/pjmedia/rtcp.c | 5 +- pjmedia/src/pjmedia/sdp.c | 18 +- pjmedia/src/pjmedia/sdp_neg.c | 2 +- pjmedia/src/pjmedia/sound_legacy.c | 4 +- pjmedia/src/pjmedia/sound_port.c | 2 +- pjmedia/src/pjmedia/splitcomb.c | 2 +- pjmedia/src/pjmedia/stream.c | 35 +- pjmedia/src/pjmedia/tonegen.c | 4 +- pjmedia/src/pjmedia/transport_srtp.c | 12 +- pjmedia/src/pjmedia/vid_codec_util.c | 2 +- pjmedia/src/pjmedia/vid_stream.c | 21 +- pjmedia/src/pjmedia/wav_player.c | 14 +- pjmedia/src/pjmedia/wav_playlist.c | 14 +- pjmedia/src/pjmedia/wav_writer.c | 2 +- pjmedia/src/pjmedia/wsola.c | 6 +- pjmedia/src/test/codec_vectors.c | 9 +- pjmedia/src/test/vid_codec_test.c | 8 +- 44 files changed, 6130 insertions(+), 1109 deletions(-) (limited to 'pjmedia') diff --git a/pjmedia/build/pjmedia.vcproj b/pjmedia/build/pjmedia.vcproj index 83b122c6..22fe2764 100644 --- a/pjmedia/build/pjmedia.vcproj +++ b/pjmedia/build/pjmedia.vcproj @@ -16,6 +16,9 @@ + @@ -222,11 +225,12 @@ /> @@ -261,7 +265,6 @@ /> - + + - + + + + + + + + + + + + + @@ -327,7 +380,7 @@ /> @@ -393,7 +446,7 @@ /> - - - - @@ -781,7 +820,6 @@ /> - - @@ -847,7 +877,7 @@ /> @@ -913,7 +943,7 @@ /> @@ -1036,7 +1067,6 @@ /> - - @@ -1102,7 +1124,7 @@ /> @@ -1168,7 +1190,7 @@ /> - - @@ -1300,7 +1315,6 @@ /> - - @@ -1366,7 +1372,7 @@ /> + + + + + + + + + + + + + + + + + + + @@ -1489,7 +1562,7 @@ /> @@ -1555,7 +1628,7 @@ /> @@ -1621,7 +1694,7 @@ /> @@ -1687,7 +1760,7 @@ /> @@ -1753,7 +1826,7 @@ /> @@ -1819,7 +1892,7 @@ /> @@ -1885,6 +1958,7 @@ /> + + @@ -1942,7 +2024,7 @@ /> @@ -2008,7 +2090,7 @@ /> @@ -2074,7 +2156,7 @@ /> @@ -2140,7 +2222,7 @@ /> @@ -2206,7 +2288,7 @@ /> @@ -2272,7 +2354,7 @@ /> @@ -2338,6 +2420,7 @@ /> + + @@ -2395,7 +2486,7 @@ /> @@ -2461,7 +2552,7 @@ /> @@ -2554,9 +2645,9 @@ /> @@ -2620,9 +2711,9 @@ /> @@ -2686,9 +2777,9 @@ /> @@ -2751,48 +2842,2172 @@ - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2816,9 +5040,18 @@ PreprocessorDefinitions="" /> + + + + + + @@ -2838,6 +5080,15 @@ PreprocessorDefinitions="" /> + + + @@ -2847,6 +5098,15 @@ PreprocessorDefinitions="" /> + + + @@ -2856,6 +5116,15 @@ PreprocessorDefinitions="" /> + + + @@ -2865,6 +5134,15 @@ PreprocessorDefinitions="" /> + + + @@ -2874,13 +5152,18 @@ PreprocessorDefinitions="" /> + + + - - + + + @@ -2900,6 +5192,15 @@ PreprocessorDefinitions="" /> + + + @@ -2909,6 +5210,15 @@ PreprocessorDefinitions="" /> + + + @@ -2918,6 +5228,15 @@ PreprocessorDefinitions="" /> + + + @@ -2927,6 +5246,15 @@ PreprocessorDefinitions="" /> + + + @@ -2936,9 +5264,18 @@ PreprocessorDefinitions="" /> + + + + + + @@ -2958,6 +5304,15 @@ PreprocessorDefinitions="" /> + + + @@ -2967,6 +5322,15 @@ PreprocessorDefinitions="" /> + + + @@ -2976,6 +5340,15 @@ PreprocessorDefinitions="" /> + + + @@ -2985,6 +5358,15 @@ PreprocessorDefinitions="" /> + + + @@ -2994,9 +5376,22 @@ PreprocessorDefinitions="" /> + + + + + - - - - - - - - + + - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - + PreprocessorDefinitions="" + /> + + + + + - - + + + + + + + + - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + @@ -224,6 +227,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + @@ -2857,6 +3226,15 @@ PreprocessorDefinitions="" /> + + + @@ -2884,6 +3262,15 @@ PreprocessorDefinitions="" /> + + + @@ -2911,6 +3298,15 @@ PreprocessorDefinitions="" /> + + + @@ -2938,6 +3334,15 @@ PreprocessorDefinitions="" /> + + + @@ -2965,6 +3370,15 @@ PreprocessorDefinitions="" /> + + + @@ -3212,6 +3626,15 @@ PreprocessorDefinitions="" /> + + + @@ -3239,6 +3662,15 @@ PreprocessorDefinitions="" /> + + + @@ -3266,6 +3698,15 @@ PreprocessorDefinitions="" /> + + + @@ -3293,6 +3734,15 @@ PreprocessorDefinitions="" /> + + + @@ -3320,6 +3770,15 @@ PreprocessorDefinitions="" /> + + + @@ -3347,6 +3806,15 @@ PreprocessorDefinitions="" /> + + + @@ -3598,6 +4066,15 @@ PreprocessorDefinitions="" /> + + + @@ -3625,6 +4102,15 @@ PreprocessorDefinitions="" /> + + + @@ -3652,6 +4138,15 @@ PreprocessorDefinitions="" /> + + + @@ -3679,6 +4174,15 @@ PreprocessorDefinitions="" /> + + + @@ -3706,6 +4210,15 @@ PreprocessorDefinitions="" /> + + + @@ -3733,6 +4246,15 @@ PreprocessorDefinitions="" /> + + + @@ -3980,6 +4502,15 @@ PreprocessorDefinitions="" /> + + + @@ -4007,6 +4538,15 @@ PreprocessorDefinitions="" /> + + + @@ -4034,6 +4574,15 @@ PreprocessorDefinitions="" /> + + + @@ -4062,7 +4611,34 @@ /> + + + + + + + + + + + + @@ -4393,6 +4978,15 @@ PreprocessorDefinitions="" /> + + + @@ -4420,6 +5014,15 @@ PreprocessorDefinitions="" /> + + + @@ -4447,6 +5050,15 @@ PreprocessorDefinitions="" /> + + + @@ -4474,6 +5086,15 @@ PreprocessorDefinitions="" /> + + + @@ -4501,6 +5122,15 @@ PreprocessorDefinitions="" /> + + + @@ -4751,6 +5381,16 @@ PreprocessorDefinitions="" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -5963,6 +6770,15 @@ PreprocessorDefinitions="" /> + + + @@ -5990,6 +6806,15 @@ PreprocessorDefinitions="" /> + + + @@ -6017,6 +6842,15 @@ PreprocessorDefinitions="" /> + + + @@ -6044,6 +6878,15 @@ PreprocessorDefinitions="" /> + + + @@ -6071,6 +6914,15 @@ PreprocessorDefinitions="" /> + + + diff --git a/pjmedia/build/pjmedia_codec.vcproj b/pjmedia/build/pjmedia_codec.vcproj index eddbc8c5..84898947 100644 --- a/pjmedia/build/pjmedia_codec.vcproj +++ b/pjmedia/build/pjmedia_codec.vcproj @@ -16,6 +16,9 @@ + @@ -222,6 +225,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + + @@ -2809,6 +3178,15 @@ PreprocessorDefinitions="" /> + + + @@ -2818,6 +3196,15 @@ PreprocessorDefinitions="" /> + + + @@ -2827,6 +3214,15 @@ PreprocessorDefinitions="" /> + + + @@ -2836,6 +3232,15 @@ PreprocessorDefinitions="" /> + + + @@ -2845,6 +3250,15 @@ PreprocessorDefinitions="" /> + + + + + + @@ -2875,6 +3298,15 @@ PreprocessorDefinitions="" /> + + + @@ -2884,6 +3316,15 @@ PreprocessorDefinitions="" /> + + + @@ -2893,6 +3334,15 @@ PreprocessorDefinitions="" /> + + + @@ -2902,6 +3352,15 @@ PreprocessorDefinitions="" /> + + + @@ -2911,6 +3370,15 @@ PreprocessorDefinitions="" /> + + + + + + @@ -2937,6 +3414,15 @@ PreprocessorDefinitions="" /> + + + @@ -2946,6 +3432,15 @@ PreprocessorDefinitions="" /> + + + @@ -2955,6 +3450,15 @@ PreprocessorDefinitions="" /> + + + @@ -2964,6 +3468,15 @@ PreprocessorDefinitions="" /> + + + @@ -2973,6 +3486,15 @@ PreprocessorDefinitions="" /> + + + + + + @@ -3007,6 +3538,15 @@ PreprocessorDefinitions="" /> + + + @@ -3016,6 +3556,15 @@ PreprocessorDefinitions="" /> + + + @@ -3025,6 +3574,15 @@ PreprocessorDefinitions="" /> + + + @@ -3034,6 +3592,15 @@ PreprocessorDefinitions="" /> + + + @@ -3043,6 +3610,15 @@ PreprocessorDefinitions="" /> + + + + @@ -234,9 +237,9 @@ /> + @@ -354,22 +365,20 @@ Name="VCBscMakeTool" /> - - - @@ -491,24 +495,27 @@ Name="VCBscMakeTool" /> - - + @@ -555,26 +568,25 @@ Name="VCBscMakeTool" /> - - + @@ -621,27 +637,24 @@ Name="VCBscMakeTool" /> - - - @@ -692,22 +701,24 @@ Name="VCBscMakeTool" /> - - @@ -744,7 +755,7 @@ + @@ -822,24 +841,22 @@ Name="VCBscMakeTool" /> - - @@ -972,9 +989,9 @@ /> @@ -1038,9 +1055,9 @@ /> + @@ -1158,24 +1182,22 @@ Name="VCBscMakeTool" /> - - @@ -1212,7 +1234,7 @@ @@ -1278,7 +1300,7 @@ + @@ -1356,26 +1386,25 @@ Name="VCBscMakeTool" /> - - + @@ -1422,24 +1455,22 @@ Name="VCBscMakeTool" /> - - @@ -1476,7 +1507,7 @@ @@ -1542,7 +1573,7 @@ + @@ -1620,24 +1658,22 @@ Name="VCBscMakeTool" /> - - @@ -1674,7 +1710,7 @@ @@ -1740,7 +1776,7 @@ @@ -1806,7 +1842,7 @@ @@ -1872,7 +1908,7 @@ @@ -1938,7 +1974,7 @@ @@ -2004,7 +2040,7 @@ @@ -2070,7 +2106,7 @@ @@ -2136,7 +2172,7 @@ @@ -2202,7 +2238,7 @@ @@ -2268,7 +2304,7 @@ @@ -2334,7 +2370,7 @@ @@ -2400,7 +2436,7 @@ @@ -2466,7 +2502,7 @@ @@ -2532,7 +2568,7 @@ @@ -2598,7 +2634,7 @@ @@ -2664,7 +2700,7 @@ @@ -2730,7 +2766,7 @@ @@ -2796,7 +2832,7 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2882,6 +3350,15 @@ PreprocessorDefinitions="" /> + + + @@ -2891,6 +3368,15 @@ PreprocessorDefinitions="" /> + + + + + + @@ -2945,6 +3440,15 @@ Name="VCCLCompilerTool" /> + + + @@ -2970,6 +3474,15 @@ Name="VCCLCompilerTool" /> + + + @@ -2995,6 +3508,15 @@ Name="VCCLCompilerTool" /> + + + @@ -3020,6 +3542,15 @@ Name="VCCLCompilerTool" /> + + + @@ -3045,6 +3576,15 @@ Name="VCCLCompilerTool" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -4137,6 +4968,15 @@ PreprocessorDefinitions="" /> + + + @@ -4146,6 +4986,15 @@ PreprocessorDefinitions="" /> + + + @@ -4155,6 +5004,15 @@ PreprocessorDefinitions="" /> + + + @@ -4164,6 +5022,15 @@ PreprocessorDefinitions="" /> + + + @@ -4173,6 +5040,15 @@ PreprocessorDefinitions="" /> + + + + + + + + + + + + + + + + + + + + + + @@ -224,6 +227,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + start; *reg1_len = circbuf->len; if (*reg1 + *reg1_len > circbuf->buf + circbuf->capacity) { - *reg1_len = circbuf->buf + circbuf->capacity - circbuf->start; + *reg1_len = (unsigned)(circbuf->buf + circbuf->capacity - + circbuf->start); *reg2 = circbuf->buf; *reg2_len = circbuf->len - *reg1_len; } else { @@ -252,9 +253,9 @@ PJ_INLINE(void) pjmedia_circ_buf_get_write_regions(pjmedia_circ_buf *circbuf, *reg1 -= circbuf->capacity; *reg1_len = circbuf->capacity - circbuf->len; if (*reg1 + *reg1_len > circbuf->buf + circbuf->capacity) { - *reg1_len = circbuf->buf + circbuf->capacity - *reg1; + *reg1_len = (unsigned)(circbuf->buf + circbuf->capacity - *reg1); *reg2 = circbuf->buf; - *reg2_len = circbuf->start - circbuf->buf; + *reg2_len = (unsigned)(circbuf->start - circbuf->buf); } else { *reg2 = NULL; *reg2_len = 0; diff --git a/pjmedia/include/pjmedia/frame.h b/pjmedia/include/pjmedia/frame.h index 0dda5e27..4c5ef672 100644 --- a/pjmedia/include/pjmedia/frame.h +++ b/pjmedia/include/pjmedia/frame.h @@ -231,7 +231,7 @@ pjmedia_frame_ext_pop_subframes(pjmedia_frame_ext *frm, unsigned n) { pjmedia_frame_ext_subframe *sf; pj_uint8_t *move_src; - unsigned move_len; + pj_size_t move_len; if (frm->subframe_cnt <= n) { frm->subframe_cnt = 0; @@ -241,8 +241,8 @@ pjmedia_frame_ext_pop_subframes(pjmedia_frame_ext *frm, unsigned n) move_src = (pj_uint8_t*)pjmedia_frame_ext_get_subframe(frm, n); sf = pjmedia_frame_ext_get_subframe(frm, frm->subframe_cnt-1); - move_len = (pj_uint8_t*)sf - move_src + sizeof(sf->bitlen) + - ((sf->bitlen+7) >> 3); + move_len = ((pj_uint8_t*)sf - move_src + sizeof(sf->bitlen) + + ((sf->bitlen+7) >> 3)); pj_memmove((pj_uint8_t*)frm+sizeof(pjmedia_frame_ext), move_src, move_len); diff --git a/pjmedia/src/pjmedia-audiodev/errno.c b/pjmedia/src/pjmedia-audiodev/errno.c index 498e43d9..a928485a 100644 --- a/pjmedia/src/pjmedia-audiodev/errno.c +++ b/pjmedia/src/pjmedia-audiodev/errno.c @@ -139,7 +139,7 @@ PJ_DEF(pj_str_t) pjmedia_audiodev_strerror(pj_status_t statcode, pj_unicode_to_ansi(wbuf, len, buf, bufsize); } #else - mr = (*waveGetErrText)(native_err, buf, bufsize); + mr = (*waveGetErrText)(native_err, buf, (UINT)bufsize); #endif if (mr==MMSYSERR_NOERROR) { diff --git a/pjmedia/src/pjmedia-audiodev/wmme_dev.c b/pjmedia/src/pjmedia-audiodev/wmme_dev.c index 3a010226..a73f2474 100644 --- a/pjmedia/src/pjmedia-audiodev/wmme_dev.c +++ b/pjmedia/src/pjmedia-audiodev/wmme_dev.c @@ -742,7 +742,7 @@ static pj_status_t init_player_stream( struct wmme_factory *wf, */ mr = waveOutOpen(&wmme_strm->hWave.Out, wf->dev_info[prm->play_id].deviceId, - &wfx, (DWORD)wmme_strm->hEvent, 0, flag); + &wfx, (DWORD)(pj_ssize_t)wmme_strm->hEvent, 0, flag); if (mr != MMSYSERR_NOERROR) { return PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_OUT(mr); } @@ -833,7 +833,7 @@ static pj_status_t init_capture_stream( struct wmme_factory *wf, */ mr = waveInOpen(&wmme_strm->hWave.In, wf->dev_info[prm->rec_id].deviceId, - &wfx, (DWORD)wmme_strm->hEvent, 0, flag); + &wfx, (DWORD)(pj_ssize_t)wmme_strm->hEvent, 0, flag); if (mr != MMSYSERR_NOERROR) { return PJMEDIA_AUDIODEV_ERRNO_FROM_WMME_IN(mr); } diff --git a/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c b/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c index ee5abad9..e4c3aea8 100644 --- a/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c +++ b/pjmedia/src/pjmedia-codec/ffmpeg_vid_codecs.c @@ -454,7 +454,7 @@ static pj_status_t h264_preopen(ffmpeg_private *ff) * extradata of ffmpeg codec context. */ if (data->fmtp.sprop_param_sets_len) { - ctx->extradata_size = data->fmtp.sprop_param_sets_len; + ctx->extradata_size = (int)data->fmtp.sprop_param_sets_len; ctx->extradata = data->fmtp.sprop_param_sets; } } @@ -1288,10 +1288,10 @@ static pj_status_t ffmpeg_codec_open( pjmedia_vid_codec *codec, /* Alloc buffers if needed */ ff->whole = (ff->param.packing == PJMEDIA_VID_PACKING_WHOLE); if (!ff->whole) { - ff->enc_buf_size = ff->enc_vafp.framebytes; + ff->enc_buf_size = (unsigned)ff->enc_vafp.framebytes; ff->enc_buf = pj_pool_alloc(ff->pool, ff->enc_buf_size); - ff->dec_buf_size = ff->dec_vafp.framebytes; + ff->dec_buf_size = (unsigned)ff->dec_vafp.framebytes; ff->dec_buf = pj_pool_alloc(ff->pool, ff->dec_buf_size); } @@ -1420,7 +1420,7 @@ static pj_status_t ffmpeg_codec_encode_whole(pjmedia_vid_codec *codec, */ PJ_ALIGN_DATA(pj_uint32_t i[4], 16); - if ((long)i & 0xF) { + if ((long)(pj_ssize_t)i & 0xF) { PJ_LOG(2,(THIS_FILE, "Stack alignment fails")); } @@ -1502,7 +1502,8 @@ static pj_status_t ffmpeg_codec_encode_begin(pjmedia_vid_codec *codec, whole_frm.buf = ff->enc_buf; whole_frm.size = ff->enc_buf_size; status = ffmpeg_codec_encode_whole(codec, opt, input, - whole_frm.size, &whole_frm); + (unsigned)whole_frm.size, + &whole_frm); if (status != PJ_SUCCESS) return status; @@ -1618,7 +1619,7 @@ static pj_status_t check_decode_result(pjmedia_vid_codec *codec, PJ_LOG(5,(THIS_FILE, "Reallocating decoding buffer %u --> %u", (unsigned)ff->dec_buf_size, (unsigned)ff->dec_vafp.framebytes)); - ff->dec_buf_size = ff->dec_vafp.framebytes; + ff->dec_buf_size = (unsigned)ff->dec_vafp.framebytes; ff->dec_buf = pj_pool_alloc(ff->pool, ff->dec_buf_size); } @@ -1681,7 +1682,7 @@ static pj_status_t ffmpeg_codec_decode_whole(pjmedia_vid_codec *codec, /* Init packet, the container of the encoded data */ av_init_packet(&avpacket); avpacket.data = (pj_uint8_t*)input->buf; - avpacket.size = input->size; + avpacket.size = (int)input->size; /* ffmpeg warns: * - input buffer padding, at least FF_INPUT_BUFFER_PADDING_SIZE diff --git a/pjmedia/src/pjmedia-codec/gsm.c b/pjmedia/src/pjmedia-codec/gsm.c index 43149b78..86c3d57c 100644 --- a/pjmedia/src/pjmedia-codec/gsm.c +++ b/pjmedia/src/pjmedia-codec/gsm.c @@ -530,7 +530,7 @@ static pj_status_t gsm_codec_encode( pjmedia_codec *codec, { struct gsm_data *gsm_data = (struct gsm_data*) codec->codec_data; pj_int16_t *pcm_in; - unsigned in_size; + pj_size_t in_size; pj_assert(gsm_data && input && output); diff --git a/pjmedia/src/pjmedia-codec/h263_packetizer.c b/pjmedia/src/pjmedia-codec/h263_packetizer.c index df812c40..3bfafe18 100644 --- a/pjmedia/src/pjmedia-codec/h263_packetizer.c +++ b/pjmedia/src/pjmedia-codec/h263_packetizer.c @@ -155,7 +155,7 @@ PJ_DEF(pj_status_t) pjmedia_h263_packetize(pjmedia_h263_packetizer *pktz, *payload = p; *payload_len = end-p; - *pos = end - bits; + *pos = (unsigned)(end - bits); return PJ_SUCCESS; } @@ -273,7 +273,7 @@ PJ_DEF(pj_status_t) pjmedia_h263_unpacketize (pjmedia_h263_packetizer *pktz, /* Write two zero octets when payload flagged with sync point */ if (P) { - pktz->unpack_last_sync_pos = q - bits; + pktz->unpack_last_sync_pos = (unsigned)(q - bits); *q++ = 0; *q++ = 0; } @@ -283,7 +283,7 @@ PJ_DEF(pj_status_t) pjmedia_h263_unpacketize (pjmedia_h263_packetizer *pktz, q += payload_len; /* Update the bitstream writing offset */ - *pos = q - bits; + *pos = (unsigned)(q - bits); pktz->unpack_prev_lost = PJ_FALSE; diff --git a/pjmedia/src/pjmedia-codec/h264_packetizer.c b/pjmedia/src/pjmedia-codec/h264_packetizer.c index c928dc20..0e71604b 100644 --- a/pjmedia/src/pjmedia-codec/h264_packetizer.c +++ b/pjmedia/src/pjmedia-codec/h264_packetizer.c @@ -214,7 +214,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz, *payload_len = pktz->cfg.mtu; else *payload_len = nal_end - nal_start + HEADER_SIZE_FU_A; - *pos = *payload + *payload_len - buf; + *pos = (unsigned)(*payload + *payload_len - buf); #if DBG_PACKETIZE PJ_LOG(3, ("h264pack", "Packetized fragmented H264 NAL unit " @@ -242,7 +242,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz, /* Init the first NAL unit in the packet */ nal[0] = nal_start; nal_size[0] = nal_end - nal_start; - total_size = nal_size[0] + HEADER_SIZE_STAP_A; + total_size = (int)nal_size[0] + HEADER_SIZE_STAP_A; NRI = (*nal_octet & 0x60) >> 5; /* Populate next NAL units */ @@ -266,7 +266,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz, } /* Update total payload size (2 octet NAL size + NAL) */ - total_size += (2 + nal_size[nal_cnt]); + total_size += (2 + (int)nal_size[nal_cnt]); if (total_size <= pktz->cfg.mtu) { pj_uint8_t tmp_nri; @@ -306,7 +306,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz, *payload = nal[0] - HEADER_SIZE_STAP_A; pj_assert(*payload >= buf+*pos); *payload_len = p - *payload; - *pos = nal[nal_cnt-1] + nal_size[nal_cnt-1] - buf; + *pos = (unsigned)(nal[nal_cnt-1] + nal_size[nal_cnt-1] - buf); #if DBG_PACKETIZE PJ_LOG(3, ("h264pack", "Packetized aggregation of " @@ -321,7 +321,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_packetize(pjmedia_h264_packetizer *pktz, /* Single NAL unit packet */ *payload = nal_start; *payload_len = nal_end - nal_start; - *pos = nal_end - buf; + *pos = (unsigned)(nal_end - buf); #if DBG_PACKETIZE PJ_LOG(3, ("h264pack", "Packetized single H264 NAL unit " @@ -399,7 +399,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_unpacketize(pjmedia_h264_packetizer *pktz, p += payload_len; /* Update the bitstream writing offset */ - *bits_pos = p - bits; + *bits_pos = (unsigned)(p - bits); pktz->unpack_last_sync_pos = *bits_pos; #if DBG_UNPACKETIZE @@ -450,7 +450,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_unpacketize(pjmedia_h264_packetizer *pktz, ++cnt; /* Update the bitstream writing offset */ - *bits_pos = p - bits; + *bits_pos = (unsigned)(p - bits); pktz->unpack_last_sync_pos = *bits_pos; } @@ -509,7 +509,7 @@ PJ_DEF(pj_status_t) pjmedia_h264_unpacketize(pjmedia_h264_packetizer *pktz, p += (payload_len - 2); /* Update the bitstream writing offset */ - *bits_pos = p - bits; + *bits_pos = (unsigned)(p - bits); if (E) { /* Update the sync pos only if the end bit flag is set */ pktz->unpack_last_sync_pos = *bits_pos; diff --git a/pjmedia/src/pjmedia-codec/ilbc.c b/pjmedia/src/pjmedia-codec/ilbc.c index c595477f..3a79ae33 100644 --- a/pjmedia/src/pjmedia-codec/ilbc.c +++ b/pjmedia/src/pjmedia-codec/ilbc.c @@ -668,7 +668,7 @@ static pj_status_t ilbc_codec_encode(pjmedia_codec *codec, { struct ilbc_codec *ilbc_codec = (struct ilbc_codec*)codec; pj_int16_t *pcm_in; - unsigned nsamples; + pj_size_t nsamples; #if defined(PJMEDIA_ILBC_CODEC_USE_COREAUDIO)&& PJMEDIA_ILBC_CODEC_USE_COREAUDIO UInt32 npackets; OSStatus err; diff --git a/pjmedia/src/pjmedia-codec/speex_codec.c b/pjmedia/src/pjmedia-codec/speex_codec.c index d5cc0a57..ab9b509a 100644 --- a/pjmedia/src/pjmedia-codec/speex_codec.c +++ b/pjmedia/src/pjmedia-codec/speex_codec.c @@ -840,7 +840,7 @@ static pj_status_t spx_codec_parse( pjmedia_codec *codec, samples_per_frame=spx_factory.speex_param[spx->param_id].samples_per_frame; /* Copy the data into the speex bit-stream */ - speex_bits_read_from(&spx->dec_bits, (char*)pkt, pkt_size); + speex_bits_read_from(&spx->dec_bits, (char*)pkt, (int)pkt_size); while (speex_get_next_frame(&spx->dec_bits) == 0 && spx->dec_bits.charPtr != char_ptr) @@ -877,7 +877,7 @@ static pj_status_t spx_codec_encode( pjmedia_codec *codec, unsigned samples_per_frame; int tx = 0; spx_int16_t *pcm_in = (spx_int16_t*)input->buf; - unsigned nsamples; + pj_size_t nsamples; spx = (struct spx_private*) codec->codec_data; @@ -952,7 +952,7 @@ static pj_status_t spx_codec_decode( pjmedia_codec *codec, } /* Copy the data into the bit-stream struct */ - speex_bits_read_from(&spx->dec_bits, (char*)input->buf, input->size); + speex_bits_read_from(&spx->dec_bits, (char*)input->buf, (int)input->size); /* Set Speex dec_bits pointer to the start bit of the frame */ speex_bits_advance(&spx->dec_bits, input->bit_info); diff --git a/pjmedia/src/pjmedia-videodev/avi_dev.c b/pjmedia/src/pjmedia-videodev/avi_dev.c index 6f6c4813..a398b8cc 100644 --- a/pjmedia/src/pjmedia-videodev/avi_dev.c +++ b/pjmedia/src/pjmedia-videodev/avi_dev.c @@ -628,7 +628,7 @@ static pj_status_t avi_dev_strm_get_frame(pjmedia_vid_dev_stream *strm, return status; return pjmedia_vid_codec_decode(stream->adi->codec, 1, &enc_frame, - frame->size, frame); + (unsigned)frame->size, frame); } else { return pjmedia_port_get_frame(stream->adi->vid, frame); } diff --git a/pjmedia/src/pjmedia-videodev/dshow_dev.c b/pjmedia/src/pjmedia-videodev/dshow_dev.c index 08f82ef9..e1d4ca97 100644 --- a/pjmedia/src/pjmedia-videodev/dshow_dev.c +++ b/pjmedia/src/pjmedia-videodev/dshow_dev.c @@ -633,7 +633,7 @@ static pj_status_t dshow_stream_put_frame(pjmedia_vid_dev_stream *strm, } hr = SourceFilter_Deliver(stream->dgraph.csource_filter, - frame->buf, frame->size); + frame->buf, (long)frame->size); if (FAILED(hr)) return hr; diff --git a/pjmedia/src/pjmedia-videodev/ffmpeg_dev.c b/pjmedia/src/pjmedia-videodev/ffmpeg_dev.c index 1bfc0c27..b70396ec 100644 --- a/pjmedia/src/pjmedia-videodev/ffmpeg_dev.c +++ b/pjmedia/src/pjmedia-videodev/ffmpeg_dev.c @@ -278,7 +278,8 @@ static pj_status_t ffmpeg_factory_refresh(pjmedia_vid_dev_factory *f) info->host_api = p; -#if defined(PJ_WIN32) && PJ_WIN32!=0 +#if (defined(PJ_WIN32) && PJ_WIN32!=0) || \ + (defined(PJ_WIN64) && PJ_WIN64!=0) info->def_devname = "0"; #elif defined(PJ_LINUX) && PJ_LINUX!=0 info->def_devname = "/dev/video0"; diff --git a/pjmedia/src/pjmedia/avi_player.c b/pjmedia/src/pjmedia/avi_player.c index 306871d8..3f096e33 100644 --- a/pjmedia/src/pjmedia/avi_player.c +++ b/pjmedia/src/pjmedia/avi_player.c @@ -158,7 +158,7 @@ static struct avi_reader_port *create_avi_port(pj_pool_t *pool) pjmedia_port_info_init(&port->base.info, &name, SIGNATURE, 8000, 1, 16, 80); - port->fd = (pj_oshandle_t)-1; + port->fd = (pj_oshandle_t)(pj_ssize_t)-1; port->base.get_frame = &avi_get_frame; port->base.on_destroy = &avi_on_destroy; @@ -785,7 +785,7 @@ static pj_status_t avi_on_destroy(pjmedia_port *this_port) pj_assert(this_port->info.signature == SIGNATURE); - if (fport->fd != (pj_oshandle_t) -1) + if (fport->fd != (pj_oshandle_t) (pj_ssize_t)-1) pj_file_close(fport->fd); return PJ_SUCCESS; } diff --git a/pjmedia/src/pjmedia/conference.c b/pjmedia/src/pjmedia/conference.c index dbf7868a..2ef65380 100644 --- a/pjmedia/src/pjmedia/conference.c +++ b/pjmedia/src/pjmedia/conference.c @@ -709,7 +709,7 @@ PJ_DEF(pjmedia_port*) pjmedia_conf_get_master_port(pjmedia_conf *conf) PJ_DEF(pj_status_t) pjmedia_conf_set_port0_name(pjmedia_conf *conf, const pj_str_t *name) { - unsigned len; + pj_size_t len; /* Sanity check. */ PJ_ASSERT_RETURN(conf != NULL && name != NULL, PJ_EINVAL); @@ -1524,8 +1524,8 @@ static pj_status_t read_port( pjmedia_conf *conf, } else { - pjmedia_copy_samples(frame, cport->rx_buf, count); - cport->rx_buf_count -= count; + pjmedia_copy_samples(frame, cport->rx_buf, (unsigned)count); + cport->rx_buf_count -= (unsigned)count; if (cport->rx_buf_count) { pjmedia_move_samples(cport->rx_buf, cport->rx_buf+count, cport->rx_buf_count); diff --git a/pjmedia/src/pjmedia/endpoint.c b/pjmedia/src/pjmedia/endpoint.c index 10f1b534..1a9d2eb6 100644 --- a/pjmedia/src/pjmedia/endpoint.c +++ b/pjmedia/src/pjmedia/endpoint.c @@ -496,7 +496,7 @@ PJ_DEF(pj_status_t) pjmedia_endpt_create_audio_sdp(pjmedia_endpt *endpt, codec_info->pt); for (i = 0; i < dec_fmtp->cnt; ++i) { - unsigned test_len = 2; + pj_size_t test_len = 2; /* Check if buf still available */ test_len = dec_fmtp->param[i].val.slen + @@ -682,7 +682,7 @@ PJ_DEF(pj_status_t) pjmedia_endpt_create_video_sdp(pjmedia_endpt *endpt, codec_info[i].pt); for (j = 0; j < dec_fmtp->cnt; ++j) { - unsigned test_len = 2; + pj_size_t test_len = 2; /* Check if buf still available */ test_len = dec_fmtp->param[j].val.slen + diff --git a/pjmedia/src/pjmedia/ffmpeg_util.c b/pjmedia/src/pjmedia/ffmpeg_util.c index fa65b7b4..4698191f 100644 --- a/pjmedia/src/pjmedia/ffmpeg_util.c +++ b/pjmedia/src/pjmedia/ffmpeg_util.c @@ -103,7 +103,7 @@ static void ffmpeg_log_cb(void* ptr, int level, const char* fmt, va_list vl) const char *LOG_SENDER = "ffmpeg"; enum { LOG_LEVEL = 5 }; char buf[100]; - int bufsize = sizeof(buf), len; + pj_size_t bufsize = sizeof(buf), len; pj_str_t fmt_st; /* Custom callback needs to filter log level by itself */ diff --git a/pjmedia/src/pjmedia/format.c b/pjmedia/src/pjmedia/format.c index 7c2bb310..c9cfb368 100644 --- a/pjmedia/src/pjmedia/format.c +++ b/pjmedia/src/pjmedia/format.c @@ -140,7 +140,7 @@ PJ_DEF(void) pjmedia_format_init_video( pjmedia_format *fmt, vafp.size = fmt->det.vid.size; vfi->apply_fmt(vfi, &vafp); - bps = vafp.framebytes * fps_num * (pj_size_t)8 / fps_denum; + bps = (pj_uint32_t)vafp.framebytes * fps_num * (pj_size_t)8 / fps_denum; fmt->det.vid.avg_bps = fmt->det.vid.max_bps = bps; } } @@ -172,7 +172,7 @@ static pj_status_t apply_packed_fmt(const pjmedia_video_format_info *fi, /* Packed formats only use 1 plane */ aparam->planes[0] = aparam->buffer; - aparam->strides[0] = stride; + aparam->strides[0] = (int)stride; aparam->plane_bytes[0] = aparam->framebytes; /* Zero unused planes */ diff --git a/pjmedia/src/pjmedia/g711.c b/pjmedia/src/pjmedia/g711.c index e9732056..98d036dc 100644 --- a/pjmedia/src/pjmedia/g711.c +++ b/pjmedia/src/pjmedia/g711.c @@ -523,7 +523,7 @@ static pj_status_t g711_encode(pjmedia_codec *codec, unsigned i, n; pj_uint8_t *dst = (pj_uint8_t*) output->buf; - n = (input->size >> 1); + n = ((unsigned)input->size >> 1); for (i=0; i!=n; ++i, ++dst) { *dst = pjmedia_linear2alaw(samples[i]); } @@ -531,7 +531,7 @@ static pj_status_t g711_encode(pjmedia_codec *codec, unsigned i, n; pj_uint8_t *dst = (pj_uint8_t*) output->buf; - n = (input->size >> 1); + n = ((unsigned)input->size >> 1); for (i=0; i!=n; ++i, ++dst) { *dst = pjmedia_linear2ulaw(samples[i]); } diff --git a/pjmedia/src/pjmedia/jbuf.c b/pjmedia/src/pjmedia/jbuf.c index bd87523a..e7fdfe42 100644 --- a/pjmedia/src/pjmedia/jbuf.c +++ b/pjmedia/src/pjmedia/jbuf.c @@ -975,7 +975,7 @@ PJ_DEF(void) pjmedia_jbuf_put_frame3(pjmedia_jbuf *jb, /* Attempt to store the frame */ min_frame_size = PJ_MIN(frame_size, jb->jb_frame_size); status = jb_framelist_put_at(&jb->jb_framelist, frame_seq, frame, - min_frame_size, bit_info, ts, + (unsigned)min_frame_size, bit_info, ts, PJMEDIA_JB_NORMAL_FRAME); /* Jitter buffer is full, remove some older frames */ @@ -989,12 +989,12 @@ PJ_DEF(void) pjmedia_jbuf_put_frame3(pjmedia_jbuf *jb, * So we're confident about 'distance' value here. */ distance = (frame_seq - jb_framelist_origin(&jb->jb_framelist)) - - jb->jb_max_count + 1; + (int)jb->jb_max_count + 1; pj_assert(distance > 0); removed = jb_framelist_remove_head(&jb->jb_framelist, distance); status = jb_framelist_put_at(&jb->jb_framelist, frame_seq, frame, - min_frame_size, bit_info, ts, + (unsigned)min_frame_size, bit_info, ts, PJMEDIA_JB_NORMAL_FRAME); jb->jb_discard += removed; @@ -1125,7 +1125,7 @@ PJ_DEF(pj_status_t) pjmedia_jbuf_get_state( const pjmedia_jbuf *jb, { PJ_ASSERT_RETURN(jb && state, PJ_EINVAL); - state->frame_size = jb->jb_frame_size; + state->frame_size = (unsigned)jb->jb_frame_size; state->min_prefetch = jb->jb_min_prefetch; state->max_prefetch = jb->jb_max_prefetch; diff --git a/pjmedia/src/pjmedia/resample_port.c b/pjmedia/src/pjmedia/resample_port.c index 5991877e..82211758 100644 --- a/pjmedia/src/pjmedia/resample_port.c +++ b/pjmedia/src/pjmedia/resample_port.c @@ -192,7 +192,7 @@ static pj_status_t resample_get_frame(pjmedia_port *this_port, if (tmp_frame.size) { pjmedia_copy_samples((pj_int16_t*)frame->buf, (const pj_int16_t*)tmp_frame.buf, - frame->size >> 1); + (unsigned)frame->size >> 1); } return PJ_SUCCESS; } diff --git a/pjmedia/src/pjmedia/rtcp.c b/pjmedia/src/pjmedia/rtcp.c index f45b8a60..ddd70781 100644 --- a/pjmedia/src/pjmedia/rtcp.c +++ b/pjmedia/src/pjmedia/rtcp.c @@ -84,6 +84,7 @@ PJ_DEF(pj_status_t) pjmedia_rtcp_get_ntp_time(const pjmedia_rtcp_session *sess, #if (defined(PJ_WIN32) && PJ_WIN32!=0) || \ + (defined(PJ_WIN64) && PJ_WIN64!=0) || \ (defined(PJ_WIN32_WINCE) && PJ_WIN32_WINCE!=0) /* On Win32, since we use QueryPerformanceCounter() as the backend @@ -963,7 +964,7 @@ PJ_DEF(pj_status_t) pjmedia_rtcp_build_rtcp_sdes( { pjmedia_rtcp_common *hdr; pj_uint8_t *p; - unsigned len; + pj_size_t len; PJ_ASSERT_RETURN(session && buf && length && sdes, PJ_EINVAL); @@ -1036,7 +1037,7 @@ PJ_DEF(pj_status_t) pjmedia_rtcp_build_rtcp_bye(pjmedia_rtcp_session *session, { pjmedia_rtcp_common *hdr; pj_uint8_t *p; - unsigned len; + pj_size_t len; PJ_ASSERT_RETURN(session && buf && length, PJ_EINVAL); diff --git a/pjmedia/src/pjmedia/sdp.c b/pjmedia/src/pjmedia/sdp.c index 0d6b4f3c..4155f6a4 100644 --- a/pjmedia/src/pjmedia/sdp.c +++ b/pjmedia/src/pjmedia/sdp.c @@ -640,7 +640,7 @@ static int print_media_desc( pjmedia_sdp_media *m, char *buf, int len) /* print connection info, if present. */ if (m->conn) { - printed = print_connection_info(m->conn, p, end-p); + printed = print_connection_info(m->conn, p, (int)(end-p)); if (printed < 0) { return -1; } @@ -649,7 +649,7 @@ static int print_media_desc( pjmedia_sdp_media *m, char *buf, int len) /* print optional bandwidth info. */ for (i=0; ibandw_count; ++i) { - printed = print_bandw(m->bandw[i], p, end-p); + printed = (int)print_bandw(m->bandw[i], p, end-p); if (printed < 0) { return -1; } @@ -658,14 +658,14 @@ static int print_media_desc( pjmedia_sdp_media *m, char *buf, int len) /* print attributes. */ for (i=0; iattr_count; ++i) { - printed = print_attr(m->attr[i], p, end-p); + printed = (int)print_attr(m->attr[i], p, end-p); if (printed < 0) { return -1; } p += printed; } - return p-buf; + return (int)(p-buf); } PJ_DEF(pjmedia_sdp_media*) pjmedia_sdp_media_clone( @@ -805,7 +805,7 @@ static int print_session(const pjmedia_sdp_session *ses, /* Connection line (c=) if exist. */ if (ses->conn) { - printed = print_connection_info(ses->conn, p, end-p); + printed = print_connection_info(ses->conn, p, (int)(end-p)); if (printed < 1) { return -1; } @@ -814,7 +814,7 @@ static int print_session(const pjmedia_sdp_session *ses, /* print optional bandwidth info. */ for (i=0; ibandw_count; ++i) { - printed = print_bandw(ses->bandw[i], p, end-p); + printed = (int)print_bandw(ses->bandw[i], p, end-p); if (printed < 1) { return -1; } @@ -837,7 +837,7 @@ static int print_session(const pjmedia_sdp_session *ses, /* Print all attribute (a=) lines. */ for (i=0; iattr_count; ++i) { - printed = print_attr(ses->attr[i], p, end-p); + printed = (int)print_attr(ses->attr[i], p, end-p); if (printed < 0) { return -1; } @@ -846,14 +846,14 @@ static int print_session(const pjmedia_sdp_session *ses, /* Print media (m=) lines. */ for (i=0; imedia_count; ++i) { - printed = print_media_desc(ses->media[i], p, end-p); + printed = print_media_desc(ses->media[i], p, (int)(end-p)); if (printed < 0) { return -1; } p += printed; } - return p-buf; + return (int)(p-buf); } /****************************************************************************** diff --git a/pjmedia/src/pjmedia/sdp_neg.c b/pjmedia/src/pjmedia/sdp_neg.c index 8162fef5..a23b6ef0 100644 --- a/pjmedia/src/pjmedia/sdp_neg.c +++ b/pjmedia/src/pjmedia/sdp_neg.c @@ -910,7 +910,7 @@ static pj_status_t process_answer(pj_pool_t *pool, PJ_INLINE(void) rewrite_pt(pj_pool_t *pool, pj_str_t *attr_val, const pj_str_t *old_pt, const pj_str_t *new_pt) { - int len_diff = new_pt->slen - old_pt->slen; + int len_diff = (int)(new_pt->slen - old_pt->slen); /* Note that attribute value should be null-terminated. */ if (len_diff > 0) { diff --git a/pjmedia/src/pjmedia/sound_legacy.c b/pjmedia/src/pjmedia/sound_legacy.c index 7e2e2ec3..57bda409 100644 --- a/pjmedia/src/pjmedia/sound_legacy.c +++ b/pjmedia/src/pjmedia/sound_legacy.c @@ -94,7 +94,7 @@ static pj_status_t snd_play_cb(void *user_data, return strm->user_play_cb(strm->user_user_data, frame->timestamp.u32.lo, frame->buf, - frame->size); + (unsigned)frame->size); } static pj_status_t snd_rec_cb(void *user_data, @@ -104,7 +104,7 @@ static pj_status_t snd_rec_cb(void *user_data, return strm->user_rec_cb(strm->user_user_data, frame->timestamp.u32.lo, frame->buf, - frame->size); + (unsigned)frame->size); } static pj_status_t open_stream( pjmedia_dir dir, diff --git a/pjmedia/src/pjmedia/sound_port.c b/pjmedia/src/pjmedia/sound_port.c index 3bf8316b..73305d83 100644 --- a/pjmedia/src/pjmedia/sound_port.c +++ b/pjmedia/src/pjmedia/sound_port.c @@ -71,7 +71,7 @@ static pj_status_t play_cb(void *user_data, pjmedia_frame *frame) { pjmedia_snd_port *snd_port = (pjmedia_snd_port*) user_data; pjmedia_port *port; - const unsigned required_size = frame->size; + const unsigned required_size = (unsigned)frame->size; pj_status_t status; pjmedia_clock_src_update(&snd_port->play_clocksrc, &frame->timestamp); diff --git a/pjmedia/src/pjmedia/splitcomb.c b/pjmedia/src/pjmedia/splitcomb.c index 2f4baf11..552a6fbe 100644 --- a/pjmedia/src/pjmedia/splitcomb.c +++ b/pjmedia/src/pjmedia/splitcomb.c @@ -565,7 +565,7 @@ static pj_status_t put_frame(pjmedia_port *this_port, /* Extract the mono frame to temporary buffer */ extract_mono_frame((const pj_int16_t*)frame->buf, sc->put_buf, ch, PJMEDIA_PIA_CCNT(&this_port->info), - frame->size * 8 / + (unsigned)frame->size * 8 / PJMEDIA_PIA_BITS(&this_port->info) / PJMEDIA_PIA_CCNT(&this_port->info)); diff --git a/pjmedia/src/pjmedia/stream.c b/pjmedia/src/pjmedia/stream.c index 76f53890..9a8bde3f 100644 --- a/pjmedia/src/pjmedia/stream.c +++ b/pjmedia/src/pjmedia/stream.c @@ -528,7 +528,7 @@ static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) frame_out.buf = p_out_samp + samples_count; frame_out.size = frame->size - samples_count*2; status = pjmedia_codec_recover(stream->codec, - frame_out.size, + (unsigned)frame_out.size, &frame_out); ++stream->plc_cnt; @@ -577,7 +577,7 @@ static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) frame_out.buf = p_out_samp + samples_count; frame_out.size = frame->size - samples_count*2; status = pjmedia_codec_recover(stream->codec, - frame_out.size, + (unsigned)frame_out.size, &frame_out); if (status != PJ_SUCCESS) break; @@ -632,7 +632,7 @@ static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) frame_out.buf = p_out_samp + samples_count; frame_out.size = frame->size - samples_count*2; status = pjmedia_codec_recover(stream->codec, - frame_out.size, + (unsigned)frame_out.size, &frame_out); if (status != PJ_SUCCESS) break; @@ -683,7 +683,8 @@ static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) frame_out.buf = p_out_samp + samples_count; frame_out.size = frame->size - samples_count*BYTES_PER_SAMPLE; status = pjmedia_codec_decode( stream->codec, &frame_in, - frame_out.size, &frame_out); + (unsigned)frame_out.size, + &frame_out); if (status != 0) { LOGERR_((port->info.name.ptr, "codec decode() error", status)); @@ -1125,7 +1126,7 @@ static void rebuffer(pjmedia_stream *stream, } else { pj_bzero(stream->enc_buf + stream->enc_buf_count, frame->size); } - stream->enc_buf_count += (frame->size >> 1); + stream->enc_buf_count += ((unsigned)frame->size >> 1); } /* How many samples are needed */ @@ -1192,7 +1193,8 @@ static pj_status_t put_frame_imp( pjmedia_port *port, /* Number of samples in the frame */ if (frame->type == PJMEDIA_FRAME_TYPE_AUDIO) - ts_len = (frame->size >> 1) / stream->codec_param.info.channel_cnt; + ts_len = ((unsigned)frame->size >> 1) / + stream->codec_param.info.channel_cnt; else if (frame->type == PJMEDIA_FRAME_TYPE_EXTENDED) ts_len = PJMEDIA_PIA_SPF(&stream->port.info) / PJMEDIA_PIA_CCNT(&stream->port.info); @@ -1236,7 +1238,7 @@ static pj_status_t put_frame_imp( pjmedia_port *port, */ status = pjmedia_rtp_encode_rtp( &channel->rtp, stream->tx_event_pt, first, - frame_out.size, + (int)frame_out.size, (first ? rtp_ts_len : 0), (const void**)&rtphdr, &rtphdrlen); @@ -1295,7 +1297,7 @@ static pj_status_t put_frame_imp( pjmedia_port *port, /* Encapsulate. */ status = pjmedia_rtp_encode_rtp( &channel->rtp, channel->pt, 0, - frame_out.size, rtp_ts_len, + (int)frame_out.size, rtp_ts_len, (const void**)&rtphdr, &rtphdrlen); @@ -1319,7 +1321,7 @@ static pj_status_t put_frame_imp( pjmedia_port *port, /* Encapsulate. */ status = pjmedia_rtp_encode_rtp( &channel->rtp, channel->pt, 0, - frame_out.size, rtp_ts_len, + (int)frame_out.size, rtp_ts_len, (const void**)&rtphdr, &rtphdrlen); @@ -1391,7 +1393,7 @@ static pj_status_t put_frame_imp( pjmedia_port *port, } /* Update stat */ - pjmedia_rtcp_tx_rtp(&stream->rtcp, frame_out.size); + pjmedia_rtcp_tx_rtp(&stream->rtcp, (unsigned)frame_out.size); stream->rtcp.stat.rtp_tx_last_ts = pj_ntohl(stream->enc->rtp.out_hdr.ts); stream->rtcp.stat.rtp_tx_last_seq = pj_ntohs(stream->enc->rtp.out_hdr.seq); @@ -1629,7 +1631,8 @@ static void on_rx_rtp( void *data, /* Check for errors */ if (bytes_read < 0) { - LOGERR_((stream->port.info.name.ptr, "RTP recv() error", -bytes_read)); + LOGERR_((stream->port.info.name.ptr, "RTP recv() error", + (pj_status_t)-bytes_read)); return; } @@ -1638,7 +1641,7 @@ static void on_rx_rtp( void *data, return; /* Update RTP and RTCP session. */ - status = pjmedia_rtp_decode_rtp(&channel->rtp, pkt, bytes_read, + status = pjmedia_rtp_decode_rtp(&channel->rtp, pkt, (int)bytes_read, &hdr, &payload, &payloadlen); if (status != PJ_SUCCESS) { LOGERR_((stream->port.info.name.ptr, "RTP decode error", status)); @@ -1887,7 +1890,7 @@ static void on_rx_rtcp( void *data, /* Check for errors */ if (bytes_read < 0) { LOGERR_((stream->port.info.name.ptr, "RTCP recv() error", - -bytes_read)); + (pj_status_t)-bytes_read)); return; } @@ -2298,7 +2301,7 @@ PJ_DEF(pj_status_t) pjmedia_stream_create( pjmedia_endpt *endpt, */ stream->out_rtcp_pkt_size = sizeof(pjmedia_rtcp_sr_pkt) + sizeof(pjmedia_rtcp_common) + - (4 + stream->cname.slen) + + (4 + (unsigned)stream->cname.slen) + 32; #if defined(PJMEDIA_HAS_RTCP_XR) && (PJMEDIA_HAS_RTCP_XR != 0) if (info->rtcp_xr_enabled) { @@ -2464,7 +2467,7 @@ PJ_DEF(pj_status_t) pjmedia_stream_destroy( pjmedia_stream *stream ) */ status = pjmedia_rtp_encode_rtp( &channel->rtp, stream->tx_event_pt, first, - frame_out.size, 0, + (int)frame_out.size, 0, (const void**)&rtphdr, &rtphdrlen); if (status == PJ_SUCCESS) { @@ -2766,7 +2769,7 @@ PJ_DEF(pj_status_t) pjmedia_stream_dial_dtmf( pjmedia_stream *stream, goto on_return; /* Increment digit count only if all digits are valid. */ - stream->tx_dtmf_count += digit_char->slen; + stream->tx_dtmf_count += (int)digit_char->slen; } on_return: diff --git a/pjmedia/src/pjmedia/tonegen.c b/pjmedia/src/pjmedia/tonegen.c index 954494bf..ea7c7bf2 100644 --- a/pjmedia/src/pjmedia/tonegen.c +++ b/pjmedia/src/pjmedia/tonegen.c @@ -628,7 +628,7 @@ static pj_status_t tonegen_get_frame(pjmedia_port *port, pjmedia_tone_desc *dig = &tonegen->digits[tonegen->cur_digit]; unsigned required, cnt, on_samp, off_samp; - required = end - dst; + required = (unsigned)(end - dst); on_samp = dig->on_msec * clock_rate / 1000; off_samp = dig->off_msec * clock_rate / 1000; @@ -728,7 +728,7 @@ static pj_status_t tonegen_get_frame(pjmedia_port *port, } if (dst < end) - pjmedia_zero_samples(dst, end-dst); + pjmedia_zero_samples(dst, (unsigned)(end-dst)); frame->type = PJMEDIA_FRAME_TYPE_AUDIO; frame->size = PJMEDIA_PIA_AVG_FSZ(&port->info); diff --git a/pjmedia/src/pjmedia/transport_srtp.c b/pjmedia/src/pjmedia/transport_srtp.c index d02d5ef5..176b2d42 100644 --- a/pjmedia/src/pjmedia/transport_srtp.c +++ b/pjmedia/src/pjmedia/transport_srtp.c @@ -801,7 +801,7 @@ static pj_status_t transport_send_rtp( pjmedia_transport *tp, { pj_status_t status; transport_srtp *srtp = (transport_srtp*) tp; - int len = size; + int len = (int)size; err_status_t err; if (srtp->bypass_srtp) @@ -845,7 +845,7 @@ static pj_status_t transport_send_rtcp2(pjmedia_transport *tp, { pj_status_t status; transport_srtp *srtp = (transport_srtp*) tp; - int len = size; + int len = (int)size; err_status_t err; if (srtp->bypass_srtp) { @@ -932,7 +932,7 @@ static void srtp_rtp_cb( void *user_data, void *pkt, pj_ssize_t size) } /* Make sure buffer is 32bit aligned */ - PJ_ASSERT_ON_FAIL( (((long)pkt) & 0x03)==0, return ); + PJ_ASSERT_ON_FAIL( (((pj_ssize_t)pkt) & 0x03)==0, return ); if (srtp->probation_cnt > 0) --srtp->probation_cnt; @@ -1005,7 +1005,7 @@ static void srtp_rtcp_cb( void *user_data, void *pkt, pj_ssize_t size) } /* Make sure buffer is 32bit aligned */ - PJ_ASSERT_ON_FAIL( (((long)pkt) & 0x03)==0, return ); + PJ_ASSERT_ON_FAIL( (((pj_ssize_t)pkt) & 0x03)==0, return ); pj_lock_acquire(srtp->mutex); @@ -1117,7 +1117,7 @@ static pj_status_t parse_attr_crypto(pj_pool_t *pool, { pj_str_t input; char *token; - int token_len; + pj_size_t token_len; pj_str_t tmp; pj_status_t status; int itmp; @@ -1681,7 +1681,7 @@ PJ_DEF(pj_status_t) pjmedia_transport_srtp_decrypt_pkt(pjmedia_transport *tp, PJ_ASSERT_RETURN(srtp->session_inited, PJ_EINVALIDOP); /* Make sure buffer is 32bit aligned */ - PJ_ASSERT_ON_FAIL( (((long)pkt) & 0x03)==0, return PJ_EINVAL); + PJ_ASSERT_ON_FAIL( (((pj_ssize_t)pkt) & 0x03)==0, return PJ_EINVAL); pj_lock_acquire(srtp->mutex); diff --git a/pjmedia/src/pjmedia/vid_codec_util.c b/pjmedia/src/pjmedia/vid_codec_util.c index c24756d4..fe1e8d4f 100644 --- a/pjmedia/src/pjmedia/vid_codec_util.c +++ b/pjmedia/src/pjmedia/vid_codec_util.c @@ -446,7 +446,7 @@ PJ_DEF(pj_status_t) pjmedia_vid_codec_h264_parse_fmtp( nal = &h264_fmtp->sprop_param_sets[ h264_fmtp->sprop_param_sets_len]; tmp_len = PJ_ARRAY_SIZE(h264_fmtp->sprop_param_sets) - - h264_fmtp->sprop_param_sets_len - + (int)h264_fmtp->sprop_param_sets_len - PJ_ARRAY_SIZE(start_code); status = pj_base64_decode(&tmp_st, nal + PJ_ARRAY_SIZE(start_code), diff --git a/pjmedia/src/pjmedia/vid_stream.c b/pjmedia/src/pjmedia/vid_stream.c index 6962a7db..4b84b8bc 100644 --- a/pjmedia/src/pjmedia/vid_stream.c +++ b/pjmedia/src/pjmedia/vid_stream.c @@ -502,7 +502,7 @@ static pj_status_t send_rtcp(pjmedia_vid_stream *stream, PJ_PERROR(4,(stream->name.ptr, status, "Error generating RTCP SDES")); } else { - len += sdes_len; + len += (int)sdes_len; } } @@ -517,7 +517,7 @@ static pj_status_t send_rtcp(pjmedia_vid_stream *stream, PJ_PERROR(4,(stream->name.ptr, status, "Error generating RTCP BYE")); } else { - len += bye_len; + len += (int)bye_len; } } @@ -606,7 +606,8 @@ static void on_rx_rtp( void *data, /* Check for errors */ if (bytes_read < 0) { - LOGERR_((channel->port.info.name.ptr, "RTP recv() error", -bytes_read)); + LOGERR_((channel->port.info.name.ptr, "RTP recv() error", + (pj_status_t)-bytes_read)); return; } @@ -615,7 +616,7 @@ static void on_rx_rtp( void *data, return; /* Update RTP and RTCP session. */ - status = pjmedia_rtp_decode_rtp(&channel->rtp, pkt, bytes_read, + status = pjmedia_rtp_decode_rtp(&channel->rtp, pkt, (int)bytes_read, &hdr, &payload, &payloadlen); if (status != PJ_SUCCESS) { LOGERR_((channel->port.info.name.ptr, "RTP decode error", status)); @@ -777,7 +778,7 @@ static void on_rx_rtcp( void *data, /* Check for errors */ if (bytes_read < 0) { LOGERR_((stream->cname.ptr, "RTCP recv() error", - -bytes_read)); + (pj_status_t)-bytes_read)); return; } @@ -869,7 +870,7 @@ static pj_status_t put_frame(pjmedia_port *port, status = pjmedia_rtp_encode_rtp(&channel->rtp, channel->pt, (has_more_data == PJ_FALSE ? 1 : 0), - frame_out.size, + (int)frame_out.size, rtp_ts_len, (const void**)&rtphdr, &rtphdrlen); @@ -899,7 +900,7 @@ static pj_status_t put_frame(pjmedia_port *port, /* Ignore this error */ } - pjmedia_rtcp_tx_rtp(&stream->rtcp, frame_out.size); + pjmedia_rtcp_tx_rtp(&stream->rtcp, (unsigned)frame_out.size); total_sent += frame_out.size; pkt_cnt++; @@ -1071,7 +1072,7 @@ static pj_status_t decode_frame(pjmedia_vid_stream *stream, /* Decode */ status = pjmedia_vid_codec_decode(stream->codec, cnt, stream->rx_frames, - frame->size, frame); + (unsigned)frame->size, frame); if (status != PJ_SUCCESS) { LOGERR_((channel->port.info.name.ptr, "codec decode() error", status)); @@ -1291,7 +1292,7 @@ static pj_status_t create_channel( pj_pool_t *pool, /* It should big enough to hold (minimally) RTCP SR with an SDES. */ min_out_pkt_size = sizeof(pjmedia_rtcp_sr_pkt) + sizeof(pjmedia_rtcp_common) + - (4 + stream->cname.slen) + + (4 + (unsigned)stream->cname.slen) + 32; if (channel->buf_size < min_out_pkt_size) @@ -1599,7 +1600,7 @@ PJ_DEF(pj_status_t) pjmedia_vid_stream_create( */ stream->out_rtcp_pkt_size = sizeof(pjmedia_rtcp_sr_pkt) + sizeof(pjmedia_rtcp_common) + - (4 + stream->cname.slen) + + (4 + (unsigned)stream->cname.slen) + 32; if (stream->out_rtcp_pkt_size > PJMEDIA_MAX_MTU) stream->out_rtcp_pkt_size = PJMEDIA_MAX_MTU; diff --git a/pjmedia/src/pjmedia/wav_player.c b/pjmedia/src/pjmedia/wav_player.c index e7084f86..78a02e04 100644 --- a/pjmedia/src/pjmedia/wav_player.c +++ b/pjmedia/src/pjmedia/wav_player.c @@ -60,7 +60,7 @@ struct file_reader_port pjmedia_wave_fmt_tag fmt_tag; pj_uint16_t bytes_per_sample; pj_bool_t eof; - pj_size_t bufsize; + pj_uint32_t bufsize; char *buf; char *readpos; char *eofpos; @@ -107,7 +107,7 @@ static struct file_reader_port *create_file_port(pj_pool_t *pool) */ static pj_status_t fill_buffer(struct file_reader_port *fport) { - pj_ssize_t size_left = fport->bufsize; + pj_uint32_t size_left = fport->bufsize; unsigned size_to_read; pj_ssize_t size; pj_status_t status; @@ -135,8 +135,8 @@ static pj_status_t fill_buffer(struct file_reader_port *fport) size = (pj_ssize_t)fport->data_left; } - size_left -= size; - fport->data_left -= size; + size_left -= (pj_uint32_t)size; + fport->data_left -= (pj_uint32_t)size; fport->fpos += size; /* If size is less than size_to_read, it indicates that we've @@ -375,7 +375,7 @@ PJ_DEF(pj_status_t) pjmedia_wav_player_port_create( pj_pool_t *pool, /* Create file buffer. */ - fport->bufsize = buff_size; + fport->bufsize = (pj_uint32_t)buff_size; /* samples_per_frame must be smaller than bufsize (because get_frame() @@ -541,7 +541,7 @@ static pj_status_t file_get_frame(pjmedia_port *this_port, pjmedia_frame *frame) { struct file_reader_port *fport = (struct file_reader_port*)this_port; - unsigned frame_size; + pj_size_t frame_size; pj_status_t status; pj_assert(fport->base.info.signature == SIGNATURE); @@ -617,7 +617,7 @@ static pj_status_t file_get_frame(pjmedia_port *this_port, /* Split read. * First stage: read until end of buffer. */ - endread = (fport->buf+fport->bufsize) - fport->readpos; + endread = (unsigned)((fport->buf+fport->bufsize) - fport->readpos); pj_memcpy(frame->buf, fport->readpos, endread); /* End Of Buffer and EOF and NO LOOP */ diff --git a/pjmedia/src/pjmedia/wav_playlist.c b/pjmedia/src/pjmedia/wav_playlist.c index bd8ca356..dfe00032 100644 --- a/pjmedia/src/pjmedia/wav_playlist.c +++ b/pjmedia/src/pjmedia/wav_playlist.c @@ -60,7 +60,7 @@ struct playlist_port pjmedia_port base; unsigned options; pj_bool_t eof; - pj_size_t bufsize; + pj_uint32_t bufsize; char *buf; char *readpos; @@ -107,8 +107,8 @@ static struct playlist_port *create_file_list_port(pj_pool_t *pool, */ static pj_status_t file_fill_buffer(struct playlist_port *fport) { - pj_ssize_t size_left = fport->bufsize; - unsigned size_to_read; + pj_uint32_t size_left = fport->bufsize; + pj_uint32_t size_to_read; pj_ssize_t size; pj_status_t status; int current_file = fport->current_file; @@ -133,7 +133,7 @@ static pj_status_t file_fill_buffer(struct playlist_port *fport) return PJ_ECANCELLED; } - size_left -= size; + size_left -= (pj_uint32_t)size; fport->fpos_list[current_file] += size; /* If size is less than size_to_read, it indicates that we've @@ -318,7 +318,7 @@ PJ_DEF(pj_status_t) pjmedia_wav_playlist_create(pj_pool_t *pool, /* Create file buffer once for this operation. */ if (buff_size < 1) buff_size = PJMEDIA_FILE_PORT_BUFSIZE; - fport->bufsize = buff_size; + fport->bufsize = (pj_uint32_t)buff_size; /* Create buffer. */ @@ -569,7 +569,7 @@ static pj_status_t file_list_get_frame(pjmedia_port *this_port, pjmedia_frame *frame) { struct playlist_port *fport = (struct playlist_port*)this_port; - unsigned frame_size; + pj_size_t frame_size; pj_status_t status; pj_assert(fport->base.info.signature == SIGNATURE); @@ -606,7 +606,7 @@ static pj_status_t file_list_get_frame(pjmedia_port *this_port, /* Split read. * First stage: read until end of buffer. */ - endread = (fport->buf+fport->bufsize) - fport->readpos; + endread = (unsigned)((fport->buf+fport->bufsize) - fport->readpos); pj_memcpy(frame->buf, fport->readpos, endread); /* Second stage: fill up buffer, and read from the start of buffer. */ diff --git a/pjmedia/src/pjmedia/wav_writer.c b/pjmedia/src/pjmedia/wav_writer.c index e1d0d66c..a88e77d0 100644 --- a/pjmedia/src/pjmedia/wav_writer.c +++ b/pjmedia/src/pjmedia/wav_writer.c @@ -311,7 +311,7 @@ static pj_status_t file_put_frame(pjmedia_port *this_port, pjmedia_frame *frame) { struct file_port *fport = (struct file_port *)this_port; - unsigned frame_size; + pj_size_t frame_size; if (fport->fmt_tag == PJMEDIA_WAVE_FMT_TAG_PCM) frame_size = frame->size; diff --git a/pjmedia/src/pjmedia/wsola.c b/pjmedia/src/pjmedia/wsola.c index 34e6afc0..30021a36 100644 --- a/pjmedia/src/pjmedia/wsola.c +++ b/pjmedia/src/pjmedia/wsola.c @@ -487,7 +487,7 @@ static void wsola_fade_out(pjmedia_wsola *wsola, *buf = (pj_int16_t)(*buf * fade_pos / fade_cnt); } if (buf != end) - pjmedia_zero_samples(buf, end - buf); + pjmedia_zero_samples(buf, (unsigned)(end - buf)); wsola->fade_out_pos = 0; } else { for (; buf != end; --fade_pos, ++buf) { @@ -661,7 +661,7 @@ static void expand(pjmedia_wsola *wsola, unsigned needed) } /* How many new samples do we have */ - dist = templ - start; + dist = (unsigned)(templ - start); /* Not enough buffer to hold the result */ if (reg1_len + dist > wsola->buf_size) { @@ -719,7 +719,7 @@ static unsigned compress(pjmedia_wsola *wsola, pj_int16_t *buf, unsigned count, CHECK_(start < end); start = find_pitch(buf, start, end, wsola->templ_size, 0); - dist = start - buf; + dist = (unsigned)(start - buf); if (wsola->options & PJMEDIA_WSOLA_NO_HANNING) { overlapp_add_simple(buf, wsola->hanning_size, buf, start); diff --git a/pjmedia/src/test/codec_vectors.c b/pjmedia/src/test/codec_vectors.c index 5257b5a7..823d4cff 100644 --- a/pjmedia/src/test/codec_vectors.c +++ b/pjmedia/src/test/codec_vectors.c @@ -34,7 +34,8 @@ static int codec_test_encode(pjmedia_codec_mgr *mgr, { pj_str_t codec_id = pj_str(codec_name); pj_pool_t *pool = NULL; - unsigned count, samples_per_frame, encoded_frame_len = 0, pos; + unsigned count, samples_per_frame; + pj_size_t encoded_frame_len = 0, pos; pjmedia_codec *codec = NULL; const pjmedia_codec_info *ci[1]; pjmedia_codec_param codec_param; @@ -125,7 +126,7 @@ static int codec_test_encode(pjmedia_codec_mgr *mgr, } if (out_frame.size) { - int cnt; + pj_size_t cnt; cnt = fwrite(out_frame.buf, out_frame.size, 1, output); @@ -152,7 +153,7 @@ static int codec_test_encode(pjmedia_codec_mgr *mgr, pos = 0; for (;;) { - int count; + pj_size_t count; count = fread(in_frame.buf, encoded_frame_len, 1, fref); if (count != 1) @@ -444,7 +445,7 @@ static int codec_test_decode(pjmedia_codec_mgr *mgr, pos = 0; for (;;) { - int count; + pj_size_t count; count = fread(pkt, samples_per_frame*2, 1, fref); if (count != 1) diff --git a/pjmedia/src/test/vid_codec_test.c b/pjmedia/src/test/vid_codec_test.c index 0b493f74..f613b84d 100644 --- a/pjmedia/src/test/vid_codec_test.c +++ b/pjmedia/src/test/vid_codec_test.c @@ -86,7 +86,7 @@ static pj_status_t codec_put_frame(pjmedia_port *port, pj_bool_t has_more = PJ_FALSE; enc_buf = port_data->enc_buf; - enc_size_left = port_data->enc_buf_size; + enc_size_left = (unsigned)port_data->enc_buf_size; /* * Encode @@ -99,7 +99,7 @@ static pj_status_t codec_put_frame(pjmedia_port *port, if (status != PJ_SUCCESS) goto on_error; enc_buf += enc_frames[enc_cnt].size; - enc_size_left -= enc_frames[enc_cnt].size; + enc_size_left -= (unsigned)enc_frames[enc_cnt].size; ++enc_cnt; while (has_more) { @@ -113,7 +113,7 @@ static pj_status_t codec_put_frame(pjmedia_port *port, break; enc_buf += enc_frames[enc_cnt].size; - enc_size_left -= enc_frames[enc_cnt].size; + enc_size_left -= (unsigned)enc_frames[enc_cnt].size; ++enc_cnt; @@ -127,7 +127,7 @@ static pj_status_t codec_put_frame(pjmedia_port *port, * Decode */ status = pjmedia_vid_codec_decode(codec, enc_cnt, enc_frames, - frame->size, frame); + (unsigned)frame->size, frame); if (status != PJ_SUCCESS) goto on_error; /* Display */ -- cgit v1.2.3