Index: pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/videoport.h
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/videoport.h	(revision 3458)
+++ pjproject/branches/projects/2.0-dev/pjmedia/include/pjmedia/videoport.h	(revision 3459)
@@ -57,4 +57,6 @@
      * calls pjmedia_port_put_frame() or pjmedia_port_get_frame() to that
      * media port.
+     *
+     * Default: PJ_TRUE
      */
     pj_bool_t		active;
@@ -69,5 +71,6 @@
 /**
  * Initialize the parameter with the default values. Note that this typically
- * would only fill the structure to zeroes.
+ * would only fill the structure to zeroes unless they have different default
+ * values.
  *
  * @param prm	The parameter.
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 3458)
+++ pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/colorbar_dev.c	(revision 3459)
@@ -92,4 +92,6 @@
     pjmedia_video_apply_fmt_param    vafp;
     pj_uint8_t                      *first_line[PJMEDIA_MAX_VIDEO_PLANES];
+    pj_timestamp		     ts;
+    unsigned			     ts_inc;
 };
 
@@ -186,8 +188,8 @@
     ddi = &cf->dev_info[0];
     pj_bzero(ddi, sizeof(*ddi));
-    strncpy(ddi->info.name, "Colorbar generator",
-            sizeof(ddi->info.name));
+    pj_ansi_strncpy(ddi->info.name, "Colorbar generator",
+		    sizeof(ddi->info.name));
     ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0';
-    strncpy(ddi->info.driver, "Colorbar", sizeof(ddi->info.driver));
+    pj_ansi_strncpy(ddi->info.driver, "Colorbar", sizeof(ddi->info.driver));
     ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0';
     ddi->info.dir = PJMEDIA_DIR_CAPTURE;
@@ -206,6 +208,9 @@
     }
 
-    PJ_LOG(4, (THIS_FILE, "Colorbar video src initialized with %d devices:",
+    PJ_LOG(4, (THIS_FILE, "Colorbar video src initialized with %d device(s):",
 	       cf->dev_count));
+    for (i = 0; i < cf->dev_count; i++) {
+	PJ_LOG(4, (THIS_FILE, "%2d: %s", i, cf->dev_info[i].info.name));
+    }
 
     return PJ_SUCCESS;
@@ -366,4 +371,5 @@
     pj_pool_t *pool;
     struct cbar_stream *strm;
+    const pjmedia_video_format_detail *vfd;
     const pjmedia_video_format_info *vfi;
     pjmedia_video_apply_fmt_param vafp;
@@ -378,4 +384,5 @@
     pj_bzero(&vafp, sizeof(vafp));
 
+    vfd = pjmedia_format_get_video_format_detail(&param->fmt, PJ_TRUE);
     vfi = pjmedia_get_video_format_info(NULL, param->fmt.id);
     cbfi = get_cbar_fmt_info(param->fmt.id);
@@ -399,4 +406,5 @@
     strm->cbfi = cbfi;
     pj_memcpy(&strm->vafp, &vafp, sizeof(vafp));
+    strm->ts_inc = PJMEDIA_SPF2(param->clock_rate, &vfd->fps, 1);
 
     for (i = 0; i < vfi->plane_cnt; ++i) {
@@ -560,4 +568,6 @@
     struct cbar_stream *stream = (struct cbar_stream*)strm;
 
+    frame->timestamp = stream->ts;
+    stream->ts.u64 += stream->ts_inc;
     return spectrum_run(stream, frame->buf, frame->size);
 }
Index: pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/dshow_dev.c
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/dshow_dev.c	(revision 3458)
+++ pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/dshow_dev.c	(revision 3459)
@@ -66,4 +66,5 @@
     {PJMEDIA_FORMAT_RGB24, &MEDIASUBTYPE_RGB24} ,
     {PJMEDIA_FORMAT_RGB32, &MEDIASUBTYPE_RGB32} ,
+    //{PJMEDIA_FORMAT_IYUV, &MEDIASUBTYPE_IYUV} ,
 };
 
@@ -113,4 +114,7 @@
         AM_MEDIA_TYPE       *mediatype;
     } dgraph[2];
+
+    pj_timestamp	     cap_ts;
+    unsigned		     cap_ts_inc;
 };
 
@@ -287,8 +291,8 @@
     ddi = &df->dev_info[df->dev_count++];
     pj_bzero(ddi, sizeof(*ddi));
-    strncpy(ddi->info.name,  "Video Mixing Renderer",
-            sizeof(ddi->info.name));
+    pj_ansi_strncpy(ddi->info.name,  "Video Mixing Renderer",
+                    sizeof(ddi->info.name));
     ddi->info.name[sizeof(ddi->info.name)-1] = '\0';
-    strncpy(ddi->info.driver, "dshow", sizeof(ddi->info.driver));
+    pj_ansi_strncpy(ddi->info.driver, "dshow", sizeof(ddi->info.driver));
     ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0';
     ddi->info.dir = PJMEDIA_DIR_RENDER;
@@ -410,5 +414,5 @@
     struct dshow_stream *strm = (struct dshow_stream*)user_data;
     unsigned char *buffer;
-    pjmedia_frame frame;
+    pjmedia_frame frame = {0};
 
     if (strm->quit_flag) {
@@ -435,4 +439,6 @@
     frame.size = IMediaSample_GetActualDataLength(pMediaSample);
     frame.bit_info = 0;
+    frame.timestamp = strm->cap_ts;
+    strm->cap_ts.u64 += strm->cap_ts_inc;
     if (strm->vid_cb.capture_cb)
         (*strm->vid_cb.capture_cb)(&strm->base, strm->user_data, &frame);
@@ -454,5 +460,5 @@
         if (stream->dgraph[i].csource_filter) {
             HRESULT hr = SourceFilter_Deliver(stream->dgraph[i].csource_filter,
-                frame->buf, frame->size);
+					      frame->buf, frame->size);
 
             if (FAILED(hr)) {
@@ -727,8 +733,13 @@
     /* Create capture stream here */
     if (param->dir & PJMEDIA_DIR_CAPTURE) {
+	const pjmedia_video_format_detail *vfd;
+
         status = create_filter_graph(PJMEDIA_DIR_CAPTURE, param->cap_id,
                                      df, strm, &strm->dgraph[ngraph++]);
         if (status != PJ_SUCCESS)
             goto on_error;
+	
+	vfd = pjmedia_format_get_video_format_detail(&param->fmt, PJ_TRUE);
+	strm->cap_ts_inc = PJMEDIA_SPF2(param->clock_rate, &vfd->fps, 1);
     }
 
Index: pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/ios_dev.m
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/ios_dev.m	(revision 3458)
+++ pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/ios_dev.m	(revision 3459)
@@ -93,4 +93,7 @@
     UIImageView		*imgView;
     void		*buf;
+    
+    pj_timestamp	 frame_ts;
+    unsigned		 ts_inc;
 };
 
@@ -356,7 +359,11 @@
     frame.size = stream->frame_size;
     frame.bit_info = 0;
+    frame.timestamp.u64 = stream->frame_ts.u64;
+    
     if (stream->vid_cb.capture_cb)
         (*stream->vid_cb.capture_cb)(&stream->base, stream->user_data, &frame);
 
+    stream->frame_ts.u64 += stream->ts_inc;
+    
     /* Unlock the pixel buffer */
     CVPixelBufferUnlockBaseAddress(imageBuffer,0);
@@ -386,5 +393,5 @@
     pj_pool_t *pool;
     struct ios_stream *strm;
-    pjmedia_video_format_detail *vfd;
+    const pjmedia_video_format_detail *vfd;
     const pjmedia_video_format_info *vfi;
     pj_status_t status = PJ_SUCCESS;
@@ -419,4 +426,5 @@
     strm->bytes_per_row = strm->size.w * strm->bpp / 8;
     strm->frame_size = strm->bytes_per_row * strm->size.h;
+    strm->ts_inc = PJMEDIA_SPF2(param->clock_rate, &vfd->fps, 1);
 
     /* Create capture stream here */
Index: pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/qt_dev.m
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/qt_dev.m	(revision 3458)
+++ pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/qt_dev.m	(revision 3459)
@@ -77,4 +77,7 @@
     pj_pool_t           *pool;              /**< Memory pool.          */
 
+    pj_timestamp	 cap_frame_ts;	    /**< Captured frame tstamp */
+    unsigned		 cap_ts_inc;	    /**< Increment	       */
+    
     pjmedia_vid_cb       vid_cb;            /**< Stream callback.      */
     void                *user_data;         /**< Application data.     */
@@ -322,7 +325,11 @@
     frame.size = size;
     frame.bit_info = 0;
+    frame.timestamp.u64 = stream->cap_frame_ts.u64;
+    
     if (stream->vid_cb.capture_cb)
         (*stream->vid_cb.capture_cb)(&stream->base, stream->user_data,
 				     &frame);
+    
+    stream->cap_frame_ts.u64 += stream->cap_ts_inc;
 }
 @end
@@ -380,5 +387,5 @@
     /* Create capture stream here */
     if (param->dir & PJMEDIA_DIR_CAPTURE) {
-	pjmedia_video_format_detail *vfd;
+	const pjmedia_video_format_detail *vfd;
 	qt_fmt_info *qfi = get_qt_format_info(param->fmt.id);
 	
@@ -438,4 +445,6 @@
 
 	pj_assert(vfd->fps.num);
+	strm->cap_ts_inc = PJMEDIA_SPF2(&strm->param.clock_rate, &vfd->fps, 1);
+	
 	[strm->video_output setMinimumVideoFrameInterval:
 			    (1.0f * vfd->fps.denum / (double)vfd->fps.num)];
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 3458)
+++ pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/v4l2_dev.c	(revision 3459)
@@ -677,6 +677,6 @@
     frame->type = PJMEDIA_FRAME_TYPE_VIDEO;
     frame->size = buf.bytesused;
-    frame->timestamp.u64 = PJ_TIME_VAL_MSEC(time) * stream->param.clock_rate
-			   / PJ_UINT64(1000);
+    frame->timestamp.u64 = PJ_UINT64(1) * PJ_TIME_VAL_MSEC(time) *
+			   stream->param.clock_rate / PJ_UINT64(1000);
     pj_memcpy(frame->buf, stream->buffers[buf.index].start, buf.bytesused);
 
Index: pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/videoport.c
===================================================================
--- pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/videoport.c	(revision 3458)
+++ pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia/videoport.c	(revision 3459)
@@ -101,4 +101,5 @@
 {
     pj_bzero(prm, sizeof(*prm));
+    prm->active = PJ_TRUE;
 }
 
