Index: /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/conference.h
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/conference.h	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/conference.h	(revision 3640)
@@ -47,12 +47,10 @@
  * The conference bridge signature in pjmedia_port_info.
  */
-#define PJMEDIA_CONF_BRIDGE_SIGNATURE	\
-		    PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'F')
+#define PJMEDIA_CONF_BRIDGE_SIGNATURE	PJMEDIA_SIG_PORT_CONF
 
 /**
  * The audio switchboard signature in pjmedia_port_info.
  */
-#define PJMEDIA_CONF_SWITCH_SIGNATURE	\
-		    PJMEDIA_PORT_SIGNATURE('A', 'S', 'W', 'I')
+#define PJMEDIA_CONF_SWITCH_SIGNATURE	PJMEDIA_SIG_PORT_CONF_SWITCH
 
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/event.h
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/event.h	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/event.h	(revision 3640)
@@ -25,4 +25,5 @@
  */
 #include <pjmedia/format.h>
+#include <pjmedia/signatures.h>
 #include <pj/list.h>
 
@@ -183,4 +184,10 @@
      */
     unsigned				 proc_cnt;
+
+    /**
+     * The object signature of the event publisher. Application may use
+     * this to check which publisher published the event.
+     */
+    pjmedia_obj_sig			 epub_sig;
 
     /**
@@ -269,4 +276,7 @@
 struct pjmedia_event_publisher
 {
+    /** The object signature of the publisher */
+    pjmedia_obj_sig		sig;
+
     /** List of subscriptions for this event publisher */
     pjmedia_event_subscription	subscription_list;
@@ -291,6 +301,8 @@
  *
  * @param epub		The event publisher.
- */
-PJ_DECL(void) pjmedia_event_publisher_init(pjmedia_event_publisher *epub);
+ * @param sig		The object signature of the publisher.
+ */
+PJ_DECL(void) pjmedia_event_publisher_init(pjmedia_event_publisher *epub,
+                                           pjmedia_obj_sig sig);
 
 /**
Index: /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/port.h
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/port.h	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/port.h	(revision 3640)
@@ -29,4 +29,5 @@
 #include <pjmedia/format.h>
 #include <pjmedia/frame.h>
+#include <pjmedia/signatures.h>
 #include <pj/assert.h>
 #include <pj/os.h>
@@ -190,6 +191,5 @@
  * Create 32bit port signature from ASCII characters.
  */
-#define PJMEDIA_PORT_SIGNATURE(a,b,c,d)	    \
-	    (a<<24 | b<<16 | c<<8 | d)
+#define PJMEDIA_PORT_SIG(a,b,c,d)	    	PJMEDIA_OBJ_SIG(a,b,c,d)
 
 
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 3640)
@@ -0,0 +1,219 @@
+/* $Id$ */
+/* 
+ * Copyright (C) 2011-2011 Teluu Inc. (http://www.teluu.com)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA 
+ */
+#ifndef __PJMEDIA_SIGNATURES_H__
+#define __PJMEDIA_SIGNATURES_H__
+
+/**
+ * @file pjmedia/signatures.h
+ * @brief Standard PJMEDIA object signatures
+ */
+#include <pjmedia/types.h>
+
+PJ_BEGIN_DECL
+
+/**
+ * @defgroup PJMEDIA_SIG Object Signatures
+ * @ingroup PJMEDIA_BASE
+ * @brief Standard PJMEDIA object signatures
+ * @{
+ *
+ * Object signature is a 32-bit integral value similar to FOURCC to help
+ * identify PJMEDIA objects such as media ports, transports, codecs, etc.
+ * There are several uses of this signature, for example a media port can
+ * use the port object signature to verify that the given port instance
+ * is the one that it created, and a receiver of \ref PJMEDIA_EVENT can
+ * use the signature of the publisher to know which object emitted the
+ * event.
+ *
+ * The 32-bit value of an object signature is generated by the following
+ * macro:
+ *
+ * \verbatim
+   #define PJMEDIA_SIGNATURE(a,b,c,d)	(a<<24 | b<<16 | c<<8 | d)
+ * \endverbatim
+ *
+ * The following convention is used to maintain order to the signature
+ * values so that application can make use of it more effectively, and to
+ * avoid conflict between the values themselves. For each object type or
+ * class, a specific prefix will be assigned as signature, and a macro
+ * is created to build a signature for such object:
+ *
+ * \verbatim
+    Class               Signature  Signature creation and test macros
+    ---------------------------------------------------------------
+    Codec    		Cxxx	   PJMEDIA_SIG_CLASS_CODEC(b,c,d)
+				   PJMEDIA_SIG_IS_CLASS_CODEC(sig)
+
+    Audio codec 	CAxx	   PJMEDIA_SIG_CLASS_AUD_CODEC(c,d)
+				   PJMEDIA_SIG_IS_CLASS_AUD_CODEC(sig)
+
+    Video codec 	CVxx	   PJMEDIA_SIG_CLASS_VID_CODEC(c,d)
+				   PJMEDIA_SIG_IS_CLASS_VID_CODEC(sig)
+
+    Media port		Pxxx	   PJMEDIA_SIG_CLASS_PORT(b,c,d)
+				   PJMEDIA_SIG_IS_CLASS_PORT(sig)
+
+    Audio media port    PAxx	   PJMEDIA_SIG_CLASS_PORT_AUD(c,d)
+				   PJMEDIA_SIG_IS_CLASS_PORT_AUD(sig)
+
+    Video media port    PVxx	   PJMEDIA_SIG_CLASS_PORT_VID(c,d)
+				   PJMEDIA_SIG_IS_CLASS_PORT_VID(sig)
+
+    Video device	VDxx	   PJMEDIA_SIG_CLASS_VID_DEV(c,d)
+				   PJMEDIA_SIG_IS_CLASS_VID_DEV(sig)
+
+    Video other		VOxx	   PJMEDIA_SIG_CLASS_VID_OTHER(c,d)
+				   PJMEDIA_SIG_IS_CLASS_VID_OTHER(sig)
+
+    Application object	Axxx	   PJMEDIA_SIG_CLASS_APP(b,c,d)
+				   PJMEDIA_SIG_IS_CLASS_APP(sig)
+
+ * \endverbatim
+ *
+ * In addition, signatures created in application code should have lowercase
+ * letters to avoid conflict with built-in objects.
+ */
+
+/**
+ * Type to store object signature.
+ */
+typedef pj_uint32_t pjmedia_obj_sig;
+
+/**
+ * A utility function to convert signature to four letters string.
+ *
+ * @param sig		The signature value.
+ * @param buf		Buffer to store the string, which MUST be at least
+ * 			five bytes long.
+ *
+ * @return		The string.
+ */
+PJ_INLINE(const char*) pjmedia_sig_to_str(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;
+}
+
+/**
+ * Macro to generate signature from four ASCII letters.
+ */
+#define PJMEDIA_SIGNATURE(a,b,c,d)	(a<<24 | b<<16 | c<<8 | d)
+
+/*************************************************************************
+ * Codec signature ('Cxxx'). Please keep the constant names sorted.
+ */
+#define PJMEDIA_SIG_CLASS_CODEC(b,c,d)	PJMEDIA_SIGNATURE('C',b,c,d)
+#define PJMEDIA_SIG_IS_CLASS_CODEC(sig)	((sig) >> 24 == 'C')
+
+/*************************************************************************
+ * Audio codec signatures ('CAxx'). Please keep the constant names sorted.
+ */
+#define PJMEDIA_SIG_CLASS_AUD_CODEC(c,d) PJMEDIA_SIG_CLASS_CODEC('A',c,d)
+#define PJMEDIA_SIG_IS_CLASS_AUD_CODEC(s) ((s)>>24=='C' && (s)>>16=='A')
+
+/*************************************************************************
+ * Video codec signatures ('CVxx'). Please keep the constant names sorted.
+ */
+#define PJMEDIA_SIG_CLASS_VID_CODEC(c,d) PJMEDIA_SIG_CLASS_CODEC('V',c,d)
+#define PJMEDIA_SIG_IS_CLASS_VID_CODEC(sig) ((s)>>24=='C' && (s)>>16=='V')
+
+#define PJMEDIA_SIG_VID_CODEC_FFMPEG	PJMEDIA_SIG_CLASS_VID_CODEC('F','F')
+
+/*************************************************************************
+ * Port signatures ('Pxxx'). Please keep the constant names sorted.
+ */
+#define PJMEDIA_SIG_CLASS_PORT(b,c,d)	PJMEDIA_SIGNATURE('P',b,c,d)
+#define PJMEDIA_SIG_IS_CLASS_PORT(sig)	((sig) >> 24 == 'P')
+
+/*************************************************************************
+ * Audio ports signatures ('PAxx'). Please keep the constant names sorted.
+ */
+#define PJMEDIA_SIG_CLASS_PORT_AUD(c,d)	PJMEDIA_SIG_CLASS_PORT('A',c,d)
+#define PJMEDIA_SIG_IS_CLASS_PORT_AUD(s) ((s)>>24=='P' && (s)>>16=='A')
+
+#define PJMEDIA_SIG_PORT_BIDIR		PJMEDIA_SIG_CLASS_PORT_AUD('B','D')
+#define PJMEDIA_SIG_PORT_CONF		PJMEDIA_SIG_CLASS_PORT_AUD('C','F')
+#define PJMEDIA_SIG_PORT_CONF_PASV	PJMEDIA_SIG_CLASS_PORT_AUD('C','P')
+#define PJMEDIA_SIG_PORT_CONF_SWITCH	PJMEDIA_SIG_CLASS_PORT_AUD('C','S')
+#define PJMEDIA_SIG_PORT_ECHO		PJMEDIA_SIG_CLASS_PORT_AUD('E','C')
+#define PJMEDIA_SIG_PORT_MEM_CAPTURE	PJMEDIA_SIG_CLASS_PORT_AUD('M','C')
+#define PJMEDIA_SIG_PORT_MEM_PLAYER	PJMEDIA_SIG_CLASS_PORT_AUD('M','P')
+#define PJMEDIA_SIG_PORT_NULL		PJMEDIA_SIG_CLASS_PORT_AUD('N','U')
+#define PJMEDIA_SIG_PORT_RESAMPLE	PJMEDIA_SIG_CLASS_PORT_AUD('R','E')
+#define PJMEDIA_SIG_PORT_SPLIT_COMB	PJMEDIA_SIG_CLASS_PORT_AUD('S','C')
+#define PJMEDIA_SIG_PORT_SPLIT_COMB_P	PJMEDIA_SIG_CLASS_PORT_AUD('S','P')
+#define PJMEDIA_SIG_PORT_STEREO		PJMEDIA_SIG_CLASS_PORT_AUD('S','R')
+#define PJMEDIA_SIG_PORT_STREAM		PJMEDIA_SIG_CLASS_PORT_AUD('S','T')
+#define PJMEDIA_SIG_PORT_TONEGEN	PJMEDIA_SIG_CLASS_PORT_AUD('T','O')
+#define PJMEDIA_SIG_PORT_WAV_PLAYER	PJMEDIA_SIG_CLASS_PORT_AUD('W','P')
+#define PJMEDIA_SIG_PORT_WAV_PLAYLIST	PJMEDIA_SIG_CLASS_PORT_AUD('W','Y')
+#define PJMEDIA_SIG_PORT_WAV_WRITER	PJMEDIA_SIG_CLASS_PORT_AUD('W','W')
+
+
+/*************************************************************************
+ * Video ports signatures ('PVxx'). Please keep the constant names sorted.
+ */
+#define PJMEDIA_SIG_CLASS_PORT_VID(c,d)	PJMEDIA_SIG_CLASS_PORT('V',c,d)
+#define PJMEDIA_SIG_IS_CLASS_PORT_VID(s) ((s)>>24=='P' && (s)>>16=='V')
+
+/** AVI player signature. */
+#define PJMEDIA_SIG_PORT_VID_AVI_PLAYER	PJMEDIA_SIG_CLASS_PORT_VID('A','V')
+#define PJMEDIA_SIG_PORT_VID_STREAM	PJMEDIA_SIG_CLASS_PORT_VID('S','T')
+#define PJMEDIA_SIG_PORT_VID_TEE	PJMEDIA_SIG_CLASS_PORT_VID('T','E')
+
+
+/**************************************************************************
+ * Video device signatures ('VDxx'). Please keep the constant names sorted.
+ */
+#define PJMEDIA_SIG_CLASS_VID_DEV(c,d)	PJMEDIA_SIGNATURE('V','D',c,d)
+#define PJMEDIA_SIG_IS_CLASS_VID_DEV(s) ((s)>>24=='V' && (s)>>16=='D')
+
+#define PJMEDIA_SIG_VID_DEV_COLORBAR	PJMEDIA_SIG_CLASS_VID_DEV('C','B')
+#define PJMEDIA_SIG_VID_DEV_SDL		PJMEDIA_SIG_CLASS_VID_DEV('S','D')
+#define PJMEDIA_SIG_VID_DEV_V4L2	PJMEDIA_SIG_CLASS_VID_DEV('V','2')
+
+
+/*********************************************************************
+ * Other video objects ('VOxx'). Please keep the constant names sorted.
+ */
+#define PJMEDIA_SIG_CLASS_VID_OTHER(c,d) PJMEDIA_SIGNATURE('V','O',c,d)
+#define PJMEDIA_SIG_IS_CLASS_VID_OTHER(s) ((s)>>24=='V' && (s)>>16=='O')
+
+#define PJMEDIA_SIG_VID_PORT		PJMEDIA_SIG_CLASS_VID_OTHER('P','O')
+
+
+/*********************************************************************
+ * Application class ('Axxx').
+ */
+#define PJMEDIA_SIG_CLASS_APP(b,c,d)	PJMEDIA_SIGNATURE('A',b,c,d)
+#define PJMEDIA_SIG_IS_CLASS_APP(s)	((s)>>24=='A')
+
+
+/**
+ * @}  PJSIP_MSG
+ */
+
+
+PJ_END_DECL
+
+#endif	/* __PJMEDIA_SIGNATURES_H__ */
Index: /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/vid_codec.h
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/vid_codec.h	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/vid_codec.h	(revision 3640)
@@ -431,6 +431,8 @@
  *
  * @param codec	    The codec to be initialized.
- */
-PJ_DECL(void) pjmedia_vid_codec_init(pjmedia_vid_codec *codec);
+ * @param sig	    Codec's object signature (see signatures.h)
+ */
+PJ_DECL(void) pjmedia_vid_codec_init(pjmedia_vid_codec *codec,
+                                     pjmedia_obj_sig sig);
 
 /**
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-codec/ffmpeg_codecs.c	(revision 3640)
@@ -887,5 +887,5 @@
         goto on_error;
     }
-    pjmedia_vid_codec_init(codec);
+    pjmedia_vid_codec_init(codec, PJMEDIA_SIG_VID_CODEC_FFMPEG);
     codec->op = &ffmpeg_op;
     codec->factory = factory;
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/colorbar_dev.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/colorbar_dev.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/colorbar_dev.c	(revision 3640)
@@ -417,5 +417,5 @@
     pj_memcpy(&strm->vafp, &vafp, sizeof(vafp));
     strm->ts_inc = PJMEDIA_SPF2(param->clock_rate, &vfd->fps, 1);
-    pjmedia_event_publisher_init(&strm->base.epub);
+    pjmedia_event_publisher_init(&strm->base.epub, PJMEDIA_SIG_VID_DEV_COLORBAR);
 
     for (i = 0; i < vfi->plane_cnt; ++i) {
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/sdl_dev.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/sdl_dev.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/sdl_dev.c	(revision 3640)
@@ -1012,5 +1012,5 @@
     pj_memcpy(&strm->vid_cb, cb, sizeof(*cb));
     strm->user_data = user_data;
-    pjmedia_event_publisher_init(&strm->base.epub);
+    pjmedia_event_publisher_init(&strm->base.epub, PJMEDIA_SIG_VID_DEV_SDL);
 
     /* Create render stream here */
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/v4l2_dev.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/v4l2_dev.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/v4l2_dev.c	(revision 3640)
@@ -574,5 +574,5 @@
     stream->user_data = user_data;
     stream->fd = INVALID_FD;
-    pjmedia_event_publisher_init(&stream->base.epub);
+    pjmedia_event_publisher_init(&stream->base.epub, PJMEDIA_SIG_VID_DEV_V4L2);
 
     stream->fd = v4l2_open(vdi->dev_name, O_RDWR | O_NONBLOCK, 0);
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/avi_player.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/avi_player.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/avi_player.c	(revision 3640)
@@ -44,5 +44,5 @@
 #define COMPARE_TAG(doc_tag, tag) (doc_tag == *((pj_uint32_t *)avi_tags[tag]))
 
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('A', 'V', 'I', 'P')
+#define SIGNATURE	    PJMEDIA_SIG_PORT_VID_AVI_PLAYER
 
 #if 0
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/bidirectional.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/bidirectional.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/bidirectional.c	(revision 3640)
@@ -23,5 +23,5 @@
 
 #define THIS_FILE   "bidirectional.c"
-#define SIGNATURE   PJMEDIA_PORT_SIGNATURE('B', 'D', 'I', 'R')
+#define SIGNATURE   PJMEDIA_SIG_PORT_BIDIR
 
 struct bidir_port
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/conference.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/conference.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/conference.c	(revision 3640)
@@ -65,5 +65,5 @@
 
 #define SIGNATURE	    PJMEDIA_CONF_BRIDGE_SIGNATURE
-#define SIGNATURE_PORT	    PJMEDIA_PORT_SIGNATURE('C', 'O', 'N', 'P')
+#define SIGNATURE_PORT	    PJMEDIA_SIG_PORT_CONF_PASV
 /* Normal level is hardcodec to 128 in all over places */
 #define NORMAL_LEVEL	    128
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/echo_port.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/echo_port.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/echo_port.c	(revision 3640)
@@ -27,5 +27,5 @@
 
 #define THIS_FILE   "ec_port.c"
-#define SIGNATURE   PJMEDIA_PORT_SIGNATURE('E', 'C', 'H', 'O')
+#define SIGNATURE   PJMEDIA_SIG_PORT_ECHO
 #define BUF_COUNT   32
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/event.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/event.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/event.c	(revision 3640)
@@ -41,10 +41,14 @@
 	event->timestamp.u64 = ts->u64;
     event->epub = epub;
+    if (epub)
+	event->epub_sig = epub->sig;
 }
 
-PJ_DEF(void) pjmedia_event_publisher_init(pjmedia_event_publisher *epub)
+PJ_DEF(void) pjmedia_event_publisher_init(pjmedia_event_publisher *epub,
+                                          pjmedia_obj_sig sig)
 {
     pj_bzero(epub, sizeof(*epub));
     pj_list_init(&epub->subscription_list);
+    epub->sig = sig;
 }
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/mem_capture.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/mem_capture.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/mem_capture.c	(revision 3640)
@@ -26,5 +26,5 @@
 #define THIS_FILE	    "mem_capture.c"
 
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('M', 'R', 'e', 'c')
+#define SIGNATURE	    PJMEDIA_SIG_PORT_MEM_CAPTURE
 #define BYTES_PER_SAMPLE    2
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/mem_player.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/mem_player.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/mem_player.c	(revision 3640)
@@ -26,5 +26,5 @@
 #define THIS_FILE	    "mem_player.c"
 
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('M', 'P', 'l', 'y')
+#define SIGNATURE	    PJMEDIA_SIG_PORT_MEM_PLAYER
 #define BYTES_PER_SAMPLE    2
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/null_port.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/null_port.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/null_port.c	(revision 3640)
@@ -25,5 +25,5 @@
 
 
-#define SIGNATURE   PJMEDIA_PORT_SIGNATURE('N', 'U', 'L', 'L')
+#define SIGNATURE   PJMEDIA_SIG_PORT_NULL
 
 static pj_status_t null_get_frame(pjmedia_port *this_port, 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/resample_port.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/resample_port.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/resample_port.c	(revision 3640)
@@ -26,5 +26,5 @@
 
 #define BYTES_PER_SAMPLE	2
-#define SIGNATURE		PJMEDIA_PORT_SIGNATURE('R','S','M','P')
+#define SIGNATURE		PJMEDIA_SIG_PORT_RESAMPLE
 
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/splitcomb.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/splitcomb.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/splitcomb.c	(revision 3640)
@@ -26,6 +26,6 @@
 
 
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('S', 'p', 'C', 'b')
-#define SIGNATURE_PORT	    PJMEDIA_PORT_SIGNATURE('S', 'p', 'C', 'P')
+#define SIGNATURE	    PJMEDIA_SIG_PORT_SPLIT_COMB
+#define SIGNATURE_PORT	    PJMEDIA_SIG_PORT_SPLIT_COMB_P
 #define THIS_FILE	    "splitcomb.c"
 #define TMP_SAMP_TYPE	    pj_int16_t
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stereo_port.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stereo_port.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stereo_port.c	(revision 3640)
@@ -25,5 +25,5 @@
 
 
-#define SIGNATURE		PJMEDIA_PORT_SIGNATURE('S','T','R','O')
+#define SIGNATURE		PJMEDIA_SIG_PORT_STEREO
 
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stream.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stream.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/stream.c	(revision 3640)
@@ -1983,5 +1983,5 @@
      */
     pjmedia_port_info_init(&stream->port.info, &name,
-			   PJMEDIA_PORT_SIGNATURE('S', 'T', 'R', 'M'),
+                           PJMEDIA_SIG_PORT_STREAM,
 			   info->fmt.clock_rate, info->fmt.channel_cnt,
 			   16, 80);
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/tonegen.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/tonegen.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/tonegen.c	(revision 3640)
@@ -335,5 +335,5 @@
 /****************************************************************************/
 
-#define SIGNATURE   PJMEDIA_PORT_SIGNATURE('t', 'n', 'g', 'n')
+#define SIGNATURE   PJMEDIA_SIG_PORT_TONEGEN
 #define THIS_FILE   "tonegen.c"
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_codec.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_codec.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_codec.c	(revision 3640)
@@ -70,8 +70,9 @@
  * Initialize pjmedia_vid_codec structure with default values.
  */
-PJ_DEF(void) pjmedia_vid_codec_init(pjmedia_vid_codec *codec)
+PJ_DEF(void) pjmedia_vid_codec_init(pjmedia_vid_codec *codec,
+                                    pjmedia_obj_sig sig)
 {
     pj_bzero(codec, sizeof(*codec));
-    pj_list_init(&codec->epub);
+    pjmedia_event_publisher_init(&codec->epub, sig);
 }
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_port.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_port.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_port.c	(revision 3640)
@@ -26,4 +26,5 @@
 #include <pj/pool.h>
 
+#define SIGNATURE	PJMEDIA_SIG_VID_PORT
 #define THIS_FILE	"vid_port.c"
 
@@ -202,5 +203,5 @@
     vp->dir = prm->vidparam.dir;
 //    vp->cap_size = vfd->size;
-    pjmedia_event_publisher_init(&vp->epub);
+    pjmedia_event_publisher_init(&vp->epub, SIGNATURE);
 
     vparam = prm->vidparam;
@@ -312,5 +313,5 @@
 	pp->base.put_frame = &vid_pasv_port_put_frame;
 	pjmedia_port_info_init2(&pp->base.info, &vp->dev_name,
-				PJMEDIA_PORT_SIGNATURE('v', 'i', 'd', 'p'),
+	                        PJMEDIA_SIG_VID_PORT,
 			        prm->vidparam.dir, &prm->vidparam.fmt);
 
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 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_stream.c	(revision 3640)
@@ -43,4 +43,5 @@
 #define LOGERR_(expr)			stream_perror expr
 #define TRC_(expr)			PJ_LOG(5,expr)
+#define SIGNATURE			PJMEDIA_SIG_PORT_VID_STREAM
 
 /* Tracing jitter buffer operations in a stream session to a CSV file.
@@ -1108,7 +1109,5 @@
 
     /* Init port. */
-    pjmedia_port_info_init2(pi, &name,
-			    PJMEDIA_PORT_SIGNATURE('V', 'C', 'H', 'N'),
-			    dir, fmt);
+    pjmedia_port_info_init2(pi, &name, SIGNATURE, dir, fmt);
     if (dir == PJMEDIA_DIR_DECODING) {
 	channel->port.get_frame = &get_frame;
@@ -1253,5 +1252,5 @@
 
     /* Init event publisher and subscribe to codec events */
-    pjmedia_event_publisher_init(&stream->epub);
+    pjmedia_event_publisher_init(&stream->epub, SIGNATURE);
     pjmedia_event_subscription_init(&stream->esub_codec, &stream_event_cb,
                                     stream);
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_tee.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_tee.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/vid_tee.c	(revision 3640)
@@ -25,5 +25,5 @@
 
 #define TEE_PORT_NAME	"vid_tee"
-#define TEE_PORT_SIGN	PJMEDIA_PORT_SIGNATURE('V', 'T', 'E', 'E')
+#define TEE_PORT_SIGN	PJMEDIA_SIG_PORT_VID_TEE
 #define MAX_DST_PORT_COUNT 20
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_player.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_player.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_player.c	(revision 3640)
@@ -33,5 +33,5 @@
 
 
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('F', 'P', 'l', 'y')
+#define SIGNATURE	    PJMEDIA_SIG_PORT_WAV_PLAYER
 #define BITS_PER_SAMPLE	    16
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_playlist.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_playlist.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_playlist.c	(revision 3640)
@@ -33,5 +33,5 @@
 #define THIS_FILE	    "wav_playlist.c"
 
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('P', 'l', 's', 't')
+#define SIGNATURE	    PJMEDIA_SIG_PORT_WAV_PLAYLIST
 #define BYTES_PER_SAMPLE    2
 
Index: /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_writer.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_writer.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/wav_writer.c	(revision 3640)
@@ -31,5 +31,5 @@
 
 #define THIS_FILE	    "wav_writer.c"
-#define SIGNATURE	    PJMEDIA_PORT_SIGNATURE('F', 'W', 'R', 'T')
+#define SIGNATURE	    PJMEDIA_SIG_PORT_WAV_WRITER
 
 
Index: /pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/playsine.c
===================================================================
--- /pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/playsine.c	(revision 3639)
+++ /pjproject/branches/projects/2.0-dev/pjsip-apps/src/samples/playsine.c	(revision 3640)
@@ -139,5 +139,5 @@
     name = pj_str("sine generator");
     pjmedia_port_info_init(&port->info, &name,
-			   PJMEDIA_PORT_SIGNATURE('s', 'i', 'n', 'e'),
+                           PJMEDIA_SIG_CLASS_PORT_AUD('s', 'i'),
 			   sampling_rate,
 			   channel_count,
