Ignore:
Timestamp:
May 11, 2007 3:14:34 PM (17 years ago)
Author:
bennylp
Message:

HUGE changeset to make the rest of the libraries compile with C++ mode

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjmedia/src/pjmedia/stream.c

    r1048 r1266  
    167167static pj_status_t get_frame( pjmedia_port *port, pjmedia_frame *frame) 
    168168{ 
    169     pjmedia_stream *stream = port->port_data.pdata; 
     169    pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 
    170170    pjmedia_channel *channel = stream->dec; 
    171171    unsigned samples_count, samples_per_frame, samples_required; 
     
    192192                        stream->codec_param.info.channel_cnt /  
    193193                        1000; 
    194     p_out_samp = frame->buf; 
     194    p_out_samp = (pj_int16_t*) frame->buf; 
    195195 
    196196    for (samples_count=0; samples_count < samples_required;  
     
    383383    pj_assert(sizeof(pjmedia_rtp_dtmf_event) == 4); 
    384384 
    385     event = frame_out->buf; 
     385    event = (pjmedia_rtp_dtmf_event*) frame_out->buf; 
    386386    cur_ts = pj_ntohl(stream->enc->rtp.out_hdr.ts); 
    387387    duration = cur_ts - digit->start_ts; 
     
    515515                                  const pjmedia_frame *frame ) 
    516516{ 
    517     pjmedia_stream *stream = port->port_data.pdata; 
     517    pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 
    518518    pjmedia_channel *channel = stream->enc; 
    519519    pj_status_t status = 0; 
     
    666666    /* Set RTP marker bit if currently not streaming */ 
    667667    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; 
    669669 
    670670        rtp->m = 1; 
     
    698698                              const pjmedia_frame *frame ) 
    699699{ 
    700     pjmedia_stream *stream = port->port_data.pdata; 
     700    pjmedia_stream *stream = (pjmedia_stream*) port->port_data.pdata; 
    701701    pjmedia_frame tmp_zero_frame; 
    702702    unsigned samples_per_frame; 
     
    831831                                  const void *payload, unsigned payloadlen) 
    832832{ 
    833     const pjmedia_rtp_dtmf_event *event = payload; 
     833    pjmedia_rtp_dtmf_event *event = (pjmedia_rtp_dtmf_event*) payload; 
    834834 
    835835    /* Check compiler packing. */ 
     
    903903 
    904904{ 
    905     pjmedia_stream *stream = data; 
     905    pjmedia_stream *stream = (pjmedia_stream*) data; 
    906906    pjmedia_channel *channel = stream->dec; 
    907907    const pjmedia_rtp_hdr *hdr; 
     
    919919 
    920920    /* Ignore keep-alive packets */ 
    921     if (bytes_read < sizeof(pjmedia_rtp_hdr)) 
     921    if (bytes_read < (pj_ssize_t) sizeof(pjmedia_rtp_hdr)) 
    922922        return; 
    923923 
     
    10531053                        pj_ssize_t bytes_read) 
    10541054{ 
    1055     pjmedia_stream *stream = data; 
     1055    pjmedia_stream *stream = (pjmedia_stream*) data; 
    10561056 
    10571057    /* Check for errors */ 
     
    10811081    /* Allocate memory for channel descriptor */ 
    10821082 
    1083     channel = pj_pool_zalloc(pool, sizeof(pjmedia_channel)); 
     1083    channel = PJ_POOL_ZALLOC_T(pool, pjmedia_channel); 
    10841084    PJ_ASSERT_RETURN(channel != NULL, PJ_ENOMEM); 
    10851085 
     
    11471147    /* Allocate the media stream: */ 
    11481148 
    1149     stream = pj_pool_zalloc(pool, sizeof(pjmedia_stream)); 
     1149    stream = PJ_POOL_ZALLOC_T(pool, pjmedia_stream); 
    11501150    PJ_ASSERT_RETURN(stream != NULL, PJ_ENOMEM); 
    11511151 
    11521152    /* Init stream/port name */ 
    1153     name.ptr = pj_pool_alloc(pool, M); 
     1153    name.ptr = (char*) pj_pool_alloc(pool, M); 
    11541154    name.slen = pj_ansi_snprintf(name.ptr, M, "strm%p", stream); 
    11551155 
     
    12631263        /* Allocate buffer */ 
    12641264        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); 
    12661267 
    12671268    } else { 
     
    15361537     
    15371538    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)) 
    15391540    { 
    15401541        status = PJ_ETOOMANY; 
Note: See TracChangeset for help on using the changeset viewer.