Ok, thhank you..........
On Fri, May 31, 2013 at 11:15 AM, Alex Cohn [via libav-users] < [email protected]> wrote: > On May 30, 2013 9:36 PM, "prathap" <[hidden > email]<http://user/SendEmail.jtp?type=node&node=4657774&i=0>> > wrote: > > > > Hi everybody > > > > when i am trying to create .so file using .c file and ffmpeg and android > NDK > > i got this errors > > > > > > Install : libmylib.so => libs/armeabi-v7a/libmylib.so > > Install : libmylib.so => libs/armeabi/libmylib.so > > Compile x86 : mylib <= mylib.c > > cc1: error: unrecognized command line option '-mfloat-abi=softfp' > > cc1: error: unrecognized command line option '-mfpu=neon' > > jni/mylib.c:1:0: error: bad value (armv7-a) for -march= switch > > make: *** [obj/local/x86/objs/mylib/mylib.o] Error 1 > > > > > ---------------------------------------------------------------------------------------------------------------------- > > > > > > My android.mk file is > > > > LOCAL_PATH := $(call my-dir) > > > > include $(CLEAR_VARS) > > > > LOCAL_LDLIBS = > -L$(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm/usr/lib > > -L$(LOCAL_PATH)/../obj/local/armeabi/ -lavformat -lavcodec -lpostproc > > -lswscale -lavutil -llog -ljnigraphics -lz -ldl -lgcc > > LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg > > LOCAL_SRC_FILES := mylib.c > > LOCAL_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=neon > > LOCAL_MODULE := mylib > > #LOCAL_SRC_FILES := mylib.c > > > > include $(BUILD_SHARED_LIBRARY) > > > > LOCAL_PATH := $(call my-dir) > > LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg > > include $(all-subdir-makefiles) > > > > > ----------------------------------------------------------------------------------------------------------------------- > > > > > > My .c program is like this > > > > > > #include <jni.h> > > #include <android/log.h> > > #include <com_myffmpegtest_MainActivity.h> > > > > #include <libavcodec/avcodec.h> > > #include <libavformat/avformat.h> > > #include <libavformat/avio.h> > > #include <libswscale/swscale.h> > > #include <libavutil/avstring.h> > > > > #define LOG_TAG "mylib" > > #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, > > __VA_ARGS__) > > #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, > > __VA_ARGS__) > > > > JNIEXPORT jint JNICALL Java_com_myffmpegtest_MainActivity_logFileInfo > > (JNIEnv *env, jclass this, jstring filename) > > { > > av_register_all(); > > > > AVFormatContext *pFormatCtx; > > const jbyte *str; > > str = (*env)->GetStringUTFChars(env, filename, NULL); > > > > if(avformat_open_input(&pFormatCtx, str, NULL, NULL)!=0) > > { > > LOGE("Can't open file '%s'\n", str); > > return 1; > > } > > else > > { > > LOGI("File was opened\n"); > > LOGI("File '%s', Codec %s", > > pFormatCtx->filename, > > pFormatCtx->iformat->name > > ); > > } > > return 0; > > } > > > > > ------------------------------------------------------------------------------------------------------------------- > > > > > > Thanks for you suggestions > > > > Regards > > Prathap.M > > You set compiler options for ARM processor. In your ndk-build command, add > APP_ABI=armeabi-v7a. If you really need x86 version, specify the relevant > compilation options separately. > > BR, > Alex Cohn > > _______________________________________________ > Libav-user mailing list > [hidden email] <http://user/SendEmail.jtp?type=node&node=4657774&i=1> > http://ffmpeg.org/mailman/listinfo/libav-user > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657774.html > To unsubscribe from Error when creating .so file using .c program and > ffmpeg using android NDK, click > here<http://libav-users.943685.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4657764&code=cHJhdGhhcC5tYWxlbXBhdGlAZ21haWwuY29tfDQ2NTc3NjR8LTEyNDg5ODE1ODM=> > . > NAML<http://libav-users.943685.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- View this message in context: http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657775.html Sent from the libav-users mailing list archive at Nabble.com. _______________________________________________ Libav-user mailing list [email protected] http://ffmpeg.org/mailman/listinfo/libav-user
