本文介绍了如何创建一个stagefright插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有涉及整合的视频去codeR成 Stagefright (Android的多媒体框架)的任务。我搜索,发现了以下有关创建新插件 Stagefright

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 a new plugin for Stagefright:

添加支持的新格式,您需要:

  • 开发一个新的提取类,如果不支持容器呢。

  • Develop a new Extractor class, if the container is not supported yet.

开发一个新的德codeR类,实现读取数据所需要的 StageFright 核心的接口。

Develop a new Decoder class, that implements the interface needed by the StageFright core to read the data.

关联的MIME类型的文件读取到新德codeR在 OMX codec.cpp 文件,在 KDE coderInfo 阵列。

Associate the mime-type of the files to read to your new Decoder in the OMXCodec.cpp file, in the kDecoderInfo array.

    static const CodecInfo kDecoderInfo[] = {
        {MEDIA_MIMETYPE_AUDIO_AAC, "OMX.TI.AAC.decode"},
        {MEDIA_MIMETYPE_AUDIO_AAC, "AACDecoder"},
    };

以上数据是所有我能找到的净。现在我有一个简单的应用程序,将采取一个文件作为输入,并使其使用本地的API在Android上的屏幕上。谁能告诉我如何进一步进行。又从哪里做所有这些 OMX codec.cpp 和其他人接触到的画面和哪些我的项目的目录,我应该有他们在,就同一请提供解决方案。先谢谢了。

The above data is all i could find out on net. Right now i have a simple app that will take a file as an input and render it on the screen using native API's in android. Can anyone please tell me how to proceed further. And from where does all these OMXCodec.cpp and others come into picture and which directory of my project should i have them in. Please provide solutions regarding the same. Thanks in advance.

推荐答案

从你的问题,看来你是在寻找一个建议,这是具体的冰淇淋三明治或更早版本的Andr​​oid。你应该清楚的第一件事是android即冰淇淋三明治版本或之前或软糖和后。的codeCS 整合是不同的在不同版本的Andr​​oid系统。

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.

我已经在你的其他问题,这是具体的软糖及更高版本(参考:<一href="http://stackoverflow.com/questions/15334509/android-how-to-integrate-a-de$c$cr-to-multimedia-framework">Android:如何整合去codeR多媒体框架)

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)

如果你想融入你的codeC在冰淇淋三明治或之前的步骤是在你的问题已经上市。除了增加去codeR成 KDE coderInfo 列表中,你可能想设置某些怪癖,如图<一个href="http://androidxref.com/4.0.4/xref/frameworks/base/media/libstagefright/OMX$c$cc.cpp#322">here.

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.

有关 OMX codec.cpp 的问题,你可以找到这个文件框架/基/媒体/ libstagefright / 的情况下冰淇淋三明治框架/ AV /媒体/ libstagefright / 的情况下软糖

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

如果你已经按照所有的步骤,将视频去codeR到 Stagefright 框架,那么最简单的测试是将执行以下操作:

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. 复制媒体文件到SD卡

  1. Copy a media file into SD-Card

OMX codec.cpp ,在这个声明 //#删除注释启用日志定义LOG_NDEBUG 0 并运行目录下的毫米。复制重建 libstagefright.so /系统/ lib目录您的设备上。

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.

启用的logcat 键,开始捕捉记录。

Enable logcat and start capturing logs.

转到库,选择您的文件,并允许标准的播放器播放您的文件。

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

检查日志文件,如果玩家选择了你的 OMX 组件通过搜索您的组件名称。如果找到了,你的整合codeC到 Stagefright 成功。否则,你将不得不调试,并找出是什么问题。

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.

后记:

  1. 根据您的问题,我presume你不熟悉与Android源。请参阅 androidxref 网站以熟悉 AOSP 分布。

除非你计划来支持新的媒体文件格式,你将不需要支持提取类。 MediaExtractor 抽象文件格式的分析,有助于解复用不同的轨道中的媒体文件。

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.

我希望通过这个信息,你应该能够得到您的codeC的集成和功能的机器人。

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

这篇关于如何创建一个stagefright插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 23:12