- Timestamp:
- Sep 24, 2014 10:30:57 AM (10 years ago)
- Location:
- pjproject/trunk/pjmedia/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/g7221.c
r4001 r4930 649 649 codec_private_t *codec_data = (codec_private_t*) codec->codec_data; 650 650 pj_pool_t *pool; 651 pjmedia_codec_fmtp *fmtp = &attr->setting.dec_fmtp; 652 pj_uint16_t fmtp_bitrate = 0; 651 653 unsigned tmp; 652 654 655 for (tmp = 0; tmp < fmtp->cnt && !fmtp_bitrate; ++tmp) { 656 if (!pj_strcmp2(&fmtp->param[tmp].name, "bitrate")) 657 fmtp_bitrate = (pj_uint16_t)pj_strtoul(&fmtp->param[tmp].val); 658 } 659 653 660 /* Validation mode first! */ 654 if (! validate_mode(attr->info.clock_rate, attr->info.avg_bps))661 if (!fmtp_bitrate || !validate_mode(attr->info.clock_rate, fmtp_bitrate)) 655 662 return PJMEDIA_CODEC_EINMODE; 656 663 … … 661 668 codec_data->plc_enabled = (attr->setting.plc != 0); 662 669 663 codec_data->bitrate = (pj_uint16_t)attr->info.avg_bps;664 codec_data->frame_size_bits = (pj_uint16_t)(attr->info.avg_bps*20/1000);670 codec_data->bitrate = fmtp_bitrate; 671 codec_data->frame_size_bits = fmtp_bitrate*20/1000; 665 672 codec_data->frame_size = (pj_uint16_t)(codec_data->frame_size_bits>>3); 666 673 codec_data->samples_per_frame = (pj_uint16_t) … … 687 694 codec_data->dec_randobj.seed2 = 1; 688 695 codec_data->dec_randobj.seed3 = 1; 696 697 /* Update codec param */ 698 attr->info.avg_bps = attr->info.max_bps = fmtp_bitrate; 689 699 690 700 return PJ_SUCCESS; -
pjproject/trunk/pjmedia/src/pjmedia/stream_info.c
r4890 r4930 19 19 */ 20 20 #include <pjmedia/stream.h> 21 #include <pjmedia/sdp_neg.h> 21 22 #include <pjmedia/stream_common.h> 22 23 #include <pj/ctype.h> … … 189 190 si->tx_pt = 0xFFFF; 190 191 for (i=0; i<rem_m->desc.fmt_count; ++i) { 191 unsigned rpt; 192 pjmedia_sdp_attr *r_attr; 193 pjmedia_sdp_rtpmap r_rtpmap; 194 195 rpt = pj_strtoul(&rem_m->desc.fmt[i]); 196 if (rpt < 96) 197 continue; 198 199 r_attr = pjmedia_sdp_media_find_attr(rem_m, &ID_RTPMAP, 200 &rem_m->desc.fmt[i]); 201 if (!r_attr) 202 continue; 203 204 if (pjmedia_sdp_attr_get_rtpmap(r_attr, &r_rtpmap) != PJ_SUCCESS) 205 continue; 206 207 if (!pj_stricmp(&rtpmap->enc_name, &r_rtpmap.enc_name) && 208 rtpmap->clock_rate == r_rtpmap.clock_rate) 192 if (pjmedia_sdp_neg_fmt_match(pool, 193 (pjmedia_sdp_media*)local_m, fmti, 194 (pjmedia_sdp_media*)rem_m, i, 0) == 195 PJ_SUCCESS) 209 196 { 210 197 /* Found matched codec. */ 211 si->tx_pt = rpt; 212 198 si->tx_pt = pj_strtoul(&rem_m->desc.fmt[i]); 213 199 break; 214 200 }
Note: See TracChangeset
for help on using the changeset viewer.