Index: pjproject/branches/projects/2.0-dev/pjsip-apps/src/pjsua/pjsua_app.c
===================================================================
--- pjproject/branches/projects/2.0-dev/pjsip-apps/src/pjsua/pjsua_app.c	(revision 3651)
+++ pjproject/branches/projects/2.0-dev/pjsip-apps/src/pjsua/pjsua_app.c	(revision 3652)
@@ -3143,4 +3143,14 @@
 }
 
+/* Callback on media events */
+static void on_call_media_event(pjsua_call_id call_id,
+                                unsigned med_idx,
+                                pjmedia_event *event)
+{
+    char event_name[5];
+    PJ_LOG(4,(THIS_FILE, "Event %s",
+	      pjmedia_fourcc_name(event->type, event_name)));
+}
+
 /*
  * Print buddy list.
@@ -5101,4 +5111,5 @@
     app_config.cfg.cb.on_ice_transport_error = &on_ice_transport_error;
     app_config.cfg.cb.on_snd_dev_operation = &on_snd_dev_operation;
+    app_config.cfg.cb.on_call_media_event = &on_call_media_event;
     app_config.log_cfg.cb = log_cb;
 
Index: pjproject/branches/projects/2.0-dev/pjsip/include/pjsua-lib/pjsua.h
===================================================================
--- pjproject/branches/projects/2.0-dev/pjsip/include/pjsua-lib/pjsua.h	(revision 3651)
+++ pjproject/branches/projects/2.0-dev/pjsip/include/pjsua-lib/pjsua.h	(revision 3652)
@@ -1046,4 +1046,19 @@
     pj_status_t (*on_snd_dev_operation)(int operation);
 
+    /**
+     * Notification about media events such as video notifications. This
+     * callback will most likely be called from media threads, thus
+     * application must not perform heavy processing in this callback.
+     * Especially, application must not destroy the call or media in this
+     * callback. If application needs to perform more complex tasks to
+     * handle the event, it should post the task to another thread.
+     *
+     * @param call_id	The call id.
+     * @param med_idx	The media stream index.
+     * @param event 	The media event.
+     */
+    void (*on_call_media_event)(pjsua_call_id call_id,
+				unsigned med_idx,
+				pjmedia_event *event);
 
 } pjsua_callback;
Index: pjproject/branches/projects/2.0-dev/pjsip/include/pjsua-lib/pjsua_internal.h
===================================================================
--- pjproject/branches/projects/2.0-dev/pjsip/include/pjsua-lib/pjsua_internal.h	(revision 3651)
+++ pjproject/branches/projects/2.0-dev/pjsip/include/pjsua-lib/pjsua_internal.h	(revision 3652)
@@ -99,4 +99,6 @@
 					    address)			    */
     pjmedia_srtp_use	 rem_srtp_use; /**< Remote's SRTP usage policy.	    */
+
+    pjmedia_event_subscription esub;/**< To subscribe to media events.	    */
 } pjsua_call_media;
 
@@ -514,4 +516,14 @@
 pj_status_t pjsua_media_channel_deinit(pjsua_call_id call_id);
 
+pj_status_t pjsua_call_media_init(pjsua_call_media *call_med,
+                                  pjmedia_type type,
+				  const pjsua_transport_config *tcfg,
+				  int security_level,
+				  int *sip_err_code);
+pj_status_t video_channel_update(pjsua_call_media *call_med,
+                                 pj_pool_t *tmp_pool,
+			         const pjmedia_sdp_session *local_sdp,
+			         const pjmedia_sdp_session *remote_sdp);
+
 
 /**
Index: pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_media.c
===================================================================
--- pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_media.c	(revision 3651)
+++ pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_media.c	(revision 3652)
@@ -1313,4 +1313,20 @@
 }
 
+/* Callback to receive media events */
+static pj_status_t call_media_on_event(pjmedia_event_subscription *esub,
+                                       pjmedia_event *event)
+{
+    pjsua_call_media *call_med = (pjsua_call_media*)esub->user_data;
+    pjsua_call *call = call_med->call;
+
+    if (pjsua_var.ua_cfg.cb.on_call_media_event && call) {
+	++event->proc_cnt;
+	(*pjsua_var.ua_cfg.cb.on_call_media_event)(call->index,
+						   call_med->idx, event);
+    }
+
+    return PJ_SUCCESS;
+}
+
 /* Initialize the media line */
 pj_status_t pjsua_call_media_init(pjsua_call_media *call_med,
@@ -1410,4 +1426,7 @@
     PJ_UNUSED_ARG(security_level);
 #endif
+
+    pjmedia_event_subscription_init(&call_med->esub, &call_media_on_event,
+                                    call_med);
 
     return PJ_SUCCESS;
@@ -2170,10 +2189,4 @@
 }
 
-
-pj_status_t video_channel_update(pjsua_call_media *call_med,
-                                 pj_pool_t *tmp_pool,
-			         const pjmedia_sdp_session *local_sdp,
-			         const pjmedia_sdp_session *remote_sdp);
-
 pj_status_t pjsua_media_channel_update(pjsua_call_id call_id,
 				       const pjmedia_sdp_session *local_sdp,
Index: pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_vid.c
===================================================================
--- pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_vid.c	(revision 3651)
+++ pjproject/branches/projects/2.0-dev/pjsip/src/pjsua-lib/pjsua_vid.c	(revision 3652)
@@ -631,4 +631,9 @@
 	    if (status != PJ_SUCCESS)
 		return status;
+
+	    /* Register to video events */
+	    pjmedia_event_subscribe(
+		    pjmedia_vid_port_get_event_publisher(w->vp_rend),
+		    &call_med->esub);
 
 	    w = &pjsua_var.win[wid];
@@ -1122,12 +1127,4 @@
 }
 
-
-pj_status_t pjsua_call_media_init(pjsua_call_media *call_med,
-                                  pjmedia_type type,
-				  const pjsua_transport_config *tcfg,
-				  int security_level,
-				  int *sip_err_code);
-
-
 /* Add a new video stream into a call */
 static pj_status_t call_add_video(pjsua_call *call,
