Ignore:
Timestamp:
Jul 14, 2011 6:34:29 AM (13 years ago)
Author:
bennylp
Message:

More re #1325 (pjmedia signature): invented pjmedia PJMEDIA_FOURCC macro, and change signature and pjmedia_format_id to use this object. Added pjmedia_fourcc_name( ) too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/types.h

    r3606 r3641  
    192192} pjmedia_rect; 
    193193 
     194/** 
     195 * Macro for packing format from a four character code, similar to FOURCC. 
     196 */ 
     197#define PJMEDIA_FOURCC(C1, C2, C3, C4) ( C4<<24 | C3<<16 | C2<<8 | C1 ) 
     198 
    194199 
    195200/** 
     
    203208 
    204209/** 
     210 * A utility function to convert fourcc type of value to four letters string. 
     211 * 
     212 * @param sig           The fourcc value. 
     213 * @param buf           Buffer to store the string, which MUST be at least 
     214 *                      five bytes long. 
     215 * 
     216 * @return              The string. 
     217 */ 
     218PJ_INLINE(const char*) pjmedia_fourcc_name(pj_uint32_t sig, char buf[]) 
     219{ 
     220    buf[3] = (char)((sig >> 24) & 0xFF); 
     221    buf[2] = (char)((sig >> 16) & 0xFF); 
     222    buf[1] = (char)((sig >>  8) & 0xFF); 
     223    buf[0] = (char)((sig >>  0) & 0xFF); 
     224    buf[4] = '\0'; 
     225    return buf; 
     226} 
     227 
     228 
     229/** 
    205230 * @} 
    206231 */ 
Note: See TracChangeset for help on using the changeset viewer.