Changeset 3787 for pjproject


Ignore:
Timestamp:
Oct 4, 2011 1:35:41 PM (13 years ago)
Author:
bennylp
Message:

More re #1362: actually try to use the device switching capability in pjsua-lib, in pjsua_call_set_vid_strm(PJSUA_CALL_VID_STRM_CHANGE_CAP_DEV) operation

Location:
pjproject/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/include/pjmedia-videodev/videodev.h

    r3781 r3787  
    9898/** 
    9999 * Parameter for switching device with PJMEDIA_VID_DEV_CAP_SWITCH capability. 
     100 * Initialize this with pjmedia_vid_dev_switch_param_default() 
    100101 */ 
    101102typedef struct pjmedia_vid_dev_switch_param 
     
    431432(*pjmedia_vid_dev_factory_create_func_ptr)(pj_pool_factory*); 
    432433 
     434/** 
     435 * Initialize pjmedia_vid_dev_switch_param. 
     436 * 
     437 * @param p         Parameter to be initialized. 
     438 */ 
     439PJ_INLINE(void) 
     440pjmedia_vid_dev_switch_param_default(pjmedia_vid_dev_switch_param *p) 
     441{ 
     442    pj_bzero(p, sizeof(*p)); 
     443    p->target_id = PJMEDIA_VID_INVALID_DEV; 
     444} 
    433445 
    434446/** 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c

    r3786 r3787  
    17571757{ 
    17581758    pjsua_call_media *call_med; 
     1759    pjmedia_vid_dev_stream *old_dev; 
     1760    pjmedia_vid_dev_switch_param switch_prm; 
    17591761    pjmedia_vid_dev_info info; 
    17601762    pjsua_vid_win *w, *new_w = NULL; 
     
    17951797    pj_assert(w->type == PJSUA_WND_TYPE_PREVIEW && w->vp_cap); 
    17961798 
     1799    /* If the old device supports fast switching, then that's excellent! */ 
     1800    old_dev = pjmedia_vid_port_get_stream(w->vp_cap); 
     1801    pjmedia_vid_dev_switch_param_default(&switch_prm); 
     1802    switch_prm.target_id = cap_dev; 
     1803    status = pjmedia_vid_dev_stream_set_cap(old_dev, 
     1804                                            PJMEDIA_VID_DEV_CAP_SWITCH, 
     1805                                            &switch_prm); 
     1806    if (status == PJ_SUCCESS) { 
     1807        w->preview_cap_id = cap_dev; 
     1808        return PJ_SUCCESS; 
     1809    } 
     1810 
     1811    /* No it doesn't support fast switching. Do slow switching then.. */ 
    17971812    status = pjmedia_vid_stream_get_port(call_med->strm.v.stream, 
    17981813                                         PJMEDIA_DIR_ENCODING, &media_port); 
Note: See TracChangeset for help on using the changeset viewer.