Ignore:
Timestamp:
Mar 25, 2011 8:38:26 AM (14 years ago)
Author:
bennylp
Message:

Re #1213 (Video devices):

  • Video device now opens in "best effort" mode, i.e. it may open with different size and fps than requested. The actual size and fps will be reflected in the "param" upon return. The vidport must check this against any differences, and create converter accordingly.
  • Removed const for param argument in vid_create_stream() API
  • Currently converter in vidport will not work if vidport is opened in bidir. Converter for renderer is untested
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/2.0-dev/pjmedia/src/pjmedia-videodev/v4l2_dev.c

    r3459 r3489  
    129129                                                 pjmedia_vid_param *param); 
    130130static pj_status_t vid4lin_factory_create_stream(pjmedia_vid_dev_factory *f, 
    131                                                  const pjmedia_vid_param *prm, 
     131                                                 pjmedia_vid_param *prm, 
    132132                                                 const pjmedia_vid_cb *cb, 
    133133                                                 void *user_data, 
     
    412412                                        pj_uint32_t pix_fmt) 
    413413{ 
    414     const pjmedia_video_format_detail *vfd; 
     414    pjmedia_video_format_detail *vfd; 
    415415    struct v4l2_format v4l2_fmt; 
    416416    pj_status_t status; 
     
    438438        (v4l2_fmt.fmt.pix.height != vfd->size.h)) 
    439439    { 
    440         status = PJMEDIA_EVID_BADSIZE; 
    441         return status; 
     440        /* Size has changed */ 
     441        vfd->size.w = v4l2_fmt.fmt.pix.width; 
     442        vfd->size.h = v4l2_fmt.fmt.pix.height; 
    442443    } 
    443444 
     
    514515/* API: create stream */ 
    515516static pj_status_t vid4lin_factory_create_stream(pjmedia_vid_dev_factory *f, 
    516                                       const pjmedia_vid_param *param, 
     517                                      pjmedia_vid_param *param, 
    517518                                      const pjmedia_vid_cb *cb, 
    518519                                      void *user_data, 
     
    525526    const vid4lin_fmt_map *fmt_map; 
    526527    const pjmedia_video_format_info *fmt_info; 
     528    pjmedia_video_format_detail *vfd; 
    527529    pj_status_t status = PJ_SUCCESS; 
     530 
    528531 
    529532    PJ_ASSERT_RETURN(f && param && p_vid_strm, PJ_EINVAL); 
     
    539542 
    540543    vdi = &cf->dev_info[param->cap_id]; 
     544    vfd = pjmedia_format_get_video_format_detail(&param->fmt, PJ_TRUE); 
    541545 
    542546    /* Create and Initialize stream descriptor */ 
     
    552556    stream->user_data = user_data; 
    553557    stream->fd = INVALID_FD; 
    554  
    555     PJ_LOG(4,(THIS_FILE, "Opening video4linux2 device %s: format=%s..", 
    556               stream->name, fmt_info->name)); 
    557558 
    558559    stream->fd = v4l2_open(vdi->dev_name, O_RDWR | O_NONBLOCK, 0); 
Note: See TracChangeset for help on using the changeset viewer.