Changeset 3893 for pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
- Timestamp:
- Dec 1, 2011 10:49:07 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_vid.c
r3891 r3893 58 58 } 59 59 60 status = pjmedia_event_mgr_create(pjsua_var.pool, 0, NULL); 61 if (status != PJ_SUCCESS) { 62 PJ_PERROR(1,(THIS_FILE, status, 63 "Error creating PJMEDIA event manager")); 64 goto on_error; 65 } 66 60 67 status = pjmedia_vid_codec_mgr_create(pjsua_var.pool, NULL); 61 68 if (status != PJ_SUCCESS) { … … 130 137 if (pjmedia_converter_mgr_instance()) 131 138 pjmedia_converter_mgr_destroy(NULL); 139 140 if (pjmedia_event_mgr_instance()) 141 pjmedia_event_mgr_destroy(NULL); 132 142 133 143 if (pjmedia_video_format_mgr_instance()) … … 614 624 615 625 if (w->vp_cap) { 626 pjmedia_event_unsubscribe(NULL, &call_media_on_event, NULL, 627 w->vp_cap); 616 628 pjmedia_vid_port_stop(w->vp_cap); 617 629 pjmedia_vid_port_disconnect(w->vp_cap); … … 619 631 } 620 632 if (w->vp_rend) { 633 pjmedia_event_unsubscribe(NULL, &call_media_on_event, NULL, 634 w->vp_rend); 621 635 pjmedia_vid_port_stop(w->vp_rend); 622 636 pjmedia_vid_port_destroy(w->vp_rend); … … 816 830 #if ENABLE_EVENT 817 831 /* Register to video events */ 818 pjmedia_event_subscribe( 819 pjmedia_vid_port_get_event_publisher(w->vp_rend), 820 &call_med->esub_rend); 832 pjmedia_event_subscribe(NULL, w->pool, &call_media_on_event, 833 call_med, w->vp_rend); 821 834 #endif 822 835 … … 887 900 w = &pjsua_var.win[wid]; 888 901 #if ENABLE_EVENT 889 pjmedia_event_subscribe( 890 pjmedia_vid_port_get_event_publisher(w->vp_cap), 891 &call_med->esub_cap); 902 pjmedia_event_subscribe(NULL, w->pool, &call_media_on_event, 903 call_med, w->vp_cap); 892 904 #endif 893 905 … … 1007 1019 1008 1020 /* Unsubscribe event */ 1009 pjmedia_event_unsubscribe(&call_med->esub_cap); 1021 pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, 1022 w->vp_cap); 1010 1023 1011 1024 /* Re-start capture again, if it is used by other stream */ … … 1022 1035 /* Stop the render before unsubscribing event */ 1023 1036 pjmedia_vid_port_stop(w->vp_rend); 1024 pjmedia_event_unsubscribe(&call_med->esub_rend); 1037 pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, 1038 w->vp_rend); 1025 1039 1026 1040 dec_vid_win(call_med->strm.v.rdr_win_id); … … 1836 1850 return status; 1837 1851 1838 pjmedia_event_unsubscribe(&call_med->esub_cap); 1852 pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, 1853 w->vp_cap); 1839 1854 1840 1855 /* temporarily disconnect while we operate on the tee. */ … … 1894 1909 1895 1910 #if ENABLE_EVENT 1896 pjmedia_event_subscribe( 1897 pjmedia_vid_port_get_event_publisher(new_w->vp_cap), 1898 &call_med->esub_cap); 1911 pjmedia_event_subscribe(NULL, new_w->pool, &call_media_on_event, 1912 call_med, new_w->vp_cap); 1899 1913 #endif 1900 1914 … … 1920 1934 if (new_w) { 1921 1935 /* Unsubscribe, just in case */ 1922 pjmedia_event_unsubscribe(&call_med->esub_cap); 1936 pjmedia_event_unsubscribe(NULL, &call_media_on_event, call_med, 1937 new_w->vp_cap); 1923 1938 /* Disconnect media port from the new capturer */ 1924 1939 pjmedia_vid_tee_remove_dst_port(new_w->tee, media_port); … … 1936 1951 #if ENABLE_EVENT 1937 1952 /* Resubscribe */ 1938 pjmedia_event_subscribe( 1939 pjmedia_vid_port_get_event_publisher(w->vp_cap), 1940 &call_med->esub_cap); 1953 pjmedia_event_subscribe(NULL, w->pool, &call_media_on_event, 1954 call_med, w->vp_cap); 1941 1955 #endif 1942 1956
Note: See TracChangeset
for help on using the changeset viewer.