- Timestamp:
- Jul 14, 2011 6:34:29 AM (13 years ago)
- Location:
- pjproject/branches/projects/2.0-dev/pjmedia
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/format.h
r3493 r3641 41 41 * enumeration. 42 42 */ 43 #define PJMEDIA_FORMAT_PACK(C1, C2, C3, C4) ( C4<<24 | C3<<16 | C2<<8 | C1)43 #define PJMEDIA_FORMAT_PACK(C1, C2, C3, C4) PJMEDIA_FOURCC(C1, C2, C3, C4) 44 44 45 45 /** -
pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/signatures.h
r3640 r3641 105 105 * @return The string. 106 106 */ 107 PJ_INLINE(const char*) pjmedia_sig_ to_str(pjmedia_obj_sig sig, char buf[])107 PJ_INLINE(const char*) pjmedia_sig_name(pjmedia_obj_sig sig, char buf[]) 108 108 { 109 buf[0] = (char)((sig >> 24) & 0xFF); 110 buf[1] = (char)((sig >> 16) & 0xFF); 111 buf[2] = (char)((sig >> 8) & 0xFF); 112 buf[3] = (char)((sig >> 0) & 0xFF); 113 buf[4] = '\0'; 114 return buf; 109 return pjmedia_fourcc_name(sig, buf); 115 110 } 116 111 … … 118 113 * Macro to generate signature from four ASCII letters. 119 114 */ 120 #define PJMEDIA_SIGNATURE(a,b,c,d) (a<<24 | b<<16 | c<<8 |d)115 #define PJMEDIA_SIGNATURE(a,b,c,d) PJMEDIA_FOURCC(a,b,c,d) 121 116 122 117 /************************************************************************* -
pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/types.h
r3606 r3641 192 192 } pjmedia_rect; 193 193 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 194 199 195 200 /** … … 203 208 204 209 /** 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 */ 218 PJ_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 /** 205 230 * @} 206 231 */ -
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_stream.c
r3640 r3641 310 310 { 311 311 const pjmedia_port_info *pi = &chan->port.info; 312 char fourcc_name[5]; 312 313 313 314 PJ_LOG(5, (pi->name.ptr, 314 " %s format %s: %dx%d % c%c%c%c%s %d/%d(~%d)fps",315 " %s format %s: %dx%d %s%s %d/%d(~%d)fps", 315 316 (chan->dir==PJMEDIA_DIR_DECODING? "Decoding":"Encoding"), 316 317 event_name, 317 318 pi->fmt.det.vid.size.w, pi->fmt.det.vid.size.h, 318 ((pi->fmt.id & 0x000000FF) >> 0), 319 ((pi->fmt.id & 0x0000FF00) >> 8), 320 ((pi->fmt.id & 0x00FF0000) >> 16), 321 ((pi->fmt.id & 0xFF000000) >> 24), 319 pjmedia_fourcc_name(pi->fmt.id, fourcc_name), 322 320 (chan->dir==PJMEDIA_DIR_ENCODING?"->":"<-"), 323 321 pi->fmt.det.vid.fps.num, pi->fmt.det.vid.fps.denum, … … 1050 1048 const char *type_name; 1051 1049 pjmedia_format *fmt; 1050 char fourcc_name[5]; 1052 1051 pjmedia_port_info *pi; 1053 1052 … … 1122 1121 1123 1122 PJ_LOG(5, (name.ptr, 1124 "%s channel created %dx%d % c%c%c%c%s%.*s %d/%d(~%d)fps",1123 "%s channel created %dx%d %s%s%.*s %d/%d(~%d)fps", 1125 1124 (dir==PJMEDIA_DIR_ENCODING?"Encoding":"Decoding"), 1126 1125 pi->fmt.det.vid.size.w, pi->fmt.det.vid.size.h, 1127 ((pi->fmt.id & 0x000000FF) >> 0), 1128 ((pi->fmt.id & 0x0000FF00) >> 8), 1129 ((pi->fmt.id & 0x00FF0000) >> 16), 1130 ((pi->fmt.id & 0xFF000000) >> 24), 1126 pjmedia_fourcc_name(pi->fmt.id, fourcc_name), 1131 1127 (dir==PJMEDIA_DIR_ENCODING?"->":"<-"), 1132 1128 info->codec_info.encoding_name.slen,
Note: See TracChangeset
for help on using the changeset viewer.