- 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/dshow_dev.c
r3420 r3459 66 66 {PJMEDIA_FORMAT_RGB24, &MEDIASUBTYPE_RGB24} , 67 67 {PJMEDIA_FORMAT_RGB32, &MEDIASUBTYPE_RGB32} , 68 //{PJMEDIA_FORMAT_IYUV, &MEDIASUBTYPE_IYUV} , 68 69 }; 69 70 … … 113 114 AM_MEDIA_TYPE *mediatype; 114 115 } dgraph[2]; 116 117 pj_timestamp cap_ts; 118 unsigned cap_ts_inc; 115 119 }; 116 120 … … 287 291 ddi = &df->dev_info[df->dev_count++]; 288 292 pj_bzero(ddi, sizeof(*ddi)); 289 strncpy(ddi->info.name, "Video Mixing Renderer",290 sizeof(ddi->info.name));293 pj_ansi_strncpy(ddi->info.name, "Video Mixing Renderer", 294 sizeof(ddi->info.name)); 291 295 ddi->info.name[sizeof(ddi->info.name)-1] = '\0'; 292 strncpy(ddi->info.driver, "dshow", sizeof(ddi->info.driver));296 pj_ansi_strncpy(ddi->info.driver, "dshow", sizeof(ddi->info.driver)); 293 297 ddi->info.driver[sizeof(ddi->info.driver)-1] = '\0'; 294 298 ddi->info.dir = PJMEDIA_DIR_RENDER; … … 410 414 struct dshow_stream *strm = (struct dshow_stream*)user_data; 411 415 unsigned char *buffer; 412 pjmedia_frame frame ;416 pjmedia_frame frame = {0}; 413 417 414 418 if (strm->quit_flag) { … … 435 439 frame.size = IMediaSample_GetActualDataLength(pMediaSample); 436 440 frame.bit_info = 0; 441 frame.timestamp = strm->cap_ts; 442 strm->cap_ts.u64 += strm->cap_ts_inc; 437 443 if (strm->vid_cb.capture_cb) 438 444 (*strm->vid_cb.capture_cb)(&strm->base, strm->user_data, &frame); … … 454 460 if (stream->dgraph[i].csource_filter) { 455 461 HRESULT hr = SourceFilter_Deliver(stream->dgraph[i].csource_filter, 456 462 frame->buf, frame->size); 457 463 458 464 if (FAILED(hr)) { … … 727 733 /* Create capture stream here */ 728 734 if (param->dir & PJMEDIA_DIR_CAPTURE) { 735 const pjmedia_video_format_detail *vfd; 736 729 737 status = create_filter_graph(PJMEDIA_DIR_CAPTURE, param->cap_id, 730 738 df, strm, &strm->dgraph[ngraph++]); 731 739 if (status != PJ_SUCCESS) 732 740 goto on_error; 741 742 vfd = pjmedia_format_get_video_format_detail(¶m->fmt, PJ_TRUE); 743 strm->cap_ts_inc = PJMEDIA_SPF2(param->clock_rate, &vfd->fps, 1); 733 744 } 734 745
Note: See TracChangeset
for help on using the changeset viewer.