How to create a stagefright plugin

后端 未结 1 718
执念已碎
执念已碎 2020-12-13 16:58

I have a task which involves integration of a video decoder into Stagefright(Android\'s multimedia framework). I searched and found the following about creating

1条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 17:03

    From your question, it appears that you are looking at a recommendation which is specific for Ice-Cream Sandwich or earlier versions of Android. The first thing you should be clear about is the version of the android i.e. Ice-Cream Sandwich or before or JellyBean and after. The integration of codecs is different across different releases of Android.

    I have already commented on your other question which is specific for JellyBean and later (Reference: Android: How to integrate a decoder to multimedia framework)

    If you would like to integrate your codec in Ice-Cream Sandwich or before, the steps are already available in your question. In addition to adding the decoder into kDecoderInfo list, you may like to setup certain quirks as shown here.

    For the question on OMXCodec.cpp, you can find this file at frameworks/base/media/libstagefright/ in case of Ice-Cream Sandwich and frameworks/av/media/libstagefright/ in case of JellyBean.

    If you have followed all the steps to integrate the video decoder into the Stagefright framework, then the easiest test would be to perform the following:

    1. Copy a media file into SD-Card

    2. In OMXCodec.cpp, enable logs by removing the comment in this statement //#define LOG_NDEBUG 0 and run a mm in the directory. Copy the rebuilt libstagefright.so to /system/lib on your device.

    3. Enable logcat and start capturing logs.

    4. Goto gallery, select your file and allow the standard player to play your file.

    5. Check your log file if the player has selected your OMX component by searching for your component name. If found, your integration of codec into Stagefright is successful. Else, you will have to debug and find out what is the problem.

    Postscript:

    1. Based on your queries, I presume you aren't familiar with Android sources. Please refer to androidxref site to become familiar with AOSP distributions.

    2. Unless you are planning to support a new media file-format, you will not require to support Extractor class. MediaExtractor abstracts a file-format parser and helps to de-multiplex the different tracks in a media file.

    I hope with this information, you should be able to get your codec integrated and functional in Android.

    0 讨论(0)
提交回复
热议问题