Changeset 438 for pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c
- Timestamp:
- May 13, 2006 10:46:23 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia-codec/l16.c
r411 r438 62 62 pjmedia_codec_param *attr ); 63 63 static pj_status_t l16_close( pjmedia_codec *codec ); 64 static pj_status_t l16_get_frames(pjmedia_codec *codec, 65 void *pkt, 66 pj_size_t pkt_size, 67 unsigned *frame_cnt, 68 pjmedia_frame frames[]); 64 static pj_status_t l16_parse(pjmedia_codec *codec, 65 void *pkt, 66 pj_size_t pkt_size, 67 const pj_timestamp *ts, 68 unsigned *frame_cnt, 69 pjmedia_frame frames[]); 69 70 static pj_status_t l16_encode( pjmedia_codec *codec, 70 71 const struct pjmedia_frame *input, … … 82 83 &l16_open, 83 84 &l16_close, 84 &l16_ get_frames,85 &l16_parse, 85 86 &l16_encode, 86 87 &l16_decode … … 235 236 236 237 pj_memset(attr, 0, sizeof(pjmedia_codec_param)); 237 attr-> pt =id->pt;238 attr-> clock_rate = id->clock_rate;239 attr-> channel_cnt = id->channel_cnt;240 attr-> avg_bps = id->clock_rate * id->channel_cnt * 16;241 attr-> pcm_bits_per_sample = 16;238 attr->info.pt = (pj_uint8_t)id->pt; 239 attr->info.clock_rate = id->clock_rate; 240 attr->info.channel_cnt = id->channel_cnt; 241 attr->info.avg_bps = id->clock_rate * id->channel_cnt * 16; 242 attr->info.pcm_bits_per_sample = 16; 242 243 243 244 /* To keep frame size below 1400 MTU, set ptime to 10ms for 244 245 * sampling rate > 35 KHz 245 246 */ 246 attr->ptime = GET_PTIME(id->clock_rate); 247 attr->info.frm_ptime = GET_PTIME(id->clock_rate); 248 249 attr->setting.frm_per_pkt = 1; 247 250 248 251 /* Default all flag bits disabled. */ … … 499 502 } 500 503 501 static pj_status_t l16_get_frames( pjmedia_codec *codec, 502 void *pkt, 503 pj_size_t pkt_size, 504 unsigned *frame_cnt, 505 pjmedia_frame frames[]) 504 static pj_status_t l16_parse( pjmedia_codec *codec, 505 void *pkt, 506 pj_size_t pkt_size, 507 const pj_timestamp *ts, 508 unsigned *frame_cnt, 509 pjmedia_frame frames[]) 506 510 { 507 511 unsigned count = 0; … … 512 516 513 517 while (pkt_size >= data->frame_size && count < *frame_cnt) { 514 frames[0].type = PJMEDIA_FRAME_TYPE_AUDIO; 515 frames[0].buf = pkt; 516 frames[0].size = data->frame_size; 518 frames[count].type = PJMEDIA_FRAME_TYPE_AUDIO; 519 frames[count].buf = pkt; 520 frames[count].size = data->frame_size; 521 frames[count].timestamp.u64 = ts->u64 + (count * data->frame_size); 517 522 518 523 pkt = ((char*)pkt) + data->frame_size;
Note: See TracChangeset
for help on using the changeset viewer.