4

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.

Community
  • 1
  • 1
sayedjuned
  • 183
  • 2
  • 10

1 Answers1

6

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.

Ganesh
  • 5,880
  • 2
  • 36
  • 54
  • 1
    thanks for your reply. I have tried your procedure with my make file and I was able to build the .s files from my decoder. Also, I would like to tell you that we are trying to add our custom decoder to Android. I am currently facing an issue regarding the source and header files like softavc, softmpeg4 and other similar files. I do not understand the role of these files. – sayedjuned Mar 11 '14 at 05:34
  • 1
    I have checked these files and come to realise that these files invoke the calling of the functions required to run the particular format like avc or mpeg4. My question is, do I need to add my decoder function calls in these files or they need to be called somewhere else in the android source code. I have read your previous answers regarding the integration of omx component. As per your details, I have added my custom decoder format in omxcodec.cpp and other files you had mentioned for integration. – sayedjuned Mar 11 '14 at 05:35
  • 1
    What I want to do is merge my current decoder to the android IL,so that the player recognises my format and accesses my code and play it in awesome player. If you could help me with the integration of my decoder to the android platform, I would be very grateful to you. – sayedjuned Mar 11 '14 at 05:35
  • @sayedjuned.. `Soft***` files are employed to implement a `SoftOMXComponent` into the framework. The `SoftOMXComponent` is employed for integrating **software** components and hence, if your custom component is `HW` accelerated, you should consider integrating it with the `OMX` core instead of `Soft***` component. I think you will have to build a `OMX` component and integrate the same with the `OMXCore`. I hope you aware of the steps for the same. – Ganesh Mar 11 '14 at 08:38
  • 1
    thanks for your reply. I want to clarify something regarding the HW acceleration part, does HW acceleration includes arm neon & x86 or opencl & cuda. My code consists of neon & x86. Can you please guide me as to which it is HW/SW? – sayedjuned Mar 11 '14 at 09:59
  • I guess my decoder is software decoder as I have not used any HW accelerators like OpenCL or CUDA. I am trying add my software decoder to the android source code. I am trying to generate libstagefright.so file for my decoder. I am working on HEVC decoder. Considering, my decoder is software, can you please guide me regarding creating softomx component files. Please provide me any related documents regarding the integration of the software decoder to the android source code. – sayedjuned Mar 11 '14 at 10:21
  • 1
    @sayedjuned.. one clarification. `libstagefright.so` is a framework library which encompasses the overall framework and is not a codec library. If you wish to integrate the codec as a `SoftOMXComponent`, I would request you to kindly raise a new question. I will consolidate all points required and respond on the same. Please accept the current response if the same has answered your query. – Ganesh Mar 11 '14 at 10:57
  • I will raise a new question. I will be thankful to you, if you can clarify this for me. Does HW acceleration includes arm neon & x86 or opencl & cuda. My code consists of neon & x86. Can you please guide me as to which it is HW/SW? – sayedjuned Mar 12 '14 at 12:52
  • 1
    @sayedjuned.. Well technically we would classify this codec as a `SW` codec. `HW` codec would be more of a dedicated hardware block which is designed for decode. Again `CUDA` or `OpenCL` is based on interpretation, but since they will be accelerated using `GPU`s, you could consider them to be `HW` codecs. – Ganesh Mar 12 '14 at 13:08
  • thanks for clarifying my doubt. I will post a new question for the previous query. – sayedjuned Mar 12 '14 at 13:33
  • @sayedjuned.. Thanks.. will look forward to your new ques.. Please consider to accept this answer if it has helped you – Ganesh Mar 12 '14 at 13:35