├── .gitignore ├── Codec ├── .gitignore ├── Codec.iml ├── amr │ ├── .gitignore │ ├── amr.iml │ ├── bintray.gradle │ ├── build.gradle │ ├── gradle.properties │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── hikvh │ │ │ └── media │ │ │ └── ApplicationTest.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── io │ │ │ └── kvh │ │ │ └── media │ │ │ └── amr │ │ │ ├── AmrDecoder.java │ │ │ └── AmrEncoder.java │ │ ├── jni │ │ ├── Android.mk │ │ ├── Application.mk │ │ ├── amr_decoder.cpp │ │ ├── amr_encoder.cpp │ │ ├── interf_dec.h │ │ ├── interf_enc.h │ │ ├── opencore │ │ │ └── codecs_v2 │ │ │ │ └── audio │ │ │ │ └── gsm_amr │ │ │ │ ├── amr_nb │ │ │ │ ├── common │ │ │ │ │ ├── Android.mk │ │ │ │ │ ├── include │ │ │ │ │ │ ├── abs_s.h │ │ │ │ │ │ ├── add.h │ │ │ │ │ │ ├── az_lsp.h │ │ │ │ │ │ ├── basic_op.h │ │ │ │ │ │ ├── basic_op_arm_gcc_v5.h │ │ │ │ │ │ ├── basic_op_c_equivalent.h │ │ │ │ │ │ ├── basicop_malloc.h │ │ │ │ │ │ ├── bitno_tab.h │ │ │ │ │ │ ├── bitreorder_tab.h │ │ │ │ │ │ ├── bytesused.h │ │ │ │ │ │ ├── cnst.h │ │ │ │ │ │ ├── cnst_vad.h │ │ │ │ │ │ ├── d_gain_c.h │ │ │ │ │ │ ├── d_gain_p.h │ │ │ │ │ │ ├── d_plsf.h │ │ │ │ │ │ ├── div_s.h │ │ │ │ │ │ ├── dtx_common_def.h │ │ │ │ │ │ ├── frame.h │ │ │ │ │ │ ├── frame_type_3gpp.h │ │ │ │ │ │ ├── gc_pred.h │ │ │ │ │ │ ├── get_const_tbls.h │ │ │ │ │ │ ├── gmed_n.h │ │ │ │ │ │ ├── gsm_amr_typedefs.h │ │ │ │ │ │ ├── int_lpc.h │ │ │ │ │ │ ├── int_lsf.h │ │ │ │ │ │ ├── inv_sqrt.h │ │ │ │ │ │ ├── l_add.h │ │ │ │ │ │ ├── l_add_c.h │ │ │ │ │ │ ├── l_comp.h │ │ │ │ │ │ ├── l_extract.h │ │ │ │ │ │ ├── l_mac.h │ │ │ │ │ │ ├── l_msu.h │ │ │ │ │ │ ├── l_mult.h │ │ │ │ │ │ ├── l_negate.h │ │ │ │ │ │ ├── l_shl.h │ │ │ │ │ │ ├── l_shr.h │ │ │ │ │ │ ├── l_shr_r.h │ │ │ │ │ │ ├── l_sub.h │ │ │ │ │ │ ├── log2.h │ │ │ │ │ │ ├── log2_norm.h │ │ │ │ │ │ ├── lsfwt.h │ │ │ │ │ │ ├── lsp.h │ │ │ │ │ │ ├── lsp_az.h │ │ │ │ │ │ ├── lsp_lsf.h │ │ │ │ │ │ ├── lsp_tab.h │ │ │ │ │ │ ├── mac_32.h │ │ │ │ │ │ ├── mode.h │ │ │ │ │ │ ├── mpy_32.h │ │ │ │ │ │ ├── mpy_32_16.h │ │ │ │ │ │ ├── mult.h │ │ │ │ │ │ ├── mult_r.h │ │ │ │ │ │ ├── n_proc.h │ │ │ │ │ │ ├── negate.h │ │ │ │ │ │ ├── norm_l.h │ │ │ │ │ │ ├── norm_s.h │ │ │ │ │ │ ├── oper_32b.h │ │ │ │ │ │ ├── p_ol_wgh.h │ │ │ │ │ │ ├── pow2.h │ │ │ │ │ │ ├── pred_lt.h │ │ │ │ │ │ ├── pvgsmamr.h │ │ │ │ │ │ ├── q_plsf.h │ │ │ │ │ │ ├── q_plsf_3_tbl.h │ │ │ │ │ │ ├── q_plsf_5_tbl.h │ │ │ │ │ │ ├── qgain475_tab.h │ │ │ │ │ │ ├── qua_gain.h │ │ │ │ │ │ ├── qua_gain_tbl.h │ │ │ │ │ │ ├── reorder.h │ │ │ │ │ │ ├── residu.h │ │ │ │ │ │ ├── reverse_bits.h │ │ │ │ │ │ ├── round.h │ │ │ │ │ │ ├── set_zero.h │ │ │ │ │ │ ├── shl.h │ │ │ │ │ │ ├── shr.h │ │ │ │ │ │ ├── shr_r.h │ │ │ │ │ │ ├── sqrt_l.h │ │ │ │ │ │ ├── sub.h │ │ │ │ │ │ ├── syn_filt.h │ │ │ │ │ │ ├── typedef.h │ │ │ │ │ │ ├── vad.h │ │ │ │ │ │ ├── weight_a.h │ │ │ │ │ │ ├── window_tab.h │ │ │ │ │ │ └── wmf_to_ets.h │ │ │ │ │ └── src │ │ │ │ │ │ ├── add.cpp │ │ │ │ │ │ ├── az_lsp.cpp │ │ │ │ │ │ ├── bitno_tab.cpp │ │ │ │ │ │ ├── bitreorder_tab.cpp │ │ │ │ │ │ ├── bits2prm.cpp │ │ │ │ │ │ ├── c2_9pf_tab.cpp │ │ │ │ │ │ ├── copy.cpp │ │ │ │ │ │ ├── div_32.cpp │ │ │ │ │ │ ├── div_s.cpp │ │ │ │ │ │ ├── extract_h.cpp │ │ │ │ │ │ ├── extract_l.cpp │ │ │ │ │ │ ├── gains_tbl.cpp │ │ │ │ │ │ ├── gc_pred.cpp │ │ │ │ │ │ ├── get_const_tbls.cpp │ │ │ │ │ │ ├── gmed_n.cpp │ │ │ │ │ │ ├── gray_tbl.cpp │ │ │ │ │ │ ├── grid_tbl.cpp │ │ │ │ │ │ ├── int_lpc.cpp │ │ │ │ │ │ ├── inv_sqrt.cpp │ │ │ │ │ │ ├── inv_sqrt_tbl.cpp │ │ │ │ │ │ ├── l_abs.cpp │ │ │ │ │ │ ├── l_deposit_h.cpp │ │ │ │ │ │ ├── l_deposit_l.cpp │ │ │ │ │ │ ├── l_shr_r.cpp │ │ │ │ │ │ ├── log2.cpp │ │ │ │ │ │ ├── log2_norm.cpp │ │ │ │ │ │ ├── log2_tbl.cpp │ │ │ │ │ │ ├── lsfwt.cpp │ │ │ │ │ │ ├── lsp.cpp │ │ │ │ │ │ ├── lsp_az.cpp │ │ │ │ │ │ ├── lsp_lsf.cpp │ │ │ │ │ │ ├── lsp_lsf_tbl.cpp │ │ │ │ │ │ ├── lsp_tab.cpp │ │ │ │ │ │ ├── mult_r.cpp │ │ │ │ │ │ ├── negate.cpp │ │ │ │ │ │ ├── norm_l.cpp │ │ │ │ │ │ ├── norm_s.cpp │ │ │ │ │ │ ├── overflow_tbl.cpp │ │ │ │ │ │ ├── ph_disp_tab.cpp │ │ │ │ │ │ ├── pow2.cpp │ │ │ │ │ │ ├── pow2_tbl.cpp │ │ │ │ │ │ ├── pred_lt.cpp │ │ │ │ │ │ ├── q_plsf.cpp │ │ │ │ │ │ ├── q_plsf_3.cpp │ │ │ │ │ │ ├── q_plsf_3_tbl.cpp │ │ │ │ │ │ ├── q_plsf_5.cpp │ │ │ │ │ │ ├── q_plsf_5_tbl.cpp │ │ │ │ │ │ ├── qua_gain_tbl.cpp │ │ │ │ │ │ ├── r_fft.cpp │ │ │ │ │ │ ├── reorder.cpp │ │ │ │ │ │ ├── residu.cpp │ │ │ │ │ │ ├── round.cpp │ │ │ │ │ │ ├── set_zero.cpp │ │ │ │ │ │ ├── shr.cpp │ │ │ │ │ │ ├── shr_r.cpp │ │ │ │ │ │ ├── sqrt_l.cpp │ │ │ │ │ │ ├── sqrt_l_tbl.cpp │ │ │ │ │ │ ├── sub.cpp │ │ │ │ │ │ ├── syn_filt.cpp │ │ │ │ │ │ ├── vad1.cpp │ │ │ │ │ │ ├── vad2.cpp │ │ │ │ │ │ ├── weight_a.cpp │ │ │ │ │ │ └── window_tab.cpp │ │ │ │ ├── dec │ │ │ │ │ ├── Android.mk │ │ │ │ │ ├── include │ │ │ │ │ │ ├── decoder_gsm_amr.h │ │ │ │ │ │ └── pvamrnbdecoder_api.h │ │ │ │ │ └── src │ │ │ │ │ │ ├── a_refl.cpp │ │ │ │ │ │ ├── a_refl.h │ │ │ │ │ │ ├── agc.cpp │ │ │ │ │ │ ├── agc.h │ │ │ │ │ │ ├── amrdecode.cpp │ │ │ │ │ │ ├── amrdecode.h │ │ │ │ │ │ ├── b_cn_cod.cpp │ │ │ │ │ │ ├── b_cn_cod.h │ │ │ │ │ │ ├── bgnscd.cpp │ │ │ │ │ │ ├── bgnscd.h │ │ │ │ │ │ ├── c_g_aver.cpp │ │ │ │ │ │ ├── c_g_aver.h │ │ │ │ │ │ ├── d1035pf.cpp │ │ │ │ │ │ ├── d1035pf.h │ │ │ │ │ │ ├── d2_11pf.cpp │ │ │ │ │ │ ├── d2_11pf.h │ │ │ │ │ │ ├── d2_9pf.cpp │ │ │ │ │ │ ├── d2_9pf.h │ │ │ │ │ │ ├── d3_14pf.cpp │ │ │ │ │ │ ├── d3_14pf.h │ │ │ │ │ │ ├── d4_17pf.cpp │ │ │ │ │ │ ├── d4_17pf.h │ │ │ │ │ │ ├── d8_31pf.cpp │ │ │ │ │ │ ├── d8_31pf.h │ │ │ │ │ │ ├── d_gain_c.cpp │ │ │ │ │ │ ├── d_gain_p.cpp │ │ │ │ │ │ ├── d_plsf.cpp │ │ │ │ │ │ ├── d_plsf_3.cpp │ │ │ │ │ │ ├── d_plsf_5.cpp │ │ │ │ │ │ ├── dec_amr.cpp │ │ │ │ │ │ ├── dec_amr.h │ │ │ │ │ │ ├── dec_gain.cpp │ │ │ │ │ │ ├── dec_gain.h │ │ │ │ │ │ ├── dec_input_format_tab.cpp │ │ │ │ │ │ ├── dec_lag3.cpp │ │ │ │ │ │ ├── dec_lag3.h │ │ │ │ │ │ ├── dec_lag6.cpp │ │ │ │ │ │ ├── dec_lag6.h │ │ │ │ │ │ ├── decoder_gsm_amr.cpp │ │ │ │ │ │ ├── dtx_dec.cpp │ │ │ │ │ │ ├── dtx_dec.h │ │ │ │ │ │ ├── ec_gains.cpp │ │ │ │ │ │ ├── ec_gains.h │ │ │ │ │ │ ├── ex_ctrl.cpp │ │ │ │ │ │ ├── ex_ctrl.h │ │ │ │ │ │ ├── gsmamr_dec.h │ │ │ │ │ │ ├── if2_to_ets.cpp │ │ │ │ │ │ ├── if2_to_ets.h │ │ │ │ │ │ ├── int_lsf.cpp │ │ │ │ │ │ ├── lsp_avg.cpp │ │ │ │ │ │ ├── lsp_avg.h │ │ │ │ │ │ ├── ph_disp.cpp │ │ │ │ │ │ ├── ph_disp.h │ │ │ │ │ │ ├── post_pro.cpp │ │ │ │ │ │ ├── post_pro.h │ │ │ │ │ │ ├── preemph.cpp │ │ │ │ │ │ ├── preemph.h │ │ │ │ │ │ ├── pstfilt.cpp │ │ │ │ │ │ ├── pstfilt.h │ │ │ │ │ │ ├── pvgsmamrdecoder.cpp │ │ │ │ │ │ ├── pvgsmamrdecoder.h │ │ │ │ │ │ ├── pvgsmamrdecoder_dpi.h │ │ │ │ │ │ ├── qgain475_tab.cpp │ │ │ │ │ │ ├── sp_dec.cpp │ │ │ │ │ │ ├── sp_dec.h │ │ │ │ │ │ └── wmf_to_ets.cpp │ │ │ │ └── enc │ │ │ │ │ ├── Android.mk │ │ │ │ │ ├── include │ │ │ │ │ └── gsmamr_encoder_wrapper.h │ │ │ │ │ └── src │ │ │ │ │ ├── amrencode.cpp │ │ │ │ │ ├── amrencode.h │ │ │ │ │ ├── autocorr.cpp │ │ │ │ │ ├── autocorr.h │ │ │ │ │ ├── c1035pf.cpp │ │ │ │ │ ├── c1035pf.h │ │ │ │ │ ├── c2_11pf.cpp │ │ │ │ │ ├── c2_11pf.h │ │ │ │ │ ├── c2_9pf.cpp │ │ │ │ │ ├── c2_9pf.h │ │ │ │ │ ├── c3_14pf.cpp │ │ │ │ │ ├── c3_14pf.h │ │ │ │ │ ├── c4_17pf.cpp │ │ │ │ │ ├── c4_17pf.h │ │ │ │ │ ├── c8_31pf.cpp │ │ │ │ │ ├── c8_31pf.h │ │ │ │ │ ├── calc_cor.cpp │ │ │ │ │ ├── calc_cor.h │ │ │ │ │ ├── calc_en.cpp │ │ │ │ │ ├── calc_en.h │ │ │ │ │ ├── cbsearch.cpp │ │ │ │ │ ├── cbsearch.h │ │ │ │ │ ├── cl_ltp.cpp │ │ │ │ │ ├── cl_ltp.h │ │ │ │ │ ├── cod_amr.cpp │ │ │ │ │ ├── cod_amr.h │ │ │ │ │ ├── convolve.cpp │ │ │ │ │ ├── convolve.h │ │ │ │ │ ├── cor_h.cpp │ │ │ │ │ ├── cor_h.h │ │ │ │ │ ├── cor_h_x.cpp │ │ │ │ │ ├── cor_h_x.h │ │ │ │ │ ├── cor_h_x2.cpp │ │ │ │ │ ├── cor_h_x2.h │ │ │ │ │ ├── corrwght_tab.cpp │ │ │ │ │ ├── div_32.cpp │ │ │ │ │ ├── div_32.h │ │ │ │ │ ├── dtx_enc.cpp │ │ │ │ │ ├── dtx_enc.h │ │ │ │ │ ├── enc_lag3.cpp │ │ │ │ │ ├── enc_lag3.h │ │ │ │ │ ├── enc_lag6.cpp │ │ │ │ │ ├── enc_lag6.h │ │ │ │ │ ├── enc_output_format_tab.cpp │ │ │ │ │ ├── ets_to_if2.cpp │ │ │ │ │ ├── ets_to_if2.h │ │ │ │ │ ├── ets_to_wmf.cpp │ │ │ │ │ ├── ets_to_wmf.h │ │ │ │ │ ├── g_adapt.cpp │ │ │ │ │ ├── g_adapt.h │ │ │ │ │ ├── g_code.cpp │ │ │ │ │ ├── g_code.h │ │ │ │ │ ├── g_pitch.cpp │ │ │ │ │ ├── g_pitch.h │ │ │ │ │ ├── gain_q.cpp │ │ │ │ │ ├── gain_q.h │ │ │ │ │ ├── gsmamr_enc.h │ │ │ │ │ ├── gsmamr_encoder_wrapper.cpp │ │ │ │ │ ├── hp_max.cpp │ │ │ │ │ ├── hp_max.h │ │ │ │ │ ├── inter_36.cpp │ │ │ │ │ ├── inter_36.h │ │ │ │ │ ├── inter_36_tab.cpp │ │ │ │ │ ├── inter_36_tab.h │ │ │ │ │ ├── l_abs.cpp │ │ │ │ │ ├── l_abs.h │ │ │ │ │ ├── l_comp.cpp │ │ │ │ │ ├── l_extract.cpp │ │ │ │ │ ├── l_negate.cpp │ │ │ │ │ ├── lag_wind.cpp │ │ │ │ │ ├── lag_wind.h │ │ │ │ │ ├── lag_wind_tab.cpp │ │ │ │ │ ├── lag_wind_tab.h │ │ │ │ │ ├── levinson.cpp │ │ │ │ │ ├── levinson.h │ │ │ │ │ ├── lflg_upd.cpp │ │ │ │ │ ├── lpc.cpp │ │ │ │ │ ├── lpc.h │ │ │ │ │ ├── ol_ltp.cpp │ │ │ │ │ ├── ol_ltp.h │ │ │ │ │ ├── p_ol_wgh.cpp │ │ │ │ │ ├── pitch_fr.cpp │ │ │ │ │ ├── pitch_fr.h │ │ │ │ │ ├── pitch_ol.cpp │ │ │ │ │ ├── pitch_ol.h │ │ │ │ │ ├── pre_big.cpp │ │ │ │ │ ├── pre_big.h │ │ │ │ │ ├── pre_proc.cpp │ │ │ │ │ ├── pre_proc.h │ │ │ │ │ ├── prm2bits.cpp │ │ │ │ │ ├── prm2bits.h │ │ │ │ │ ├── q_gain_c.cpp │ │ │ │ │ ├── q_gain_c.h │ │ │ │ │ ├── q_gain_p.cpp │ │ │ │ │ ├── q_gain_p.h │ │ │ │ │ ├── qgain475.cpp │ │ │ │ │ ├── qgain475.h │ │ │ │ │ ├── qgain795.cpp │ │ │ │ │ ├── qgain795.h │ │ │ │ │ ├── qua_gain.cpp │ │ │ │ │ ├── s10_8pf.cpp │ │ │ │ │ ├── s10_8pf.h │ │ │ │ │ ├── set_sign.cpp │ │ │ │ │ ├── set_sign.h │ │ │ │ │ ├── sid_sync.cpp │ │ │ │ │ ├── sid_sync.h │ │ │ │ │ ├── sp_enc.cpp │ │ │ │ │ ├── sp_enc.h │ │ │ │ │ ├── spreproc.cpp │ │ │ │ │ ├── spreproc.h │ │ │ │ │ ├── spstproc.cpp │ │ │ │ │ ├── spstproc.h │ │ │ │ │ ├── ton_stab.cpp │ │ │ │ │ ├── ton_stab.h │ │ │ │ │ ├── vad1.cpp │ │ │ │ │ ├── vad1.h │ │ │ │ │ └── vad2.h │ │ │ │ └── common │ │ │ │ └── dec │ │ │ │ ├── Android.mk │ │ │ │ └── include │ │ │ │ └── pvgsmamrdecoderinterface.h │ │ ├── oscl │ │ │ ├── oscl_aostatus.h │ │ │ ├── oscl_aostatus.inl │ │ │ ├── oscl_assert.h │ │ │ ├── oscl_assert.inl │ │ │ ├── oscl_base.h │ │ │ ├── oscl_base_alloc.h │ │ │ ├── oscl_base_macros.h │ │ │ ├── oscl_bin_stream.h │ │ │ ├── oscl_bin_stream.inl │ │ │ ├── oscl_byte_order.h │ │ │ ├── oscl_byte_order.inl │ │ │ ├── oscl_configfile_list.h │ │ │ ├── oscl_defalloc.h │ │ │ ├── oscl_dll.h │ │ │ ├── oscl_dns.h │ │ │ ├── oscl_double_list.h │ │ │ ├── oscl_double_list.inl │ │ │ ├── oscl_errno.h │ │ │ ├── oscl_errno.inl │ │ │ ├── oscl_error.h │ │ │ ├── oscl_error_allocator.h │ │ │ ├── oscl_error_codes.h │ │ │ ├── oscl_error_imp.h │ │ │ ├── oscl_error_imp_cppexceptions.h │ │ │ ├── oscl_error_imp_fatalerror.h │ │ │ ├── oscl_error_imp_jumps.h │ │ │ ├── oscl_error_trapcleanup.h │ │ │ ├── oscl_exception.h │ │ │ ├── oscl_exclusive_ptr.h │ │ │ ├── oscl_file_cache.h │ │ │ ├── oscl_file_dir_utils.h │ │ │ ├── oscl_file_find.h │ │ │ ├── oscl_file_handle.h │ │ │ ├── oscl_file_io.h │ │ │ ├── oscl_file_manager.h │ │ │ ├── oscl_file_server.h │ │ │ ├── oscl_file_types.h │ │ │ ├── oscl_heapbase.h │ │ │ ├── oscl_heapbase.inl │ │ │ ├── oscl_init.h │ │ │ ├── oscl_int64_utils.h │ │ │ ├── oscl_library_common.h │ │ │ ├── oscl_library_list.h │ │ │ ├── oscl_linked_list.h │ │ │ ├── oscl_lock_base.h │ │ │ ├── oscl_map.h │ │ │ ├── oscl_math.h │ │ │ ├── oscl_math.inl │ │ │ ├── oscl_media_data.h │ │ │ ├── oscl_media_status.h │ │ │ ├── oscl_mem.h │ │ │ ├── oscl_mem.inl │ │ │ ├── oscl_mem_audit.h │ │ │ ├── oscl_mem_auto_ptr.h │ │ │ ├── oscl_mem_basic_functions.h │ │ │ ├── oscl_mem_basic_functions.inl │ │ │ ├── oscl_mem_inst.h │ │ │ ├── oscl_mem_mempool.h │ │ │ ├── oscl_mempool_allocator.h │ │ │ ├── oscl_mutex.h │ │ │ ├── oscl_namestring.h │ │ │ ├── oscl_opaque_type.h │ │ │ ├── oscl_priqueue.h │ │ │ ├── oscl_procstatus.h │ │ │ ├── oscl_queue.h │ │ │ ├── oscl_rand.h │ │ │ ├── oscl_rand.inl │ │ │ ├── oscl_refcounter.h │ │ │ ├── oscl_refcounter_memfrag.h │ │ │ ├── oscl_registry_access_client.h │ │ │ ├── oscl_registry_client.h │ │ │ ├── oscl_registry_serv_impl.h │ │ │ ├── oscl_registry_serv_impl_global.h │ │ │ ├── oscl_registry_serv_impl_tls.h │ │ │ ├── oscl_registry_types.h │ │ │ ├── oscl_scheduler.h │ │ │ ├── oscl_scheduler_ao.h │ │ │ ├── oscl_scheduler_aobase.h │ │ │ ├── oscl_scheduler_readyq.h │ │ │ ├── oscl_scheduler_threadcontext.h │ │ │ ├── oscl_scheduler_tuneables.h │ │ │ ├── oscl_scheduler_types.h │ │ │ ├── oscl_semaphore.h │ │ │ ├── oscl_shared_lib_interface.h │ │ │ ├── oscl_shared_library.h │ │ │ ├── oscl_shared_ptr.h │ │ │ ├── oscl_singleton.h │ │ │ ├── oscl_snprintf.h │ │ │ ├── oscl_socket.h │ │ │ ├── oscl_socket_types.h │ │ │ ├── oscl_stdstring.h │ │ │ ├── oscl_str_ptr_len.h │ │ │ ├── oscl_string.h │ │ │ ├── oscl_string_containers.h │ │ │ ├── oscl_string_rep.h │ │ │ ├── oscl_string_uri.h │ │ │ ├── oscl_string_utf8.h │ │ │ ├── oscl_string_utils.h │ │ │ ├── oscl_string_xml.h │ │ │ ├── oscl_tagtree.h │ │ │ ├── oscl_thread.h │ │ │ ├── oscl_tickcount.h │ │ │ ├── oscl_tickcount.inl │ │ │ ├── oscl_time.h │ │ │ ├── oscl_time.inl │ │ │ ├── oscl_timer.h │ │ │ ├── oscl_tls.h │ │ │ ├── oscl_tree.h │ │ │ ├── oscl_types.h │ │ │ ├── oscl_utf8conv.h │ │ │ ├── oscl_uuid.h │ │ │ ├── oscl_vector.h │ │ │ ├── osclconfig.h │ │ │ ├── osclconfig_ansi_memory.h │ │ │ ├── osclconfig_check.h │ │ │ ├── osclconfig_compiler_warnings.h │ │ │ ├── osclconfig_error.h │ │ │ ├── osclconfig_error_check.h │ │ │ ├── osclconfig_global_new_delete.h │ │ │ ├── osclconfig_global_placement_new.h │ │ │ ├── osclconfig_io.h │ │ │ ├── osclconfig_io_check.h │ │ │ ├── osclconfig_ix86.h │ │ │ ├── osclconfig_lib.h │ │ │ ├── osclconfig_lib_check.h │ │ │ ├── osclconfig_limits_typedefs.h │ │ │ ├── osclconfig_memory.h │ │ │ ├── osclconfig_memory_check.h │ │ │ ├── osclconfig_no_os.h │ │ │ ├── osclconfig_proc.h │ │ │ ├── osclconfig_proc_check.h │ │ │ ├── osclconfig_proc_unix_android.h │ │ │ ├── osclconfig_proc_unix_common.h │ │ │ ├── osclconfig_time.h │ │ │ ├── osclconfig_time_check.h │ │ │ ├── osclconfig_unix_android.h │ │ │ ├── osclconfig_unix_common.h │ │ │ ├── osclconfig_util.h │ │ │ └── osclconfig_util_check.h │ │ └── wrapper.cpp │ │ ├── libs │ │ ├── arm64-v8a │ │ │ └── libamr-codec.so │ │ ├── armeabi-v7a │ │ │ └── libamr-codec.so │ │ ├── armeabi │ │ │ └── libamr-codec.so │ │ ├── mips │ │ │ └── libamr-codec.so │ │ ├── mips64 │ │ │ └── libamr-codec.so │ │ ├── x86 │ │ │ └── libamr-codec.so │ │ └── x86_64 │ │ │ └── libamr-codec.so │ │ └── res │ │ └── values │ │ └── strings.xml ├── app │ ├── .gitignore │ ├── app.iml │ ├── build.gradle │ ├── proguard-rules.pro │ └── src │ │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── hikvh │ │ │ └── media │ │ │ └── ApplicationTest.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ └── io │ │ │ └── kvh │ │ │ └── media │ │ │ ├── KCacheUtils.java │ │ │ ├── demo │ │ │ ├── AmrFileDecoder.java │ │ │ └── MainActivity.java │ │ │ └── sound │ │ │ ├── Codec.java │ │ │ ├── Filer.java │ │ │ ├── Recorder.java │ │ │ ├── SoundMan.java │ │ │ ├── Supporter.java │ │ │ └── Uploader.java │ │ └── res │ │ ├── layout │ │ └── activity_main.xml │ │ ├── mipmap-hdpi │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ └── ic_launcher.png │ │ ├── raw │ │ └── demo.amr │ │ └── values │ │ ├── dimens.xml │ │ └── strings.xml ├── build.gradle ├── demo.iml ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── opencore-amr-Android.iml └── settings.gradle ├── FAQ.md ├── FAQ_CN.md ├── LICENSE ├── README.md ├── README_CN.md ├── arts └── android_studio_integration.png ├── git-ci-ph └── git-pl /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /captures 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | 17 | # Gradle files 18 | .gradle/ 19 | build/ 20 | 21 | # Local configuration file (sdk path, etc) 22 | /demo/local.properties 23 | 24 | # Proguard folder generated by Eclipse 25 | proguard/ 26 | 27 | # Log Files 28 | *.log 29 | 30 | # jetbrain 31 | .idea/ 32 | .navigation/ 33 | app/build_release.gradle 34 | -------------------------------------------------------------------------------- /Codec/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | /captures 3 | # Built application files 4 | *.apk 5 | *.ap_ 6 | 7 | # Files for the Dalvik VM 8 | *.dex 9 | 10 | # Java class files 11 | *.class 12 | 13 | # Generated files 14 | bin/ 15 | gen/ 16 | 17 | # Gradle files 18 | .gradle/ 19 | build/ 20 | 21 | /local.properties 22 | # Local configuration file (sdk path, etc) 23 | 24 | # Proguard folder generated by Eclipse 25 | proguard/ 26 | 27 | # Log Files 28 | *.log 29 | 30 | # jetbrain 31 | .idea/ 32 | .navigation/ 33 | app/build_release.gradle -------------------------------------------------------------------------------- /Codec/Codec.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /Codec/amr/.gitignore: -------------------------------------------------------------------------------- 1 | /src/main/obj 2 | /build 3 | -------------------------------------------------------------------------------- /Codec/amr/bintray.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'com.github.dcendents.android-maven' 3 | apply plugin: 'com.jfrog.bintray' 4 | 5 | // This is the library version used when deploying the artifact 6 | group = PROJ_GROUP 7 | version = PROJ_VERSION 8 | 9 | install { 10 | repositories.mavenInstaller { 11 | // This generates POM.xml with proper parameters 12 | pom { 13 | project { 14 | packaging 'aar' 15 | description PROJ_DESCRIPTION 16 | 17 | // Add your description here 18 | name PROJ_POM_NAME 19 | url PROJ_WEBSITEURL 20 | 21 | // Set your license 22 | licenses { 23 | license { 24 | name PROJ_LICENCE_NAME 25 | url PROJ_LICENCE_URL 26 | distribution PROJ_LICENCE_DEST 27 | } 28 | } 29 | developers { 30 | developer { 31 | id DEVELOPER_ID 32 | name DEVELOPER_NAME 33 | email DEVELOPER_EMAIL 34 | } 35 | } 36 | scm { 37 | connection PROJ_VCSURL 38 | developerConnection PROJ_VCSURL 39 | url PROJ_WEBSITEURL 40 | } 41 | } 42 | } 43 | } 44 | } 45 | 46 | task sourcesJar(type: Jar) { 47 | from android.sourceSets.main.java.srcDirs 48 | classifier = 'sources' 49 | } 50 | 51 | task javadoc(type: Javadoc) { 52 | source = android.sourceSets.main.java.srcDirs 53 | classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) 54 | } 55 | 56 | task javadocJar(type: Jar, dependsOn: javadoc) { 57 | classifier = 'javadoc' 58 | from javadoc.destinationDir 59 | } 60 | 61 | artifacts { 62 | archives javadocJar 63 | archives sourcesJar 64 | } 65 | 66 | Properties properties = new Properties() 67 | properties.load(project.rootProject.file('local.properties').newDataInputStream()) 68 | 69 | bintray { 70 | user = properties.getProperty("bintray.user") 71 | key = properties.getProperty("bintray.apikey") 72 | 73 | configurations = ['archives'] 74 | pkg { 75 | repo = "maven" 76 | name = PROJ_NAME 77 | desc = PROJ_DESCRIPTION 78 | websiteUrl = PROJ_WEBSITEURL 79 | issueTrackerUrl = PROJ_ISSUETRACKERURL 80 | vcsUrl = PROJ_VCSURL 81 | licenses = ["Apache-2.0"] 82 | version { 83 | desc = PROJ_DESCRIPTION 84 | gpg { 85 | sign = true //Determines whether to GPG sign the files. The default is false 86 | passphrase = properties.getProperty("bintray.gpg.password") 87 | //Optional. The passphrase for GPG signing' 88 | } 89 | } 90 | } 91 | } -------------------------------------------------------------------------------- /Codec/amr/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 23 5 | buildToolsVersion '23.0.0' 6 | 7 | sourceSets { 8 | main { 9 | jniLibs.srcDirs = ['src/main/libs'] 10 | jni.srcDirs = [] 11 | } 12 | } 13 | 14 | defaultConfig { 15 | minSdkVersion 9 16 | targetSdkVersion 19 17 | versionCode 1 18 | versionName "1.0" 19 | } 20 | 21 | buildTypes { 22 | release { 23 | minifyEnabled false 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | } 26 | } 27 | } 28 | 29 | dependencies { 30 | compile fileTree(dir: 'libs', include: ['*.jar']) 31 | } 32 | 33 | apply from: './bintray.gradle' -------------------------------------------------------------------------------- /Codec/amr/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | PROJ_GROUP=io.kvh 21 | PROJ_ARTIFACTID=amr 22 | PROJ_VERSION=1.1.1 23 | 24 | PROJ_NAME=opencore-amr-android 25 | PROJ_POM_NAME=Opencore Amr Android 26 | PROJ_WEBSITEURL=https://github.com/kevinho/opencore-amr-android 27 | PROJ_ISSUETRACKERURL=https://github.com/kevinho/opencore-amr-android/issues 28 | PROJ_VCSURL=https://github.com/kevinho/opencore-amr-android.git 29 | PROJ_DESCRIPTION=Opencore amr codec & Solution for packaging arm audio to file 30 | 31 | PROJ_LICENCE_NAME=The Apache Software License, Version 2.0 32 | PROJ_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt 33 | PROJ_LICENCE_DEST=repo 34 | 35 | DEVELOPER_ID=kevinho 36 | DEVELOPER_NAME=Kevin Ho 37 | DEVELOPER_EMAIL=freefacefly@gmail.com -------------------------------------------------------------------------------- /Codec/amr/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/changbinhe/Documents/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /Codec/amr/src/androidTest/java/com/hikvh/media/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.hikvh.media; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /Codec/amr/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /Codec/amr/src/main/java/io/kvh/media/amr/AmrDecoder.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media.amr; 2 | 3 | /** 4 | * Created by kv.h on 14/11/21. 5 | */ 6 | public class AmrDecoder { 7 | 8 | public static native long init(); 9 | 10 | public static native void exit(long state); 11 | 12 | public static native void decode(long state, byte[] in, short[] out); 13 | 14 | static { 15 | System.loadLibrary("amr-codec"); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Codec/amr/src/main/java/io/kvh/media/amr/AmrEncoder.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media.amr; 2 | 3 | /** 4 | * Created by kv.h on 14/11/21. 5 | */ 6 | public class AmrEncoder { 7 | 8 | 9 | /** 10 | * http://read.pudn.com/downloads466/doc/fileformat/1956393/AMR%20format.pdf 11 | CMR MODE FRAME SIZE( in bytes ) 12 | 0 AMR 4.75 13 13 | 1 AMR 5.15 14 14 | 2 AMR 5.9 16 15 | 3 AMR 6.7 18 16 | 4 AMR 7.4 20 17 | 5 AMR 7.95 21 18 | 6 AMR 10.2 27 19 | 7 AMR 12.2 32 20 | */ 21 | 22 | public enum Mode { 23 | MR475,/* 4.75 kbps */ 24 | MR515, /* 5.15 kbps */ 25 | MR59, /* 5.90 kbps */ 26 | MR67, /* 6.70 kbps */ 27 | MR74, /* 7.40 kbps */ 28 | MR795, /* 7.95 kbps */ 29 | MR102, /* 10.2 kbps */ 30 | MR122, /* 12.2 kbps */ 31 | MRDTX, /* DTX */ 32 | N_MODES /* Not Used */ 33 | } 34 | 35 | public static native void init(int dtx); 36 | 37 | public static native int encode(int mode, short[] in, byte[] out); 38 | 39 | public static native void reset(); 40 | 41 | public static native void exit(); 42 | 43 | static { 44 | System.loadLibrary("amr-codec"); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | PV_TOP := $(LOCAL_PATH)/opencore 5 | PV_INCLUDES := $(LOCAL_PATH)/oscl \ 6 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/common/include \ 7 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/common/src \ 8 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/dec/include \ 9 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/dec/src \ 10 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/enc/include \ 11 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/enc/src \ 12 | $(PV_TOP)/codecs_v2/audio/gsm_amr/common/dec/include 13 | 14 | include $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk 15 | include $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk 16 | include $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk 17 | 18 | include $(CLEAR_VARS) 19 | 20 | LOCAL_PATH := $(PV_TOP)/.. 21 | LOCAL_MODULE := amr-codec 22 | LOCAL_SRC_FILES := $(LOCAL_PATH)/amr_encoder.cpp \ 23 | $(LOCAL_PATH)/amr_decoder.cpp \ 24 | $(LOCAL_PATH)/wrapper.cpp 25 | 26 | LOCAL_C_INCLUDES := $(PV_INCLUDES) 27 | 28 | 29 | LOCAL_LDLIBS := -L$(SYSROOT)/usr/lib -llog 30 | LOCAL_SHARED_LIBRARIES := libpv_amr_nb_common_lib \ 31 | libpvencoder_gsmamr \ 32 | libpvdecoder_gsmamr 33 | 34 | 35 | include $(BUILD_SHARED_LIBRARY) 36 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/Application.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | APP_MODULES := amr-codec 3 | APP_PLATFORM := android-16 4 | APP_OPTM := release 5 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/amr_decoder.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | namespace amr_decode { 6 | 7 | #ifndef _Included_com_hikvh_media_amr_AmrDecoder 8 | #define _Included_com_hikvh_media_amr_AmrDecoder 9 | 10 | #ifdef __cplusplus 11 | extern "C" { 12 | #endif 13 | 14 | JNIEXPORT jlong JNICALL 15 | Java_io_kvh_media_amr_AmrDecoder_init(JNIEnv *env, jclass type) { 16 | return (jlong) Decoder_Interface_init(); 17 | } 18 | 19 | JNIEXPORT void JNICALL 20 | Java_io_kvh_media_amr_AmrDecoder_exit(JNIEnv *env, jclass type, jlong state) { 21 | Decoder_Interface_exit((void *) state); 22 | } 23 | 24 | JNIEXPORT void JNICALL 25 | Java_io_kvh_media_amr_AmrDecoder_decode(JNIEnv *env, jclass, jlong state, jbyteArray in, jshortArray out) { 26 | 27 | jsize inLen = env->GetArrayLength(in); 28 | jbyte inBuf[inLen]; 29 | env->GetByteArrayRegion(in, 0, inLen, inBuf); 30 | 31 | jsize outLen = env->GetArrayLength(out); 32 | short outBuf[outLen]; 33 | 34 | Decoder_Interface_Decode((void *) state, (const unsigned char *) inBuf, (short *) outBuf); 35 | 36 | env->SetShortArrayRegion(out, 0, outLen, outBuf); 37 | } 38 | 39 | #ifdef __cplusplus 40 | } 41 | #endif 42 | #endif 43 | 44 | } 45 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/amr_encoder.cpp: -------------------------------------------------------------------------------- 1 | /* DO NOT EDIT THIS FILE - it is machine generated */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #ifndef _Included_com_hikvh_media_amr_AmrEncoder 8 | #define _Included_com_hikvh_media_amr_AmrEncoder 9 | 10 | struct encoder_state *state; 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | JNIEXPORT void JNICALL 17 | Java_io_kvh_media_amr_AmrEncoder_init(JNIEnv *env, jclass type, jint dtx) { 18 | state = (encoder_state *) Encoder_Interface_init(dtx); 19 | } 20 | 21 | JNIEXPORT void JNICALL 22 | Java_io_kvh_media_amr_AmrEncoder_reset(JNIEnv *env, jclass type) { 23 | Encoder_Interface_reset(state); 24 | } 25 | 26 | JNIEXPORT void JNICALL 27 | Java_io_kvh_media_amr_AmrEncoder_exit(JNIEnv *env, jclass type) { 28 | Encoder_Interface_exit(state); 29 | } 30 | 31 | JNIEXPORT jint JNICALL 32 | Java_io_kvh_media_amr_AmrEncoder_encode 33 | (JNIEnv *env, jclass, jint mode, jshortArray in, jbyteArray out) { 34 | 35 | jsize inLen = env->GetArrayLength(in); 36 | jshort inBuf[inLen]; 37 | env->GetShortArrayRegion(in, 0, inLen, inBuf); 38 | 39 | jsize outLen = env->GetArrayLength(out); 40 | jbyte outBuf[outLen]; 41 | int encodeLength; 42 | 43 | encodeLength = Encoder_Interface_Encode(state, (Mode) mode, (const short *) inBuf, 44 | (unsigned char *) outBuf); 45 | 46 | env->SetByteArrayRegion(out, 0, outLen, outBuf); 47 | return encodeLength; 48 | } 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | #endif 54 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/interf_dec.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 2009 Martin Storsjo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef OPENCORE_AMRNB_INTERF_DEC_H 20 | #define OPENCORE_AMRNB_INTERF_DEC_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | void* Decoder_Interface_init(void); 27 | void Decoder_Interface_exit(void* state); 28 | void Decoder_Interface_Decode(void* state, const unsigned char* in, short* out); 29 | 30 | #ifdef __cplusplus 31 | } 32 | #endif 33 | 34 | #endif 35 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/interf_enc.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 2009 Martin Storsjo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef OPENCORE_AMRNB_INTERF_ENC_H 20 | #define OPENCORE_AMRNB_INTERF_ENC_H 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | #ifndef AMRNB_WRAPPER_INTERNAL 27 | /* Copied from enc/src/gsmamr_enc.h */ 28 | enum Mode { 29 | MR475 = 0,/* 4.75 kbps */ 30 | MR515, /* 5.15 kbps */ 31 | MR59, /* 5.90 kbps */ 32 | MR67, /* 6.70 kbps */ 33 | MR74, /* 7.40 kbps */ 34 | MR795, /* 7.95 kbps */ 35 | MR102, /* 10.2 kbps */ 36 | MR122, /* 12.2 kbps */ 37 | MRDTX, /* DTX */ 38 | N_MODES /* Not Used */ 39 | }; 40 | 41 | #endif 42 | 43 | struct encoder_state { 44 | void* encCtx; 45 | void* pidSyncCtx; 46 | }; 47 | 48 | void* Encoder_Interface_init(int dtx); 49 | void Encoder_Interface_reset(void* state); 50 | void Encoder_Interface_exit(void* state); 51 | int Encoder_Interface_Encode(void* state, enum Mode mode, const short* in, unsigned char* out); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_SRC_FILES := \ 5 | src/add.cpp \ 6 | src/az_lsp.cpp \ 7 | src/bitno_tab.cpp \ 8 | src/bitreorder_tab.cpp \ 9 | src/c2_9pf_tab.cpp \ 10 | src/div_s.cpp \ 11 | src/gains_tbl.cpp \ 12 | src/gc_pred.cpp \ 13 | src/get_const_tbls.cpp \ 14 | src/gmed_n.cpp \ 15 | src/grid_tbl.cpp \ 16 | src/gray_tbl.cpp \ 17 | src/int_lpc.cpp \ 18 | src/inv_sqrt.cpp \ 19 | src/inv_sqrt_tbl.cpp \ 20 | src/l_shr_r.cpp \ 21 | src/log2.cpp \ 22 | src/log2_norm.cpp \ 23 | src/log2_tbl.cpp \ 24 | src/lsfwt.cpp \ 25 | src/lsp.cpp \ 26 | src/lsp_az.cpp \ 27 | src/lsp_lsf.cpp \ 28 | src/lsp_lsf_tbl.cpp \ 29 | src/lsp_tab.cpp \ 30 | src/mult_r.cpp \ 31 | src/norm_l.cpp \ 32 | src/norm_s.cpp \ 33 | src/overflow_tbl.cpp \ 34 | src/ph_disp_tab.cpp \ 35 | src/pow2.cpp \ 36 | src/pow2_tbl.cpp \ 37 | src/pred_lt.cpp \ 38 | src/q_plsf.cpp \ 39 | src/q_plsf_3.cpp \ 40 | src/q_plsf_3_tbl.cpp \ 41 | src/q_plsf_5.cpp \ 42 | src/q_plsf_5_tbl.cpp \ 43 | src/qua_gain_tbl.cpp \ 44 | src/reorder.cpp \ 45 | src/residu.cpp \ 46 | src/round.cpp \ 47 | src/shr.cpp \ 48 | src/shr_r.cpp \ 49 | src/sqrt_l.cpp \ 50 | src/sqrt_l_tbl.cpp \ 51 | src/sub.cpp \ 52 | src/syn_filt.cpp \ 53 | src/weight_a.cpp \ 54 | src/window_tab.cpp 55 | 56 | 57 | LOCAL_MODULE := libpv_amr_nb_common_lib 58 | 59 | LOCAL_C_INCLUDES := $(PV_INCLUDES) \ 60 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/common/src \ 61 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/common/include 62 | 63 | 64 | include $(BUILD_STATIC_LIBRARY) 65 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/get_const_tbls.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef GET_CONST_TBLS_H 19 | #define GET_CONST_TBLS_H 20 | 21 | #include "typedef.h" 22 | 23 | #ifdef __cplusplus 24 | extern "C" 25 | { 26 | #endif 27 | typedef struct 28 | { 29 | const Word16* dgray_ptr; 30 | const Word16* dico1_lsf_3_ptr; 31 | const Word16* dico1_lsf_5_ptr; 32 | const Word16* dico2_lsf_3_ptr; 33 | const Word16* dico2_lsf_5_ptr; 34 | const Word16* dico3_lsf_3_ptr; 35 | const Word16* dico3_lsf_5_ptr; 36 | const Word16* dico4_lsf_5_ptr; 37 | const Word16* dico5_lsf_5_ptr; 38 | const Word16* gray_ptr; 39 | const Word16* lsp_init_data_ptr; 40 | const Word16* mean_lsf_3_ptr; 41 | const Word16* mean_lsf_5_ptr; 42 | const Word16* mr515_3_lsf_ptr; 43 | const Word16* mr795_1_lsf_ptr; 44 | const Word16* past_rq_init_ptr; 45 | const Word16* pred_fac_3_ptr; 46 | const Word16* qua_gain_code_ptr; 47 | const Word16* qua_gain_pitch_ptr; 48 | const Word16* startPos_ptr; 49 | const Word16* table_gain_lowrates_ptr; 50 | const Word16* table_gain_highrates_ptr; 51 | const Word16* prmno_ptr; 52 | const Word16* const* bitno_ptr; 53 | const Word16* numOfBits_ptr; 54 | const Word16* const* reorderBits_ptr; 55 | const Word16* numCompressedBytes_ptr; 56 | const Word16* window_200_40_ptr; 57 | const Word16* window_160_80_ptr; 58 | const Word16* window_232_8_ptr; 59 | const Word16* ph_imp_low_MR795_ptr; 60 | const Word16* ph_imp_mid_MR795_ptr; 61 | const Word16* ph_imp_low_ptr; 62 | const Word16* ph_imp_mid_ptr; 63 | } CommonAmrTbls; 64 | 65 | OSCL_IMPORT_REF void get_const_tbls(CommonAmrTbls* tbl_struct_ptr); 66 | 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif 73 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/mode.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | /* 30 | ******************************************************************************** 31 | * 32 | * GSM AMR-NB speech codec R98 Version 7.5.0 March 2, 2001 33 | * R99 Version 3.2.0 34 | * REL-4 Version 4.0.0 35 | * 36 | ******************************************************************************** 37 | * 38 | * File : mode.h 39 | * Purpose : Declaration of mode type 40 | * 41 | ******************************************************************************** 42 | */ 43 | #ifndef mode_h 44 | #define mode_h "$Id $" 45 | 46 | /* 47 | ******************************************************************************** 48 | * INCLUDE FILES 49 | ******************************************************************************** 50 | */ 51 | 52 | 53 | #ifdef __cplusplus 54 | extern "C" 55 | { 56 | #endif 57 | 58 | /* 59 | ******************************************************************************** 60 | * DEFINITION OF DATA TYPES 61 | ******************************************************************************** 62 | */ 63 | enum Mode { MR475 = 0, 64 | MR515, 65 | MR59, 66 | MR67, 67 | MR74, 68 | MR795, 69 | MR102, 70 | MR122, 71 | 72 | MRDTX, 73 | 74 | N_MODES /* number of (SPC) modes */ 75 | 76 | }; 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/n_proc.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | /* $Id $ */ 30 | 31 | void proc_head(char *mes); 32 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/pvgsmamr.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | #ifndef __PVGSMAMR_H 30 | #define __PVGSMAMR_H 31 | 32 | 33 | // includes 34 | #include 35 | #include 36 | 37 | #include "sp_dec.h" 38 | #include "pvglobals.h" 39 | 40 | 41 | // PVGsmDecoder AO 42 | class CPVGsmDecoder : public CBase 43 | { 44 | public: 45 | IMPORT_C static CPVGsmDecoder* NewL(void); 46 | IMPORT_C ~CPVGsmDecoder(); 47 | IMPORT_C TInt StartL(void); 48 | 49 | // only port the API's used in PVPlayer 2.0 50 | IMPORT_C TInt DecodeFrame(enum Mode mode, unsigned char* compressedBlock, unsigned char* audioBuffer); 51 | IMPORT_C TInt InitDecoder(void); 52 | IMPORT_C void ExitDecoder(void); 53 | 54 | private: 55 | CPVGsmDecoder(); 56 | void ConstructL(void); 57 | 58 | Speech_Decode_FrameState* decState; 59 | enum RXFrameType rx_type; 60 | struct globalDataStruct *gds; 61 | }; 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/set_zero.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | /* 30 | ******************************************************************************** 31 | * 32 | * GSM AMR-NB speech codec R98 Version 7.5.0 March 2, 2001 33 | * R99 Version 3.2.0 34 | * REL-4 Version 4.0.0 35 | * 36 | ******************************************************************************** 37 | * 38 | * File : set_zero.h 39 | * Description : Set vector x[] to zero 40 | * 41 | * 42 | ******************************************************************************** 43 | */ 44 | #ifndef set_zero_h 45 | #define set_zero_h "$Id $" 46 | 47 | /* 48 | ******************************************************************************** 49 | * INCLUDE FILES 50 | ******************************************************************************** 51 | */ 52 | #include "typedef.h" 53 | 54 | #ifdef __cplusplus 55 | extern "C" 56 | { 57 | #endif 58 | 59 | /* 60 | ******************************************************************************** 61 | * DEFINITION OF DATA TYPES 62 | ******************************************************************************** 63 | */ 64 | 65 | /* 66 | ******************************************************************************** 67 | * DECLARATION OF PROTOTYPES 68 | ******************************************************************************** 69 | */ 70 | void Set_zero( 71 | Word16 x[], /* (o) : vector to clear */ 72 | Word16 L /* (i) : length of vector */ 73 | ); 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif 80 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/typedef.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2010 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | /* 30 | ******************************************************************************** 31 | * 32 | * GSM AMR-NB speech codec R98 Version 7.5.0 March 2, 2001 33 | * R99 Version 3.2.0 34 | * REL-4 Version 4.0.0 35 | * 36 | ******************************************************************************** 37 | * 38 | * File : typedef.c 39 | * Purpose : Basic types. 40 | * 41 | ******************************************************************************** 42 | */ 43 | #include "oscl_base_macros.h"// has integer values of PV_COMPILER 44 | #ifndef typedef_h 45 | #define typedef_h "$Id $" 46 | 47 | #undef ORIGINAL_TYPEDEF_H /* CHANGE THIS TO #define to get the */ 48 | /* "original" ETSI version of typedef.h */ 49 | /* CHANGE TO #undef for PV version */ 50 | 51 | #ifdef ORIGINAL_TYPEDEF_H 52 | /* 53 | * this is the original code from the ETSI file typedef.h 54 | */ 55 | 56 | #if defined(__unix__) || defined(__unix) 57 | typedef signed char Word8; 58 | typedef short Word16; 59 | typedef int Word32; 60 | typedef int Flag; 61 | 62 | #else 63 | #error No System recognized 64 | #endif 65 | #else /* not original typedef.h */ 66 | 67 | /* 68 | * use (improved) type definition file typdefs.h 69 | */ 70 | #include "gsm_amr_typedefs.h" 71 | 72 | #endif 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/common/src/set_zero.cpp: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | /* 30 | ******************************************************************************** 31 | * GSM AMR-NB speech codec R98 Version 7.5.0 March 2, 2001 32 | * R99 Version 3.2.0 33 | * REL-4 Version 4.0.0 34 | * 35 | ******************************************************************************** 36 | * 37 | * File : set_zero.h 38 | * 39 | ******************************************************************************** 40 | */ 41 | /* 42 | ******************************************************************************** 43 | * MODULE INCLUDE FILE AND VERSION ID 44 | ******************************************************************************** 45 | */ 46 | #include "set_zero.h" 47 | 48 | /* 49 | ******************************************************************************** 50 | * INCLUDE FILES 51 | ******************************************************************************** 52 | */ 53 | #include "typedef.h" 54 | #include "basic_op.h" 55 | 56 | /* 57 | ******************************************************************************** 58 | * PUBLIC PROGRAM CODE 59 | ******************************************************************************** 60 | */ 61 | void Set_zero( 62 | Word16 x[], /* (o) : vector to clear */ 63 | Word16 L /* (i) : length of vector */ 64 | ) 65 | { 66 | Word16 i; 67 | 68 | for (i = 0; i < L; i++) 69 | { 70 | x[i] = 0; 71 | } 72 | 73 | return; 74 | } 75 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_SRC_FILES := \ 5 | src/decoder_gsm_amr.cpp \ 6 | src/a_refl.cpp \ 7 | src/agc.cpp \ 8 | src/amrdecode.cpp \ 9 | src/b_cn_cod.cpp \ 10 | src/bgnscd.cpp \ 11 | src/c_g_aver.cpp \ 12 | src/d1035pf.cpp \ 13 | src/d2_11pf.cpp \ 14 | src/d2_9pf.cpp \ 15 | src/d3_14pf.cpp \ 16 | src/d4_17pf.cpp \ 17 | src/d8_31pf.cpp \ 18 | src/d_gain_c.cpp \ 19 | src/d_gain_p.cpp \ 20 | src/d_plsf.cpp \ 21 | src/d_plsf_3.cpp \ 22 | src/d_plsf_5.cpp \ 23 | src/dec_amr.cpp \ 24 | src/dec_gain.cpp \ 25 | src/dec_input_format_tab.cpp \ 26 | src/dec_lag3.cpp \ 27 | src/dec_lag6.cpp \ 28 | src/dtx_dec.cpp \ 29 | src/ec_gains.cpp \ 30 | src/ex_ctrl.cpp \ 31 | src/if2_to_ets.cpp \ 32 | src/int_lsf.cpp \ 33 | src/lsp_avg.cpp \ 34 | src/ph_disp.cpp \ 35 | src/post_pro.cpp \ 36 | src/preemph.cpp \ 37 | src/pstfilt.cpp \ 38 | src/qgain475_tab.cpp \ 39 | src/sp_dec.cpp \ 40 | src/wmf_to_ets.cpp 41 | 42 | LOCAL_MODULE := libpvdecoder_gsmamr 43 | 44 | LOCAL_C_INCLUDES := \ 45 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/dec/src \ 46 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/dec/include \ 47 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/common/include\ 48 | $(PV_INCLUDES) 49 | 50 | include $(BUILD_STATIC_LIBRARY) 51 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/include/decoder_gsm_amr.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | ////////////////////////////////////////////////////////////////////////////////// 30 | // // 31 | // File: decoder_amr_nb.h // 32 | // // 33 | ////////////////////////////////////////////////////////////////////////////////// 34 | 35 | #ifndef _DECODER_AMR_NB_H 36 | #define _DECODER_AMR_NB_H 37 | 38 | #include "oscl_base.h" 39 | #include "pvgsmamrdecoderinterface.h" 40 | 41 | // CDecoder_AMR_WB 42 | class CDecoder_AMRInterface; 43 | class CDecoder_AMR_NB: public CDecoder_AMRInterface 44 | { 45 | public: 46 | OSCL_IMPORT_REF void ConstructL(); 47 | OSCL_IMPORT_REF static CDecoder_AMR_NB *NewL(); 48 | OSCL_IMPORT_REF virtual ~CDecoder_AMR_NB(); 49 | 50 | OSCL_IMPORT_REF virtual int32 StartL(tPVAmrDecoderExternal * pExt, 51 | bool aAllocateInputBuffer = false, 52 | bool aAllocateOutputBuffer = false); 53 | 54 | OSCL_IMPORT_REF virtual int32 ExecuteL(tPVAmrDecoderExternal * pExt); 55 | 56 | OSCL_IMPORT_REF virtual int32 ResetDecoderL(); 57 | OSCL_IMPORT_REF virtual void StopL(); 58 | OSCL_IMPORT_REF virtual void TerminateDecoderL(); 59 | 60 | private: 61 | void* iDecState; 62 | 63 | int16* iInputBuf; 64 | int16* iOutputBuf; 65 | 66 | 67 | }; 68 | 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pvgsmamrdecoder.cpp: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | 30 | #include "PVGSMAMRDecoder.h" 31 | 32 | 33 | ///////////////////////////////////////////////////////////////////////////// 34 | OSCL_EXPORT_REF CPVGSMAMRDecoder::CPVGSMAMRDecoder() 35 | { 36 | } 37 | 38 | 39 | ///////////////////////////////////////////////////////////////////////////// 40 | OSCL_EXPORT_REF CPVGSMAMRDecoder::~CPVGSMAMRDecoder() 41 | { 42 | delete iDecState; 43 | iDecState = NULL; 44 | } 45 | 46 | 47 | ///////////////////////////////////////////////////////////////////////////// 48 | OSCL_EXPORT_REF int32 CPVGSMAMRDecoder::InitDecoder(void) 49 | { 50 | return GSMInitDecode(&iDecState, (int8*)"Decoder"); 51 | } 52 | 53 | 54 | ///////////////////////////////////////////////////////////////////////////// 55 | OSCL_EXPORT_REF int32 CPVGSMAMRDecoder::DecodeFrame(Frame_Type_3GPP aType, 56 | uint8* aCompressedBlock, 57 | uint8* aAudioBuffer, 58 | int32 aFormat) 59 | { 60 | return AMRDecode(iDecState, aType, aCompressedBlock, (Word16*)aAudioBuffer, (Word16) aFormat); 61 | } 62 | 63 | 64 | ///////////////////////////////////////////////////////////////////////////// 65 | OSCL_EXPORT_REF int32 CPVGSMAMRDecoder::ResetDecoder(void) 66 | { 67 | return Speech_Decode_Frame_reset(iDecState); 68 | } 69 | 70 | 71 | ///////////////////////////////////////////////////////////////////////////// 72 | OSCL_EXPORT_REF void CPVGSMAMRDecoder::TerminateDecoder(void) 73 | { 74 | GSMDecodeFrameExit(&iDecState); 75 | iDecState = NULL; 76 | } 77 | 78 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pvgsmamrdecoder.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | 30 | #ifndef __PVGSMAMRDECODER_H 31 | #define __PVGSMAMRDECODER_H 32 | 33 | #include "oscl_base.h" 34 | 35 | #include "gsmamr_dec.h" 36 | 37 | // PVGSMAMRDecoder 38 | class CPVGSMAMRDecoder 39 | { 40 | public: 41 | OSCL_IMPORT_REF CPVGSMAMRDecoder(); 42 | OSCL_IMPORT_REF ~CPVGSMAMRDecoder(); 43 | 44 | OSCL_IMPORT_REF int32 InitDecoder(void); 45 | OSCL_IMPORT_REF int32 DecodeFrame(Frame_Type_3GPP aType, 46 | uint8* aCompressedBlock, 47 | uint8* aAudioBuffer, 48 | int32 aFormat); 49 | OSCL_IMPORT_REF int32 ResetDecoder(void); 50 | OSCL_IMPORT_REF void TerminateDecoder(void); 51 | 52 | private: 53 | void* iDecState; 54 | }; 55 | 56 | #endif 57 | 58 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/pvgsmamrdecoder_dpi.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /**************************************************************************************** 19 | Portions of this file are derived from the following 3GPP standard: 20 | 21 | 3GPP TS 26.073 22 | ANSI-C code for the Adaptive Multi-Rate (AMR) speech codec 23 | Available from http://www.3gpp.org 24 | 25 | (C) 2004, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TTA, TTC) 26 | Permission to distribute, modify and use this file under the standard license 27 | terms listed above has been obtained from the copyright holder. 28 | ****************************************************************************************/ 29 | 30 | #ifndef __PVGSMAMRDECODER_H 31 | #define __PVGSMAMRDECODER_H 32 | 33 | #include "oscl_base.h" 34 | 35 | #include "gsmamr_dec.h" 36 | #include "gsmamrdpidecoder.h" 37 | 38 | // PVGSMAMRDecoder 39 | class CPVGSMAMRDecoder 40 | { 41 | public: 42 | OSCL_IMPORT_REF CPVGSMAMRDecoder(); 43 | OSCL_IMPORT_REF ~CPVGSMAMRDecoder(); 44 | 45 | OSCL_IMPORT_REF int32 InitDecoder(void); 46 | OSCL_IMPORT_REF int32 DecodeFrame(Frame_Type_3GPP aType, 47 | uint8* aCompressedBlock, 48 | uint8* aAudioBuffer, 49 | int32 aFormat); 50 | OSCL_IMPORT_REF int32 ResetDecoder(void); 51 | OSCL_IMPORT_REF void TerminateDecoder(void); 52 | 53 | private: 54 | void* iDecState; 55 | CPvGsmAmrDPIDecoder *iDecoder; 56 | }; 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_SRC_FILES := \ 5 | src/amrencode.cpp \ 6 | src/autocorr.cpp \ 7 | src/c1035pf.cpp \ 8 | src/c2_11pf.cpp \ 9 | src/c2_9pf.cpp \ 10 | src/c3_14pf.cpp \ 11 | src/c4_17pf.cpp \ 12 | src/c8_31pf.cpp \ 13 | src/calc_cor.cpp \ 14 | src/calc_en.cpp \ 15 | src/cbsearch.cpp \ 16 | src/cl_ltp.cpp \ 17 | src/cod_amr.cpp \ 18 | src/convolve.cpp \ 19 | src/cor_h.cpp \ 20 | src/cor_h_x.cpp \ 21 | src/cor_h_x2.cpp \ 22 | src/corrwght_tab.cpp \ 23 | src/div_32.cpp \ 24 | src/dtx_enc.cpp \ 25 | src/enc_lag3.cpp \ 26 | src/enc_lag6.cpp \ 27 | src/enc_output_format_tab.cpp \ 28 | src/ets_to_if2.cpp \ 29 | src/ets_to_wmf.cpp \ 30 | src/g_adapt.cpp \ 31 | src/g_code.cpp \ 32 | src/g_pitch.cpp \ 33 | src/gain_q.cpp \ 34 | src/gsmamr_encoder_wrapper.cpp \ 35 | src/hp_max.cpp \ 36 | src/inter_36.cpp \ 37 | src/inter_36_tab.cpp \ 38 | src/l_abs.cpp \ 39 | src/l_comp.cpp \ 40 | src/l_extract.cpp \ 41 | src/l_negate.cpp \ 42 | src/lag_wind.cpp \ 43 | src/lag_wind_tab.cpp \ 44 | src/levinson.cpp \ 45 | src/lpc.cpp \ 46 | src/ol_ltp.cpp \ 47 | src/p_ol_wgh.cpp \ 48 | src/pitch_fr.cpp \ 49 | src/pitch_ol.cpp \ 50 | src/pre_big.cpp \ 51 | src/pre_proc.cpp \ 52 | src/prm2bits.cpp \ 53 | src/q_gain_c.cpp \ 54 | src/q_gain_p.cpp \ 55 | src/qgain475.cpp \ 56 | src/qgain795.cpp \ 57 | src/qua_gain.cpp \ 58 | src/s10_8pf.cpp \ 59 | src/set_sign.cpp \ 60 | src/sid_sync.cpp \ 61 | src/sp_enc.cpp \ 62 | src/spreproc.cpp \ 63 | src/spstproc.cpp \ 64 | src/ton_stab.cpp \ 65 | src/vad1.cpp 66 | 67 | LOCAL_MODULE := libpvencoder_gsmamr 68 | 69 | LOCAL_C_INCLUDES := \ 70 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/enc/src \ 71 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/enc/include \ 72 | $(PV_TOP)/codecs_v2/audio/gsm_amr/amr_nb/common/include \ 73 | $(PV_INCLUDES) 74 | LOCAL_STATIC_LIBRARIES := libpv_amr_nb_common_lib 75 | 76 | include $(BUILD_STATIC_LIBRARY) 77 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/opencore/codecs_v2/audio/gsm_amr/common/dec/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_SRC_FILES := \ 5 | 6 | 7 | LOCAL_CFLAGS := $(PV_CFLAGS) 8 | 9 | 10 | LOCAL_STATIC_LIBRARIES := 11 | 12 | LOCAL_SHARED_LIBRARIES := 13 | 14 | LOCAL_C_INCLUDES := \ 15 | $(PV_TOP)/codecs_v2/audio/gsm_amr/common/dec/build/make \ 16 | $(PV_TOP)/codecs_v2/audio/gsm_amr/common/dec/include \ 17 | $(PV_INCLUDES) 18 | 19 | LOCAL_COPY_HEADERS := \ 20 | include/pvgsmamrdecoderinterface.h 21 | 22 | include $(BUILD_COPY_HEADERS) 23 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_aostatus.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | /*! \addtogroup osclproc OSCL Proc 20 | * 21 | * @{ 22 | */ 23 | 24 | /** \file oscl_aostatus.h 25 | \brief Some basic types used with active objects. 26 | */ 27 | #ifndef OSCL_AOSTATUS_H_INCLUDED 28 | #define OSCL_AOSTATUS_H_INCLUDED 29 | 30 | #ifndef OSCLCONFIG_PROC_H_INCLUDED 31 | #include "osclconfig_proc.h" 32 | #endif 33 | 34 | 35 | #ifndef OSCL_BASE_H_INCLUDED 36 | #include "oscl_base.h" 37 | #endif 38 | 39 | //Request status values. These are negative so that 40 | //they won't conflict with system error codes. 41 | const int32 OSCL_REQUEST_ERR_NONE = 0; 42 | const int32 OSCL_REQUEST_PENDING = (-0x7fffffff); 43 | const int32 OSCL_REQUEST_ERR_CANCEL = (-1); 44 | const int32 OSCL_REQUEST_ERR_GENERAL = (-2); 45 | 46 | 47 | //Request status type 48 | class OsclAOStatus 49 | { 50 | public: 51 | OSCL_INLINE OsclAOStatus(); 52 | OSCL_INLINE OsclAOStatus(int32 aStatus); 53 | OSCL_INLINE int32 operator=(int32 aStatus); 54 | OSCL_INLINE int32 operator==(int32 aStatus) const; 55 | OSCL_INLINE int32 operator!=(int32 aStatus) const; 56 | OSCL_INLINE int32 operator>=(int32 aStatus) const; 57 | OSCL_INLINE int32 operator<=(int32 aStatus) const; 58 | OSCL_INLINE int32 operator>(int32 aStatus) const; 59 | OSCL_INLINE int32 operator<(int32 aStatus) const; 60 | OSCL_INLINE int32 Value() const; 61 | private: 62 | int32 iStatus; 63 | }; 64 | 65 | 66 | #if !(OSCL_DISABLE_INLINES) 67 | #include "oscl_aostatus.inl" 68 | #endif 69 | 70 | 71 | #endif 72 | 73 | /*! @} */ 74 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_aostatus.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /** \file oscl_aostatus.inl 19 | \brief Inline functions for oscl_aostatus.h 20 | */ 21 | 22 | 23 | OSCL_INLINE OsclAOStatus::OsclAOStatus() 24 | {} 25 | OSCL_INLINE OsclAOStatus::OsclAOStatus(int32 aVal) 26 | : iStatus(aVal) 27 | {} 28 | OSCL_INLINE int32 OsclAOStatus::operator=(int32 aVal) 29 | { 30 | return(iStatus = aVal); 31 | } 32 | OSCL_INLINE int32 OsclAOStatus::operator==(int32 aVal) const 33 | { 34 | return(iStatus == aVal); 35 | } 36 | OSCL_INLINE int32 OsclAOStatus::operator!=(int32 aVal) const 37 | { 38 | return(iStatus != aVal); 39 | } 40 | OSCL_INLINE int32 OsclAOStatus::operator>=(int32 aVal) const 41 | { 42 | return(iStatus >= aVal); 43 | } 44 | OSCL_INLINE int32 OsclAOStatus::operator<=(int32 aVal) const 45 | { 46 | return(iStatus <= aVal); 47 | } 48 | OSCL_INLINE int32 OsclAOStatus::operator>(int32 aVal) const 49 | { 50 | return(iStatus > aVal); 51 | } 52 | OSCL_INLINE int32 OsclAOStatus::operator<(int32 aVal) const 53 | { 54 | return(iStatus < aVal); 55 | } 56 | OSCL_INLINE int32 OsclAOStatus::Value() const 57 | { 58 | return(iStatus); 59 | } 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_assert.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ A S S E R T 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclbase OSCL Base 26 | * 27 | * @{ 28 | */ 29 | 30 | /*! \file oscl_assert.h 31 | * \brief The file oscl_assert.h provides an OSCL_ASSERT macro to document 32 | assumptions and test them during development. 33 | */ 34 | 35 | 36 | #ifndef OSCL_ASSERT_H_INCLUDED 37 | #define OSCL_ASSERT_H_INCLUDED 38 | 39 | #ifndef OSCL_BASE_H_INCLUDED 40 | #include "oscl_base.h" 41 | #endif 42 | 43 | 44 | //! This function terminates the current process abnormally 45 | /*! 46 | */ 47 | OSCL_COND_IMPORT_REF void _OSCL_Abort(); 48 | 49 | //! OSCL_ASSERT macro evaluates an expression and when the result is false, prints a diagnostic message and aborts the program. 50 | /*! 51 | \param expr is the expression to be evaluated 52 | \param filename is the name of the current source file 53 | \param line_number is the line number in the current source file 54 | */ 55 | #if (!defined(NDEBUG) || (OSCL_ASSERT_ALWAYS)) 56 | OSCL_IMPORT_REF void OSCL_Assert(const char *expr, const char *filename, int line_number); 57 | 58 | #define OSCL_ASSERT(_expr) \ 59 | ((_expr)?((void)0):OSCL_Assert(# _expr,__FILE__,__LINE__)) 60 | 61 | #else 62 | #define OSCL_ASSERT(_expr) ((void)0) 63 | #endif 64 | 65 | #if (!OSCL_DISABLE_INLINES) 66 | #include "oscl_assert.inl" 67 | #endif 68 | 69 | /*! @} */ 70 | 71 | #endif // OSCL_ASSERT_H_INCLUDED 72 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_assert.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #if(OSCL_HAS_ERROR_HOOK) 19 | #include "oscl_tls.h" 20 | #endif 21 | 22 | OSCL_COND_EXPORT_REF OSCL_INLINE void _OSCL_Abort() 23 | { 24 | abort(); 25 | } 26 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_base_alloc.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ B A S E _ A L L O C 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclbase OSCL Base 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /*! \file oscl_base_alloc.h 32 | \brief A basic allocator that does not rely on other modules 33 | */ 34 | 35 | 36 | #ifndef OSCL_BASE_ALLOC_H_INCLUDED 37 | #define OSCL_BASE_ALLOC_H_INCLUDED 38 | 39 | #include "osclconfig.h" 40 | #include "oscl_defalloc.h" 41 | #include "osclconfig_memory.h" 42 | 43 | /** A basic allocator that does not rely on other modules. 44 | * There is no memory auditing or exception generation. 45 | * 46 | * Note: this allocator is for internal use by Oscl code only. 47 | * Higher level code should use OsclMemAllocator defined in 48 | * "oscl_mem.h". 49 | */ 50 | class _OsclBasicAllocator: public Oscl_DefAlloc 51 | { 52 | public: 53 | OsclAny* allocate(const uint32 size) 54 | { 55 | return malloc(size); 56 | } 57 | 58 | void deallocate(OsclAny *p) 59 | { 60 | free(p); 61 | } 62 | 63 | virtual ~_OsclBasicAllocator() {} 64 | }; 65 | 66 | /*! @} */ 67 | 68 | #endif // OSCL_BASE_H_INCLUDED 69 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_dll.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ D L L 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclbase OSCL Base 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** 32 | * @file oscl_dll.h 33 | * @brief Defines a DLL entry point. 34 | * 35 | */ 36 | 37 | #ifndef OSCL_DLL_H_INCLUDED 38 | #define OSCL_DLL_H_INCLUDED 39 | 40 | #ifndef OSCLCONFIG_H_INCLUDED 41 | #include "osclconfig.h" 42 | #endif 43 | 44 | /** 45 | * DLL entry/exit point. 46 | * 47 | * Allows you to define custom operations at the 48 | * entry and exit of the DLL. Place this macro 49 | * within one souce file for each DLL. 50 | * 51 | * Functions with the custom commands for the 52 | * DLL entry and exit point must also be defined. 53 | * The entry point custom function is LocalDllEntry(), 54 | * and the exit point custom function is LocalDllExit(). 55 | * 56 | * These functions will be called as a result of 57 | * executing this macro. 58 | * 59 | * Usage : 60 | * 61 | * LocalDllEntry() { 62 | * custom operations... 63 | * } 64 | * 65 | * LocalDllExit() { 66 | * custom operations... 67 | * } 68 | * 69 | * OSCL_DLL_ENTRY_POINT() 70 | * 71 | */ 72 | #define OSCL_DLL_ENTRY_POINT() void oscl_dll_entry_point() {} 73 | 74 | 75 | /** 76 | * Default DLL entry/exit point function. 77 | * 78 | * The body of the DLL entry point is given. The macro 79 | * only needs to be declared within the source file. 80 | * 81 | * Usage : 82 | * 83 | * OSCL_DLL_ENTRY_POINT_DEFAULT() 84 | */ 85 | 86 | #define OSCL_DLL_ENTRY_POINT_DEFAULT() 87 | 88 | 89 | 90 | /*! @} */ 91 | 92 | 93 | #endif 94 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_double_list.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // Class OsclDoubleList 19 | template 20 | OSCL_INLINE OsclDoubleList::OsclDoubleList() 21 | {} 22 | template 23 | OSCL_INLINE OsclDoubleList::OsclDoubleList(int32 anOffset) 24 | : OsclDoubleListBase(anOffset) 25 | {} 26 | template 27 | OSCL_INLINE void OsclDoubleList::InsertHead(T &aRef) 28 | { 29 | OsclDoubleListBase::InsertHead(&aRef); 30 | } 31 | template 32 | OSCL_INLINE void OsclDoubleList::InsertTail(T &aRef) 33 | { 34 | OsclDoubleListBase::InsertTail(&aRef); 35 | } 36 | template 37 | OSCL_INLINE bool OsclDoubleList::IsHead(const T *aPtr) const 38 | { 39 | return(OsclPtrAdd(aPtr, iOffset) == (T *)&iHead); 40 | } 41 | template 42 | OSCL_INLINE bool OsclDoubleList::IsTail(const T *aPtr) const 43 | { 44 | return(OsclPtrAdd(aPtr, iOffset) == (T *)iHead.iPrev); 45 | } 46 | template 47 | OSCL_INLINE T *OsclDoubleList::Head() const 48 | { 49 | OSCL_ASSERT(!IsEmpty()); 50 | return(OsclPtrSub((T *)iHead.iNext, iOffset)); 51 | } 52 | template 53 | OSCL_INLINE T *OsclDoubleList::Tail() const 54 | { 55 | OSCL_ASSERT(!IsEmpty()); 56 | return(OsclPtrSub((T *)iHead.iPrev, iOffset)); 57 | } 58 | 59 | // Class OsclPriorityList 60 | template 61 | OSCL_INLINE OsclPriorityList::OsclPriorityList() 62 | {} 63 | template 64 | OSCL_INLINE OsclPriorityList::OsclPriorityList(int32 anOffset) 65 | : OsclDoubleListBase(anOffset) 66 | {} 67 | template 68 | OSCL_INLINE void OsclPriorityList::Insert(T &aRef) 69 | { 70 | OsclDoubleListBase::Insert(&aRef); 71 | } 72 | template 73 | OSCL_INLINE bool OsclPriorityList::IsHead(const T *aPtr) const 74 | { 75 | return(OsclPtrAdd(aPtr, iOffset) == (T *)&iHead); 76 | } 77 | template 78 | OSCL_INLINE bool OsclPriorityList::IsTail(const T *aPtr) const 79 | { 80 | return(OsclPtrAdd(aPtr, iOffset) == (T *)iHead.iPrev); 81 | } 82 | template 83 | OSCL_INLINE T *OsclPriorityList::Head() const 84 | { 85 | OSCL_ASSERT(!IsEmpty()); 86 | return(OsclPtrSub((T *)iHead.iNext, iOffset)); 87 | } 88 | template 89 | OSCL_INLINE T *OsclPriorityList::Tail() const 90 | { 91 | OSCL_ASSERT(!IsEmpty()); 92 | return(PtrSub((T *)iHead.iPrev, iOffset)); 93 | } 94 | 95 | 96 | 97 | 98 | 99 | 100 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_errno.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | OSCL_COND_EXPORT_REF OSCL_INLINE bool OSCL_IsErrnoSupported() 19 | { 20 | return true; 21 | }; 22 | 23 | OSCL_COND_EXPORT_REF OSCL_INLINE int OSCL_GetLastError() 24 | { 25 | return errno; 26 | }; 27 | 28 | OSCL_COND_EXPORT_REF OSCL_INLINE bool OSCL_SetLastError(int newVal) 29 | { 30 | errno = newVal; 31 | return true; 32 | }; 33 | 34 | OSCL_COND_EXPORT_REF OSCL_INLINE char * OSCL_StrError(int errNum) 35 | { 36 | return (strerror(errNum)); 37 | }; 38 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_error_codes.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ E R R O R _ C O D E S 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclerror OSCL Error 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_error_codes.h 32 | \brief Defines basic error and leave codes. 33 | */ 34 | 35 | #ifndef OSCL_ERROR_CODES_H_INCLUDED 36 | #define OSCL_ERROR_CODES_H_INCLUDED 37 | 38 | 39 | /** Leave Codes 40 | */ 41 | typedef int32 OsclLeaveCode; 42 | 43 | #define OsclErrNone 0 44 | #define OsclErrGeneral 100 45 | #define OsclErrNoMemory 101 46 | #define OsclErrCancelled 102 47 | #define OsclErrNotSupported 103 48 | #define OsclErrArgument 104 49 | #define OsclErrBadHandle 105 50 | #define OsclErrAlreadyExists 106 51 | #define OsclErrBusy 107 52 | #define OsclErrNotReady 108 53 | #define OsclErrCorrupt 109 54 | #define OsclErrTimeout 110 55 | #define OsclErrOverflow 111 56 | #define OsclErrUnderflow 112 57 | #define OsclErrInvalidState 113 58 | #define OsclErrNoResources 114 59 | #define OsclErrNotInstalled 115 60 | #define OsclErrAlreadyInstalled 116 61 | #define OsclErrSystemCallFailed 117 62 | #define OsclErrNoHandler 118 63 | #define OsclErrThreadContextIncorrect 119 64 | 65 | /** For backward compatibility with old definitions 66 | */ 67 | #define OSCL_ERR_NONE OsclErrNone 68 | #define OSCL_BAD_ALLOC_EXCEPTION_CODE OsclErrNoMemory 69 | 70 | /** Return Codes 71 | */ 72 | typedef int32 OsclReturnCode; 73 | 74 | #define OsclSuccess 0 75 | #define OsclPending 1 76 | #define OsclFailure -1 77 | 78 | #endif 79 | 80 | /*! @} */ 81 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_error_imp.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ E R R O R _ I M P 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclerror OSCL Error 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_error_imp.h 32 | \brief Internal error implementation support 33 | */ 34 | 35 | #ifndef OSCL_ERROR_IMP_H_INCLUDED 36 | #define OSCL_ERROR_IMP_H_INCLUDED 37 | 38 | #ifndef OSCLCONFIG_ERROR_H_INCLUDED 39 | #include "osclconfig_error.h" 40 | #endif 41 | 42 | /** Internal leave/trap implementation. 43 | */ 44 | 45 | //This selects the type of implementation 46 | //based on OSCL capabilities. 47 | #define PVERROR_IMP_JUMPS 48 | 49 | 50 | /* 51 | #define PVERROR_IMP_CPP_EXCEPTIONS 52 | #undef PVERROR_IMP_JUMPS 53 | #undef PVERROR_IMP_FATAL_ERROR 54 | */ 55 | 56 | /** 57 | //include the internal leave/trap implementation macros. 58 | */ 59 | #if defined( PVERROR_IMP_JUMPS) 60 | #include "oscl_error_imp_jumps.h" 61 | #elif defined (PVERROR_IMP_CPP_EXCEPTIONS) 62 | #include "oscl_error_imp_cppexceptions.h" 63 | #elif defined(PVERROR_IMP_FATAL_ERROR) 64 | #include "oscl_error_imp_fatalerror.h" 65 | #else 66 | #error No leave implementation! 67 | #endif 68 | 69 | 70 | 71 | 72 | #endif 73 | 74 | /*! @} */ 75 | 76 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_error_imp_cppexceptions.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ E R R O R _ I M P _ C P P E X C E P T I O N S 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclerror OSCL Error 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_error_imp_cppexceptions.h 32 | \brief Implementation File for Leave using C++ exceptions. 33 | */ 34 | 35 | #ifndef OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED 36 | #define OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED 37 | 38 | #ifndef OSCL_ERROR_TRAPCLEANUP_H_INCLUDED 39 | #include "oscl_error_trapcleanup.h" 40 | #endif 41 | 42 | //Implementation file for Leave using C++ exceptions. 43 | 44 | //This is a full implementation of Leave. 45 | 46 | class internalLeave 47 | { 48 | public: 49 | int a; 50 | }; 51 | 52 | //Leave throws C++ exceptions. 53 | #define PVError_DoLeave() internalLeave __ilv;__ilv.a=0;throw(__ilv) 54 | 55 | 56 | //_PV_TRAP catches Leaves. 57 | //_r is the leave code, _s are statements to execute 58 | #define _PV_TRAP(__r,__s)\ 59 | __r=OsclErrNone;\ 60 | {\ 61 | OsclErrorTrapImp* __tr=OsclErrorTrapImp::Trap();\ 62 | if(!__tr){__s;}else{\ 63 | try{__s;}\ 64 | catch(internalLeave __lv)\ 65 | {__lv.a=__r=__tr->iLeave;}\ 66 | __tr->UnTrap();}\ 67 | } 68 | 69 | //_PV_TRAP_NO_TLS catches Leaves. 70 | //_r is the leave code, _s are statements to execute 71 | #define _PV_TRAP_NO_TLS(__trapimp,__r,__s)\ 72 | __r=OsclErrNone;\ 73 | {\ 74 | OsclErrorTrapImp* __tr=OsclErrorTrapImp::TrapNoTls(__trapimp);\ 75 | if(!__tr){__s;}else{\ 76 | try{__s;}\ 77 | catch(internalLeave __lv)\ 78 | {__lv.a=__r=__tr->iLeave;}\ 79 | __tr->UnTrap();}\ 80 | } 81 | 82 | 83 | #endif // OSCL_ERROR_IMP_CPPEXCEPTIONS_H_INCLUDED 84 | 85 | /*! @} */ 86 | 87 | 88 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_error_imp_fatalerror.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ E R R O R _ I M P _ F A T A L E R R O R 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclerror OSCL Error 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_error_imp_fatalerror.h 32 | \brief Implementation File for Leave using system fatal error. 33 | */ 34 | 35 | #ifndef OSCL_ERROR_IMP_FATALERROR_H_INCLUDED 36 | #define OSCL_ERROR_IMP_FATALERROR_H_INCLUDED 37 | 38 | // Implementation File for Leave using system fatal error. 39 | 40 | //Fatal error implementation for compilers without C++ exceptions. 41 | //This implementation is very limited. Leave conditions 42 | //just cause fatal program errors. There is no way to catch or trap 43 | //any Leave. 44 | #ifndef OSCL_ASSERT_H_INCLUDED 45 | #include "oscl_assert.h" 46 | #endif 47 | 48 | //Leave just calls a system fatal error. 49 | #define PVError_DoLeave() _OSCL_Abort() 50 | 51 | //_PV_TRAP 52 | //_r is leave code, _s is statements. 53 | //this macro isn't really functional since any 54 | //leave will abort the program, but it's needed 55 | //to compile. 56 | #define _PV_TRAP(__r,__s) \ 57 | __r=OsclErrNone;\ 58 | {__s;} 59 | 60 | //_PV_TRAP_NO_TLS 61 | //_r is leave code, _s is statements. 62 | //this macro isn't really functional since any 63 | //leave will abort the program, but it's needed 64 | //to compile. 65 | #define _PV_TRAP_NO_TLS(__tr,__r,__s) \ 66 | __r=OsclErrNone;\ 67 | {__s;} 68 | 69 | 70 | 71 | #endif // OSCL_ERROR_IMP_FATALERROR_H_INCLUDED 72 | 73 | /*! @} */ 74 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_file_handle.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ F I L E _ HANDLE 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclio OSCL IO 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /*! \file oscl_file_handle.h 32 | \brief The file oscl_file_handle.h defines the class OsclFileHandle 33 | 34 | */ 35 | 36 | #ifndef OSCL_FILE_HANDLE_H_INCLUDED 37 | #define OSCL_FILE_HANDLE_H_INCLUDED 38 | 39 | #ifndef OSCLCONFIG_IO_H_INCLUDED 40 | #include "osclconfig_io.h" 41 | #endif 42 | 43 | #ifndef OSCL_BASE_H_INCLUDED 44 | #include "oscl_base.h" 45 | #endif 46 | 47 | 48 | /** 49 | ** TOsclFileHandle is an OS-native file handle type. 50 | * With a class-based file API such as Symbian, a class ref is used 51 | * as a file handle. 52 | * For most ANSI-style file APIs, a file pointer is used as a 53 | * file handle. 54 | */ 55 | typedef FILE* TOsclFileHandle; 56 | 57 | /** 58 | ** OsclFileHandle is a container for a handle to a previously-opened file. 59 | */ 60 | class OsclFileHandle 61 | { 62 | public: 63 | OsclFileHandle(TOsclFileHandle aHandle) 64 | : iHandle(aHandle) 65 | {} 66 | OsclFileHandle(const OsclFileHandle& aHandle) 67 | : iHandle(aHandle.iHandle) 68 | {} 69 | TOsclFileHandle Handle()const 70 | { 71 | return iHandle; 72 | } 73 | private: 74 | TOsclFileHandle iHandle; 75 | friend class Oscl_File; 76 | }; 77 | 78 | 79 | #endif // OSCL_FILE_HANDLE_H_INCLUDED 80 | 81 | /*! @} */ 82 | 83 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_file_types.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ F I L E _ TYPES 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclio OSCL IO 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /*! \file oscl_file_types.h 32 | \brief The file oscl_file_types.h defines some constants and types 33 | for file I/O implementations. Anything that needs to be shared 34 | across implementation modules can go here. 35 | 36 | */ 37 | 38 | #ifndef OSCL_FILE_TYPES_H_INCLUDED 39 | #define OSCL_FILE_TYPES_H_INCLUDED 40 | 41 | 42 | #define OSCL_IO_FILENAME_MAXLEN 512 43 | #define OSCL_IO_EXTENSION_MAXLEN 512 44 | 45 | #define OSCL_FILE_WCHAR_PATH_DELIMITER _STRLIT("/") 46 | #define OSCL_FILE_CHAR_PATH_DELIMITER _STRLIT_CHAR("/") 47 | 48 | //a class for passing configuration options from Oscl_File to OsclNativeFile 49 | class OsclNativeFileParams 50 | { 51 | public: 52 | OsclNativeFileParams(uint32 mode = 0, uint32 bufsize = 0, uint32 asyncsize = 0) 53 | : iNativeAccessMode(mode) 54 | , iNativeBufferSize(bufsize) 55 | , iAsyncReadBufferSize(asyncsize) 56 | {} 57 | uint32 iNativeAccessMode; 58 | uint32 iNativeBufferSize; 59 | uint32 iAsyncReadBufferSize; 60 | }; 61 | 62 | 63 | #endif // OSCL_FILE_TYPES_H_INCLUDED 64 | 65 | /*! @} */ 66 | 67 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_heapbase.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ H E A P B A S E 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclerror OSCL Error 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_heapbase.h 32 | \brief OSCL Heap Base include file 33 | */ 34 | #ifndef OSCL_HEAPBASE_H_INCLUDED 35 | #define OSCL_HEAPBASE_H_INCLUDED 36 | 37 | #ifndef OSCLCONFIG_ERROR_H_INCLUDED 38 | #include "osclconfig_error.h" 39 | #endif 40 | 41 | #ifndef OSCL_BASE_H_INCLUDED 42 | #include "oscl_base.h" 43 | #endif 44 | 45 | /** 46 | //_OsclHeapBase is used as the base for cleanup stack 47 | //items with virtual destructor. 48 | */ 49 | 50 | 51 | class _OsclHeapBase 52 | { 53 | public: 54 | virtual ~_OsclHeapBase() {} 55 | 56 | protected: 57 | _OsclHeapBase() {} 58 | _OsclHeapBase(const _OsclHeapBase&) {} 59 | private: 60 | _OsclHeapBase& operator=(const _OsclHeapBase&); 61 | friend class PVCleanupStack; 62 | }; 63 | 64 | /** 65 | //OsclTrapItem may be used in the cleanup stack when 66 | //a custom cleanup operation is needed. 67 | */ 68 | 69 | typedef void (*OsclTrapOperation)(OsclAny*); 70 | 71 | class OsclTrapItem 72 | { 73 | public: 74 | OSCL_INLINE OsclTrapItem(OsclTrapOperation anOperation); 75 | OSCL_INLINE OsclTrapItem(OsclTrapOperation anOperation, OsclAny* aPtr); 76 | private: 77 | OsclTrapOperation iOperation; 78 | OsclAny* iPtr; 79 | friend class OsclTrapStackItem; 80 | friend class OsclTrapStack; 81 | }; 82 | 83 | 84 | 85 | #if !(OSCL_DISABLE_INLINES) 86 | #include "oscl_heapbase.inl" 87 | #endif 88 | 89 | #endif // 90 | 91 | 92 | /*! @} */ 93 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_heapbase.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /** \file oscl_heapbase.inl 19 | \brief OSCL Heap Base inline file 20 | */ 21 | 22 | OSCL_INLINE OsclTrapItem::OsclTrapItem(OsclTrapOperation anOperation) 23 | : iOperation(anOperation) 24 | {} 25 | OSCL_INLINE OsclTrapItem::OsclTrapItem(OsclTrapOperation anOperation, OsclAny *aPtr) 26 | : iOperation(anOperation), iPtr(aPtr) 27 | {} 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_int64_utils.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef OSCL_INT64_UTILS_H_INCLUDED 20 | #define OSCL_INT64_UTILS_H_INCLUDED 21 | 22 | #ifndef OSCL_BASE_H_INCLUDED 23 | #include "oscl_base.h" 24 | #endif 25 | 26 | //! The Oscl_Int64_Utils class provides a wrapper for commonly used int64/uint64 operations 27 | /*! 28 | * The Oscl_Int64_Utils class: 29 | * 30 | * Provides a wrapper for commonly used operations to mask the differences between OSes 31 | * that have an int64/uint64 class instead of a 64-bit integer. 32 | */ 33 | class Oscl_Int64_Utils 34 | { 35 | public: 36 | OSCL_IMPORT_REF static void set_int64(int64& input_value, const int32 upper, const uint32 lower); 37 | 38 | OSCL_IMPORT_REF static int32 get_int64_upper32(const int64& input_value); 39 | 40 | OSCL_IMPORT_REF static uint32 get_int64_lower32(const int64& input_value); 41 | 42 | OSCL_IMPORT_REF static uint32 get_int64_middle32(const int64& input_value); 43 | 44 | OSCL_IMPORT_REF static void set_uint64(uint64& input_value, const uint32 upper, const uint32 lower); 45 | 46 | OSCL_IMPORT_REF static uint32 get_uint64_upper32(const uint64& input_value); 47 | 48 | OSCL_IMPORT_REF static uint32 get_uint64_lower32(const uint64& input_value); 49 | 50 | OSCL_IMPORT_REF static uint32 get_uint64_middle32(const uint64& input_value); 51 | }; 52 | 53 | /** 54 | * OsclInteger64Transport Structure 55 | * 56 | * Structure to only transport 64-bit integer values 57 | * uint64 and int64 could be classes so needed for cases 58 | * where having a class will not work. 59 | */ 60 | typedef struct OsclInteger64Transport 61 | { 62 | uint32 iHigh; 63 | uint32 iLow; 64 | } _OsclInteger64Transport; 65 | 66 | #endif 67 | 68 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_library_common.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef OSCL_LIBRARY_COMMON_H_INCLUDED 19 | #define OSCL_LIBRARY_COMMON_H_INCLUDED 20 | 21 | #include "oscl_tickcount.h" 22 | 23 | 24 | typedef int32 OsclLibStatus; 25 | const OsclLibStatus OsclLibSuccess = 0; 26 | const OsclLibStatus OsclLibFail = 1; 27 | const OsclLibStatus OsclLibNotFound = 2; 28 | const OsclLibStatus OsclLibOutOfMemory = 3; 29 | const OsclLibStatus OsclLibNotSupported = 4; 30 | const OsclLibStatus OsclLibNotLoaded = 5; 31 | 32 | #ifndef OSCL_LIBRARY_PERF_LOGGING 33 | //defaults for cases where the flag is not defined in the osclconfig_lib.h 34 | #if defined( NDEBUG)||(OSCL_RELEASE_BUILD) 35 | //for release builds 36 | #define OSCL_LIBRARY_PERF_LOGGING 0 37 | #else 38 | //for debug builds 39 | #define OSCL_LIBRARY_PERF_LOGGING 1 40 | #endif 41 | #endif 42 | 43 | 44 | #if OSCL_LIBRARY_PERF_LOGGING 45 | #define TICK uint32 46 | #define SET_TICK(tick1) tick1 = OsclTickCount::TickCount() 47 | #define DIFF_TICK(tick1,diff) TICK tick2; SET_TICK(tick2);diff = tick2 - tick1 48 | #endif 49 | 50 | #endif //OSCL_LIBRARY_COMMON_H_INCLUDED 51 | 52 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_library_list.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef OSCL_LIBRARY_LIST_H_INCLUDED 19 | #define OSCL_LIBRARY_LIST_H_INCLUDED 20 | 21 | #ifndef OSCL_MEM_H_INCLUDED 22 | #include "oscl_mem.h" 23 | #endif 24 | 25 | #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED 26 | #include "oscl_string_containers.h" 27 | #endif 28 | 29 | #ifndef OSCL_VECTOR_H_INCLUDED 30 | #include "oscl_vector.h" 31 | #endif 32 | 33 | #ifndef OSCL_LIBRARY_COMMON_H_INCLUDED 34 | #include "oscl_library_common.h" 35 | #endif 36 | 37 | struct OsclUuid; 38 | class PVLogger; 39 | 40 | /** 41 | * OsclLibraryList contains the list of dynamically shared libraries that need to be loaded 42 | **/ 43 | class OsclLibraryList 44 | { 45 | public: 46 | /** 47 | * Default object Constructor function 48 | **/ 49 | OSCL_IMPORT_REF OsclLibraryList(); 50 | 51 | /** 52 | * Object destructor function 53 | **/ 54 | OSCL_IMPORT_REF ~OsclLibraryList(); 55 | 56 | /** 57 | * Populate the list for the given interface ID. 58 | * 59 | * @param aInterfaceId ID to find the list of libraries for. 60 | * @param aConfigFile - DLL Config file 61 | * 62 | * @returns OsclLibStatus about whether the librarylist vector got populated or not 63 | **/ 64 | OSCL_IMPORT_REF OsclLibStatus Populate(const OsclUuid& aInterfaceId, const OSCL_String& aConfigFile); 65 | 66 | /** 67 | * Get the number of libraries in the list. 68 | * 69 | * @returns Number of libraries in list. 70 | */ 71 | OSCL_IMPORT_REF uint32 Size(); 72 | 73 | /** 74 | * Returns the n'th element. 75 | * @param n element position to return 76 | * @returns the reference to the library path stored in the iLibList vector 77 | */ 78 | OSCL_IMPORT_REF const OSCL_String& GetLibraryPathAt(uint32 n); 79 | 80 | private: 81 | Oscl_Vector, OsclMemAllocator> iLibList; 82 | PVLogger* ipLogger; 83 | #if OSCL_LIBRARY_PERF_LOGGING 84 | PVLogger* iDiagnosticsLogger; 85 | uint32 iLibHit; 86 | uint32 iLinesRead; 87 | #endif 88 | }; 89 | 90 | #endif //OSCL_LIBRARY_LIST_H_INCLUDED 91 | 92 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_math.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_log(double value) 20 | { 21 | return (double) log(value); 22 | } 23 | 24 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_log10(double value) 25 | { 26 | return (double) log10(value); 27 | } 28 | 29 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_sqrt(double value) 30 | { 31 | return (double) sqrt(value); 32 | } 33 | 34 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_pow(double x, double y) 35 | { 36 | return (double) pow(x, y); 37 | } 38 | 39 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_exp(double value) 40 | { 41 | return (double) exp(value); 42 | } 43 | 44 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_sin(double value) 45 | { 46 | return (double) sin(value); 47 | } 48 | 49 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_cos(double value) 50 | { 51 | return (double) cos(value); 52 | } 53 | 54 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_tan(double value) 55 | { 56 | return (double) tan(value); 57 | } 58 | 59 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_asin(double value) 60 | { 61 | return (double) asin(value); 62 | } 63 | 64 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_atan(double value) 65 | { 66 | return (double) atan(value); 67 | } 68 | 69 | OSCL_COND_EXPORT_REF OSCL_INLINE double oscl_floor(double value) 70 | { 71 | return (double) floor(value); 72 | } 73 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_media_status.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ M E D I A _ S T A T U S 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_media_status.h 32 | \brief Defines a status values for the MediaData containers. 33 | */ 34 | 35 | #ifndef OSCL_MEDIA_STATUS_H 36 | #define OSCL_MEDIA_STATUS_H 37 | 38 | 39 | const int32 APPEND_MEDIA_AT_END = -1; 40 | 41 | class BufFragStatusClass 42 | { 43 | public: 44 | typedef enum 45 | { 46 | BFG_SUCCESS = 0, 47 | TOO_MANY_FRAGS = 1, 48 | NOT_ENOUGH_SPACE = 2, 49 | EMPTY_FRAGMENT = 3, 50 | NULL_INPUT = 4, 51 | FIXED_FRAG_LOC_FULL = 5, 52 | INTERNAL_ERROR, 53 | INVALID_ID 54 | } status_t; 55 | }; 56 | 57 | class MediaStatusClass : public BufFragStatusClass {}; 58 | 59 | #endif 60 | 61 | /*! @} */ 62 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_mem.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // Basic memory manipulation functions 19 | #define OSCL_DISABLE_WARNING_TRUNCATE_DEBUG_MESSAGE 20 | #include "osclconfig_compiler_warnings.h" 21 | 22 | 23 | OSCL_INLINE OSCL_COND_EXPORT_REF uint oscl_mem_aligned_size(uint x) 24 | { 25 | uint y; 26 | 27 | if (x & 0x7) 28 | { 29 | y = x & (~0x7); 30 | y += 8; 31 | } 32 | else 33 | { 34 | y = x; 35 | } 36 | 37 | return y; 38 | } 39 | 40 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_mem_basic_functions.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef OSCL_MEM_BASIC_FUNCTIONS_INL 19 | #define OSCL_MEM_BASIC_FUNCTIONS_INL 20 | 21 | #ifndef OSCLCONFIG_MEMORY_H_INCLUDED 22 | #include "osclconfig_memory.h" 23 | #endif 24 | 25 | #ifndef OSCL_MEM_BASIC_FUNCTIONS_H 26 | #include "oscl_mem_basic_functions.h" 27 | #endif 28 | 29 | // Basic memory manipulation functions 30 | #define OSCL_DISABLE_WARNING_TRUNCATE_DEBUG_MESSAGE 31 | #include "osclconfig_compiler_warnings.h" 32 | 33 | OSCL_INLINE OSCL_COND_EXPORT_REF void* _oscl_malloc(int32 size) 34 | { 35 | return malloc(size); 36 | } 37 | 38 | OSCL_INLINE OSCL_COND_EXPORT_REF void* _oscl_realloc(void* src, int32 size) 39 | { 40 | return realloc(src, size); 41 | } 42 | 43 | OSCL_INLINE OSCL_COND_EXPORT_REF void* _oscl_calloc(int32 size1, int32 size2) 44 | { 45 | return calloc(size1, size2); 46 | } 47 | 48 | OSCL_INLINE OSCL_COND_EXPORT_REF void _oscl_free(void* src) 49 | { 50 | free(src); 51 | } 52 | 53 | OSCL_INLINE OSCL_COND_EXPORT_REF void* oscl_memcpy(void* dest, const void* src, uint32 count) 54 | { 55 | return memcpy(dest, src, count); 56 | } 57 | 58 | OSCL_INLINE OSCL_COND_EXPORT_REF void* oscl_memmove(void* dest, const void* src, uint32 count) 59 | { 60 | return memmove(dest, src, count); 61 | } 62 | 63 | OSCL_INLINE OSCL_COND_EXPORT_REF void* oscl_memmove32(void* dest, const void* src, uint32 count) 64 | { 65 | return memmove(dest, src, count); 66 | } 67 | 68 | OSCL_INLINE OSCL_COND_EXPORT_REF void* oscl_memset(void* dest, uint8 val, uint32 count) 69 | { 70 | return memset(dest, val, count); 71 | } 72 | 73 | OSCL_INLINE OSCL_COND_EXPORT_REF int oscl_memcmp(const void* dest, const void* src, uint32 count) 74 | { 75 | return memcmp(dest, src, count); 76 | } 77 | 78 | #endif /*OSCL_MEM_BASIC_FUNCTIONS_INL*/ 79 | 80 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_mem_inst.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ M E M _ I N S T . H 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclbase OSCL Base 26 | * 27 | * @{ 28 | */ 29 | 30 | /*! \file oscl_mem_inst.h 31 | \brief The file defines default memory instrumentation level. 32 | */ 33 | 34 | 35 | #ifndef OSCL_MEM_INST_H_INCLUDED 36 | #define OSCL_MEM_INST_H_INCLUDED 37 | 38 | #ifndef OSCLCONFIG_MEMORY_H_INCLUDED 39 | #include "osclconfig_memory.h" 40 | #endif 41 | 42 | /* 43 | ** PVMEM_INST_LEVEL controls the instrumentation level for 44 | ** memory leak tracking. Detailed memory leak information (file 45 | ** and line # of each allocation) is compiled in or out depending 46 | ** on the level. This information is an aid to debugging memory leaks, 47 | ** but compiling it in will increase code size and run-time overhead. 48 | ** 49 | ** Values are as follows 50 | ** PVMEM_INST_LEVEL 0 -- detailed memory leak reporting information 51 | ** is compiled out. 52 | ** PVMEM_INST_LEVEL 1 -- detailed memory leak reporting information 53 | ** is compiled in. 54 | ** 55 | ** The value can be defined in the osclconfig_memory.h file for the platform. 56 | ** In case PVMEM_INST_LEVEL is not defined for the platform, default 57 | ** values are defined here. 58 | */ 59 | #ifndef PVMEM_INST_LEVEL 60 | #if defined(NDEBUG) 61 | /* release mode-- no instrumentation */ 62 | #define PVMEM_INST_LEVEL 0 63 | #else 64 | /* debug mode-- full instrumentation */ 65 | #define PVMEM_INST_LEVEL 1 66 | #endif 67 | #endif 68 | 69 | /* 70 | ** When bypassing the Oscl memory manager, instrumentation 71 | ** is not needed, so should always be compiled out. 72 | */ 73 | #if(OSCL_BYPASS_MEMMGT) 74 | #undef PVMEM_INST_LEVEL 75 | #define PVMEM_INST_LEVEL 0 76 | #endif 77 | 78 | 79 | /*! @} */ 80 | 81 | #endif 82 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_mempool_allocator.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ M E M P O O L _ A L L O C A T O R 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclerror OSCL Error 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /*! \file oscl_mempool_allocator.h 32 | \brief This file contains the definition of memory pool allocator for leave/trap 33 | */ 34 | 35 | /*************************************************************************************** 36 | File Name : oscl_mempool_allocator.h 37 | Description : File containing definition of class OsclMemPoolAllocator that provides 38 | methods for creating, deleting memory pool. 39 | Coding History : 40 | Achint Kaur April 11, 2006 Initial Draft 41 | ***************************************************************************************/ 42 | #ifndef OSCL_MEMPOOL_ALLOCATOR_H_INCLUDED 43 | #define OSCL_MEMPOOL_ALLOCATOR_H_INCLUDED 44 | 45 | #ifndef OSCL_DEFALLOC_H_INCLUDED 46 | // For custom allocator Oscl_DefAlloc object 47 | #include "oscl_defalloc.h" 48 | #endif 49 | 50 | class OsclMemPoolAllocator 51 | { 52 | public: 53 | // Constructor 54 | OsclMemPoolAllocator(Oscl_DefAlloc* gen_alloc = NULL); 55 | 56 | // Virtual destructor 57 | virtual ~OsclMemPoolAllocator(); 58 | 59 | // Create memory pool 60 | OsclAny* CreateMemPool(const uint32 aNumChunk = 2, const uint32 aChunkSize = 4); 61 | 62 | // Delete memory pool 63 | void DestroyMemPool(); 64 | 65 | // Memory alignment 66 | uint oscl_mem_aligned_size(uint size); 67 | 68 | private: 69 | // Custom allocator for memory 70 | Oscl_DefAlloc* iCustomAllocator; 71 | 72 | // Base address for memory pool 73 | OsclAny* iBaseAddress; 74 | 75 | }; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_namestring.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ N A M E S T R I N G 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclerror OSCL Error 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_namestring.h 32 | \brief Name string class include file. 33 | */ 34 | 35 | #ifndef OSCL_NAMESTRING_H_INCLUDED 36 | #define OSCL_NAMESTRING_H_INCLUDED 37 | 38 | #ifndef OSCL_BASE_H_INCLUDED 39 | #include "oscl_base.h" 40 | #endif 41 | 42 | /** 43 | // Name string class appropriate for passing 44 | // short constant ASCII strings around. 45 | // All strings are automatically truncated 46 | // and null-terminated. 47 | */ 48 | template 49 | class OsclNameString 50 | { 51 | public: 52 | OsclNameString() 53 | { 54 | Set(""); 55 | } 56 | 57 | OsclNameString(const char a[]) 58 | { 59 | Set((uint8*)a); 60 | } 61 | 62 | OsclNameString(uint8* a) 63 | { 64 | Set(a); 65 | } 66 | 67 | /** 68 | * Set the string to the input value. The string 69 | * will be truncated to fit the storage class and 70 | * automatically null-terminated. 71 | * 72 | * @param a (input param): null-terminated character 73 | * string. 74 | */ 75 | void Set(uint8* a) 76 | { 77 | for (int i = 0; i < __len; i++) 78 | iStr[i] = '\0'; 79 | if (a) 80 | { 81 | for (int i = 0; i < __len - 1; i++) 82 | { 83 | iStr[i] = a[i]; 84 | if (a[i] == '\0') 85 | return; 86 | } 87 | } 88 | } 89 | 90 | void Set(const char a[]) 91 | { 92 | Set((uint8*)a); 93 | } 94 | 95 | uint8* Str()const 96 | { 97 | return (uint8*)&iStr[0]; 98 | } 99 | 100 | int32 MaxLen()const 101 | { 102 | return __len; 103 | } 104 | 105 | private: 106 | uint8 iStr[__len]; 107 | }; 108 | #endif 109 | 110 | /*! @} */ 111 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_rand.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ R A N D 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /*! 32 | * \file oscl_rand.h 33 | * \brief Provides pseudo-random number generation. 34 | * 35 | */ 36 | 37 | #ifndef OSCL_RAND_H_INCLUDED 38 | #define OSCL_RAND_H_INCLUDED 39 | 40 | #ifndef OSCLCONFIG_UTIL_H_INCLUDED 41 | #include "osclconfig_util.h" 42 | #endif 43 | 44 | #ifndef OSCL_BASE_H_INCLUDED 45 | #include "oscl_base.h" 46 | #endif 47 | 48 | #ifndef OSCL_MEM_BASIC_FUNCTIONS_H 49 | #include "oscl_mem_basic_functions.h" 50 | #endif 51 | 52 | class OsclRand 53 | { 54 | public: 55 | OSCL_COND_IMPORT_REF void Seed(int32 seed); 56 | OSCL_COND_IMPORT_REF int32 Rand(); 57 | private: 58 | }; 59 | 60 | #if (!OSCL_DISABLE_INLINES) 61 | #include "oscl_rand.inl" 62 | #endif 63 | 64 | 65 | #endif 66 | 67 | /*! @} */ 68 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_rand.inl: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ R A N D 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | OSCL_COND_EXPORT_REF OSCL_INLINE void OsclRand::Seed(int32 seed) 27 | { 28 | srand(seed); 29 | } 30 | 31 | OSCL_COND_EXPORT_REF OSCL_INLINE int32 OsclRand::Rand() 32 | { 33 | return rand(); 34 | } 35 | 36 | 37 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 38 | 39 | // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_registry_access_client.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // Oscl Registry Access Client 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /*! 32 | * \file oscl_registry_access_client.h 33 | * \brief Client-side implementation Registry Access implementation. 34 | * 35 | */ 36 | 37 | 38 | #ifndef OSCL_REGISTRY_ACCESS_CLIENT_H_INCLUDED 39 | #define OSCL_REGISTRY_ACCESS_CLIENT_H_INCLUDED 40 | 41 | 42 | #ifndef OSCL_REGISTRY_TYPES_H_INCLUDED 43 | #include "oscl_registry_types.h" 44 | #endif 45 | #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED 46 | #include "oscl_string_containers.h" 47 | #endif 48 | #ifndef OSCL_VECTOR_H_INCLUDED 49 | #include "oscl_vector.h" 50 | #endif 51 | #ifndef OSCL_MEM_H_INCLUDED 52 | #include "oscl_mem.h" 53 | #endif 54 | 55 | class OsclRegistryAccessClientImpl; 56 | class OsclRegistryAccessClientTlsImpl; 57 | 58 | class OsclRegistryAccessClient 59 | { 60 | public: 61 | OSCL_IMPORT_REF OsclRegistryAccessClient(); 62 | OSCL_IMPORT_REF ~OsclRegistryAccessClient(); 63 | 64 | /*! 65 | ** Create a session. 66 | ** @return OsclErrNone on success. 67 | */ 68 | OSCL_IMPORT_REF int32 Connect(); 69 | 70 | /*! 71 | ** Lookup a factory by registry and component mime type. 72 | ** @param aComponent: registry+component MIME type 73 | ** @return Factory. Factory will be NULL if not found. 74 | */ 75 | OSCL_IMPORT_REF OsclComponentFactory GetFactory(OSCL_String& aComponent); 76 | 77 | 78 | /*! 79 | ** Get all factories for a given registry type. 80 | ** @param aRegistry: registry MIME type 81 | ** @param aVec: output component factory + mimestring vector. 82 | */ 83 | OSCL_IMPORT_REF void GetFactories(OSCL_String& aRegistry, Oscl_Vector& aVec); 84 | 85 | /*! 86 | ** Close and cleanup session. 87 | */ 88 | OSCL_IMPORT_REF void Close(); 89 | 90 | private: 91 | OsclRegistryAccessClientImpl* iGlobalImpl; 92 | OsclRegistryAccessClientTlsImpl* iTlsImpl; 93 | }; 94 | 95 | 96 | #endif // OSCL_STRING_H_INCLUDED 97 | 98 | /*! @} */ 99 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_registry_client.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // Oscl Registry Client 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | 30 | /*! 31 | * \file oscl_registry_client.h 32 | * \brief Client-side implementation of OsclRegistry 33 | * 34 | */ 35 | 36 | #ifndef OSCL_REGISTRY_CLIENT_H_INCLUDED 37 | #define OSCL_REGISTRY_CLIENT_H_INCLUDED 38 | 39 | #ifndef OSCL_REGISTRY_TYPES_H_INCLUDED 40 | #include "oscl_registry_types.h" 41 | #endif 42 | 43 | #ifndef OSCL_MEM_H_INCLUDED 44 | #include "oscl_mem.h" 45 | #endif 46 | 47 | #ifndef OSCL_STRING_H_INCLUDED 48 | #include "oscl_string.h" 49 | #endif 50 | 51 | class OsclRegistryClientImpl; 52 | class OsclRegistryClientTlsImpl; 53 | 54 | class OsclRegistryClient : public HeapBase 55 | { 56 | public: 57 | OSCL_IMPORT_REF OsclRegistryClient(); 58 | OSCL_IMPORT_REF ~OsclRegistryClient(); 59 | 60 | /*! 61 | ** Create a session. 62 | ** @param aPerThread: Select per-thread registry instead of global registry. 63 | ** @return OsclErrNone on success. 64 | */ 65 | OSCL_IMPORT_REF int32 Connect(bool aPerThread = false); 66 | 67 | /*! 68 | ** Register a component factory by registry ID and component ID. 69 | ** 70 | ** @param aComponentID: registry + component mime-string. 71 | ** @param aFactory: factory function pointer. 72 | ** @param aParam: component Create param. 73 | ** @return OsclErrNone on success. 74 | */ 75 | OSCL_IMPORT_REF int32 Register(OSCL_String& aComponentID, OsclComponentFactory aFactory); 76 | 77 | /*! 78 | ** Unregister a previously registered component. 79 | ** @return OsclErrNone on success. 80 | */ 81 | OSCL_IMPORT_REF int32 UnRegister(OSCL_String& aComponentID); 82 | 83 | /*! 84 | ** Close and cleanup. All components registered in this session are 85 | ** are automatically unregistered. 86 | */ 87 | OSCL_IMPORT_REF void Close(); 88 | 89 | private: 90 | OsclRegistryClientImpl* iGlobalImpl; 91 | OsclRegistryClientTlsImpl* iTlsImpl; 92 | 93 | }; 94 | 95 | 96 | #endif //OSCL_REGISTRY_CLIENT_H_INCLUDED 97 | /*! @} */ 98 | 99 | 100 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_registry_serv_impl_global.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // Oscl Registry Serv Impl 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | /*! 30 | * \file oscl_registry_serv_impl.h 31 | * \brief Server-side implementation of OsclRegistry interfaces. 32 | * 33 | */ 34 | 35 | 36 | #ifndef OSCL_REGISTRY_SERV_IMPL_GLOBAL_H_INCLUDED 37 | #define OSCL_REGISTRY_SERV_IMPL_GLOBAL_H_INCLUDED 38 | 39 | #include "osclconfig_proc.h" 40 | #include "oscl_base.h" 41 | #if (OSCL_HAS_SINGLETON_SUPPORT) 42 | 43 | #include "oscl_registry_serv_impl.h" 44 | #include "oscl_registry_types.h" 45 | #include "oscl_vector.h" 46 | #include "oscl_mem.h" 47 | 48 | //global-variable-based implementation. 49 | //this handles both the registration client and the access client 50 | //interfaces. 51 | class OsclRegistryServImpl 52 | { 53 | protected: 54 | OsclRegistryServImpl(); 55 | virtual ~OsclRegistryServImpl(); 56 | 57 | int32 Connect(); 58 | void Close(); 59 | 60 | //for registration client 61 | int32 Register(OSCL_String& aComponentID, OsclComponentFactory aFactory); 62 | int32 UnRegister(OSCL_String& aComponentID); 63 | 64 | //for access client. 65 | OsclComponentFactory GetFactory(OSCL_String& aComponent); 66 | void GetFactories(OSCL_String& aRegistry, Oscl_Vector& aVec); 67 | 68 | friend class OsclRegistryClient; 69 | friend class OsclRegistryAccessClient; 70 | private: 71 | bool IsOpen() const 72 | { 73 | return iIsOpen; 74 | } 75 | bool iIsOpen; 76 | //server data. 77 | OsclComponentRegistry* GetOsclComponentRegistry(); 78 | //session data. 79 | Oscl_Vector iIdVec; 80 | 81 | }; 82 | 83 | #endif //oscl config 84 | 85 | #endif //OSCL_REGISTRY_IMPL_GLOBAL_H_INCLUDED 86 | /*! @} */ 87 | 88 | 89 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_registry_serv_impl_tls.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // Oscl Registry Serv Impl 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | /*! 30 | * \file oscl_registry_serv_impl.h 31 | * \brief Server-side implementation of OsclRegistry interfaces. 32 | * 33 | */ 34 | 35 | 36 | #ifndef OSCL_REGISTRY_SERV_IMPL_TLS_H_INCLUDED 37 | #define OSCL_REGISTRY_SERV_IMPL_TLS_H_INCLUDED 38 | 39 | #include "osclconfig_proc.h" 40 | 41 | #include "oscl_registry_serv_impl.h" 42 | #include "oscl_registry_types.h" 43 | #include "oscl_vector.h" 44 | #include "oscl_mem.h" 45 | 46 | //TLS-based implementation. 47 | //this handles both the registration client and the access client 48 | //interfaces. 49 | class OsclRegistryServTlsImpl 50 | { 51 | protected: 52 | OsclRegistryServTlsImpl(); 53 | virtual ~OsclRegistryServTlsImpl(); 54 | 55 | int32 Connect(); 56 | void Close(); 57 | 58 | //for registration client 59 | int32 Register(OSCL_String& aComponentID, OsclComponentFactory aFactory); 60 | int32 UnRegister(OSCL_String& aComponentID); 61 | 62 | //for access client. 63 | OsclComponentFactory GetFactory(OSCL_String& aComponent); 64 | void GetFactories(OSCL_String& aRegistry, Oscl_Vector& aVec); 65 | 66 | friend class OsclRegistryClient; 67 | friend class OsclRegistryAccessClient; 68 | private: 69 | bool IsOpen() const 70 | { 71 | return iIsOpen; 72 | } 73 | bool iIsOpen; 74 | //server data. 75 | OsclComponentRegistry* GetOsclComponentRegistry(); 76 | //session data. 77 | Oscl_Vector iIdVec; 78 | }; 79 | 80 | 81 | #endif //OSCL_REGISTRY_IMPL_TLS_H_INCLUDED 82 | /*! @} */ 83 | 84 | 85 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_registry_types.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // Oscl Registry Types 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /*! 32 | * \file oscl_registry_types.h 33 | * \brief Common types used in Oscl registry interfaces. 34 | * 35 | */ 36 | 37 | 38 | #ifndef OSCL_REGISTRY_TYPES_H_INCLUDED 39 | #define OSCL_REGISTRY_TYPES_H_INCLUDED 40 | 41 | 42 | #ifndef OSCL_TYPES_H_INCLUDED 43 | #include "oscl_types.h" 44 | #endif 45 | #ifndef OSCL_STRING_CONTAINERS_H_INCLUDED 46 | #include "oscl_string_containers.h" 47 | #endif 48 | 49 | /*! 50 | * OsclComponentFactory is an opaque pointer. 51 | */ 52 | typedef OsclAny* OsclComponentFactory; 53 | 54 | /*! 55 | * A class used to access the registry data 56 | */ 57 | class OsclRegistryAccessElement 58 | { 59 | public: 60 | OsclComponentFactory iFactory; 61 | OSCL_HeapString iMimeString; 62 | }; 63 | 64 | 65 | 66 | #endif // OSCL_REGISTRY_TYPES_H_INCLUDED 67 | 68 | /*! @} */ 69 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_scheduler_types.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | /*! \addtogroup osclproc OSCL Proc 19 | * 20 | * @{ 21 | */ 22 | 23 | 24 | /** \file oscl_scheduler_types.h 25 | \brief Scheduler common types include file. 26 | */ 27 | 28 | /** This file defines the OsclExecBase, OsclTimerBase, and OsclExecSchedulerBase 29 | classes. These are the base classes for PV AOs and PV Scheduler. 30 | We want the PV exec objects to be usable with either a PV scheduler 31 | or a non-PV native Symbian scheduler. We also want the PV scheduler to be 32 | usable with non-PV exec objects. Therefore, the PV scheduler and AO classes 33 | derived from Symbian classes on Symbian platforms. On non-Symbian platforms, 34 | the PV classes derive from classes with a similar API to the Symbian classes. 35 | */ 36 | 37 | #ifndef OSCL_SCHEDULER_TYPES_H_INCLUDED 38 | #define OSCL_SCHEDULER_TYPES_H_INCLUDED 39 | 40 | #ifndef OSCLCONFIG_PROC_H_INCLUDED 41 | #include "osclconfig_proc.h" 42 | #endif 43 | 44 | 45 | //Non-Symbian 46 | 47 | #ifndef OSCL_AOSTATUS_H_INCLUDED 48 | #include "oscl_aostatus.h" 49 | #endif 50 | 51 | #ifndef OSCL_HEAPBASE_H_INCLUDED 52 | #include "oscl_heapbase.h" 53 | #endif 54 | 55 | 56 | /** OsclActiveSchedulerBase is the base for OsclExecScheduler. 57 | The non-Symbian OsclActiveSchedulerBase class is functionally similar to 58 | a subset of Symbian CActiveScheduler class. 59 | */ 60 | class OsclExecSchedulerBase : public _OsclHeapBase 61 | { 62 | private: 63 | virtual void Error(int32 anError) const; 64 | virtual void OnStarting(); 65 | virtual void OnStopping(); 66 | OsclExecSchedulerBase(); 67 | ~OsclExecSchedulerBase(); 68 | friend class OsclExecScheduler; 69 | friend class OsclCoeActiveScheduler; 70 | friend class PVActiveBase; 71 | }; 72 | 73 | 74 | 75 | 76 | #endif // 77 | 78 | 79 | /*! @} */ 80 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_shared_lib_interface.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef OSCL_SHARED_LIB_INTERFACE_H_INCLUDED 19 | #define OSCL_SHARED_LIB_INTERFACE_H_INCLUDED 20 | 21 | #ifndef OSCL_UUID_H_INCLUDED 22 | #include "oscl_uuid.h" 23 | #endif 24 | 25 | class OsclSharedLibraryInterface 26 | { 27 | public: 28 | virtual OsclAny* SharedLibraryLookup(const OsclUuid& aInterfaceId) = 0; 29 | }; 30 | #endif // OSCL_SHARED_LIB_INTERFACE_H_INCLUDED 31 | 32 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_snprintf.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L_ S N P R I N T F 22 | 23 | // This is a portable implementation of snprintf() for use on all 24 | // platforms supported by oscl. 25 | 26 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 27 | 28 | /*! \addtogroup osclutil OSCL Util 29 | * 30 | * @{ 31 | */ 32 | 33 | 34 | /*! 35 | * \file oscl_snprintf.h 36 | * \brief Provides a portable implementation of snprintf 37 | * 38 | */ 39 | 40 | 41 | #ifndef OSCL_SNPRINTF_H_INCLUDED 42 | #define OSCL_SNPRINTF_H_INCLUDED 43 | 44 | // - - Inclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - - 45 | 46 | #ifndef OSCL_BASE_H_INCLUDED 47 | #include "oscl_base.h" 48 | #endif 49 | 50 | #ifndef OSCLCONFIG_UTIL_H_INCLUDED 51 | #include "osclconfig_util.h" 52 | #endif 53 | 54 | OSCL_IMPORT_REF int32 oscl_snprintf(char *str, uint32 count, const char *fmt, /*args*/ ...); 55 | OSCL_IMPORT_REF int32 oscl_snprintf(oscl_wchar *str, uint32 count, const oscl_wchar *fmt, /*args*/ ...); 56 | OSCL_IMPORT_REF int32 oscl_vsnprintf(char *str, uint32 count, const char *fmt, va_list args); 57 | OSCL_IMPORT_REF int32 oscl_vsnprintf(oscl_wchar *str, uint32 count, const oscl_wchar *fmt, va_list args); 58 | #endif 59 | 60 | /*! @} */ 61 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_string_utils.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ S T R I N G _ U T I L S 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_string_utils.h 32 | \brief Utilities to parse and convert strings 33 | */ 34 | 35 | #ifndef OSCL_STRING_UTILS_H_INCLUDED 36 | #define OSCL_STRING_UTILS_H_INCLUDED 37 | 38 | #ifndef OSCL_BASE_H_INCLUDED 39 | #include "oscl_base.h" 40 | #endif 41 | 42 | #define oscl_isdigit(c) ((c) >= '0' && (c) <= '9') 43 | 44 | OSCL_IMPORT_REF const char* skip_whitespace(const char *ptr); 45 | 46 | OSCL_IMPORT_REF char * skip_whitespace(char * ptr); 47 | 48 | OSCL_IMPORT_REF const char* skip_whitespace(const char *start, const char *end); 49 | 50 | OSCL_IMPORT_REF const char* skip_to_whitespace(const char *start, const char *end); 51 | 52 | OSCL_IMPORT_REF const char * skip_to_line_term(const char *start_ptr, const char *end_ptr); 53 | 54 | OSCL_IMPORT_REF const char* skip_whitespace_and_line_term(const char *start, const char *end); 55 | 56 | OSCL_IMPORT_REF int extract_string(const char * in_ptr, char *outstring, int maxsize); 57 | 58 | OSCL_IMPORT_REF int extract_string(const char * start, const char *end, char *outstring, int maxsize); 59 | 60 | OSCL_IMPORT_REF bool PV_atoi(const char *buf, const char new_format, uint32& value); 61 | 62 | OSCL_IMPORT_REF bool PV_atoi(const char *buf, const char new_format, int length, uint32& value); 63 | OSCL_IMPORT_REF bool PV_atoi(const char *buf, const char new_format, int length, uint64& value); 64 | OSCL_IMPORT_REF bool PV_atof(const char *buf, OsclFloat& value); 65 | OSCL_IMPORT_REF bool PV_atof(const char *buf, int length, OsclFloat& value); 66 | OSCL_IMPORT_REF int oscl_abs(int aVal); 67 | #endif // OSCL_STRING_UTILS_H_INCLUDED 68 | 69 | /*! @} */ 70 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/oscl_tickcount.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L _ T I C K C O U N T 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | /*! \addtogroup osclutil OSCL Util 26 | * 27 | * @{ 28 | */ 29 | 30 | 31 | /** \file oscl_tickcount.h 32 | \brief Defines a data structure for string containment/manipulations where the storage for the string is maintained externally. 33 | */ 34 | 35 | #ifndef OSCL_TICKCOUNT_H_INCLUDED 36 | #define OSCL_TICKCOUNT_H_INCLUDED 37 | 38 | #ifndef OSCL_BASE_H_INCLUDED 39 | #include "oscl_base.h" 40 | #endif 41 | 42 | #define OSCLTICKCOUNT_MAX_TICKS 0xffffffff 43 | 44 | /** 45 | * OsclTickCount class is used to retrieve the system tick 46 | * count and the tick counter's frequency. 47 | * 48 | * The maximum tick count value is equivalent to the maximum 49 | * uint32 value. 50 | */ 51 | class OsclTickCount 52 | { 53 | public: 54 | /** 55 | * This function returns the current system tick count 56 | * 57 | * @return returns the tick count 58 | */ 59 | static uint32 TickCount(); 60 | 61 | /** 62 | * This function returns the tick frequency in ticks 63 | * per second 64 | * 65 | * @return ticks per second 66 | */ 67 | static uint32 TickCountFrequency(); 68 | 69 | /** 70 | * This function returns the tick period in 71 | * microseconds per tick 72 | * 73 | * @return microseconds per tick 74 | */ 75 | static uint32 TickCountPeriod(); 76 | 77 | /** 78 | * This function converts ticks to milliseconds 79 | * 80 | * @return milliseconds 81 | */ 82 | static uint32 TicksToMsec(uint32 ticks); 83 | 84 | /** 85 | * This function converts milliseconds to ticks 86 | * 87 | * @return ticks 88 | */ 89 | static uint32 MsecToTicks(uint32 msec); 90 | }; 91 | 92 | #if !OSCL_DISABLE_INLINES 93 | #include "oscl_tickcount.inl" 94 | #endif 95 | 96 | #endif // OSCL_TICK_UTILS_H_INCLUDED 97 | 98 | /*! @} */ 99 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_ansi_memory.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ A N S I _ M E M O R Y 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_ansi_memory.h 27 | * \brief This file contains common typedefs based on the ANSI C limits.h header 28 | * 29 | * This header file should work for any ANSI C compiler to determine the 30 | * proper native C types to use for OSCL integer types. 31 | */ 32 | 33 | 34 | #ifndef OSCLCONFIG_ANSI_MEMORY_H_INCLUDED 35 | #define OSCLCONFIG_ANSI_MEMORY_H_INCLUDED 36 | 37 | #include 38 | typedef size_t oscl_memsize_t; 39 | #define OSCL_HAS_ANSI_MEMORY_FUNCS 1 40 | 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_compiler_warnings.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ C O M P I L E R _ W A R N I N G S 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_compiler_warnings.h 27 | * \brief This file contains the ability to turn off/on compiler warnings 28 | * 29 | */ 30 | 31 | // This macro enables the "#pragma GCC system_header" found in any header file that 32 | // includes this config file. 33 | // "#pragma GCC system_header" suppresses compiler warnings in the rest of that header 34 | // file by treating the header as a system header file. 35 | // For instance, foo.h has 30 lines, "#pragma GCC system_header" is inserted at line 10, 36 | // from line 11 to the end of file, all compiler warnings are disabled. 37 | // However, this does not affect any files that include foo.h. 38 | // Currently, oscl_defalloc.h and oscl_mem.h uses #pragma GCC system_header 39 | // This is meant to be a temporary fix until the root cause of the compiler warnings 40 | // can be resolved properly 41 | // 42 | #ifdef __GNUC__ 43 | #define OSCL_DISABLE_GCC_WARNING_SYSTEM_HEADER 44 | #endif 45 | 46 | #define OSCL_FUNCTION_PTR(x) (&x) 47 | 48 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_error.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ E R R O R 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_error.h 27 | * \brief This file contains the common typedefs and header files needed to compile osclerror 28 | * 29 | */ 30 | 31 | 32 | #ifndef OSCLCONFIG_ERROR_H_INCLUDED 33 | #define OSCLCONFIG_ERROR_H_INCLUDED 34 | 35 | #ifndef OSCLCONFIG_H_INCLUDED 36 | #include "osclconfig.h" 37 | #endif 38 | 39 | #define OSCL_HAS_EXCEPTIONS 1 40 | #define OSCL_HAS_ERRNO_H 1 41 | #define OSCL_HAS_SYMBIAN_ERRORTRAP 0 42 | #define OSCL_HAS_SETJMP_H 1 43 | 44 | // system header files 45 | #include 46 | #include 47 | 48 | 49 | // confirm that all definitions have been defined 50 | #include "osclconfig_error_check.h" 51 | 52 | #endif // OSCLCONFIG_ERROR_H_INCLUDED 53 | 54 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_error_check.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef OSCLCONFIG_ERROR_CHECK_H_INCLUDED 20 | #define OSCLCONFIG_ERROR_CHECK_H_INCLUDED 21 | 22 | 23 | /** 24 | OSCL_HAS_EXCEPTIONS macro should be set to 1 if 25 | the target platform supports C++ exceptions (throw, catch). 26 | Otherwise it should be set to 0. 27 | */ 28 | #ifndef OSCL_HAS_EXCEPTIONS 29 | #error "ERROR: OSCL_HAS_EXCEPTIONS has to be defined to either 1 or 0" 30 | #endif 31 | 32 | /** 33 | OSCL_HAS_EXCEPTIONS macro should be set to 1 if 34 | the target platform supports the POSIX-compliant errno.h header file. 35 | Otherwise it should be set to 0. 36 | */ 37 | #ifndef OSCL_HAS_ERRNO_H 38 | #error "ERROR: OSCL_HAS_ERRNO_H has to be defined to either 1 or 0" 39 | #endif 40 | 41 | /** 42 | OSCL_HAS_SYMBIAN_ERRORTRAP macro should be set to 1 if 43 | the target platform has Symbian leave, trap, and cleanup stack support. 44 | Otherwise it should be set to 0. 45 | */ 46 | #ifndef OSCL_HAS_SYMBIAN_ERRORTRAP 47 | #error "ERROR: OSCL_HAS_SYMBIAN_ERRORTRAP has to be defined to either 1 or 0" 48 | #endif 49 | 50 | /** 51 | OSCL_HAS_SETJMP_H macro should be set to 1 if 52 | the target platform supports the setjmp.h header file including 53 | the setjmp and longjmp functions. 54 | Otherwise it should be set to 0. 55 | */ 56 | #ifndef OSCL_HAS_SETJMP_H 57 | #error "ERROR: OSCL_HAS_SETJMP_H has to be defined to either 1 or 0" 58 | #endif 59 | 60 | 61 | #endif //OSCLCONFIG_ERROR_CHECK_H_INCLUDED 62 | 63 | 64 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_global_new_delete.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef OSCLCONFIG_GLOBAL_NEW_DELETE_H_INCLUDED 19 | #define OSCLCONFIG_GLOBAL_NEW_DELETE_H_INCLUDED 20 | 21 | //This file contains overloads for the global new/delete operators 22 | //for use in configurations without a native new/delete operator, 23 | //or where it is desirable to overload the existing global new/delete 24 | //operators. The implementation of the operators is in oscl_mem.cpp. 25 | 26 | void* operator new(size_t); 27 | void operator delete(void*); 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_global_placement_new.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef OSCLCONFIG_GLOBAL_PLACEMENT_NEW_H_INCLUDED 19 | #define OSCLCONFIG_GLOBAL_PLACEMENT_NEW_H_INCLUDED 20 | 21 | //This file contains a definition of placement new operator 22 | //for use in configurations without a native placement new 23 | //operator definition. 24 | 25 | inline void* operator new(size_t, void* ptr) 26 | { 27 | return ptr; 28 | } 29 | 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_ix86.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G ( P L A T F O R M C O N F I G I N F O ) 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_ix86.h 27 | * \brief This file contains configuration information for the ix86 processor family 28 | * 29 | */ 30 | 31 | #ifndef OSCLCONFIG_IX86_H_INCLUDED 32 | #define OSCLCONFIG_IX86_H_INCLUDED 33 | 34 | 35 | // Define macros for integer alignment and little endian byte order. 36 | #define OSCL_INTEGERS_WORD_ALIGNED 1 37 | #define OSCL_BYTE_ORDER_BIG_ENDIAN 0 38 | #define OSCL_BYTE_ORDER_LITTLE_ENDIAN 1 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_lib.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ L I B ( P L A T F O R M C O N F I G I N F O ) 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_lib.h 27 | \brief This file contains configuration information for the ANSI build. 28 | 29 | */ 30 | 31 | #ifndef OSCLCONFIG_LIB_H_INCLUDED 32 | #define OSCLCONFIG_LIB_H_INCLUDED 33 | 34 | 35 | 36 | //Set this to 1 to indicate this platform has oscllib support 37 | #define OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT 1 38 | #define PV_RUNTIME_LIB_FILENAME_EXTENSION "so" 39 | 40 | //Set this to 1 to enable looking for debug versions of libraries. 41 | //Use #ifndef to allow the compiler setting to override this definition 42 | #ifndef OSCL_LIB_READ_DEBUG_LIBS 43 | #if defined(NDEBUG) 44 | #define OSCL_LIB_READ_DEBUG_LIBS 0 45 | #else 46 | #define OSCL_LIB_READ_DEBUG_LIBS 1 47 | #endif 48 | #endif 49 | 50 | // The path recursively from which the config files are picked up 51 | #ifndef PV_DYNAMIC_LOADING_CONFIG_FILE_PATH 52 | #ifdef ANDROID 53 | #define PV_DYNAMIC_LOADING_CONFIG_FILE_PATH "/system/etc" 54 | #else 55 | #define PV_DYNAMIC_LOADING_CONFIG_FILE_PATH "./" 56 | #endif 57 | #endif 58 | 59 | // check all osclconfig required macros are defined 60 | #include "osclconfig_lib_check.h" 61 | 62 | #endif // OSCLCONFIG_LIB_H_INCLUDED 63 | 64 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_lib_check.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef OSCLCONFIG_LIB_CHECK_H_INCLUDED 20 | #define OSCLCONFIG_LIB_CHECK_H_INCLUDED 21 | 22 | /*! \addtogroup osclconfig OSCL config 23 | * 24 | * @{ 25 | */ 26 | 27 | 28 | 29 | /** 30 | OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT should be set to 1 if the platform has basic explicit runtime DLL loading support. 31 | */ 32 | #if !defined(OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT ) 33 | #error "ERROR: OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT must be defined to 0 or 1" 34 | #endif 35 | 36 | #if(OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT) 37 | /** 38 | ** When OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT is 1, 39 | ** OSCL_LIB_READ_DEBUG_LIBS should be set to 0 or 1. Set to 1 to enable loading 40 | ** debug versions of libs. 41 | */ 42 | #if !defined(OSCL_LIB_READ_DEBUG_LIBS) 43 | #error "ERROR: OSCL_LIB_READ_DEBUG_LIBS must be defined to 0 or 1" 44 | #endif 45 | 46 | /* 47 | ** When OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT is 1, 48 | ** PV_DYNAMIC_LOADING_CONFIG_FILE_PATH should be set. 49 | */ 50 | #if !defined(PV_DYNAMIC_LOADING_CONFIG_FILE_PATH) 51 | #error "ERROR: PV_DYNAMIC_LOADING_CONFIG_FILE_PATH must be set to a path where the config files are expected to be present" 52 | #endif 53 | 54 | /* 55 | ** When OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT is 1, 56 | ** PV_RUNTIME_LIB_FILENAME_EXTENSION should be set. 57 | */ 58 | #if !defined(PV_RUNTIME_LIB_FILENAME_EXTENSION) 59 | #error "ERROR: PV_RUNTIME_LIB_FILENAME_EXTENSION must be specified for use as the dynamic library file extension" 60 | #endif 61 | #endif // OSCL_HAS_RUNTIME_LIB_LOADING_SUPPORT 62 | 63 | /*! @} */ 64 | 65 | #endif // OSCLCONFIG_LIB_CHECK_H_INCLUDED 66 | 67 | 68 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_limits_typedefs.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G_ L I M I T S _ T Y P E D E F S 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_limits_typedefs.h 27 | * \brief This file contains common typedefs based on the ANSI C limits.h header 28 | * 29 | * This header file should work for any ANSI C compiler to determine the 30 | * proper native C types to use for OSCL integer types. 31 | */ 32 | 33 | 34 | #ifndef OSCLCONFIG_LIMITS_TYPEDEFS_H_INCLUDED 35 | #define OSCLCONFIG_LIMITS_TYPEDEFS_H_INCLUDED 36 | 37 | 38 | #include 39 | 40 | // determine if char is signed or unsigned 41 | #if ( CHAR_MIN == 0 ) 42 | #define OSCL_CHAR_IS_UNSIGNED 1 43 | #define OSCL_CHAR_IS_SIGNED 0 44 | #elif ( CHAR_MIN == SCHAR_MIN ) 45 | #define OSCL_CHAR_IS_UNSIGNED 0 46 | #define OSCL_CHAR_IS_SIGNED 1 47 | #else 48 | #error "Cannot determine if char is signed or unsigned" 49 | #endif 50 | 51 | 52 | #if ( (CHAR_MAX == 255) || (CHAR_MAX == 127) ) 53 | typedef signed char int8; 54 | typedef unsigned char uint8; 55 | #else 56 | #error "Cannot determine an 8-bit interger type" 57 | #endif 58 | 59 | 60 | #if ( SHRT_MAX == 32767 ) 61 | typedef short int16; 62 | typedef unsigned short uint16; 63 | 64 | #elif ( INT_MAX == 32767 ) 65 | typedef int int16; 66 | typedef unsigned int uint16; 67 | 68 | #else 69 | #error "Cannot determine 16-bit integer type" 70 | #endif 71 | 72 | 73 | 74 | #if ( INT_MAX == 2147483647 ) 75 | typedef int int32; 76 | typedef unsigned int uint32; 77 | 78 | #elif ( LONG_MAX == 2147483647 ) 79 | typedef long int32; 80 | typedef unsigned long uint32; 81 | 82 | #else 83 | #error "Cannot determine 32-bit integer type" 84 | #endif 85 | 86 | 87 | 88 | #endif 89 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_memory.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ M E M O R Y 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | 27 | 28 | #ifndef OSCLCONFIG_MEMORY_H_INCLUDED 29 | #define OSCLCONFIG_MEMORY_H_INCLUDED 30 | 31 | 32 | #ifndef OSCLCONFIG_H_INCLUDED 33 | #include "osclconfig.h" 34 | #endif 35 | 36 | #ifndef OSCLCONFIG_ANSI_MEMORY_H_INCLUDED 37 | #include "osclconfig_ansi_memory.h" 38 | #endif 39 | 40 | #ifdef NDEBUG 41 | #define OSCL_BYPASS_MEMMGT 1 42 | #else 43 | #define OSCL_BYPASS_MEMMGT 1 //Temporarily disabling 44 | #endif 45 | 46 | 47 | /* PVMEM_INST_LEVEL - Memory leak instrumentation level enables the compilation 48 | * of detailed memory leak info (filename + line number). 49 | * PVMEM_INST_LEVEL 0: Release mode. 50 | * PVMEM_INST_LEVEL 1: Debug mode. 51 | */ 52 | 53 | /* OSCL_HAS_GLOBAL_NEW_DELETE - Enables or disables the definition of overloaded 54 | * global memory operators in oscl_mem.h 55 | * 56 | * Release Mode: OSCL_HAS_GLOBAL_NEW_DELETE 0 57 | * Debug Mode: OSCL_HAS_GLOBAL_NEW_DELETE 1 58 | */ 59 | 60 | #if(OSCL_RELEASE_BUILD) 61 | #define OSCL_HAS_GLOBAL_NEW_DELETE 0 62 | #define PVMEM_INST_LEVEL 0 63 | #else 64 | #define OSCL_HAS_GLOBAL_NEW_DELETE 1 65 | #define PVMEM_INST_LEVEL 1 66 | #endif 67 | 68 | #if(OSCL_HAS_GLOBAL_NEW_DELETE) 69 | //Detect if or is included anyplace to avoid a compile error. 70 | #if defined(_INC_NEW) 71 | #error Duplicate New Definition! 72 | #endif //_INC_NEW 73 | #if defined(_NEW_) 74 | #error Duplicate New Definition! 75 | #endif //_NEW_ 76 | #endif //OSCL_HAS_GLOBAL_NEW_DELETE 77 | 78 | #ifdef __cplusplus 79 | #include //for placement new 80 | #endif //__cplusplus 81 | 82 | //OSCL_HAS_HEAP_BASE_SUPPORT - Enables or disables overloaded memory operators in HeapBase class 83 | #define OSCL_HAS_HEAP_BASE_SUPPORT 1 84 | 85 | #define OSCL_HAS_SYMBIAN_MEMORY_FUNCS 0 86 | 87 | 88 | #include "osclconfig_memory_check.h" 89 | 90 | 91 | #endif 92 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_memory_check.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef OSCLCONFIG_MEMORY_CHECK_H_INCLUDED 20 | #define OSCLCONFIG_MEMORY_CHECK_H_INCLUDED 21 | 22 | 23 | /** 24 | OSCL_BYPASS_MEMMGT macro should be set to 1 if 25 | it is desirable to bypass the PV memory management system and just 26 | use the native memory management. 27 | Otherwise it should be set to 0. 28 | */ 29 | #ifndef OSCL_BYPASS_MEMMGT 30 | #error "ERROR: OSCL_BYPASS_MEMMGT has to be defined to either 1 or 0" 31 | #endif 32 | 33 | /** 34 | OSCL_HAS_ANSI_MEMORY_FUNCS macro should be set to 1 if 35 | the target platform supports ANSI C memory functions (malloc, free, etc). 36 | Otherwise it should be set to 0. 37 | */ 38 | #ifndef OSCL_HAS_ANSI_MEMORY_FUNCS 39 | #error "ERROR: OSCL_HAS_ANSI_MEMORY_FUNCS has to be defined to either 1 or 0" 40 | #endif 41 | 42 | /** 43 | OSCL_HAS_SYMBIAN_MEMORY_FUNCS macro should be set to 1 if 44 | the target platform supports Symbian memory functions User::Alloc, User::Free, etc. 45 | Otherwise it should be set to 0. 46 | */ 47 | #ifndef OSCL_HAS_SYMBIAN_MEMORY_FUNCS 48 | #error "ERROR: OSCL_HAS_SYMBIAN_MEMORY_FUNCS has to be defined to either 1 or 0" 49 | #endif 50 | 51 | /* 52 | * OSCL_HAS_HEAP_BASE_SUPPORT macro should be set to 1 for the 53 | * platforms that allows inheritance from HeapBase class for 54 | * overloading of new/delete operators. 55 | */ 56 | 57 | #ifndef OSCL_HAS_HEAP_BASE_SUPPORT 58 | #error "ERROR: OSCL_HAS_HEAP_BASE_SUPPORT has to be defined to either 1 or 0." 59 | #endif 60 | 61 | /* 62 | * OSCL_HAS_GLOBAL_NEW_DELETE macro should be set to 1 for the 63 | * platforms that allows overloading of new/delete operators. 64 | */ 65 | 66 | #ifndef OSCL_HAS_GLOBAL_NEW_DELETE 67 | #error "ERROR: OSCL_HAS_GLOBAL_NEW_DELETE has to be defined to either 1 or 0." 68 | #endif 69 | 70 | #endif // OSCLCONFIG_MEMORY_CHECK_H_INCLUDED 71 | 72 | 73 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_no_os.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #ifndef OSCLCONFIG_NO_OS_H_INCLUDED 20 | #define OSCLCONFIG_NO_OS_H_INCLUDED 21 | 22 | /*! \addtogroup osclconfig OSCL config 23 | * 24 | * @{ 25 | */ 26 | 27 | //a file to turn off ALL os-specific switches. 28 | 29 | //osclconfig 30 | #define OSCL_HAS_UNIX_SUPPORT 0 31 | #define OSCL_HAS_MSWIN_SUPPORT 0 32 | #define OSCL_HAS_MSWIN_PARTIAL_SUPPORT 0 33 | #define OSCL_HAS_MSWIN_TIME_SUPPORT 0 34 | #define OSCL_HAS_SYMBIAN_SUPPORT 0 35 | #define OSCL_HAS_SAVAJE_SUPPORT 0 36 | #define OSCL_HAS_PV_C_OS_SUPPORT 0 37 | 38 | //osclconfig_error 39 | #define OSCL_HAS_SYMBIAN_ERRORTRAP 0 40 | 41 | //osclconfig_memory 42 | #define OSCL_HAS_SYMBIAN_MEMORY_FUNCS 0 43 | #define OSCL_HAS_PV_C_OS_API_MEMORY_FUNCS 0 44 | 45 | //osclconfig_time 46 | #define OSCL_HAS_PV_C_OS_TIME_FUNCS 0 47 | #define OSCL_HAS_UNIX_TIME_FUNCS 0 48 | 49 | //osclconfig_util 50 | #define OSCL_HAS_SYMBIAN_TIMERS 0 51 | #define OSCL_HAS_SYMBIAN_MATH 0 52 | 53 | //osclconfig_proc 54 | #define OSCL_HAS_SYMBIAN_SCHEDULER 0 55 | #define OSCL_HAS_SEM_TIMEDWAIT_SUPPORT 0 56 | #define OSCL_HAS_PTHREAD_SUPPORT 0 57 | 58 | //osclconfig_io 59 | #define OSCL_HAS_SYMBIAN_COMPATIBLE_IO_FUNCTION 0 60 | #define OSCL_HAS_SAVAJE_IO_SUPPORT 0 61 | #define OSCL_HAS_SYMBIAN_SOCKET_SERVER 0 62 | #define OSCL_HAS_SYMBIAN_DNS_SERVER 0 63 | #define OSCL_HAS_BERKELEY_SOCKETS 0 64 | 65 | 66 | /*! @} */ 67 | 68 | #endif // OSCLCONFIG_CHECK_H_INCLUDED 69 | 70 | 71 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_proc.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ P R O C ( P L A T F O R M C O N F I G I N F O ) 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_proc.h 27 | * \brief This file contains configuration information for the linux platform 28 | * 29 | */ 30 | 31 | #ifndef OSCLCONFIG_PROC_H_INCLUDED 32 | #define OSCLCONFIG_PROC_H_INCLUDED 33 | 34 | #ifndef OSCLCONFIG_H_INCLUDED 35 | #include "osclconfig.h" 36 | #endif 37 | 38 | #include "osclconfig_proc_unix_android.h" 39 | 40 | #include "osclconfig_proc_check.h" 41 | 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_proc_unix_android.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ P R O C ( P L A T F O R M C O N F I G I N F O ) 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_proc.h 27 | * \brief This file contains configuration information for the linux platform 28 | * 29 | */ 30 | 31 | #ifndef OSCLCONFIG_PROC_UNIX_ANDROID_H_INCLUDED 32 | #define OSCLCONFIG_PROC_UNIX_ANDROID_H_INCLUDED 33 | 34 | #define OSCL_HAS_SYMBIAN_SCHEDULER 0 35 | 36 | #define OSCL_HAS_THREAD_SUPPORT 1 37 | #define OSCL_HAS_NON_PREEMPTIVE_THREAD_SUPPORT 0 38 | 39 | //semaphore with advanced realtime features incl. timed wait. 40 | #define OSCL_HAS_SEM_TIMEDWAIT_SUPPORT 0 41 | //#include 42 | //#include 43 | 44 | //pthreads 45 | #define OSCL_HAS_PTHREAD_SUPPORT 1 46 | #include 47 | #include 48 | #include 49 | 50 | // threads, mutex, semaphores 51 | typedef pthread_t TOsclThreadId; 52 | typedef void* TOsclThreadFuncArg; 53 | typedef void* TOsclThreadFuncRet; 54 | #define OSCL_THREAD_DECL 55 | typedef pthread_t TOsclThreadObject; 56 | typedef pthread_mutex_t TOsclMutexObject; 57 | typedef int TOsclSemaphoreObject; 58 | typedef pthread_cond_t TOsclConditionObject; 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_proc_unix_common.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ P R O C ( P L A T F O R M C O N F I G I N F O ) 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | /*! \file osclconfig_proc.h 27 | * \brief This file contains configuration information for the linux platform 28 | * 29 | */ 30 | 31 | #ifndef OSCLCONFIG_PROC_UNIX_COMMON_H_INCLUDED 32 | #define OSCLCONFIG_PROC_UNIX_COMMON_H_INCLUDED 33 | 34 | #define OSCL_HAS_SYMBIAN_SCHEDULER 0 35 | 36 | #define OSCL_HAS_THREAD_SUPPORT 1 37 | #define OSCL_HAS_NON_PREEMPTIVE_THREAD_SUPPORT 0 38 | 39 | //semaphore with advanced realtime features incl. timed wait. 40 | #define OSCL_HAS_SEM_TIMEDWAIT_SUPPORT 1 41 | #include 42 | #include 43 | 44 | //pthreads 45 | #define OSCL_HAS_PTHREAD_SUPPORT 1 46 | #include 47 | #include 48 | 49 | // threads, mutex, semaphores 50 | typedef pthread_t TOsclThreadId; 51 | typedef void* TOsclThreadFuncArg; 52 | typedef void* TOsclThreadFuncRet; 53 | #define OSCL_THREAD_DECL 54 | typedef pthread_t TOsclThreadObject; 55 | typedef pthread_mutex_t TOsclMutexObject; 56 | typedef sem_t TOsclSemaphoreObject; 57 | typedef pthread_cond_t TOsclConditionObject; 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_time.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | // -*- c++ -*- 19 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 | 21 | // O S C L C O N F I G _ T I M E ( T I M E - D E F I N I T I O N S ) 22 | 23 | // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 | 25 | 26 | 27 | 28 | #ifndef OSCLCONFIG_TIME_H_INCLUDED 29 | #define OSCLCONFIG_TIME_H_INCLUDED 30 | 31 | 32 | #ifndef OSCLCONFIG_H_INCLUDED 33 | #include "osclconfig.h" 34 | #endif 35 | 36 | // system header files 37 | #include // timeval 38 | #include // timercmp 39 | #include 40 | 41 | 42 | 43 | #define OSCL_HAS_UNIX_TIME_FUNCS 1 44 | 45 | 46 | typedef struct timeval OsclBasicTimeStruct; 47 | typedef tm OsclBasicDateTimeStruct; 48 | 49 | #include "osclconfig_time_check.h" 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_time_check.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | //osclconfig: this build configuration file is for win32 20 | #ifndef OSCLCONFIG_TIME_CHECK_H_INCLUDED 21 | #define OSCLCONFIG_TIME_CHECK_H_INCLUDED 22 | 23 | 24 | /** 25 | OSCL_HAS_UNIX_TIME_FUNCS macro should be set to 1 if 26 | the target platform supports unix time of day functions. 27 | Otherwise it should be set to 0. 28 | */ 29 | #ifndef OSCL_HAS_UNIX_TIME_FUNCS 30 | #error "ERROR: OSCL_HAS_UNIX_TIME_FUNCS has to be defined to either 1 or 0" 31 | #endif 32 | 33 | /** 34 | OsclBasicTimeStruct type should be defined to the platform-specific 35 | time of day type. 36 | */ 37 | typedef OsclBasicTimeStruct __Validate__BasicTimeStruct__; 38 | 39 | /** 40 | OsclBasicDateTimeStruct type should be defined to the platform-specific 41 | date + time type. 42 | */ 43 | typedef OsclBasicDateTimeStruct __Validate__BasicTimeDateStruct__; 44 | 45 | #endif //OSCLCONFIG_TIME_CHECK_H_INCLUDED 46 | 47 | 48 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_util.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef OSCLCONFIG_UTIL_H_INCLUDED 19 | #define OSCLCONFIG_UTIL_H_INCLUDED 20 | 21 | #ifndef OSCLCONFIG_H_INCLUDED 22 | #include "osclconfig.h" 23 | #endif 24 | 25 | #include //sprintf 26 | #include // OSCL clock 27 | #include // timeval 28 | 29 | #define OSCL_CLOCK_HAS_DRIFT_CORRECTION 0 30 | #define OSCL_HAS_SYMBIAN_TIMERS 0 31 | #define OSCL_HAS_SYMBIAN_MATH 0 32 | 33 | #define OSCL_RAND_MAX RAND_MAX 34 | 35 | //Define system sleep call for the tick count test here. 36 | #include 37 | #define SLEEP_ONE_SEC sleep(1) 38 | 39 | 40 | #include "osclconfig_util_check.h" 41 | 42 | #endif 43 | 44 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/oscl/osclconfig_util_check.h: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 1998-2009 PacketVideo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | #ifndef OSCLCONFIG_UTIL_CHECK_H_INCLUDED 19 | #define OSCLCONFIG_UTIL_CHECK_H_INCLUDED 20 | 21 | /** 22 | OSCL_HAS_SYMBIAN_TIMERS macro should be set to 1 if 23 | the target platform supports Symbian timers (RTimer). 24 | Otherwise it should be set to 0. 25 | */ 26 | #ifndef OSCL_HAS_SYMBIAN_TIMERS 27 | #error "ERROR: OSCL_HAS_SYMBIAN_TIMERS has to be defined to either 1 or 0" 28 | #endif 29 | 30 | /** 31 | OSCL_HAS_SYMBIAN_MATH macro should be set to 1 if 32 | the target platform supports Symbian features. 33 | Otherwise it should be set to 0. 34 | */ 35 | #ifndef OSCL_HAS_SYMBIAN_MATH 36 | #error "ERROR: OSCL_HAS_SYMBIAN_MATH has to be defined to either 1 or 0" 37 | #endif 38 | 39 | /** 40 | OSCL_HAS_ANSI_MATH_SUPPORT macro should be set to 1 if 41 | the target platform supports the ANSI C math functions (math.h) 42 | Otherwise it should be set to 0. 43 | */ 44 | #ifndef OSCL_HAS_ANSI_MATH_SUPPORT 45 | #error "ERROR: OSCL_HAS_ANSI_MATH_SUPPORT has to be defined to either 1 or 0" 46 | #endif 47 | 48 | /** 49 | OSCL_CLOCK_HAS_DRIFT_CORRECTION macro should be set to 1 if the target platform 50 | has drift correction Otherwise it should be set to 0. 51 | */ 52 | #ifndef OSCL_CLOCK_HAS_DRIFT_CORRECTION 53 | #error "ERROR: OSCL_CLOCK_HAS_DRIFT_CORRECTION has to be defined to either 1 or 0" 54 | #endif 55 | 56 | #endif // OSCLCONFIG_UTIL_CHECK_H_INCLUDED 57 | 58 | 59 | -------------------------------------------------------------------------------- /Codec/amr/src/main/jni/wrapper.cpp: -------------------------------------------------------------------------------- 1 | /* ------------------------------------------------------------------ 2 | * Copyright (C) 2009 Martin Storsjo 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 | * express or implied. 14 | * See the License for the specific language governing permissions 15 | * and limitations under the License. 16 | * ------------------------------------------------------------------- 17 | */ 18 | 19 | #define AMRNB_WRAPPER_INTERNAL 20 | #include 21 | #include 22 | #include 23 | #include "interf_dec.h" 24 | #include "interf_enc.h" 25 | #include "opencore/codecs_v2/audio/gsm_amr/amr_nb/enc/src/amrencode.h" 26 | #include "opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/sp_dec.h" 27 | #include "oscl/osclconfig_limits_typedefs.h" 28 | #include "opencore/codecs_v2/audio/gsm_amr/amr_nb/dec/src/amrdecode.h" 29 | #include "opencore/codecs_v2/audio/gsm_amr/amr_nb/common/include/gsm_amr_typedefs.h" 30 | #include "opencore/codecs_v2/audio/gsm_amr/common/dec/include/pvgsmamrdecoderinterface.h" 31 | #include 32 | 33 | #ifndef DISABLE_AMRNB_DECODER 34 | void* Decoder_Interface_init(void) { 35 | void* ptr = NULL; 36 | GSMInitDecode(&ptr, (int8*)"Decoder"); 37 | return ptr; 38 | } 39 | 40 | void Decoder_Interface_exit(void* state) { 41 | GSMDecodeFrameExit(&state); 42 | } 43 | 44 | void Decoder_Interface_Decode(void* state, const unsigned char* in, short* out) { 45 | unsigned char type = (in[0] >> 3) & 0x0f; 46 | in++; 47 | AMRDecode(state, (enum Frame_Type_3GPP) type, (UWord8*) in, out, MIME_IETF); 48 | } 49 | #endif 50 | 51 | #ifndef DISABLE_AMRNB_ENCODER 52 | 53 | void* Encoder_Interface_init(int dtx) { 54 | struct encoder_state* state = (struct encoder_state*) malloc(sizeof(struct encoder_state)); 55 | AMREncodeInit(&state->encCtx, &state->pidSyncCtx, dtx); 56 | return state; 57 | } 58 | 59 | void Encoder_Interface_reset(void* s){ 60 | struct encoder_state* state = (struct encoder_state*) s; 61 | AMREncodeReset(&state->encCtx,&state->pidSyncCtx); 62 | } 63 | 64 | void Encoder_Interface_exit(void* s) { 65 | struct encoder_state* state = (struct encoder_state*) s; 66 | AMREncodeExit(&state->encCtx, &state->pidSyncCtx); 67 | free(state); 68 | } 69 | 70 | int Encoder_Interface_Encode(void* s, enum Mode mode, const short* in, unsigned char* out) { 71 | struct encoder_state* state = (struct encoder_state*) s; 72 | enum Frame_Type_3GPP frame_type = (enum Frame_Type_3GPP) mode; 73 | int ret = AMREncode(state->encCtx, state->pidSyncCtx, mode, (Word16*) in, out, &frame_type, AMR_TX_IETF); 74 | out[0] |= 0x04; 75 | return ret; 76 | } 77 | #endif 78 | 79 | -------------------------------------------------------------------------------- /Codec/amr/src/main/libs/arm64-v8a/libamr-codec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinho/opencore-amr-android/888937a78a67d47c9f2437744214f45d13e85dec/Codec/amr/src/main/libs/arm64-v8a/libamr-codec.so -------------------------------------------------------------------------------- /Codec/amr/src/main/libs/armeabi-v7a/libamr-codec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinho/opencore-amr-android/888937a78a67d47c9f2437744214f45d13e85dec/Codec/amr/src/main/libs/armeabi-v7a/libamr-codec.so -------------------------------------------------------------------------------- /Codec/amr/src/main/libs/armeabi/libamr-codec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinho/opencore-amr-android/888937a78a67d47c9f2437744214f45d13e85dec/Codec/amr/src/main/libs/armeabi/libamr-codec.so -------------------------------------------------------------------------------- /Codec/amr/src/main/libs/mips/libamr-codec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinho/opencore-amr-android/888937a78a67d47c9f2437744214f45d13e85dec/Codec/amr/src/main/libs/mips/libamr-codec.so -------------------------------------------------------------------------------- /Codec/amr/src/main/libs/mips64/libamr-codec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinho/opencore-amr-android/888937a78a67d47c9f2437744214f45d13e85dec/Codec/amr/src/main/libs/mips64/libamr-codec.so -------------------------------------------------------------------------------- /Codec/amr/src/main/libs/x86/libamr-codec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinho/opencore-amr-android/888937a78a67d47c9f2437744214f45d13e85dec/Codec/amr/src/main/libs/x86/libamr-codec.so -------------------------------------------------------------------------------- /Codec/amr/src/main/libs/x86_64/libamr-codec.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevinho/opencore-amr-android/888937a78a67d47c9f2437744214f45d13e85dec/Codec/amr/src/main/libs/x86_64/libamr-codec.so -------------------------------------------------------------------------------- /Codec/amr/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Media 3 | 4 | -------------------------------------------------------------------------------- /Codec/app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /Codec/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 19 5 | buildToolsVersion '19.1.0' 6 | 7 | defaultConfig { 8 | applicationId "io.kvh.media.demo" 9 | minSdkVersion 9 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | } 21 | } 22 | 23 | dependencies { 24 | compile fileTree(dir: 'libs', include: ['*.jar']) 25 | compile project(':amr') 26 | //compile 'io.kvh:amr:1.1.1'//this is the second option 27 | } -------------------------------------------------------------------------------- /Codec/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /Users/changbinhe/Documents/Android/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /Codec/app/src/androidTest/java/com/hikvh/media/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.hikvh.media; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /Codec/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /Codec/app/src/main/java/io/kvh/media/KCacheUtils.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media; 2 | 3 | import android.content.Context; 4 | import android.content.pm.PackageManager; 5 | import android.os.Environment; 6 | 7 | import java.io.File; 8 | 9 | import static android.os.Environment.MEDIA_MOUNTED; 10 | 11 | public class KCacheUtils { 12 | private static Context mContext; 13 | private static final String EXTERNAL_STORAGE_PERMISSION = "android.permission.WRITE_EXTERNAL_STORAGE"; 14 | 15 | public static void init(Context context) { 16 | mContext = context; 17 | } 18 | 19 | public static String getCacheDirectory() { 20 | String cachedDir = null; 21 | if (MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) && hasExternalStoragePermission()) { 22 | cachedDir = getExternalCacheDir().getAbsolutePath(); 23 | } 24 | if (cachedDir == null) { 25 | cachedDir = mContext.getCacheDir().getAbsolutePath(); 26 | } 27 | if (cachedDir == null) { 28 | cachedDir = mContext.getFilesDir().getParentFile().getPath() + mContext.getPackageName() + "/cache"; 29 | } 30 | return cachedDir; 31 | } 32 | 33 | private static File getExternalCacheDir() { 34 | File dataDir = new File(new File(Environment.getExternalStorageDirectory(), "Android"), "data"); 35 | File appCacheDir = new File(new File(dataDir, mContext.getPackageName()), "cache"); 36 | if (!appCacheDir.exists()) { 37 | if (!appCacheDir.mkdirs()) { 38 | return null; 39 | } 40 | } 41 | return appCacheDir; 42 | } 43 | 44 | private static boolean hasExternalStoragePermission() { 45 | int perm = mContext.checkCallingOrSelfPermission(EXTERNAL_STORAGE_PERMISSION); 46 | return perm == PackageManager.PERMISSION_GRANTED; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Codec/app/src/main/java/io/kvh/media/demo/AmrFileDecoder.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media.demo; 2 | 3 | import android.media.AudioFormat; 4 | import android.media.AudioManager; 5 | import android.media.AudioTrack; 6 | import android.util.Log; 7 | 8 | import java.io.IOException; 9 | import java.io.InputStream; 10 | 11 | import io.kvh.media.amr.AmrDecoder; 12 | 13 | /** 14 | * Created by bugtags.com on 16/4/5. 15 | */ 16 | public class AmrFileDecoder implements Runnable { 17 | 18 | private Thread mDecodeThread; 19 | private AudioTrack mAudioTrack; 20 | 21 | private InputStream mInputStream; 22 | private long mDecoderState; 23 | 24 | byte[] readBuffer; 25 | byte[] readBufferWithoutCompress; 26 | 27 | int playerBufferSize = 0; 28 | // 8 k * 16bit * 1 = 8k shorts 29 | static final int SAMPLE_RATE = 8000; 30 | // 20 ms second 31 | // 0.02 x 8000 x 2 = 320;160 short 32 | static final int PCM_FRAME_SIZE = 160; 33 | 34 | //using AmrEncoder.Mode.MR122 to encode, generated frame size would be 32 35 | static final int AMR_FRAME_SIZE = 32;// see io.kvh.media.sound.Codec 36 | 37 | boolean isRunning; 38 | 39 | public void start(InputStream inputStream) { 40 | if (isRunning) { 41 | return; 42 | } 43 | 44 | isRunning = true; 45 | 46 | mDecoderState = AmrDecoder.init(); 47 | 48 | playerBufferSize = AudioTrack.getMinBufferSize(SAMPLE_RATE, 49 | AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT); 50 | mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, SAMPLE_RATE, 51 | AudioFormat.CHANNEL_OUT_MONO, AudioFormat.ENCODING_PCM_16BIT, 52 | playerBufferSize, AudioTrack.MODE_STREAM); 53 | readBuffer = new byte[AMR_FRAME_SIZE]; 54 | readBufferWithoutCompress = new byte[PCM_FRAME_SIZE]; 55 | 56 | mInputStream = inputStream; 57 | 58 | //amr file has 6 bytes header: "23 21 41 4D 52 0A" => "#!amr.", so skip here 59 | try { 60 | mInputStream.skip(6); 61 | } catch (IOException e) { 62 | e.printStackTrace(); 63 | } 64 | mAudioTrack.play(); 65 | mDecodeThread = new Thread(this); 66 | mDecodeThread.start(); 67 | } 68 | 69 | public void stop() { 70 | if (!isRunning) 71 | return; 72 | 73 | mDecodeThread.interrupt(); 74 | 75 | AmrDecoder.exit(mDecoderState); 76 | 77 | isRunning = false; 78 | 79 | mAudioTrack.stop(); 80 | } 81 | 82 | @Override 83 | public void run() { 84 | try { 85 | while (isRunning && mInputStream.read(readBuffer) != -1) { 86 | // amr frame 32 bytes 87 | byte[] amrFrame = readBuffer.clone(); 88 | // pcm frame 160 shorts 89 | short[] pcmFrame = new short[PCM_FRAME_SIZE]; 90 | AmrDecoder.decode(mDecoderState, amrFrame, pcmFrame); 91 | 92 | // 播放 93 | mAudioTrack.write(pcmFrame, 0, pcmFrame.length); 94 | } 95 | } catch (IOException e) { 96 | e.printStackTrace(); 97 | } 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /Codec/app/src/main/java/io/kvh/media/demo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media.demo; 2 | 3 | import android.app.Activity; 4 | import android.os.Bundle; 5 | import android.view.View; 6 | import android.widget.Button; 7 | import android.widget.Toast; 8 | 9 | import com.hikvh.media.demo.R; 10 | 11 | import io.kvh.media.KCacheUtils; 12 | import io.kvh.media.sound.SoundMan; 13 | 14 | public class MainActivity extends Activity { 15 | boolean isRecording; 16 | boolean isDecoding; 17 | 18 | private AmrFileDecoder mAmrFileDecoder; 19 | 20 | @Override 21 | protected void onCreate(Bundle savedInstanceState) { 22 | super.onCreate(savedInstanceState); 23 | KCacheUtils.init(this); 24 | setContentView(R.layout.activity_main); 25 | } 26 | 27 | public void onRecord(View view) { 28 | Button recordButton = (Button) view; 29 | if (isRecording) { 30 | SoundMan.getInstance().stop(); 31 | recordButton.setText(R.string.record_start); 32 | } else { 33 | SoundMan.getInstance().start(); 34 | recordButton.setText(R.string.record_stop); 35 | 36 | Toast.makeText(this, String.format("Check your file at: %s", KCacheUtils.getCacheDirectory() + "/record"), Toast.LENGTH_LONG).show(); 37 | } 38 | 39 | isRecording = !isRecording; 40 | } 41 | 42 | public void onDecode(View view) { 43 | Button decodeButton = (Button) view; 44 | 45 | if (mAmrFileDecoder == null) { 46 | mAmrFileDecoder = new AmrFileDecoder(); 47 | } 48 | 49 | if (!isDecoding) { 50 | mAmrFileDecoder.start(getResources().openRawResource(R.raw.demo)); 51 | decodeButton.setText(R.string.decode_stop); 52 | } else { 53 | mAmrFileDecoder.stop(); 54 | decodeButton.setText(R.string.decode_start); 55 | } 56 | 57 | isDecoding = !isDecoding; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /Codec/app/src/main/java/io/kvh/media/sound/Recorder.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media.sound; 2 | 3 | import android.media.AudioFormat; 4 | import android.media.AudioRecord; 5 | import android.media.MediaRecorder; 6 | import android.util.Log; 7 | 8 | /** 9 | * Created by changbinhe on 14/11/22. 10 | */ 11 | public class Recorder implements Runnable, Supporter.OnOffSwitcher { 12 | 13 | private static String TAG = "AudioRecorder"; 14 | 15 | //8 k * 16bit * 1 = 8k shorts 16 | static final int SAMPLE_RATE = 8000; 17 | //20 ms second 18 | //0.02 x 8000 x 2 = 320;160 short 19 | static final int FRAME_SIZE = 160; 20 | 21 | private AudioRecord audioRecord; 22 | 23 | private short[] audioBuffer; 24 | 25 | private Thread runningThread; 26 | 27 | boolean isRecording; 28 | 29 | Supporter.PcmConsumer pcmConsumer; 30 | 31 | public void setPcmConsumer(Supporter.PcmConsumer pcmConsumer) { 32 | this.pcmConsumer = pcmConsumer; 33 | } 34 | 35 | @Override 36 | public void start() { 37 | if (isRecording) { 38 | Log.e(TAG, "is recoding"); 39 | return; 40 | } 41 | int bufferSizeInByte = AudioRecord.getMinBufferSize(SAMPLE_RATE, 42 | AudioFormat.CHANNEL_CONFIGURATION_MONO, 43 | AudioFormat.ENCODING_PCM_16BIT); 44 | audioRecord = new AudioRecord(MediaRecorder.AudioSource.MIC, 45 | SAMPLE_RATE, 46 | AudioFormat.CHANNEL_CONFIGURATION_MONO, 47 | AudioFormat.ENCODING_PCM_16BIT, 48 | bufferSizeInByte); 49 | 50 | audioBuffer = new short[bufferSizeInByte / 2]; 51 | 52 | audioRecord.startRecording(); 53 | 54 | isRecording = true; 55 | 56 | //start 57 | runningThread = new Thread(this); 58 | runningThread.start(); 59 | } 60 | 61 | @Override 62 | public void stop() { 63 | if (!isRecording) 64 | return; 65 | 66 | isRecording = false; 67 | runningThread.interrupt(); 68 | runningThread = null; 69 | audioRecord.release(); 70 | } 71 | 72 | @Override 73 | public void run() { 74 | while (isRecording) { 75 | int read = audioRecord.read(audioBuffer, 0, FRAME_SIZE); 76 | if (read == AudioRecord.ERROR_INVALID_OPERATION || read == AudioRecord.ERROR_BAD_VALUE) { 77 | Log.i(TAG, "error:" + read); 78 | continue; 79 | } 80 | 81 | pcmConsumer.onPcmFeed(audioBuffer, read); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Codec/app/src/main/java/io/kvh/media/sound/SoundMan.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media.sound; 2 | 3 | import android.os.Handler; 4 | import android.util.Log; 5 | 6 | import io.kvh.media.amr.AmrDecoder; 7 | 8 | /** 9 | * Created by changbinhe on 14/11/22. 10 | */ 11 | public class SoundMan implements Supporter.OnOffSwitcher { 12 | private static final String TAG = "Filer"; 13 | private static final boolean DEBUG = true; 14 | 15 | private static final class SingletonHolder { 16 | public static final SoundMan INSTANCE = new SoundMan(); 17 | } 18 | 19 | public static SoundMan getInstance() { 20 | return SingletonHolder.INSTANCE; 21 | } 22 | 23 | private boolean isRunning; 24 | private boolean initialized; 25 | private Handler handler; 26 | 27 | private SoundMan() { 28 | handler = new Handler(); 29 | } 30 | 31 | @Override 32 | public void start() { 33 | if (DEBUG) 34 | Log.i(TAG, "try to start"); 35 | if (isRunning) { 36 | Log.i(TAG, "already started"); 37 | return; 38 | } 39 | 40 | if (!initialized) { 41 | if (DEBUG) 42 | Log.i(TAG, "try init"); 43 | init(); 44 | initialized = true; 45 | if (DEBUG) 46 | Log.i(TAG, "init succeed"); 47 | } 48 | isRunning = true; 49 | 50 | recorder.start(); 51 | codec.start(); 52 | filer.start(); 53 | uploader.start(); 54 | if (DEBUG) 55 | Log.i(TAG, "start succeed"); 56 | 57 | handler.removeCallbacksAndMessages(null); 58 | handler.postDelayed(sliceRunnable, Supporter.SLICE_SECOND * 1000); 59 | } 60 | 61 | Runnable sliceRunnable = new Runnable() { 62 | @Override 63 | public void run() { 64 | filer.nextSlice(); 65 | handler.postDelayed(sliceRunnable,Supporter.SLICE_SECOND * 1000); 66 | } 67 | }; 68 | 69 | @Override 70 | public void stop() { 71 | if (!isRunning) 72 | return; 73 | isRunning = false; 74 | handler.removeCallbacksAndMessages(null); 75 | 76 | //new slice 77 | recorder.stop(); 78 | codec.stop(); 79 | filer.stop(); 80 | } 81 | 82 | private void init() { 83 | AmrDecoder.init(); 84 | 85 | recorder = new Recorder(); 86 | codec = new Codec(); 87 | filer = new Filer(); 88 | uploader = new Uploader(); 89 | 90 | recorder.setPcmConsumer(codec); 91 | codec.setAmrConsumer(filer); 92 | filer.setFileConsumer(uploader); 93 | } 94 | 95 | private Codec codec; 96 | private Filer filer; 97 | private Recorder recorder; 98 | private Uploader uploader; 99 | 100 | } 101 | -------------------------------------------------------------------------------- /Codec/app/src/main/java/io/kvh/media/sound/Supporter.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media.sound; 2 | 3 | import java.io.File; 4 | 5 | /** 6 | * Created by changbinhe on 14/11/22. 7 | */ 8 | public class Supporter { 9 | public static final int SLICE_SECOND = 20; 10 | 11 | public static interface PcmConsumer { 12 | public void onPcmFeed(short[] buffer, int length); 13 | } 14 | 15 | public static interface AmrConsumer { 16 | public void onAmrFeed(byte[] buffer, int length); 17 | } 18 | 19 | public static interface FileConsumer { 20 | public void onFileFeed(File file); 21 | } 22 | 23 | public static interface OnOffSwitcher { 24 | public void start(); 25 | 26 | public void stop(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /Codec/app/src/main/java/io/kvh/media/sound/Uploader.java: -------------------------------------------------------------------------------- 1 | package io.kvh.media.sound; 2 | 3 | import android.util.Log; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | * Created by changbinhe on 14/11/22. 9 | */ 10 | public class Uploader implements Supporter.FileConsumer, Supporter.OnOffSwitcher { 11 | private static final String TAG = "Uploader"; 12 | 13 | @Override 14 | public void onFileFeed(File file) { 15 | Log.i(TAG, String.format("receive slice file:%s for %d seconds", file.getAbsolutePath(), Supporter.SLICE_SECOND)); 16 | 17 | //send the file to your server in asyn way 18 | } 19 | 20 | @Override 21 | public void start() { 22 | 23 | } 24 | 25 | @Override 26 | public void stop() { 27 | 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Codec/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 |