Changeset 5961


Ignore:
Timestamp:
Mar 29, 2019 1:52:59 AM (5 years ago)
Author:
ming
Message:

Fixed #2187: Avoid starting video capture if the setting vid_out_auto_transmit is false

Location:
pjproject/trunk/pjsip
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h

    r5939 r5961  
    411411    pj_bool_t                    preview_running;/**< Preview is started*/ 
    412412    pj_bool_t                    is_native;     /**< Preview is by dev  */ 
     413    pj_bool_t                    cap_started;   /**< Has the capture 
     414                                                     been started?      */ 
    413415} pjsua_vid_win; 
    414416 
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c

    r5960 r5961  
    11461146 
    11471147            /* Start capturer */ 
    1148             if (just_created) { 
     1148            if (just_created && acc->cfg.vid_out_auto_transmit) { 
    11491149                status = pjmedia_vid_port_start(w->vp_cap); 
    11501150                if (status != PJ_SUCCESS) { 
     
    11521152                    goto on_error; 
    11531153                } 
     1154                w->cap_started = PJ_TRUE; 
    11541155            } 
    11551156 
     
    22582259 
    22592260    if (enable) { 
    2260         /* Start stream in encoding direction */ 
     2261        pjsua_vid_win *w; 
     2262        pjsua_vid_win_id wid; 
     2263 
     2264        wid = vid_preview_get_win(call_med->strm.v.cap_dev, PJ_FALSE); 
     2265        pj_assert(wid != PJSUA_INVALID_ID); 
     2266 
     2267        w = &pjsua_var.win[wid]; 
     2268 
     2269        if (!w->cap_started) { 
     2270            /* Start the video capture first */ 
     2271            status = pjmedia_vid_port_start(w->vp_cap); 
     2272            if (status != PJ_SUCCESS) 
     2273                return status; 
     2274            w->cap_started = PJ_TRUE; 
     2275        } 
     2276         
     2277        /* Resume stream in encoding direction */ 
    22612278        status = pjmedia_vid_stream_resume(call_med->strm.v.stream, 
    22622279                                           PJMEDIA_DIR_ENCODING); 
Note: See TracChangeset for help on using the changeset viewer.