Ignore:
Timestamp:
Aug 24, 2010 10:45:01 AM (14 years ago)
Author:
nanang
Message:

Fix #1114:

  • Fixed bytes_per_frame calculation in stream port.
  • Fixed sample streamutil.c to use codec info/param for codec bandwidth calculation (was using bytes_per_frame info of stream port).
  • Doc fix for bytes_per_frame field in pjmedia_port_info.
File:
1 edited

Legend:

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

    r3237 r3292  
    20312031                                          stream->codec_param.setting.frm_per_pkt / 
    20322032                                          1000; 
    2033     stream->port.info.bytes_per_frame = stream->codec_param.info.max_bps *  
    2034                                         stream->codec_param.info.frm_ptime * 
    2035                                         stream->codec_param.setting.frm_per_pkt / 
    2036                                         8 / 1000; 
    2037     if ((stream->codec_param.info.max_bps * stream->codec_param.info.frm_ptime * 
    2038         stream->codec_param.setting.frm_per_pkt) % 8000 != 0) 
    2039     { 
    2040         ++stream->port.info.bytes_per_frame; 
    2041     } 
    2042  
    20432033    stream->port.info.format.id = stream->codec_param.info.fmt_id; 
    20442034    if (stream->codec_param.info.fmt_id == PJMEDIA_FORMAT_L16) { 
     2035        /* Raw format */ 
     2036        stream->port.info.bytes_per_frame = stream->port.info.samples_per_frame * 
     2037                                            stream->port.info.bits_per_sample / 8; 
     2038 
    20452039        stream->port.put_frame = &put_frame; 
    20462040        stream->port.get_frame = &get_frame; 
    20472041    } else { 
     2042        /* Encoded format */ 
     2043        stream->port.info.bytes_per_frame = stream->codec_param.info.max_bps *  
     2044                                            stream->codec_param.info.frm_ptime * 
     2045                                            stream->codec_param.setting.frm_per_pkt / 
     2046                                            8 / 1000; 
     2047        if ((stream->codec_param.info.max_bps * stream->codec_param.info.frm_ptime * 
     2048            stream->codec_param.setting.frm_per_pkt) % 8000 != 0) 
     2049        { 
     2050            ++stream->port.info.bytes_per_frame; 
     2051        } 
    20482052        stream->port.info.format.bitrate = stream->codec_param.info.avg_bps; 
    20492053        stream->port.info.format.vad = (stream->codec_param.setting.vad != 0); 
     2054 
    20502055        stream->port.put_frame = &put_frame; 
    20512056        stream->port.get_frame = &get_frame_ext; 
Note: See TracChangeset for help on using the changeset viewer.