Android adds or cancels support for a certain media file format

Source: Internet
Author: User

First, add some formatting
Take the RMVB format as an example, due to the lisence problem, a rmvb format video file is copied to the phone's SD card, the file cannot be displayed as a video file, if your company has a third-party apk to support playback of the format of the video, you can follow the methods below to add support for the RMVB format.
In Frameworks\base\media\java\android\media\mediafile.java: About 270 rows, add the mimetype in RMVB format:

Addfiletype ("AVI", File_type_avi, "Video/avi");
Addfiletype ("MOV", File_type_quicktime_video, "video/quicktime");
Addfiletype ("QT", File_type_quicktime_video, "video/quicktime");
Addfiletype ("RMVB", FILE_TYPE_RMVB, "Video/x-pn-realvideo");//Add RMVB

Then compile the Framework/base module, push the generated Framework.jar and Secondary-framework.jar to the phone, and then restart the phone:
ADB push Framework.jar System/framework
ADB push Secondary-framework.jar System/framework
ADB reboot

Ii. cancellation of a format
In the case of wma/wmv format, if you want to cancel support for this format, you can modify it as follows:
The first step in the format of the MIME type is originally video\audio to unknown
Modify Frameworks\base\media\java\android\media\mediafile.java
Addfiletype ("WMV", file_type_wmv, "video/x-ms-wmv", mtpconstants.format_wmv);
Addfiletype ("ASF", file_type_asf, "video/x-ms-asf");
Addfiletype ("WMA", File_type_wma, "audio/x-ms-wma", mtpconstants.format_wma);

If you want to completely remove the corresponding video codec, you can proceed to the second to third step.
The second step is to find out if the following files have macros Mtk_asf_playback_support (JB2,JB3,JB5) or Mtk_wmv_playback_support and Mtk_wma_playback_support (JB9,KK)
Alps\mediatek\config\project name\projectconfig.mk
Alps\mediatek\config\platform name\projectconfig.mk
Alps\mediatek\config\commone\projectconfig.mk
If so,
Please place the mtk_asf_playback_support as no;
Please place the mtk_wmv_playback_support as no;
Please place the mtk_wma_playback_support as no;

Step three Modify the Media_codecs.xml file
Mediatek\config\common\media_codecs.xml
Mediatek\config\platform Name\media_codec.xml
Remove:
<mediacodec name= "OMX. Mtk. VIDEO. DECODER. VC1 "type=" video/x-ms-wmv ">
<mediacodec name= "OMX. Mtk. AUDIO. DECODER. WMA "type=" audio/x-ms-wma "/>

Android adds or cancels support for a certain media file format

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.