Changeset 2363 for pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c
- Timestamp:
- Nov 11, 2008 11:25:13 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/ipp_codecs.c
r2359 r2363 230 230 5900, 12200, 4, 1, 1, 231 231 &predecode_amr, &parse_amr, &pack_amr 232 /*, {1, {{{"octet-align", 11}, {"1", 1}}} } */ 232 233 }, 233 234 # endif … … 424 425 425 426 typedef struct amr_settings_t { 426 pjmedia_codec_amr_ settingsenc_setting;427 pjmedia_codec_amr_ settingsdec_setting;427 pjmedia_codec_amr_pack_setting enc_setting; 428 pjmedia_codec_amr_pack_setting dec_setting; 428 429 pj_int8_t enc_mode; 429 430 } amr_settings_t; … … 442 443 pjmedia_frame frame; 443 444 pjmedia_codec_amr_bit_info *info; 444 pjmedia_codec_amr_ settings*setting;445 pjmedia_codec_amr_pack_setting *setting; 445 446 446 447 setting = &((amr_settings_t*)codec_data->codec_setting)->dec_setting; … … 492 493 pj_uint8_t *r; /* Read cursor */ 493 494 pj_uint8_t SID_FT; 494 pjmedia_codec_amr_ settings*setting;495 pjmedia_codec_amr_pack_setting *setting; 495 496 496 497 setting = &((amr_settings_t*)codec_data->codec_setting)->enc_setting; … … 540 541 { 541 542 amr_settings_t* s = (amr_settings_t*)codec_data->codec_setting; 542 pjmedia_codec_amr_ settings*setting;543 pjmedia_codec_amr_pack_setting *setting; 543 544 pj_status_t status; 544 pj_uint8_t CMR;545 pj_uint8_t cmr; 545 546 546 547 setting = &s->dec_setting; 547 548 548 549 status = pjmedia_codec_amr_parse(pkt, pkt_size, ts, setting, frames, 549 frame_cnt, & CMR);550 frame_cnt, &cmr); 550 551 if (status != PJ_SUCCESS) 551 552 return status; 552 553 553 554 /* Check Change Mode Request. */ 554 if ((setting->amr_nb && CMR <= 7) || (!setting->amr_nb && CMR<= 8)) {555 s->enc_mode = CMR;555 if ((setting->amr_nb && cmr <= 7) || (!setting->amr_nb && cmr <= 8)) { 556 s->enc_mode = cmr; 556 557 } 557 558 … … 1024 1025 if (ippc->pt == PJMEDIA_RTP_PT_AMR || ippc->pt == PJMEDIA_RTP_PT_AMRWB) { 1025 1026 amr_settings_t *s; 1027 pj_uint8_t octet_align = 0; 1028 const pj_str_t STR_FMTP_OCTET_ALIGN = {"octet-align", 11}; 1029 1030 /* Check octet-align */ 1031 for (i = 0; i < attr->setting.dec_fmtp.cnt; ++i) { 1032 if (pj_stricmp(&attr->setting.dec_fmtp.param[i].name, 1033 &STR_FMTP_OCTET_ALIGN) == 0) 1034 { 1035 octet_align=(pj_uint8_t) 1036 (pj_strtoul(&attr->setting.dec_fmtp.param[i].val)); 1037 break; 1038 } 1039 } 1026 1040 1027 1041 s = PJ_POOL_ZALLOC_T(pool, amr_settings_t); … … 1033 1047 1034 1048 s->enc_setting.amr_nb = ippc->pt == PJMEDIA_RTP_PT_AMR; 1035 s->enc_setting.octet_aligned = 0;1049 s->enc_setting.octet_aligned = octet_align; 1036 1050 s->enc_setting.reorder = PJ_TRUE; 1037 s->enc_setting. CMR= 15;1051 s->enc_setting.cmr = 15; 1038 1052 1039 1053 s->dec_setting.amr_nb = ippc->pt == PJMEDIA_RTP_PT_AMR; 1040 s->dec_setting.octet_aligned = 0;1054 s->dec_setting.octet_aligned = octet_align; 1041 1055 s->dec_setting.reorder = PJ_TRUE; 1042 1056 }
Note: See TracChangeset
for help on using the changeset viewer.