- Timestamp:
- Sep 4, 2008 1:55:33 PM (16 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 added
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/build.symbian/pjmedia.mmp
r1979 r2262 68 68 SOURCE stream.c 69 69 SOURCE tonegen.c 70 SOURCE transport_adapter_sample.c 70 71 SOURCE transport_ice.c 71 72 SOURCE transport_udp.c -
pjproject/trunk/pjmedia/build/Makefile
r2232 r2262 58 58 sdp.o sdp_cmp.o sdp_neg.o \ 59 59 session.o silencedet.o sound_port.o stereo_port.o \ 60 stream.o tonegen.o transport_ice.o transport_loop.o \ 60 stream.o tonegen.o transport_adapter_sample.o \ 61 transport_ice.o transport_loop.o \ 61 62 transport_srtp.o transport_udp.o \ 62 63 wav_player.o wav_playlist.o wav_writer.o wave.o \ -
pjproject/trunk/pjmedia/build/pjmedia.dsp
r2198 r2262 258 258 # Begin Source File 259 259 260 SOURCE=..\src\pjmedia\transport_adapter_sample.c 261 # End Source File 262 # Begin Source File 263 260 264 SOURCE=..\src\pjmedia\transport_ice.c 261 265 # End Source File … … 439 443 440 444 SOURCE=..\include\pjmedia\transport.h 445 # End Source File 446 # Begin Source File 447 448 SOURCE=..\include\pjmedia\transport_adapter_sample.h 441 449 # End Source File 442 450 # Begin Source File -
pjproject/trunk/pjmedia/build/pjmedia.vcproj
r2104 r2262 971 971 </File> 972 972 <File 973 RelativePath="..\src\pjmedia\transport_adapter_sample.c" 974 > 975 </File> 976 <File 973 977 RelativePath="..\src\pjmedia\transport_ice.c" 974 978 > … … 1246 1250 </File> 1247 1251 <File 1252 RelativePath="..\include\pjmedia\transport_adapter_sample.h" 1253 > 1254 </File> 1255 <File 1248 1256 RelativePath="..\include\pjmedia\transport_ice.h" 1249 1257 > -
pjproject/trunk/pjmedia/include/pjmedia.h
r2101 r2262 59 59 #include <pjmedia/tonegen.h> 60 60 #include <pjmedia/transport.h> 61 #include <pjmedia/transport_adapter_sample.h> 61 62 #include <pjmedia/transport_ice.h> 62 63 #include <pjmedia/transport_loop.h> -
pjproject/trunk/pjmedia/include/pjmedia/transport.h
r2039 r2262 428 428 * transport. 429 429 */ 430 PJMEDIA_TRANSPORT_TYPE_SRTP 430 PJMEDIA_TRANSPORT_TYPE_SRTP, 431 432 /** 433 * Start of user defined transport. 434 */ 435 PJMEDIA_TRANSPORT_TYPE_USER 431 436 432 437 } pjmedia_transport_type; -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r2227 r2262 24 24 25 25 //#define STEREO_DEMO 26 //#define TRANSPORT_ADAPTER_SAMPLE 26 27 27 28 /* Ringtones US UK */ … … 132 133 #ifdef STEREO_DEMO 133 134 static void stereo_demo(); 135 #endif 136 #ifdef TRANSPORT_ADAPTER_SAMPLE 137 static pj_status_t transport_adapter_sample(void); 134 138 #endif 135 139 pj_status_t app_destroy(void); … … 4207 4211 4208 4212 /* Add RTP transports */ 4213 #ifdef TRANSPORT_ADAPTER_SAMPLE 4214 status = transport_adapter_sample(); 4215 4216 #else 4209 4217 status = pjsua_media_transports_create(&app_config.rtp_cfg); 4218 #endif 4210 4219 if (status != PJ_SUCCESS) 4211 4220 goto on_error; … … 4392 4401 #endif 4393 4402 4403 #ifdef TRANSPORT_ADAPTER_SAMPLE 4404 static pj_status_t create_transport_adapter(pjmedia_endpt *med_endpt, int port, 4405 pjmedia_transport **p_tp) 4406 { 4407 pjmedia_transport *udp; 4408 pj_status_t status; 4409 4410 /* Create the UDP media transport */ 4411 status = pjmedia_transport_udp_create(med_endpt, NULL, port, 0, &udp); 4412 if (status != PJ_SUCCESS) 4413 return status; 4414 4415 /* Create the adapter */ 4416 status = pjmedia_tp_adapter_create(med_endpt, NULL, udp, p_tp); 4417 if (status != PJ_SUCCESS) { 4418 pjmedia_transport_close(udp); 4419 return status; 4420 } 4421 4422 return PJ_SUCCESS; 4423 } 4424 4425 static pj_status_t transport_adapter_sample(void) 4426 { 4427 pjsua_media_transport tp[PJSUA_MAX_CALLS]; 4428 pj_status_t status; 4429 int port = 7000; 4430 unsigned i; 4431 4432 for (i=0; i<app_config.cfg.max_calls; ++i) { 4433 status = create_transport_adapter(pjsua_get_pjmedia_endpt(), 4434 port + i*10, 4435 &tp[i].transport); 4436 if (status != PJ_SUCCESS) 4437 return status; 4438 } 4439 4440 return pjsua_media_transports_attach(tp, i, PJ_TRUE); 4441 } 4442 #endif 4443 -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua_internal.h
r2241 r2262 80 80 pj_status_t med_tp_ready;/**< Media transport status. */ 81 81 pjmedia_transport *med_orig; /**< Original media transport */ 82 pj_bool_t med_tp_auto_del; /**< May delete media transport */ 82 83 pjsua_med_tp_st med_tp_st; /**< Media transport state */ 83 84 pj_timer_entry refresh_tm;/**< Timer to send re-INVITE. */ -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r2245 r2262 544 544 pjsua_media_channel_deinit(i); 545 545 } 546 if (pjsua_var.calls[i].med_tp ) {547 (*pjsua_var.calls[i].med_tp->op->destroy)(pjsua_var.calls[i].med_tp);548 pjsua_var.calls[i].med_tp = NULL;549 }546 if (pjsua_var.calls[i].med_tp && pjsua_var.calls[i].med_tp_auto_del) { 547 pjmedia_transport_close(pjsua_var.calls[i].med_tp); 548 } 549 pjsua_var.calls[i].med_tp = NULL; 550 550 } 551 551 … … 842 842 /* Delete existing media transports */ 843 843 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 844 if (pjsua_var.calls[i].med_tp != NULL) { 844 if (pjsua_var.calls[i].med_tp != NULL && 845 pjsua_var.calls[i].med_tp_auto_del) 846 { 845 847 pjmedia_transport_close(pjsua_var.calls[i].med_tp); 846 848 pjsua_var.calls[i].med_tp = NULL; … … 851 853 pjsua_transport_config_dup(pjsua_var.pool, &cfg, app_cfg); 852 854 855 /* Create the transports */ 853 856 if (pjsua_var.media_cfg.enable_ice) { 854 857 status = create_ice_media_transports(); … … 857 860 } 858 861 862 /* Set media transport auto_delete to True */ 863 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 864 pjsua_var.calls[i].med_tp_auto_del = PJ_TRUE; 865 } 859 866 860 867 PJSUA_UNLOCK(); 861 868 862 869 return status; 870 } 871 872 /* 873 * Attach application's created media transports. 874 */ 875 PJ_DEF(pj_status_t) pjsua_media_transports_attach(pjsua_media_transport tp[], 876 unsigned count, 877 pj_bool_t auto_delete) 878 { 879 unsigned i; 880 881 PJ_ASSERT_RETURN(tp && count==pjsua_var.ua_cfg.max_calls, PJ_EINVAL); 882 883 /* Assign the media transports */ 884 for (i=0; i<pjsua_var.ua_cfg.max_calls; ++i) { 885 if (pjsua_var.calls[i].med_tp != NULL && 886 pjsua_var.calls[i].med_tp_auto_del) 887 { 888 pjmedia_transport_close(pjsua_var.calls[i].med_tp); 889 } 890 891 pjsua_var.calls[i].med_tp = tp[i].transport; 892 pjsua_var.calls[i].med_tp_auto_del = auto_delete; 893 } 894 895 return PJ_SUCCESS; 863 896 } 864 897
Note: See TracChangeset
for help on using the changeset viewer.