- Timestamp:
- Oct 3, 2011 5:23:59 AM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/event.c
r3666 r3778 73 73 pjmedia_event_subscription *esub) 74 74 { 75 char epub_name[5]; 76 75 77 PJ_ASSERT_RETURN(epub && esub && esub->cb, PJ_EINVAL); 76 78 /* Must not currently subscribe to anything */ 77 79 PJ_ASSERT_RETURN(esub->subscribe_to == NULL, PJ_EINVALIDOP); 80 81 TRACE_((THIS_FILE, "Subscription to publisher %s", 82 pjmedia_fourcc_name(epub->sig, epub_name))); 78 83 79 84 pj_list_push_back(&epub->subscription_list, esub); … … 85 90 { 86 91 PJ_ASSERT_RETURN(esub, PJ_EINVAL); 92 87 93 if (esub->subscribe_to) { 94 char epub_name[5]; 95 TRACE_((THIS_FILE, "Unsubscription to publisher %s", 96 pjmedia_fourcc_name(esub->subscribe_to->sig, 97 epub_name))); 98 88 99 PJ_ASSERT_RETURN( 89 100 pj_list_find_node(&esub->subscribe_to->subscription_list, -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r3777 r3778 2039 2039 2040 2040 on_return: 2041 pjsip_dlg_dec_lock(dlg);2041 if (dlg) pjsip_dlg_dec_lock(dlg); 2042 2042 pj_log_pop_indent(); 2043 2043 return status; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r3777 r3778 1340 1340 #endif 1341 1341 1342 pjmedia_event_subscription_init(&call_med->esub_rend, &call_media_on_event,1343 call_med);1344 pjmedia_event_subscription_init(&call_med->esub_cap, &call_media_on_event,1345 call_med);1346 1347 1342 on_error: 1348 1343 if (status != PJ_SUCCESS && call_med->tp) { … … 1403 1398 call_med->strm.v.cap_dev = info.id; 1404 1399 } 1400 1401 /* Init event subscribtion */ 1402 pjmedia_event_subscription_init(&call_med->esub_rend, &call_media_on_event, 1403 call_med); 1404 pjmedia_event_subscription_init(&call_med->esub_cap, &call_media_on_event, 1405 call_med); 1405 1406 } 1406 1407 #endif -
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.