Index: pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/format.h
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/format.h	(revision 3640)
+++ pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/format.h	(revision 3641)
@@ -41,5 +41,5 @@
  * enumeration.
  */
-#define PJMEDIA_FORMAT_PACK(C1, C2, C3, C4) ( C4<<24 | C3<<16 | C2<<8 | C1 )
+#define PJMEDIA_FORMAT_PACK(C1, C2, C3, C4) PJMEDIA_FOURCC(C1, C2, C3, C4)
 
 /**
Index: pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/signatures.h
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/signatures.h	(revision 3640)
+++ pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/signatures.h	(revision 3641)
@@ -105,12 +105,7 @@
  * @return		The string.
  */
-PJ_INLINE(const char*) pjmedia_sig_to_str(pjmedia_obj_sig sig, char buf[])
+PJ_INLINE(const char*) pjmedia_sig_name(pjmedia_obj_sig sig, char buf[])
 {
-    buf[0] = (char)((sig >> 24) & 0xFF);
-    buf[1] = (char)((sig >> 16) & 0xFF);
-    buf[2] = (char)((sig >>  8) & 0xFF);
-    buf[3] = (char)((sig >>  0) & 0xFF);
-    buf[4] = '\0';
-    return buf;
+    return pjmedia_fourcc_name(sig, buf);
 }
 
@@ -118,5 +113,5 @@
  * Macro to generate signature from four ASCII letters.
  */
-#define PJMEDIA_SIGNATURE(a,b,c,d)	(a<<24 | b<<16 | c<<8 | d)
+#define PJMEDIA_SIGNATURE(a,b,c,d)	PJMEDIA_FOURCC(a,b,c,d)
 
 /*************************************************************************
Index: pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/types.h
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/types.h	(revision 3640)
+++ pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/types.h	(revision 3641)
@@ -192,4 +192,9 @@
 } pjmedia_rect;
 
+/**
+ * Macro for packing format from a four character code, similar to FOURCC.
+ */
+#define PJMEDIA_FOURCC(C1, C2, C3, C4) ( C4<<24 | C3<<16 | C2<<8 | C1 )
+
 
 /**
@@ -203,4 +208,24 @@
 
 /**
+ * A utility function to convert fourcc type of value to four letters string.
+ *
+ * @param sig		The fourcc value.
+ * @param buf		Buffer to store the string, which MUST be at least
+ * 			five bytes long.
+ *
+ * @return		The string.
+ */
+PJ_INLINE(const char*) pjmedia_fourcc_name(pj_uint32_t sig, char buf[])
+{
+    buf[3] = (char)((sig >> 24) & 0xFF);
+    buf[2] = (char)((sig >> 16) & 0xFF);
+    buf[1] = (char)((sig >>  8) & 0xFF);
+    buf[0] = (char)((sig >>  0) & 0xFF);
+    buf[4] = '\0';
+    return buf;
+}
+
+
+/**
  * @}
  */
Index: pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_stream.c
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_stream.c	(revision 3640)
+++ pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_stream.c	(revision 3641)
@@ -310,14 +310,12 @@
 {
     const pjmedia_port_info *pi = &chan->port.info;
+    char fourcc_name[5];
 
     PJ_LOG(5, (pi->name.ptr,
-	       " %s format %s: %dx%d %c%c%c%c%s %d/%d(~%d)fps",
+	       " %s format %s: %dx%d %s%s %d/%d(~%d)fps",
 	       (chan->dir==PJMEDIA_DIR_DECODING? "Decoding":"Encoding"),
 	       event_name,
 	       pi->fmt.det.vid.size.w, pi->fmt.det.vid.size.h,
-	       ((pi->fmt.id & 0x000000FF) >> 0),
-	       ((pi->fmt.id & 0x0000FF00) >> 8),
-	       ((pi->fmt.id & 0x00FF0000) >> 16),
-	       ((pi->fmt.id & 0xFF000000) >> 24),
+	       pjmedia_fourcc_name(pi->fmt.id, fourcc_name),
 	       (chan->dir==PJMEDIA_DIR_ENCODING?"->":"<-"),
 	       pi->fmt.det.vid.fps.num, pi->fmt.det.vid.fps.denum,
@@ -1050,4 +1048,5 @@
     const char *type_name;
     pjmedia_format *fmt;
+    char fourcc_name[5];
     pjmedia_port_info *pi;
     
@@ -1122,11 +1121,8 @@
 
     PJ_LOG(5, (name.ptr,
-	       "%s channel created %dx%d %c%c%c%c%s%.*s %d/%d(~%d)fps",
+	       "%s channel created %dx%d %s%s%.*s %d/%d(~%d)fps",
 	       (dir==PJMEDIA_DIR_ENCODING?"Encoding":"Decoding"),
 	       pi->fmt.det.vid.size.w, pi->fmt.det.vid.size.h,
-	       ((pi->fmt.id & 0x000000FF) >> 0),
-	       ((pi->fmt.id & 0x0000FF00) >> 8),
-	       ((pi->fmt.id & 0x00FF0000) >> 16),
-	       ((pi->fmt.id & 0xFF000000) >> 24),
+	       pjmedia_fourcc_name(pi->fmt.id, fourcc_name),
 	       (dir==PJMEDIA_DIR_ENCODING?"->":"<-"),
 	       info->codec_info.encoding_name.slen,
