- Timestamp:
- Mar 17, 2011 11:25:19 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/colorbar_dev.c
r3420 r3459 92 92 pjmedia_video_apply_fmt_param vafp; 93 93 pj_uint8_t *first_line[PJMEDIA_MAX_VIDEO_PLANES]; 94 pj_timestamp ts; 95 unsigned ts_inc; 94 96 }; 95 97 … … 186 188 ddi = &cf->dev_info[0]; 187 189 pj_bzero(ddi, sizeof(*ddi)); 188 strncpy(ddi->info.name, "Colorbar generator",189 190 pj_ansi_strncpy(ddi->info.name, "Colorbar generator", 191 sizeof(ddi->info.name)); 190 192 ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0'; 191 strncpy(ddi->info.driver, "Colorbar", sizeof(ddi->info.driver));193 pj_ansi_strncpy(ddi->info.driver, "Colorbar", sizeof(ddi->info.driver)); 192 194 ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0'; 193 195 ddi->info.dir = PJMEDIA_DIR_CAPTURE; … … 206 208 } 207 209 208 PJ_LOG(4, (THIS_FILE, "Colorbar video src initialized with %d device s:",210 PJ_LOG(4, (THIS_FILE, "Colorbar video src initialized with %d device(s):", 209 211 cf->dev_count)); 212 for (i = 0; i < cf->dev_count; i++) { 213 PJ_LOG(4, (THIS_FILE, "%2d: %s", i, cf->dev_info[i].info.name)); 214 } 210 215 211 216 return PJ_SUCCESS; … … 366 371 pj_pool_t *pool; 367 372 struct cbar_stream *strm; 373 const pjmedia_video_format_detail *vfd; 368 374 const pjmedia_video_format_info *vfi; 369 375 pjmedia_video_apply_fmt_param vafp; … … 378 384 pj_bzero(&vafp, sizeof(vafp)); 379 385 386 vfd = pjmedia_format_get_video_format_detail(¶m->fmt, PJ_TRUE); 380 387 vfi = pjmedia_get_video_format_info(NULL, param->fmt.id); 381 388 cbfi = get_cbar_fmt_info(param->fmt.id); … … 399 406 strm->cbfi = cbfi; 400 407 pj_memcpy(&strm->vafp, &vafp, sizeof(vafp)); 408 strm->ts_inc = PJMEDIA_SPF2(param->clock_rate, &vfd->fps, 1); 401 409 402 410 for (i = 0; i < vfi->plane_cnt; ++i) { … … 560 568 struct cbar_stream *stream = (struct cbar_stream*)strm; 561 569 570 frame->timestamp = stream->ts; 571 stream->ts.u64 += stream->ts_inc; 562 572 return spectrum_run(stream, frame->buf, frame->size); 563 573 }
Note: See TracChangeset
for help on using the changeset viewer.