Changeset 3772


Ignore:
Timestamp:
Sep 23, 2011 4:00:27 AM (8 years ago)
Author:
nanang
Message:

Closes #1377: fixed video stream cleanup to reset back cap_win_id & rdr_win_id value to PJSUA_INVALID_ID after capture/render device released from the call stream.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c

    r3763 r3772  
    980980        pjsua_vid_win *w = 
    981981                    &pjsua_var.win[call_med->strm.v.cap_win_id]; 
    982  
    983         pjmedia_vid_stream_get_port(call_med->strm.v.stream, 
    984                                     PJMEDIA_DIR_ENCODING, 
    985                                     &media_port); 
    986         pj_assert(media_port); 
    987  
    988         pjmedia_vid_port_stop(w->vp_cap); 
    989         pjmedia_vid_tee_remove_dst_port(w->tee, media_port); 
    990         pjmedia_vid_port_start(w->vp_cap); 
     982        pj_status_t status; 
     983 
     984        /* Disconnect video stream from capture device */ 
     985        status = pjmedia_vid_stream_get_port(call_med->strm.v.stream, 
     986                                             PJMEDIA_DIR_ENCODING, 
     987                                             &media_port); 
     988        if (status == PJ_SUCCESS) { 
     989            /* Video tee is not threadsafe, so stop the capture first */ 
     990            pjmedia_vid_port_stop(w->vp_cap); 
     991            pjmedia_vid_tee_remove_dst_port(w->tee, media_port); 
     992            pjmedia_vid_port_start(w->vp_cap); 
     993        } 
    991994 
    992995        dec_vid_win(call_med->strm.v.cap_win_id); 
     996        call_med->strm.v.cap_win_id = PJSUA_INVALID_ID; 
    993997    } 
    994998 
    995999    if (call_med->strm.v.rdr_win_id != PJSUA_INVALID_ID) { 
    9961000        dec_vid_win(call_med->strm.v.rdr_win_id); 
     1001        call_med->strm.v.rdr_win_id = PJSUA_INVALID_ID; 
    9971002    } 
    9981003 
Note: See TracChangeset for help on using the changeset viewer.