Changeset 3664 for pjproject/trunk/pjsip-apps/src/samples/jbsim.c
- Timestamp:
- Jul 19, 2011 3:42:28 AM (13 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk
- Property svn:mergeinfo changed
-
pjproject/trunk/pjsip-apps/src/samples/jbsim.c
r3553 r3664 473 473 474 474 /* Register codecs */ 475 #if defined(PJMEDIA_HAS_GSM_CODEC) && PJMEDIA_HAS_GSM_CODEC != 0 476 pjmedia_codec_gsm_init(g_app.endpt); 477 #endif 478 #if defined(PJMEDIA_HAS_G711_CODEC) && PJMEDIA_HAS_G711_CODEC!=0 479 pjmedia_codec_g711_init(g_app.endpt); 480 #endif 481 #if defined(PJMEDIA_HAS_SPEEX_CODEC) && PJMEDIA_HAS_SPEEX_CODEC!=0 482 pjmedia_codec_speex_init(g_app.endpt, 0, PJMEDIA_CODEC_SPEEX_DEFAULT_QUALITY, 483 PJMEDIA_CODEC_SPEEX_DEFAULT_COMPLEXITY); 484 #endif 485 #if defined(PJMEDIA_HAS_G722_CODEC) && (PJMEDIA_HAS_G722_CODEC != 0) 486 pjmedia_codec_g722_init(g_app.endpt); 487 #endif 488 #if defined(PJMEDIA_HAS_ILBC_CODEC) && PJMEDIA_HAS_ILBC_CODEC != 0 489 /* Init ILBC with mode=20 to make the losts occur at the same 490 * places as other codecs. 491 */ 492 pjmedia_codec_ilbc_init(g_app.endpt, 20); 493 #endif 494 #if defined(PJMEDIA_HAS_INTEL_IPP) && PJMEDIA_HAS_INTEL_IPP != 0 495 pjmedia_codec_ipp_init(g_app.endpt); 496 #endif 497 #if defined(PJMEDIA_HAS_L16_CODEC) && PJMEDIA_HAS_L16_CODEC != 0 498 pjmedia_codec_l16_init(g_app.endpt, 0); 499 #endif 475 pjmedia_codec_register_audio_codecs(g_app.endpt, NULL); 500 476 501 477 /* Create the loop transport */ … … 531 507 532 508 /* Make sure stream and WAV parameters match */ 533 if ( g_app.tx_wav->info.clock_rate != g_app.tx->port->info.clock_rate||534 g_app.tx_wav->info.channel_count != g_app.tx->port->info.channel_count)509 if (PJMEDIA_PIA_SRATE(&g_app.tx_wav->info) != PJMEDIA_PIA_SRATE(&g_app.tx->port->info) || 510 PJMEDIA_PIA_CCNT(&g_app.tx_wav->info) != PJMEDIA_PIA_CCNT(&g_app.tx->port->info)) 535 511 { 536 512 jbsim_perror("Error: Input WAV file has different clock rate " … … 555 531 status = pjmedia_wav_writer_port_create(g_app.pool, 556 532 g_app.cfg.rx_wav_out, 557 g_app.rx->port->info.clock_rate,558 g_app.rx->port->info.channel_count,559 g_app.rx->port->info.samples_per_frame,560 g_app.rx->port->info.bits_per_sample,533 PJMEDIA_PIA_SRATE(&g_app.rx->port->info), 534 PJMEDIA_PIA_CCNT(&g_app.rx->port->info), 535 PJMEDIA_PIA_SPF(&g_app.rx->port->info), 536 PJMEDIA_PIA_BITS(&g_app.rx->port->info), 561 537 0, 562 538 0, … … 571 547 g_app.framebuf = (pj_int16_t*) 572 548 pj_pool_alloc(g_app.pool, 573 MAX( g_app.rx->port->info.samples_per_frame,574 g_app.tx->port->info.samples_per_frame) * sizeof(pj_int16_t));549 MAX(PJMEDIA_PIA_SPF(&g_app.rx->port->info), 550 PJMEDIA_PIA_SPF(&g_app.tx->port->info)) * sizeof(pj_int16_t)); 575 551 576 552 … … 595 571 frame.type = PJMEDIA_FRAME_TYPE_AUDIO; 596 572 frame.buf = g_app.framebuf; 597 frame.size = dst->info.samples_per_frame* 2;573 frame.size = PJMEDIA_PIA_SPF(&dst->info) * 2; 598 574 599 575 status = pjmedia_port_get_frame(src, &frame); … … 602 578 if (status!= PJ_SUCCESS || frame.type != PJMEDIA_FRAME_TYPE_AUDIO) { 603 579 frame.buf = g_app.framebuf; 604 pjmedia_zero_samples(g_app.framebuf, src->info.samples_per_frame);605 frame.size = src->info.samples_per_frame* 2;580 pjmedia_zero_samples(g_app.framebuf, PJMEDIA_PIA_SPF(&src->info)); 581 frame.size = PJMEDIA_PIA_SPF(&src->info) * 2; 606 582 if (has_frame) 607 583 *has_frame = PJ_FALSE; … … 629 605 630 606 /* packet interval, without jitter */ 631 pkt_interval = port->info.samples_per_frame* 1000 /632 port->info.clock_rate;607 pkt_interval = PJMEDIA_PIA_SPF(&port->info) * 1000 / 608 PJMEDIA_PIA_SRATE(&port->info); 633 609 634 610 while (PJ_TIME_VAL_GTE(*t, strm->state.tx.next_schedule)) { … … 778 754 long pkt_interval; 779 755 780 pkt_interval = port->info.samples_per_frame* 1000 /781 port->info.clock_rate*756 pkt_interval = PJMEDIA_PIA_SPF(&port->info) * 1000 / 757 PJMEDIA_PIA_SRATE(&port->info) * 782 758 g_app.cfg.rx_snd_burst; 783 759
Note: See TracChangeset
for help on using the changeset viewer.