- Timestamp:
- Feb 5, 2009 10:59:14 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-codec/passthrough.c
r2436 r2438 460 460 codec_desc[i].channel_count / 461 461 codec_desc[i].clock_rate); 462 attr->info.format .u32 = codec_desc[i].format.u32;462 attr->info.format = codec_desc[i].format; 463 463 464 464 /* Default flags. */ 465 465 attr->setting.frm_per_pkt = codec_desc[i].frm_per_pkt; 466 attr->setting.plc = 1;466 attr->setting.plc = 0; 467 467 attr->setting.penh= 0; 468 attr->setting.vad = 1;468 attr->setting.vad = 0; 469 469 attr->setting.cng = attr->setting.vad; 470 470 attr->setting.dec_fmtp = codec_desc[i].dec_fmtp; … … 720 720 frames[count].timestamp.u64 = ts->u64 + count*desc->samples_per_frame; 721 721 722 pkt = ( (char*)pkt)+ codec_data->avg_frame_size;722 pkt = (pj_uint8_t*)pkt + codec_data->avg_frame_size; 723 723 pkt_size -= codec_data->avg_frame_size; 724 724 … … 800 800 pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output; 801 801 802 /* Check if input is formatted in pjmedia_frame */ 803 pj_assert(input && input->type == PJMEDIA_FRAME_TYPE_AUDIO); 802 pj_assert(input && input->size > 0); 804 803 805 804 #if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR … … 818 817 } 819 818 #endif 820 821 pj_bzero(output_, sizeof(pjmedia_frame_ext)); 822 output_->base.type = PJMEDIA_FRAME_TYPE_EXTENDED; 823 824 if (input && input->size > 0) { 825 PJ_ASSERT_RETURN(output_buf_len >= sizeof(pjmedia_frame_ext) + 826 sizeof(pjmedia_frame_ext_subframe) + 827 input->size, 828 PJMEDIA_CODEC_EFRMTOOSHORT); 829 830 pjmedia_frame_ext_append_subframe(output_, input->buf, 831 (pj_uint16_t)(input->size << 3), 832 (pj_uint16_t)desc->samples_per_frame); 833 } 819 /* 820 PJ_ASSERT_RETURN(output_buf_len >= sizeof(pjmedia_frame_ext) + 821 sizeof(pjmedia_frame_ext_subframe) + 822 input->size, 823 PJMEDIA_CODEC_EFRMTOOSHORT); 824 */ 825 826 pjmedia_frame_ext_append_subframe(output_, input->buf, 827 (pj_uint16_t)(input->size << 3), 828 (pj_uint16_t)desc->samples_per_frame); 834 829 835 830 return PJ_SUCCESS; … … 843 838 struct pjmedia_frame *output) 844 839 { 845 return codec_decode(codec, NULL, output_buf_len, output); 840 codec_private_t *codec_data = (codec_private_t*) codec->codec_data; 841 struct codec_desc *desc = &codec_desc[codec_data->codec_idx]; 842 pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output; 843 844 PJ_UNUSED_ARG(output_buf_len); 845 846 pjmedia_frame_ext_append_subframe(output_, NULL, 0, 847 (pj_uint16_t)desc->samples_per_frame); 848 849 return PJ_SUCCESS; 846 850 } 847 851
Note: See TracChangeset
for help on using the changeset viewer.