]> sjero.net Git - linphone/commitdiff
add amr support on android
authorSimon Morlat <simon.morlat@linphone.org>
Fri, 15 Apr 2011 21:54:46 +0000 (23:54 +0200)
committerSimon Morlat <simon.morlat@linphone.org>
Fri, 15 Apr 2011 21:54:46 +0000 (23:54 +0200)
build/android/Android.mk
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneCore.java

index 4ac0b93a72e213409ba3b51f1233260b457e5207..db4d5368d4a7b5222d4e8044cae9255799485c25 100755 (executable)
@@ -61,7 +61,8 @@ LOCAL_CFLAGS += \
        -DENABLE_TRACE \
        -DLINPHONE_VERSION=\"3.4.0\" \
        -DLINPHONE_PLUGINS_DIR=\"\\tmp\" \
-       -DLOG_DOMAIN=$(MY_LOG_DOMAIN)
+       -DLOG_DOMAIN=$(MY_LOG_DOMAIN) \
+       -UNE_BONNE_PIPE_CA_FAIT_DU_BIEN
 
 LOCAL_CFLAGS += -DIN_LINPHONE
 
@@ -89,9 +90,17 @@ LOCAL_STATIC_LIBRARIES := \
        libortp \
        libeXosip2 \
        libosip2 \
-       libgsm
+       libgsm 
 
 
+ifneq ($(BUILD_AMR),0)
+LOCAL_CFLAGS += -DHAVE_AMR
+
+LOCAL_STATIC_LIBRARIES += \
+       libmsamr \
+       libopencoreamr 
+endif
+
 ifeq ($(LINPHONE_VIDEO),1)
 ifeq ($(BUILD_X264),1)
 LOCAL_STATIC_LIBRARIES += \
index 74a076936c0e34a93dd614750bdb24a0f2260608..b2dd76f164617bf2c8cf29f297f8931429daf299 100644 (file)
@@ -27,6 +27,9 @@ extern "C" void libmsilbc_init();
 #ifdef HAVE_X264
 extern "C" void libmsx264_init();
 #endif
+#ifdef HAVE_AMR
+extern "C" void libmsamr_init();
+#endif
 #endif /*ANDROID*/
 
 static JavaVM *jvm=0;
@@ -339,6 +342,9 @@ extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_newLinphoneCore(JNIEnv*
 #endif
 #ifdef HAVE_X264
        libmsx264_init();
+#endif
+#ifdef HAVE_AMR
+       libmsamr_init();
 #endif
        jlong nativePtr = (jlong)linphone_core_new(     &ldata->vTable
                        ,userConfig
@@ -557,6 +563,24 @@ extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_listVideoPayloadTy
        return jCodecs;
 }
 
+extern "C" jlongArray Java_org_linphone_core_LinphoneCoreImpl_listAudioPayloadTypes(JNIEnv*  env
+                                                                                                                                                       ,jobject  thiz
+                                                                                                                                                       ,jlong lc) {
+       const MSList* codecs = linphone_core_get_audio_codecs((LinphoneCore*)lc);
+       int codecsCount = ms_list_size(codecs);
+       jlongArray jCodecs = env->NewLongArray(codecsCount);
+       jlong *jInternalArray = env->GetLongArrayElements(jCodecs, NULL);
+
+       for (int i = 0; i < codecsCount; i++ ) {
+               jInternalArray[i] = (unsigned long) (codecs->data);
+               codecs = codecs->next;
+       }
+
+       env->ReleaseLongArrayElements(jCodecs, jInternalArray, 0);
+
+       return jCodecs;
+}
+
 extern "C" jlong Java_org_linphone_core_LinphoneCoreImpl_enablePayloadType(JNIEnv*  env
                                                                                                                                                        ,jobject  thiz
                                                                                                                                                        ,jlong lc
index 328ef8c87de4ad2d649d2c070fb5da247ad37574..90b6de412775e7ce6a4c90bafb5f1f4f098f7579 100644 (file)
@@ -536,7 +536,16 @@ public interface LinphoneCore {
        
        VideoSize getPreferredVideoSize();
        
-       PayloadType[] listVideoCodecs();
+       /**
+        * Returns the currently supported audio codecs, as PayloadType elements
+        * @return
+        */
+       PayloadType[] getAudioCodecs();
+       /**
+        * Returns the currently supported video codecs, as PayloadType elements
+        * @return
+        */
+       PayloadType[] getVideoCodecs();
        /**
         * enable signaling keep alive. small udp packet sent periodically to keep udp NAT association
         */