Changeset 1266 for pjproject/trunk/pjmedia/src/pjmedia/splitcomb.c
- Timestamp:
- May 11, 2007 3:14:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/splitcomb.c
r974 r1266 59 59 pjmedia_port *port; 60 60 pj_bool_t reversed; 61 } *port_desc;61 } port_desc[64]; 62 62 63 63 /* Temporary buffers needed to extract mono frame from … … 144 144 145 145 /* Create the splitter/combiner structure */ 146 sc = pj_pool_zalloc(pool, sizeof(struct splitcomb));146 sc = PJ_POOL_ZALLOC_T(pool, struct splitcomb); 147 147 PJ_ASSERT_RETURN(sc != NULL, PJ_ENOMEM); 148 148 149 149 /* Create temporary buffers */ 150 sc->get_buf = pj_pool_alloc(pool, samples_per_frame * 150 sc->get_buf = (TMP_SAMP_TYPE*) 151 pj_pool_alloc(pool, samples_per_frame * 151 152 sizeof(TMP_SAMP_TYPE) / 152 153 channel_count); 153 154 PJ_ASSERT_RETURN(sc->get_buf, PJ_ENOMEM); 154 155 155 sc->put_buf = pj_pool_alloc(pool, samples_per_frame * 156 sc->put_buf = (TMP_SAMP_TYPE*) 157 pj_pool_alloc(pool, samples_per_frame * 156 158 sizeof(TMP_SAMP_TYPE) / 157 159 channel_count); … … 171 173 172 174 /* Init ports array */ 175 /* 173 176 sc->port_desc = pj_pool_zalloc(pool, channel_count*sizeof(*sc->port_desc)); 177 */ 178 pj_bzero(sc->port_desc, sizeof(sc->port_desc)); 174 179 175 180 /* Done for now */ … … 238 243 239 244 /* Create the port */ 240 rport = pj_pool_zalloc(pool, sizeof(struct reverse_port));245 rport = PJ_POOL_ZALLOC_T(pool, struct reverse_port); 241 246 rport->parent = sc; 242 247 rport->ch_num = ch_num; … … 262 267 /* Create put buffers */ 263 268 for (i=0; i<rport->buf_cnt; ++i) { 264 rport->dnstream_buf[i] = pj_pool_zalloc(pool, port->info.bytes_per_frame); 269 rport->dnstream_buf[i]=(pj_int16_t*) 270 pj_pool_zalloc(pool, port->info.bytes_per_frame); 265 271 PJ_ASSERT_RETURN(rport->dnstream_buf[i], PJ_ENOMEM); 266 272 } … … 269 275 /* Create get buffers */ 270 276 for (i=0; i<rport->buf_cnt; ++i) { 271 rport->upstream_buf[i] = pj_pool_zalloc(pool, 277 rport->upstream_buf[i] = (pj_int16_t*) 278 pj_pool_zalloc(pool, 272 279 port->info.bytes_per_frame); 273 280 PJ_ASSERT_RETURN(rport->upstream_buf[i], PJ_ENOMEM); … … 367 374 368 375 /* Extract the mono frame */ 369 extract_mono_frame( frame->buf, sc->put_buf, ch,376 extract_mono_frame((const pj_int16_t*)frame->buf, sc->put_buf, ch, 370 377 this_port->info.channel_count, 371 378 frame->size * 8 / … … 405 412 406 413 /* Extract mono-frame and put it in downstream buffer */ 407 extract_mono_frame( frame->buf,414 extract_mono_frame((const pj_int16_t*)frame->buf, 408 415 rport->dnstream_buf[rport->dn_write_pos], 409 416 ch, this_port->info.channel_count, … … 434 441 435 442 /* Clear output frame */ 436 pjmedia_zero_samples(frame->buf, this_port->info.samples_per_frame); 443 pjmedia_zero_samples((pj_int16_t*)frame->buf, 444 this_port->info.samples_per_frame); 437 445 438 446 /* Read frame from each port */ … … 460 468 461 469 /* Combine the mono frame into multichannel frame */ 462 store_mono_frame(mono_frame.buf, frame->buf, ch, 470 store_mono_frame((const pj_int16_t*)mono_frame.buf, 471 (pj_int16_t*)frame->buf, ch, 463 472 this_port->info.channel_count, 464 473 mono_frame.size * 8 / … … 495 504 496 505 /* Combine the mono frame into multichannel frame */ 497 store_mono_frame( rport->upstream_buf[rport->up_read_pos],498 frame->buf, ch,506 store_mono_frame((const pj_int16_t*)rport->upstream_buf[rport->up_read_pos], 507 (pj_int16_t*)frame->buf, ch, 499 508 this_port->info.channel_count, 500 509 port->info.samples_per_frame); … … 580 589 581 590 pjmedia_copy_samples(rport->upstream_buf[rport->up_write_pos], 582 frame->buf, count);591 (const pj_int16_t*) frame->buf, count); 583 592 rport->up_write_pos = (rport->up_write_pos+1) % rport->buf_cnt; 584 593 … … 622 631 623 632 /* Get the samples from the circular buffer */ 624 pjmedia_copy_samples( frame->buf,633 pjmedia_copy_samples((pj_int16_t*)frame->buf, 625 634 rport->dnstream_buf[rport->dn_read_pos], 626 635 count);
Note: See TracChangeset
for help on using the changeset viewer.