Timmon13 / sipdroid

Automatically exported from code.google.com/p/sipdroid
GNU General Public License v3.0
0 stars 0 forks source link

gsm codec activation and resource not found #623

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I am working on Sipdroid(1.5.5 beta version) open source. 
I am trying to active gsm codec for apllication sipdroid.
I use emulator for run the application

Here is some error:

After execute this line "System.loadLibrary("gsm_jni");"
Show the error message "UnsatisFiedLinkError: Library gsm_jni not found."

I need solution if anyone know about this problem

Here is the Jvaa file "GSM.java" and code

package org.sipdroid.codecs;
import org.sipdroid.sipua.ui.Receiver;
import org.sipdroid.sipua.ui.Settings;
import org.sipdroid.sipua.ui.Sipdroid;

import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import android.util.Log;

public class GSM extends CodecBase implements Codec {

    public static final String tag = "Sipdialer";

    GSM() {
        CODEC_NAME = "GSM";
        CODEC_USER_NAME = "GSM";
        CODEC_DESCRIPTION = "13kbit";
        CODEC_NUMBER = 3;
        CODEC_DEFAULT_SETTING = "always";
        /* up convert original compression parameter for this codec */
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(Receiver.mContext);
        String pref = sp.getString(Settings.PREF_COMPRESSION, Settings.DEFAULT_COMPRESSION);
        Log.i(tag, "Compression:  "+pref);
        //load();
        if (pref != null) {
            SharedPreferences.Editor e = sp.edit();
            e.remove("compression");
            e.putString(CODEC_NAME, pref);
            e.commit();
        }
        super.update();
    }

    void load() {
        try {
             System.loadLibrary("gsm_jni");
            super.load();
            } catch (UnsatisfiedLinkError ule) {

                String a =ule.toString();
                Log.e("JNI", a);
            }

        }

    public native int open();
    public native int decode(byte encoded[], short lin[], int size);
    public native int encode(short lin[], int offset, byte encoded[], int size);
    public native void close();

    public void init() {
        load();
        if (isLoaded())
            open();
    }

}

Original issue reported on code.google.com by ocean.ra...@gmail.com on 31 Aug 2010 at 12:06

GoogleCodeExporter commented 9 years ago

Original comment by pmerl...@googlemail.com on 17 Sep 2010 at 8:04