Ignore:
Timestamp:
Feb 5, 2009 10:59:14 AM (15 years ago)
Author:
nanang
Message:
  • Added new API for sound & sound port to create/open sound device with extended setting, to allow opening sound device with non-PCM format and other settings.
  • Updated symbian_ua/ua.cpp to be able to reopen sound device when audio stream session is using non-PCM data/passthrough codec.
  • Updated stream.c to allow it works with non-PCM data.
  • Added PCMU/A frames processing into non-PCM play/record callbacks in symbian_audio_aps.cpp.
  • Added passthrough codec init/deinitialization in pjsua-lib.
  • Added a new pjmedia_frame_ext helper function, pjmedia_frame_ext_pop_subframes, to pop-out/remove some subframes.
  • Other minor updates/fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/aps-direct/pjmedia/src/pjmedia-codec/passthrough.c

    r2436 r2438  
    460460                                    codec_desc[i].channel_count /  
    461461                                    codec_desc[i].clock_rate); 
    462             attr->info.format.u32 = codec_desc[i].format.u32; 
     462            attr->info.format = codec_desc[i].format; 
    463463 
    464464            /* Default flags. */ 
    465465            attr->setting.frm_per_pkt = codec_desc[i].frm_per_pkt; 
    466             attr->setting.plc = 1; 
     466            attr->setting.plc = 0; 
    467467            attr->setting.penh= 0; 
    468             attr->setting.vad = 1; 
     468            attr->setting.vad = 0; 
    469469            attr->setting.cng = attr->setting.vad; 
    470470            attr->setting.dec_fmtp = codec_desc[i].dec_fmtp; 
     
    720720        frames[count].timestamp.u64 = ts->u64 + count*desc->samples_per_frame; 
    721721 
    722         pkt = ((char*)pkt) + codec_data->avg_frame_size; 
     722        pkt = (pj_uint8_t*)pkt + codec_data->avg_frame_size; 
    723723        pkt_size -= codec_data->avg_frame_size; 
    724724 
     
    800800    pjmedia_frame_ext *output_ = (pjmedia_frame_ext*) output; 
    801801 
    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); 
    804803 
    805804#if PJMEDIA_HAS_PASSTHROUGH_CODEC_AMR 
     
    818817    } 
    819818#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); 
    834829 
    835830    return PJ_SUCCESS; 
     
    843838                                  struct pjmedia_frame *output) 
    844839{ 
    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; 
    846850} 
    847851 
Note: See TracChangeset for help on using the changeset viewer.