Ignore:
Timestamp:
Jun 9, 2011 4:08:47 AM (9 years ago)
Author:
ming
Message:

Re #1292: Make sure each video device and video port instance is always unidirectional

File:
1 edited

Legend:

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

    r3578 r3580  
    392392 
    393393    pj_bzero(param, sizeof(*param)); 
    394     if (di->info.dir == PJMEDIA_DIR_CAPTURE_RENDER) { 
    395         param->dir = PJMEDIA_DIR_CAPTURE_RENDER; 
    396         param->cap_id = index; 
    397         param->rend_id = index; 
    398     } else if (di->info.dir & PJMEDIA_DIR_CAPTURE) { 
    399         param->dir = PJMEDIA_DIR_CAPTURE; 
    400         param->cap_id = index; 
    401         param->rend_id = PJMEDIA_VID_INVALID_DEV; 
    402     } else if (di->info.dir & PJMEDIA_DIR_RENDER) { 
    403         param->dir = PJMEDIA_DIR_RENDER; 
    404         param->rend_id = index; 
    405         param->cap_id = PJMEDIA_VID_INVALID_DEV; 
    406     } else { 
    407         return PJMEDIA_EVID_INVDEV; 
    408     } 
     394    param->dir = PJMEDIA_DIR_RENDER; 
     395    param->rend_id = index; 
     396    param->cap_id = PJMEDIA_VID_INVALID_DEV; 
    409397 
    410398    /* Set the device capabilities here */ 
     
    412400    param->fmt.type = PJMEDIA_TYPE_VIDEO; 
    413401    param->clock_rate = DEFAULT_CLOCK_RATE; 
    414     pjmedia_format_init_video(&param->fmt, sdl_fmts[0].fmt_id, 
    415                               DEFAULT_WIDTH, DEFAULT_HEIGHT, 
    416                               DEFAULT_FPS, 1); 
     402    pj_memcpy(&param->fmt, &di->info.fmt[0], sizeof(param->fmt)); 
    417403 
    418404    return PJ_SUCCESS; 
     
    10181004    pj_status_t status; 
    10191005 
     1006    PJ_ASSERT_RETURN(param->dir == PJMEDIA_DIR_RENDER, PJ_EINVAL); 
     1007 
    10201008    /* Create and Initialize stream descriptor */ 
    10211009    pool = pj_pool_create(sf->pf, "sdl-dev", 1000, 1000, NULL); 
     
    10271015    pj_memcpy(&strm->vid_cb, cb, sizeof(*cb)); 
    10281016    strm->user_data = user_data; 
    1029  
    1030     /* Create capture stream here */ 
    1031     if (param->dir & PJMEDIA_DIR_CAPTURE) { 
    1032     } 
    10331017 
    10341018    /* Create render stream here */ 
Note: See TracChangeset for help on using the changeset viewer.