Changeset 421


Ignore:
Timestamp:
Apr 29, 2006 8:23:37 AM (18 years ago)
Author:
bennylp
Message:

Fixed bugs in codec priority sorting

Location:
pjproject/trunk/pjmedia
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia/codec.h

    r411 r421  
    388388     * of previously highest priority codec to NEXT_HIGHER. 
    389389     */ 
    390     PJMEDIA_CODEC_PRIO_HIGHEST, 
     390    PJMEDIA_CODEC_PRIO_HIGHEST = 16, 
    391391 
    392392    /** 
     
    394394     * codecs with this same priority. 
    395395     */ 
    396     PJMEDIA_CODEC_PRIO_NEXT_HIGHER, 
     396    PJMEDIA_CODEC_PRIO_NEXT_HIGHER = 12, 
    397397 
    398398    /** 
     
    400400     * codec manager by codec factory. 
    401401     */ 
    402     PJMEDIA_CODEC_PRIO_NORMAL, 
     402    PJMEDIA_CODEC_PRIO_NORMAL = 8, 
    403403 
    404404    /** 
     
    407407     * in the last place in the order. 
    408408     */ 
    409     PJMEDIA_CODEC_PRIO_LOWEST, 
     409    PJMEDIA_CODEC_PRIO_LOWEST = 4, 
    410410 
    411411    /** 
     
    416416     * query functions. 
    417417     */ 
    418     PJMEDIA_CODEC_PRIO_DISABLED, 
     418    PJMEDIA_CODEC_PRIO_DISABLED = 0, 
    419419}; 
    420420 
  • pjproject/trunk/pjmedia/src/pjmedia/endpoint.c

    r419 r421  
    407407 
    408408 
     409 
     410#if PJ_LOG_MAX_LEVEL >= 3 
     411static const char *good_number(char *buf, pj_int32_t val) 
     412{ 
     413    if (val < 1000) { 
     414        pj_ansi_sprintf(buf, "%d", val); 
     415    } else if (val < 1000000) { 
     416        pj_ansi_sprintf(buf, "%d.%dK",  
     417                        val / 1000, 
     418                        (val % 1000) / 100); 
     419    } else { 
     420        pj_ansi_sprintf(buf, "%d.%02dM",  
     421                        val / 1000000, 
     422                        (val % 1000000) / 10000); 
     423    } 
     424 
     425    return buf; 
     426} 
     427#endif 
     428 
    409429PJ_DEF(pj_status_t) pjmedia_endpt_dump(pjmedia_endpt *endpt) 
    410430{ 
     
    428448        const char *type; 
    429449        pjmedia_codec_param param; 
     450        char bps[16]; 
    430451 
    431452        switch (codec_info[i].type) { 
     
    446467 
    447468        PJ_LOG(3,(THIS_FILE,  
    448                   "   %s codec #%2d: pt=%d (%.*s @%dKHz/%d, %d bps, ptime=%d ms, vad=%d, cng=%d)",  
     469                  "   %s codec #%2d: pt=%d (%.*s @%dKHz/%d, %sbps, ptime=%d ms, vad=%d, cng=%d)",  
    449470                  type, i, codec_info[i].pt, 
    450471                  (int)codec_info[i].encoding_name.slen, 
     
    452473                  codec_info[i].clock_rate/1000, 
    453474                  codec_info[i].channel_cnt, 
    454                   param.avg_bps, param.ptime, 
     475                  good_number(bps, param.avg_bps),  
     476                  param.ptime, 
    455477                  param.vad, 
    456478                  param.cng)); 
Note: See TracChangeset for help on using the changeset viewer.