Changeset 1266 for pjproject/trunk/pjmedia/src/pjmedia/stream.c
- Timestamp:
- May 11, 2007 3:14:34 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r1048 r1266 167 167 static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) 168 168 { 169 pjmedia_stream *stream = port->port_data.pdata;169 pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 170 170 pjmedia_channel *channel = stream->dec; 171 171 unsigned samples_count, samples_per_frame, samples_required; … … 192 192 stream->codec_param.info.channel_cnt / 193 193 1000; 194 p_out_samp = frame->buf;194 p_out_samp = (pj_int16_t*) frame->buf; 195 195 196 196 for (samples_count=0; samples_count < samples_required; … … 383 383 pj_assert(sizeof(pjmedia_rtp_dtmf_event) == 4); 384 384 385 event = frame_out->buf;385 event = (pjmedia_rtp_dtmf_event*) frame_out->buf; 386 386 cur_ts = pj_ntohl(stream->enc->rtp.out_hdr.ts); 387 387 duration = cur_ts - digit->start_ts; … … 515 515 const pjmedia_frame *frame ) 516 516 { 517 pjmedia_stream *stream = port->port_data.pdata;517 pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 518 518 pjmedia_channel *channel = stream->enc; 519 519 pj_status_t status = 0; … … 666 666 /* Set RTP marker bit if currently not streaming */ 667 667 if (stream->is_streaming == PJ_FALSE) { 668 pjmedia_rtp_hdr *rtp = channel->out_pkt;668 pjmedia_rtp_hdr *rtp = (pjmedia_rtp_hdr*) channel->out_pkt; 669 669 670 670 rtp->m = 1; … … 698 698 const pjmedia_frame *frame ) 699 699 { 700 pjmedia_stream *stream = port->port_data.pdata;700 pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 701 701 pjmedia_frame tmp_zero_frame; 702 702 unsigned samples_per_frame; … … 831 831 const void *payload, unsigned payloadlen) 832 832 { 833 const pjmedia_rtp_dtmf_event *event =payload;833 pjmedia_rtp_dtmf_event *event = (pjmedia_rtp_dtmf_event*) payload; 834 834 835 835 /* Check compiler packing. */ … … 903 903 904 904 { 905 pjmedia_stream *stream = data;905 pjmedia_stream *stream = (pjmedia_stream*) data; 906 906 pjmedia_channel *channel = stream->dec; 907 907 const pjmedia_rtp_hdr *hdr; … … 919 919 920 920 /* Ignore keep-alive packets */ 921 if (bytes_read < sizeof(pjmedia_rtp_hdr))921 if (bytes_read < (pj_ssize_t) sizeof(pjmedia_rtp_hdr)) 922 922 return; 923 923 … … 1053 1053 pj_ssize_t bytes_read) 1054 1054 { 1055 pjmedia_stream *stream = data;1055 pjmedia_stream *stream = (pjmedia_stream*) data; 1056 1056 1057 1057 /* Check for errors */ … … 1081 1081 /* Allocate memory for channel descriptor */ 1082 1082 1083 channel = pj_pool_zalloc(pool, sizeof(pjmedia_channel));1083 channel = PJ_POOL_ZALLOC_T(pool, pjmedia_channel); 1084 1084 PJ_ASSERT_RETURN(channel != NULL, PJ_ENOMEM); 1085 1085 … … 1147 1147 /* Allocate the media stream: */ 1148 1148 1149 stream = pj_pool_zalloc(pool, sizeof(pjmedia_stream));1149 stream = PJ_POOL_ZALLOC_T(pool, pjmedia_stream); 1150 1150 PJ_ASSERT_RETURN(stream != NULL, PJ_ENOMEM); 1151 1151 1152 1152 /* Init stream/port name */ 1153 name.ptr = pj_pool_alloc(pool, M);1153 name.ptr = (char*) pj_pool_alloc(pool, M); 1154 1154 name.slen = pj_ansi_snprintf(name.ptr, M, "strm%p", stream); 1155 1155 … … 1263 1263 /* Allocate buffer */ 1264 1264 stream->enc_buf_size = stream->port.info.clock_rate * ptime / 1000; 1265 stream->enc_buf = pj_pool_alloc(pool, stream->enc_buf_size * 2); 1265 stream->enc_buf = (pj_int16_t*) 1266 pj_pool_alloc(pool, stream->enc_buf_size * 2); 1266 1267 1267 1268 } else { … … 1536 1537 1537 1538 if (stream->tx_dtmf_count+digit_char->slen >= 1538 PJ_ARRAY_SIZE(stream->tx_dtmf_buf))1539 (long)PJ_ARRAY_SIZE(stream->tx_dtmf_buf)) 1539 1540 { 1540 1541 status = PJ_ETOOMANY;
Note: See TracChangeset
for help on using the changeset viewer.