Tiny4412 Android5.0 定制media codecs相关的格式

简介: tiny4412 4412 Android 5.0系统上,支持以下的media格式,文件位于: device/friendly-arm/tiny4412/media_codecs.xml打开后我们可以看到这个xml包含相关的音视频编解码支持的格式: ...

tiny4412 4412 Android 5.0系统上,支持以下的media格式,文件位于: device/friendly-arm/tiny4412/media_codecs.xml

打开后我们可以看到这个xml包含相关的音视频编解码支持的格式:

<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright (C) 2012 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<!--
<!DOCTYPE MediaCodecs [
<!ELEMENT MediaCodecs (Decoders,Encoders)>
<!ELEMENT Decoders (MediaCodec*)>
<!ELEMENT Encoders (MediaCodec*)>
<!ELEMENT MediaCodec (Type*,Quirk*)>
<!ATTLIST MediaCodec name CDATA #REQUIRED>
<!ATTLIST MediaCodec type CDATA>
<!ELEMENT Type EMPTY>
<!ATTLIST Type name CDATA #REQUIRED>
<!ELEMENT Quirk EMPTY>
<!ATTLIST Quirk name CDATA #REQUIRED>
]>

There's a simple and a complex syntax to declare the availability of a
media codec:

A codec that properly follows the OpenMax spec and therefore doesn't have any
quirks and that only supports a single content type can be declared like so:

    <MediaCodec name="OMX.foo.bar" type="something/interesting" />

If a codec has quirks OR supports multiple content types, the following syntax
can be used:

    <MediaCodec name="OMX.foo.bar" >
        <Type name="something/interesting" />
        <Type name="something/else" />
        ...
        <Quirk name="requires-allocate-on-input-ports" />
        <Quirk name="requires-allocate-on-output-ports" />
        <Quirk name="output-buffers-are-unreadable" />
    </MediaCodec>

Only the three quirks included above are recognized at this point:

"requires-allocate-on-input-ports"
    must be advertised if the component does not properly support specification
    of input buffers using the OMX_UseBuffer(...) API but instead requires
    OMX_AllocateBuffer to be used.

"requires-allocate-on-output-ports"
    must be advertised if the component does not properly support specification
    of output buffers using the OMX_UseBuffer(...) API but instead requires
    OMX_AllocateBuffer to be used.

"output-buffers-are-unreadable"
    must be advertised if the emitted output buffers of a decoder component
    are not readable, i.e. use a custom format even though abusing one of
    the official OMX colorspace constants.
    Clients of such decoders will not be able to access the decoded data,
    naturally making the component much less useful. The only use for
    a component with this quirk is to render the output to the screen.
    Audio decoders MUST NOT advertise this quirk.
    Video decoders that advertise this quirk must be accompanied by a
    corresponding color space converter for thumbnail extraction,
    matching surfaceflinger support that can render the custom format to
    a texture and possibly other code, so just DON'T USE THIS QUIRK.

-->

<MediaCodecs>
    <Decoders>
        <MediaCodec name="OMX.SEC.MPEG4.Decoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.SEC.H263.Decoder" type="video/3gpp" />
        <MediaCodec name="OMX.SEC.AVC.Decoder" type="video/avc" />
        <MediaCodec name="OMX.SEC.FP.AVC.Decoder" type="video/avc" />
        <MediaCodec name="OMX.SEC.MPEG2.Decoder" type="video/mpeg2" />
        <MediaCodec name="OMX.SEC.WMV.Decoder" type="video/vc1" />
        <MediaCodec name="OMX.SEC.MP3.Decoder" >
          <Type name="audio/mpeg" />
          <Quirk name="supports-multiple-frames-per-inputbuffer" />
          <Quirk name="needs-flush-before-disable" />
	    </MediaCodec>

        <MediaCodec name="OMX.google.mp3.decoder" type="audio/mpeg" />        
        <MediaCodec name="OMX.google.amrnb.decoder" type="audio/3gpp" />
        <MediaCodec name="OMX.google.amrwb.decoder" type="audio/amr-wb" />
        <MediaCodec name="OMX.google.aac.decoder" type="audio/mp4a-latm" />
        <MediaCodec name="OMX.google.g711.alaw.decoder" type="audio/g711-alaw" />
        <MediaCodec name="OMX.google.g711.mlaw.decoder" type="audio/g711-mlaw" />
        <MediaCodec name="OMX.google.vorbis.decoder" type="audio/vorbis" />

        <MediaCodec name="OMX.google.mpeg4.decoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.google.h263.decoder" type="video/3gpp" />
        <MediaCodec name="OMX.google.h264.decoder" type="video/avc" />
        <MediaCodec name="OMX.google.vpx.decoder" type="video/x-vnd.on2.vp8" />
        <MediaCodec name="FfmpegVideoDecoder" type="video/ffmpeg" />
        <MediaCodec name="FfmpegAudioDecoder" type="audio/ffmpeg" />
    </Decoders>

    <Encoders>
        <MediaCodec name="OMX.SEC.MPEG4.Encoder" type="video/mp4v-es" />
        <MediaCodec name="OMX.SEC.H263.Encoder" type="video/3gpp" />
        <MediaCodec name="OMX.SEC.AVC.Encoder" type="video/avc" />

        <MediaCodec name="OMX.google.amrnb.encoder" type="audio/3gpp" />
        <MediaCodec name="OMX.google.amrwb.encoder" type="audio/amr-wb" />
        <MediaCodec name="OMX.google.aac.encoder" type="audio/mp4a-latm" />
        <MediaCodec name="OMX.google.flac.encoder" type="audio/flac" />
    </Encoders>
</MediaCodecs>
这里面,一部分是Android系统在发布的时候就自带支持的一些格式,而有一些格式是厂商加进去的,如果正式发布产品,有些格式还不是完全免费的,需要支付一定的认证费用才能使用对应的格式,那么再产品定制环节,我们可以根据需求来删除对应的格式,同时也可以添加对应的格式。

至于这部分,后面找到对应的java文件会再做分析:

(未完待补充!)



目录
相关文章
|
8月前
|
Android开发
手把手教你深度定制tiny4412安卓5.0系统(一)---开发板如何预置文件到android系统
手把手教你深度定制tiny4412安卓5.0系统(一)---开发板如何预置文件到android系统
124 0
|
Android开发
Tiny4412 Android5.0 定制:编译生成img后如何删除原厂的apk
在android-5.0.2/build/core/Makefile的315行可以看到,这里是apk生成签名相关的地方。 315 name := $(TARGET_PRODUCT) 316 ifeq ($(TARGET_BUILD_TYPE),debug) 317 name := $...
1178 0
|
Android开发 Java Apache
Tiny4412 Android5.0 定制media codecs相关的格式(二)
http://blog.csdn.net/morixinguan/article/details/73149058 上一节说到4412的在Android 5.0源代码中支持了许多的格式,那么这些格式最终又是怎么确定的呢? 找到以下这个文件: android-5.
1221 0
|
传感器 Go vr&ar
手把手教你Tiny4412 Android5.0 定制 按下开发板上的按键通过广播发送到应用层
首先,处理按键按下后,可以通过发送广播让应用层识别按键事件,那么怎么来发送,可以找到下面这个文件: frameworks/base/policy/src/com/android/internal/policy/impl/PhoneWindowManager.
1832 0
|
Android开发
Tiny4412 Android5.0 定制键值相关的文件
在4412中,开发板上只有四个按键,我们可以根据产品的需求自定义按键的功能。 在KeyEvent.java这个文件中,可以通过发出按键的事件,上报给上层。让上层app或者服务去接收处理。比如,我们可以看到这样的代码: 注释写得非常清楚,按下按键后,可以发出键值,按下的时间等等,也可以通过Android广播的形式去发送这些事件。
1066 0
|
Java Android开发
Tiny4412 Android5.0 定制MTP显示的名字
找到frameworks/base/media/java/android/mtp/MtpDatabase.java 找到以下方法:  private int getDeviceProperty(int property, long[] outIntValue, char[] outStringV...
1114 0
|
Android开发
手把手教你深度定制tiny4412安卓5.0系统(一)---开发板如何预置文件到android系统
想要预置文件,首先要了解Android源码中device这个目,打开这个目录我们看到,这个目录厂家会针对不同的开发板做一些修改: 在这个目录中,我们看到有不同的厂家定制的信息,我们这款开发板是友善之壁提供的,那么我们只要进入friend-arm这个目录下就可以了,进到这个目录,看到tiny4412,我们切换进入看到: 要预置相关的文件,前面有一篇文章专门讲过怎么预置,一般是在device.mk中进行,但是平台不同,供应商会整合到其它地方: 文章如下,下面我们将参考这篇文章进行预置。
1599 0
|
Linux Android开发 C语言
ubuntu17.04编译Tiny4412 Android5.0源代码
跟着ubuntu12.04一样,我解开了4412的Android5.0源代码。 因为前面这篇文章已经安装了一些开发环境,所以这里不再哆嗦。 还是和这篇文章一样的: http://blog.csdn.
1523 0
|
Shell Android开发
安卓系统权限修改(基于tiny4412开发板)
在Android 5.0源代码根目录下: 找到system/extras/su/su.c下的main函数下的这段代码: 将其注释后重新编译即可。 //安卓系统权限修改2017-1-26 yangyx--->change /* Until we have something better, only root and the shell can use su.
920 0
|
Android开发
安卓selinux权限修改(基于tiny4412开发板)
在源代码根目录下: system/core/init/init.c   找到 static void selinux_initialize(void) 函数将boot is_enforcing = selinux_is_enforcing();改成boot is disabled = selinux_is_disabled();security_setenforce(is_disabled); 重新编译即可。
1039 0