Search code examples
androidandroid-ndkandroid-mediaplayercodecstagefright

How to build the .s (asm) file in Android.mk file


I am integrating custom codec to libstagefright in android source code. I completed successfully whatever explained by Custom Wrapper Codec Integration into Android but I found problem like I have .s file in my custom codec.

I am following the LOCAL_CFLAGS := -DOSCL_EXPORT_REF= -DOSCL_IMPORT_REF= from this it is not taking the .s files to build.

I have found several solutions but those are not my answer links are

please help me for this issue

Thanks in Advance.


Solution

  • Please try with this approach to include the .s files. It is important to have a fallback C implementation and I assume that you do have one. In your codecs' Android.mk file,

    ifeq ($(TARGET_ARCH),arm)
    LOCAL_SRC_FILES += \
        src/asm/file1.s \
        src/asm/file2.s \
        src/asm/file3.s \
        src/asm/file4.s
    else
    LOCAL_SRC_FILES += \
        src/file1.cpp \
        src/file2.cpp \
        src/file3.cpp \
        src/file4.cpp
    endif
    

    For example, you can refer to the way the MP3 decoder is build as in this Android.mk file.