- Timestamp:
- Feb 23, 2006 2:09:10 AM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 3 added
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/build/pjmedia.dsp
r214 r222 109 109 # Begin Source File 110 110 111 SOURCE=..\src\pjmedia\file_port.c 112 # End Source File 113 # Begin Source File 114 111 115 SOURCE=..\src\pjmedia\g711.c 112 116 # End Source File … … 194 198 # Begin Source File 195 199 200 SOURCE=..\include\pjmedia\file_port.h 201 # End Source File 202 # Begin Source File 203 196 204 SOURCE=..\include\pjmedia\jbuf.h 197 205 # End Source File … … 243 251 244 252 SOURCE=..\include\pjmedia\vad.h 253 # End Source File 254 # Begin Source File 255 256 SOURCE=..\include\pjmedia\wave.h 245 257 # End Source File 246 258 # End Group -
pjproject/trunk/pjmedia/include/pjmedia.h
r205 r222 30 30 #include <pjmedia/endpoint.h> 31 31 #include <pjmedia/errno.h> 32 #include <pjmedia/file_port.h> 32 33 #include <pjmedia/jbuf.h> 33 34 #include <pjmedia/port.h> … … 38 39 #include <pjmedia/session.h> 39 40 #include <pjmedia/sound.h> 41 #include <pjmedia/wave.h> 40 42 41 43 #endif /* __PJMEDIA_H__ */ -
pjproject/trunk/pjmedia/include/pjmedia/conference.h
r205 r222 41 41 typedef struct pjmedia_conf_port_info 42 42 { 43 unsigned slot; 43 44 pj_str_t name; 44 45 pjmedia_port_op tx_setting; … … 151 152 /** 152 153 * Get port info. 154 * 155 * @param conf The conference bridge. 156 * @param slot Port index. 157 * @param info Pointer to receive the info. 158 * 159 * @return PJ_SUCCESS on success. 153 160 */ 154 161 PJ_DECL(pj_status_t) pjmedia_conf_get_port_info( pjmedia_conf *conf, 155 162 unsigned slot, 156 163 pjmedia_conf_port_info *info); 164 165 166 /** 167 * Get occupied ports info. 168 * 169 * @param conf The conference bridge. 170 * @param size On input, contains maximum number of infos 171 * to be retrieved. On output, contains the actual 172 * number of infos that have been copied. 173 * @param info Array of info. 174 * 175 * @return PJ_SUCCESS on success. 176 */ 177 PJ_DECL(pj_status_t) pjmedia_conf_get_ports_info(pjmedia_conf *conf, 178 unsigned *size, 179 pjmedia_conf_port_info info[]); 157 180 158 181 -
pjproject/trunk/pjmedia/include/pjmedia/errno.h
r215 r222 407 407 408 408 409 /************************************************************ 410 * FILE ERRORS 411 ***********************************************************/ 412 /** 413 * @hideinitializer 414 * Not a valid WAVE file. 415 */ 416 #define PJMEDIA_ENOTVALIDWAVE (PJMEDIA_ERRNO_START+180) /* 220180 */ 417 /** 418 * @hideinitializer 419 * Unsupported WAVE file. 420 */ 421 #define PJMEDIA_EWAVEUNSUPP (PJMEDIA_ERRNO_START+181) /* 220181 */ 422 /** 423 * @hideinitializer 424 * Wave file too short. 425 */ 426 #define PJMEDIA_EWAVETOOSHORT (PJMEDIA_ERRNO_START+182) /* 220182 */ 427 409 428 410 429 PJ_END_DECL -
pjproject/trunk/pjmedia/include/pjmedia/vad.h
r203 r222 23 23 /** 24 24 * @file vad.h 25 * @brief Voice Activity Detector.25 * @brief Simple, adaptive silence detector. 26 26 */ 27 27 #include <pjmedia/types.h> -
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r214 r222 600 600 conf_port = conf->ports[slot]; 601 601 602 info->slot = slot; 602 603 info->name = conf_port->name; 603 604 info->tx_setting = conf_port->tx_setting; … … 605 606 info->listener = conf_port->listeners; 606 607 608 return PJ_SUCCESS; 609 } 610 611 612 PJ_DEF(pj_status_t) pjmedia_conf_get_ports_info(pjmedia_conf *conf, 613 unsigned *size, 614 pjmedia_conf_port_info info[]) 615 { 616 unsigned i, count=0; 617 618 PJ_ASSERT_RETURN(conf && size && info, PJ_EINVAL); 619 620 for (i=0; i<conf->max_ports && count<*size; ++i) { 621 if (!conf->ports[i]) 622 continue; 623 624 pjmedia_conf_get_port_info(conf, i, &info[count]); 625 ++count; 626 } 627 628 *size = count; 607 629 return PJ_SUCCESS; 608 630 } -
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r215 r222 113 113 { PJMEDIA_ENCBITS, "Media ports have incompatible bits per sample" }, 114 114 { PJMEDIA_ENCBYTES, "Media ports have incompatible bytes per frame" }, 115 116 /* Media file errors: */ 117 { PJMEDIA_ENOTVALIDWAVE, "Not a valid WAVE file" }, 118 { PJMEDIA_EWAVEUNSUPP, "Unsupported WAVE file format" }, 119 { PJMEDIA_EWAVETOOSHORT, "WAVE file too short" }, 115 120 }; 116 121 -
pjproject/trunk/pjsip/src/pjsua/main.c
r215 r222 262 262 static void conf_list(void) 263 263 { 264 pjmedia_conf_port_info info;265 struct pjsua_inv_data *inv_data;264 unsigned i, count; 265 pjmedia_conf_port_info info[16]; 266 266 267 267 printf("Conference ports:\n"); 268 268 269 inv_data = pjsua.inv_list.next; 270 while (inv_data != &pjsua.inv_list) { 269 count = PJ_ARRAY_SIZE(info); 270 pjmedia_conf_get_ports_info(pjsua.mconf, &count, info); 271 for (i=0; i<count; ++i) { 272 char txlist[80]; 273 unsigned j; 274 pjmedia_conf_port_info *port_info = &info[i]; 271 275 272 pjmedia_conf_get_port_info(pjsua.mconf, inv_data->conf_slot, &info); 273 274 printf("Port %2d %.*s\n", inv_data->conf_slot, 275 (int)info.name.slen, info.name.ptr); 276 277 inv_data = inv_data->next; 278 } 276 txlist[0] = '\0'; 277 for (j=0; j<pjsua.max_ports; ++j) { 278 char s[10]; 279 if (port_info->listener[j]) { 280 pj_sprintf(s, "#%d ", j); 281 pj_ansi_strcat(txlist, s); 282 } 283 } 284 printf("Port #%02d %20.*s tx to: %s\n", 285 port_info->slot, 286 (int)port_info->name.slen, 287 port_info->name.ptr, 288 txlist); 289 290 } 291 puts(""); 279 292 } 280 293 -
pjproject/trunk/pjsip/src/pjsua/pjsua.h
r212 r222 116 116 117 117 pjmedia_endpt *med_endpt; /**< Media endpoint. */ 118 unsigned max_ports; /**< Max ports in conf. */ 118 119 pjmedia_conf *mconf; /**< Media conference. */ 119 120 pj_bool_t null_audio; /**< Null audio flag. */ 121 char *wav_file; /**< WAV file name to play. */ 122 unsigned wav_slot; /**< WAV player slot in bridge */ 120 123 121 124 -
pjproject/trunk/pjsip/src/pjsua/pjsua_core.c
r220 r222 76 76 77 77 pjsua.reg_timeout = 55; 78 79 /* Default maximum conference ports: */ 80 81 pjsua.max_ports = 8; 78 82 79 83 /* Init route set list: */ … … 518 522 /* Init conference bridge. */ 519 523 520 status = pjmedia_conf_create(pjsua.pool, 8, 8000, 160, 16, &pjsua.mconf); 524 status = pjmedia_conf_create(pjsua.pool, pjsua.max_ports, 525 8000, 160, 16, &pjsua.mconf); 521 526 if (status != PJ_SUCCESS) { 522 527 pj_caching_pool_destroy(&pjsua.cp); … … 554 559 pjsip_transport *udp_transport; 555 560 pj_status_t status = PJ_SUCCESS; 561 562 /* Create WAV file player if required: */ 563 564 if (pjsua.wav_file) { 565 pjmedia_port *port; 566 pj_str_t port_name; 567 568 /* Create the file player port. */ 569 status = pjmedia_file_player_port_create( pjsua.pool, pjsua.wav_file, 570 0, -1, NULL, &port); 571 if (status != PJ_SUCCESS) { 572 pjsua_perror(THIS_FILE, 573 "Error playing media file", 574 status); 575 return status; 576 } 577 578 /* Add port to conference bridge: */ 579 status = pjmedia_conf_add_port(pjsua.mconf, pjsua.pool, port, 580 pj_cstr(&port_name, pjsua.wav_file), 581 &pjsua.wav_slot); 582 if (status != PJ_SUCCESS) { 583 pjsua_perror(THIS_FILE, 584 "Unable to add file player to conference bridge", 585 status); 586 return status; 587 } 588 } 589 556 590 557 591 /* Init sockets (STUN etc): */ -
pjproject/trunk/pjsip/src/pjsua/pjsua_opt.c
r197 r222 56 56 puts("Media options:"); 57 57 puts(" --null-audio Use NULL audio device"); 58 puts(" --wav-file=file Play WAV file in conference bridge"); 59 puts(""); 58 60 //puts(""); 59 61 //puts("User Agent options:"); … … 197 199 OPT_USE_STUN1, OPT_USE_STUN2, 198 200 OPT_ADD_BUDDY, OPT_OFFER_X_MS_MSG, OPT_NO_PRESENCE, 199 OPT_AUTO_ANSWER, OPT_AUTO_HANGUP };201 OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_WAV_FILE}; 200 202 struct option long_options[] = { 201 203 { "config-file",1, 0, OPT_CONFIG_FILE}, … … 223 225 { "auto-answer",1, 0, OPT_AUTO_ANSWER}, 224 226 { "auto-hangup",1, 0, OPT_AUTO_HANGUP}, 227 { "wav-file", 1, 0, OPT_WAV_FILE}, 225 228 { NULL, 0, 0, 0} 226 229 }; … … 405 408 } 406 409 pjsua.buddies[pjsua.buddy_cnt++].uri = pj_str(optarg); 410 break; 411 412 case OPT_WAV_FILE: 413 pjsua.wav_file = optarg; 407 414 break; 408 415 }
Note: See TracChangeset
for help on using the changeset viewer.