From 024b2ca5c92600456eac7ab2b7c735e025986545 Mon Sep 17 00:00:00 2001 From: Nanang Izzuddin Date: Mon, 6 Apr 2015 06:21:41 +0000 Subject: Misc (re #1782): Fixed various compile warnings on MacOS & iOS. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@5046 74dad513-b988-da41-8d7b-12977e46ad98 --- pjmedia/src/pjmedia-codec/silk.c | 4 ++-- pjmedia/src/pjmedia/avi_player.c | 3 +-- pjmedia/src/pjmedia/converter_libyuv.c | 12 ++++++------ pjmedia/src/pjmedia/vid_codec_util.c | 2 +- pjmedia/src/pjmedia/vid_port.c | 12 +++++++++--- 5 files changed, 19 insertions(+), 14 deletions(-) diff --git a/pjmedia/src/pjmedia-codec/silk.c b/pjmedia/src/pjmedia-codec/silk.c index 9b2281ef..94e93bc3 100644 --- a/pjmedia/src/pjmedia-codec/silk.c +++ b/pjmedia/src/pjmedia-codec/silk.c @@ -895,12 +895,12 @@ static pj_status_t silk_codec_decode(pjmedia_codec *codec, } if (output->size == 0) { - output->type = PJMEDIA_TYPE_NONE; + output->type = PJMEDIA_FRAME_TYPE_NONE; output->buf = NULL; return PJMEDIA_CODEC_EFAILED; } - output->type = PJMEDIA_TYPE_AUDIO; + output->type = PJMEDIA_FRAME_TYPE_AUDIO; output->timestamp = input->timestamp; return PJ_SUCCESS; diff --git a/pjmedia/src/pjmedia/avi_player.c b/pjmedia/src/pjmedia/avi_player.c index 3f096e33..15fa73a1 100644 --- a/pjmedia/src/pjmedia/avi_player.c +++ b/pjmedia/src/pjmedia/avi_player.c @@ -539,8 +539,7 @@ pjmedia_avi_streams_get_stream(pjmedia_avi_streams *streams, unsigned idx) { pj_assert(streams); - return (idx >=0 && idx < streams->num_streams ? - streams->streams[idx] : NULL); + return (idx < streams->num_streams ? streams->streams[idx] : NULL); } PJ_DEF(pjmedia_avi_stream *) diff --git a/pjmedia/src/pjmedia/converter_libyuv.c b/pjmedia/src/pjmedia/converter_libyuv.c index 52435d1b..62693fd1 100644 --- a/pjmedia/src/pjmedia/converter_libyuv.c +++ b/pjmedia/src/pjmedia/converter_libyuv.c @@ -145,17 +145,17 @@ typedef struct fmt_convert_map { #define GET_PJ_FORMAT(fmt) PJMEDIA_FORMAT_##fmt #define MAP_CONV_PACK_TO_PACK(src,dst,method) GET_PJ_FORMAT(src),\ - GET_PJ_FORMAT(dst),CONV_PACK_TO_PACK,method + GET_PJ_FORMAT(dst),CONV_PACK_TO_PACK,(gen_conv_func)&method #define MAP_CONV_PACK_TO_PLANAR(src,dst,method) GET_PJ_FORMAT(src),\ - GET_PJ_FORMAT(dst),CONV_PACK_TO_PLANAR,method + GET_PJ_FORMAT(dst),CONV_PACK_TO_PLANAR,(gen_conv_func)&method #define MAP_CONV_PLANAR_TO_PACK(src,dst,method) GET_PJ_FORMAT(src),\ - GET_PJ_FORMAT(dst),CONV_PLANAR_TO_PACK,method + GET_PJ_FORMAT(dst),CONV_PLANAR_TO_PACK,(gen_conv_func)&method #define MAP_CONV_PLANAR_TO_PLANAR(src,dst,method) GET_PJ_FORMAT(src),\ - GET_PJ_FORMAT(dst),CONV_PLANAR_TO_PLANAR,method + GET_PJ_FORMAT(dst),CONV_PLANAR_TO_PLANAR,(gen_conv_func)&method #define MAP_SCALE_PACK(fmt,method) GET_PJ_FORMAT(fmt),\ - GET_PJ_FORMAT(fmt),SCALE_PACK,method + GET_PJ_FORMAT(fmt),SCALE_PACK,(gen_conv_func)&method #define MAP_SCALE_PLANAR(fmt,method) GET_PJ_FORMAT(fmt),\ - GET_PJ_FORMAT(fmt),SCALE_PLANAR,method + GET_PJ_FORMAT(fmt),SCALE_PLANAR,(gen_conv_func)&method static fmt_convert_map conv_to_i420[] = { diff --git a/pjmedia/src/pjmedia/vid_codec_util.c b/pjmedia/src/pjmedia/vid_codec_util.c index 43b91019..0aab8832 100644 --- a/pjmedia/src/pjmedia/vid_codec_util.c +++ b/pjmedia/src/pjmedia/vid_codec_util.c @@ -399,7 +399,7 @@ PJ_DEF(pj_status_t) pjmedia_vid_codec_h264_parse_fmtp( return status; } else if (pj_stricmp(&fmtp->param[i].name, &PACKETIZATION_MODE)==0) { tmp = pj_strtoul(&fmtp->param[i].val); - if (tmp >= 0 && tmp <= 2) + if (tmp <= 2) h264_fmtp->packetization_mode = (pj_uint8_t)tmp; else return PJMEDIA_SDP_EINFMTP; diff --git a/pjmedia/src/pjmedia/vid_port.c b/pjmedia/src/pjmedia/vid_port.c index ed600039..3690ca13 100644 --- a/pjmedia/src/pjmedia/vid_port.c +++ b/pjmedia/src/pjmedia/vid_port.c @@ -32,6 +32,10 @@ #define THIS_FILE "vid_port.c" +/* Enable/disable test of finding closest format algo */ +#define ENABLE_TEST_FIND_FMT 0 + + /** * Enable this to trace the format matching process. */ @@ -247,13 +251,13 @@ static pj_uint32_t match_format_id(pj_uint32_t req_id, static pj_uint32_t get_match_format_id(pj_uint32_t req_fmt_id, pjmedia_vid_dev_info *di) { - unsigned i = 0, match_idx = 0, match_fmt = FMT_DIFF_COLOR_SPACE+1; + unsigned i, match_idx = 0, match_fmt = FMT_DIFF_COLOR_SPACE+1; /* Find the matching format. If no exact match is found, find * the supported format with the same color space. If no match is found, * use the first supported format on the list. */ - for (i; i < di->fmt_cnt; ++i) { + for (i = 0; i < di->fmt_cnt; ++i) { unsigned tmp_fmt = match_format_id(req_fmt_id, di->fmt[i].id); if (match_fmt == FMT_MATCH) @@ -379,6 +383,7 @@ static struct fmt_prop find_closest_fmt(pj_uint32_t req_fmt_id, return ret_prop; } +#if ENABLE_TEST_FIND_FMT /** * This is to test the algo to find the closest fmt */ @@ -469,6 +474,7 @@ static void test_find_closest_fmt(pjmedia_vid_dev_info *di) } } } +#endif PJ_DEF(pj_status_t) pjmedia_vid_port_create( pj_pool_t *pool, const pjmedia_vid_port_param *prm, @@ -535,7 +541,7 @@ PJ_DEF(pj_status_t) pjmedia_vid_port_create( pj_pool_t *pool, return status; } -#if 0 +#if ENABLE_TEST_FIND_FMT test_find_closest_fmt(&di); #endif -- cgit v1.2.3