Changeset 1266 for pjproject/trunk/pjmedia/src/pjmedia/conference.c
- Timestamp:
- May 11, 2007 3:14:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/conference.c
r1171 r1266 240 240 241 241 /* Create port. */ 242 conf_port = pj_pool_zalloc(pool, sizeof(struct conf_port));242 conf_port = PJ_POOL_ZALLOC_T(pool, struct conf_port); 243 243 PJ_ASSERT_RETURN(conf_port, PJ_ENOMEM); 244 244 … … 255 255 256 256 /* Create transmit flag array */ 257 conf_port->listener_slots = pj_pool_zalloc(pool, 257 conf_port->listener_slots = (SLOT_TYPE*) 258 pj_pool_zalloc(pool, 258 259 conf->max_ports * sizeof(SLOT_TYPE)); 259 260 PJ_ASSERT_RETURN(conf_port->listener_slots, PJ_ENOMEM); … … 336 337 conf->clock_rate); 337 338 conf_port->rx_buf_count = 0; 338 conf_port->rx_buf = pj_pool_alloc(pool, conf_port->rx_buf_cap * 339 conf_port->rx_buf = (pj_int16_t*) 340 pj_pool_alloc(pool, conf_port->rx_buf_cap * 339 341 sizeof(conf_port->rx_buf[0])); 340 342 PJ_ASSERT_RETURN(conf_port->rx_buf, PJ_ENOMEM); … … 343 345 conf_port->tx_buf_cap = conf_port->rx_buf_cap; 344 346 conf_port->tx_buf_count = 0; 345 conf_port->tx_buf = pj_pool_alloc(pool, conf_port->tx_buf_cap * 347 conf_port->tx_buf = (pj_int16_t*) 348 pj_pool_alloc(pool, conf_port->tx_buf_cap * 346 349 sizeof(conf_port->tx_buf[0])); 347 350 PJ_ASSERT_RETURN(conf_port->tx_buf, PJ_ENOMEM); … … 350 353 351 354 /* Create mix buffer. */ 352 conf_port->mix_buf = pj_pool_zalloc(pool, conf->samples_per_frame * 355 conf_port->mix_buf = (pj_uint32_t*) 356 pj_pool_zalloc(pool, conf->samples_per_frame * 353 357 sizeof(conf_port->mix_buf[0])); 354 358 PJ_ASSERT_RETURN(conf_port->mix_buf, PJ_ENOMEM); … … 381 385 /* Passive port has rx buffers. */ 382 386 for (i=0; i<RX_BUF_COUNT; ++i) { 383 conf_port->snd_buf[i] = pj_pool_zalloc(pool, conf->samples_per_frame * 387 conf_port->snd_buf[i] = (pj_int16_t*) 388 pj_pool_zalloc(pool, conf->samples_per_frame * 384 389 sizeof(conf_port->snd_buf[0][0])); 385 390 if (conf_port->snd_buf[i] == NULL) { … … 487 492 488 493 /* Create and init conf structure. */ 489 conf = pj_pool_zalloc(pool, sizeof(pjmedia_conf));494 conf = PJ_POOL_ZALLOC_T(pool, pjmedia_conf); 490 495 PJ_ASSERT_RETURN(conf, PJ_ENOMEM); 491 496 492 conf->ports = pj_pool_zalloc(pool, max_ports*sizeof(void*)); 497 conf->ports = (struct conf_port**) 498 pj_pool_zalloc(pool, max_ports*sizeof(void*)); 493 499 PJ_ASSERT_RETURN(conf->ports, PJ_ENOMEM); 494 500 … … 502 508 503 509 /* Create and initialize the master port interface. */ 504 conf->master_port = pj_pool_zalloc(pool, sizeof(pjmedia_port));510 conf->master_port = PJ_POOL_ZALLOC_T(pool, pjmedia_port); 505 511 PJ_ASSERT_RETURN(conf->master_port, PJ_ENOMEM); 506 512 … … 523 529 524 530 /* Create temporary buffer. */ 525 conf->uns_buf = pj_pool_zalloc(pool, samples_per_frame * 531 conf->uns_buf = (pj_uint16_t*) 532 pj_pool_zalloc(pool, samples_per_frame * 526 533 sizeof(conf->uns_buf[0])); 527 534 … … 598 605 static pj_status_t destroy_port(pjmedia_port *this_port) 599 606 { 600 pjmedia_conf *conf = this_port->port_data.pdata;607 pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata; 601 608 return pjmedia_conf_destroy(conf); 602 609 } … … 626 633 const pj_str_t *name) 627 634 { 628 intlen;635 unsigned len; 629 636 630 637 /* Sanity check. */ … … 764 771 name = &tmp; 765 772 766 tmp.ptr = pj_pool_alloc(pool, 32);773 tmp.ptr = (char*) pj_pool_alloc(pool, 32); 767 774 tmp.slen = pj_ansi_snprintf(tmp.ptr, 32, "ConfPort#%d", index); 768 775 } 769 776 770 777 /* Create and initialize the media port structure. */ 771 port = pj_pool_zalloc(pool, sizeof(pjmedia_port));778 port = PJ_POOL_ZALLOC_T(pool, pjmedia_port); 772 779 PJ_ASSERT_RETURN(port, PJ_ENOMEM); 773 780 … … 1601 1608 pjmedia_frame *frame) 1602 1609 { 1603 pjmedia_conf *conf = this_port->port_data.pdata;1610 pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata; 1604 1611 pjmedia_frame_type speaker_frame_type = PJMEDIA_FRAME_TYPE_NONE; 1605 1612 unsigned ci, cj, i, j; … … 1677 1684 1678 1685 snd_buf = conf_port->snd_buf[conf_port->snd_read_pos]; 1679 pjmedia_copy_samples(frame->buf, snd_buf, conf->samples_per_frame); 1686 pjmedia_copy_samples((pj_int16_t*)frame->buf, snd_buf, 1687 conf->samples_per_frame); 1680 1688 conf_port->snd_read_pos = (conf_port->snd_read_pos+1) % RX_BUF_COUNT; 1681 1689 … … 1685 1693 pjmedia_frame_type frame_type; 1686 1694 1687 status = read_port(conf, conf_port, frame->buf,1695 status = read_port(conf, conf_port, (pj_int16_t*)frame->buf, 1688 1696 conf->samples_per_frame, &frame_type); 1689 1697 … … 1711 1719 */ 1712 1720 if (conf_port->rx_adj_level != NORMAL_LEVEL) { 1713 pj_int16_t *input = frame->buf;1721 pj_int16_t *input = (pj_int16_t*) frame->buf; 1714 1722 pj_int32_t adj = conf_port->rx_adj_level; 1715 1723 … … 1739 1747 1740 1748 } else { 1741 level = pjmedia_calc_avg_signal( frame->buf,1749 level = pjmedia_calc_avg_signal((pj_int16_t*) frame->buf, 1742 1750 conf->samples_per_frame); 1743 1751 } … … 1800 1808 if (listener->transmitter_cnt == 1) { 1801 1809 pjmedia_copy_samples((pj_int16_t*)mix_buf, 1802 frame->buf, conf->samples_per_frame); 1810 (const pj_int16_t*)frame->buf, 1811 conf->samples_per_frame); 1803 1812 listener->src_level = level; 1804 1813 } else { … … 1857 1866 conf->samples_per_frame)); 1858 1867 1859 pjmedia_copy_samples( frame->buf, (pj_int16_t*)conf->ports[0]->mix_buf, 1868 pjmedia_copy_samples( (pj_int16_t*)frame->buf, 1869 (const pj_int16_t*)conf->ports[0]->mix_buf, 1860 1870 conf->samples_per_frame); 1861 1871 } else { 1862 pjmedia_zero_samples( frame->buf, conf->samples_per_frame);1872 pjmedia_zero_samples((pj_int16_t*)frame->buf, conf->samples_per_frame); 1863 1873 } 1864 1874 … … 1898 1908 const pjmedia_frame *frame) 1899 1909 { 1900 pjmedia_conf *conf = this_port->port_data.pdata;1910 pjmedia_conf *conf = (pjmedia_conf*) this_port->port_data.pdata; 1901 1911 struct conf_port *port = conf->ports[this_port->port_data.ldata]; 1902 const pj_int16_t *input = frame->buf;1912 const pj_int16_t *input = (const pj_int16_t*) frame->buf; 1903 1913 pj_int16_t *target_snd_buf; 1904 1914
Note: See TracChangeset
for help on using the changeset viewer.