Changeset 2834 for pjproject/trunk/pjmedia/src/pjmedia/stream.c
- Timestamp:
- Jul 15, 2009 5:55:16 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r2761 r2834 1674 1674 stream->port.info.channel_count = info->fmt.channel_cnt; 1675 1675 stream->port.port_data.pdata = stream; 1676 if (info->param==NULL || info->param->info.fmt_id == PJMEDIA_FORMAT_L16) {1677 stream->port.info.format.id = PJMEDIA_FORMAT_L16;1678 1679 stream->port.put_frame = &put_frame;1680 stream->port.get_frame = &get_frame;1681 } else {1682 stream->port.info.format.id = info->param->info.fmt_id;1683 stream->port.info.format.bitrate = info->param->info.avg_bps;1684 stream->port.info.format.vad = (info->param->setting.vad != 0);1685 1686 stream->port.put_frame = &put_frame;1687 stream->port.get_frame = &get_frame_ext;1688 }1689 1690 1676 1691 1677 /* Init stream: */ … … 1746 1732 stream->codec_param.setting.frm_per_pkt = 1; 1747 1733 1748 /* Set additional info. */ 1734 /* Open the codec. */ 1735 status = stream->codec->op->open(stream->codec, &stream->codec_param); 1736 if (status != PJ_SUCCESS) 1737 goto err_cleanup; 1738 1739 /* Set additional info and callbacks. */ 1749 1740 stream->port.info.bits_per_sample = 16; 1750 1741 stream->port.info.samples_per_frame = info->fmt.clock_rate * … … 1763 1754 } 1764 1755 1765 /* Open the codec: */ 1766 1767 status = stream->codec->op->open(stream->codec, &stream->codec_param); 1768 if (status != PJ_SUCCESS) 1769 goto err_cleanup; 1756 stream->port.info.format.id = stream->codec_param.info.fmt_id; 1757 if (stream->codec_param.info.fmt_id == PJMEDIA_FORMAT_L16) { 1758 stream->port.put_frame = &put_frame; 1759 stream->port.get_frame = &get_frame; 1760 } else { 1761 stream->port.info.format.bitrate = stream->codec_param.info.avg_bps; 1762 stream->port.info.format.vad = (stream->codec_param.setting.vad != 0); 1763 stream->port.put_frame = &put_frame; 1764 stream->port.get_frame = &get_frame_ext; 1765 } 1770 1766 1771 1767 /* If encoder and decoder's ptime are asymmetric, then we need to
Note: See TracChangeset
for help on using the changeset viewer.