How does Android 2.3 stagefright select the OMX component?

Source: Internet
Author: User

Http://www.cnblogs.com/super119/archive/2011/09/01/2161896.html

Android 2.3 comes with an executable program named stagefright, which is executed on the board.

Stagefright-l

All OMX components are displayed. OMX. PV comes with Android and is soft-decoded (Pv-Packet Video). Others are vendor's.

Then, how does stagefright select which OMX component is used to serve a specific decode or encode?

Stagefright has a command line option:-s (prefer software codec)

So let's look at the source code of stagefright and see what the-s option has done.

It turns out that the last parameter is passed in directly at the omxcodec: Create time, that is, the kprefersoftwarecodecs Member of the omxcodec class is set to true.

Therefore, it is actually omxcodec to decide which OMX component to choose. The caller can use the omxcodec: Create method.

Omxcodec: when creating, The findmatchingcodecs method of omxcodec will be called. This method will give the names of all satisfied OMX components. At this time, if

If kprefersoftwarecodecs is true, findmatchingcodecs puts soft codec (that is, OMX. PV) in front of the vector.

When kprefersoftwarecodecs is not true, the OMX component found by findmatchingcodecs is sorted in the order defined in the global variable kdecoderinfo (decode as an example, h. definition part of 264:

{Media_mimetype_video_avc, "OMX. qcom.7x30. Video. decoder. AVC "},
{Media_mimetype_video_avc, "OMX. qcom. Video. decoder. AVC "},
{Media_mimetype_video_avc, "OMX. Ti. Video. decoder "},
{Media_mimetype_video_avc, "OMX. Sec. AVC. decoder "},
{Media_mimetype_video_avc, "avcdecoder "},
// {Media_mimetype_video_avc, "OMX. PV. avcdec "},

Obviously, here we first consider the vendor's OMX components (from Qualcomm to Ti to Samsung), and then the software decoding that comes with it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.