Changeset 867 for pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
- Timestamp:
- Dec 26, 2006 9:18:11 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
r807 r867 60 60 pj_pool_t *pool ); 61 61 static pj_status_t spx_codec_open( pjmedia_codec *codec, 62 pjmedia_codec_param *attr );62 const pjmedia_codec_param *attr ); 63 63 static pj_status_t spx_codec_close( pjmedia_codec *codec ); 64 static pj_status_t spx_codec_modify(pjmedia_codec *codec, 65 const pjmedia_codec_param *attr ); 64 66 static pj_status_t spx_codec_parse( pjmedia_codec *codec, 65 67 void *pkt, … … 86 88 &spx_codec_open, 87 89 &spx_codec_close, 90 &spx_codec_modify, 88 91 &spx_codec_parse, 89 92 &spx_codec_encode, … … 545 548 */ 546 549 static pj_status_t spx_codec_open( pjmedia_codec *codec, 547 pjmedia_codec_param *attr )550 const pjmedia_codec_param *attr ) 548 551 { 549 552 struct spx_private *spx; … … 552 555 spx = (struct spx_private*) codec->codec_data; 553 556 id = spx->param_id; 557 558 /* Only supports one frame per packet */ 559 PJ_ASSERT_RETURN(attr->setting.frm_per_pkt==1, PJ_EINVAL); 554 560 555 561 /* … … 626 632 speex_bits_destroy( &spx->dec_bits ); 627 633 } 634 635 return PJ_SUCCESS; 636 } 637 638 639 /* 640 * Modify codec settings. 641 */ 642 static pj_status_t spx_codec_modify(pjmedia_codec *codec, 643 const pjmedia_codec_param *attr ) 644 { 645 struct spx_private *spx; 646 int tmp; 647 648 spx = (struct spx_private*) codec->codec_data; 649 650 /* Only supports one frame per packet */ 651 PJ_ASSERT_RETURN(attr->setting.frm_per_pkt==1, PJ_EINVAL); 652 653 /* VAD */ 654 tmp = (attr->setting.vad != 0); 655 speex_encoder_ctl(spx->enc, SPEEX_SET_VAD, &tmp); 656 speex_encoder_ctl(spx->enc, SPEEX_SET_DTX, &tmp); 657 658 /* PENH */ 659 tmp = attr->setting.penh; 660 speex_decoder_ctl(spx->dec, SPEEX_SET_ENH, &tmp); 628 661 629 662 return PJ_SUCCESS;
Note: See TracChangeset
for help on using the changeset viewer.