Changeset 3778 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
- Timestamp:
- Oct 3, 2011 5:23:59 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r3776 r3778 24 24 #if PJSUA_HAS_VIDEO 25 25 26 #define ENABLE_EVENT 026 #define ENABLE_EVENT 1 27 27 #define VID_TEE_MAX_PORT (PJSUA_MAX_CALLS + 1) 28 28 … … 972 972 pj_log_push_indent(); 973 973 974 /* Unsubscribe events */975 pjmedia_event_unsubscribe(&call_med->esub_rend);976 pjmedia_event_unsubscribe(&call_med->esub_cap);977 978 974 if (call_med->strm.v.cap_win_id != PJSUA_INVALID_ID) { 979 975 pjmedia_port *media_port; 980 pjsua_vid_win *w = 981 &pjsua_var.win[call_med->strm.v.cap_win_id]; 976 pjsua_vid_win *w = &pjsua_var.win[call_med->strm.v.cap_win_id]; 982 977 pj_status_t status; 978 979 /* Stop the capture before detaching stream and unsubscribing event */ 980 pjmedia_vid_port_stop(w->vp_cap); 983 981 984 982 /* Disconnect video stream from capture device */ … … 987 985 &media_port); 988 986 if (status == PJ_SUCCESS) { 989 /* Video tee is not threadsafe, so stop the capture first */990 pjmedia_vid_port_stop(w->vp_cap);991 987 pjmedia_vid_tee_remove_dst_port(w->tee, media_port); 988 } 989 990 /* Unsubscribe event */ 991 pjmedia_event_unsubscribe(&call_med->esub_cap); 992 993 /* Re-start capture again, if it is used by other stream */ 994 if (w->ref_cnt > 1) 992 995 pjmedia_vid_port_start(w->vp_cap); 993 }994 996 995 997 dec_vid_win(call_med->strm.v.cap_win_id); … … 998 1000 999 1001 if (call_med->strm.v.rdr_win_id != PJSUA_INVALID_ID) { 1002 pjsua_vid_win *w = &pjsua_var.win[call_med->strm.v.rdr_win_id]; 1003 1004 /* Stop the render before unsubscribing event */ 1005 pjmedia_vid_port_stop(w->vp_rend); 1006 pjmedia_event_unsubscribe(&call_med->esub_rend); 1007 1000 1008 dec_vid_win(call_med->strm.v.rdr_win_id); 1001 1009 call_med->strm.v.rdr_win_id = PJSUA_INVALID_ID; … … 1840 1848 1841 1849 if (w->vp_rend) { 1842 #if ENABLE_EVENT1843 pjmedia_event_subscribe(1844 pjmedia_vid_port_get_event_publisher(w->vp_rend),1845 &call_med->esub_cap);1846 #endif1847 1848 1850 /* Start renderer */ 1849 1851 status = pjmedia_vid_port_start(new_w->vp_rend); … … 1851 1853 goto on_error; 1852 1854 } 1855 1856 #if ENABLE_EVENT 1857 pjmedia_event_subscribe( 1858 pjmedia_vid_port_get_event_publisher(new_w->vp_cap), 1859 &call_med->esub_cap); 1860 #endif 1853 1861 1854 1862 /* Start capturer */
Note: See TracChangeset
for help on using the changeset viewer.