自 2025 年 3 月 27 日起,我们建议您使用 android-latest-release
而非 aosp-main
构建 AOSP 并为其做出贡献。如需了解详情,请参阅 AOSP 的变更。
媒体
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
媒体模块负责处理媒体类型和编解码器、与 ExoPlayer 交互、向框架提供传输控件和播放信息,以及执行其他媒体相关函数。
媒体组件是常见的攻击目标(很多最近发现的安全 bug 都与媒体相关),因此通过加速安全 bug 和功能的更新来加强安全性应该会减少可被攻击利用的安全 bug 的数量。媒体框架仍然可扩展;合作伙伴可以继续扩展媒体编解码器和媒体格式提取器。
媒体模块和组件
以下模块中存在可更新的媒体组件。
如需详细了解这些模块和组件,请参阅媒体部分。
媒体模块 (com.android.media
) 和媒体编解码器模块 (com.android.media.swcodec
) 采用 APEX 格式,适用于搭载 Android 10 或更高版本的设备。
自定义
如需详细了解如何添加自定义提取器和解码器,请参阅自定义媒体组件。
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-04-04。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-04-04。"],[],[],null,["# Media modules handle media types and codecs, interact with ExoPlayer, expose\ntransport controls and playback information to the framework and perform\nother media-related functions.\n\nMedia components are a frequent target of attacks (many recent security bugs are\nmedia related), so tightening security by accelerating updates for security bugs\nand features should reduce the number of security bugs that can be exploited by\nattacks. The media framework remains extensible; partners can continue to extend\nmedia codecs and media format extractors.\n\nMedia modules and components\n----------------------------\n\nUpdatable media components exist in the following modules.\n\n- **Media module.** Includes the following media components.\n\n - Media extractors handle different types of media. Each extractor is an\n individual `.so` file with a *sniffer* function to determine whether the\n extractor can handle a given media file and a *factory* function that\n creates an instance of the extractor for that media file.\n\n - `MediaSession2` APIs allow media apps to expose their transport controls\n and playback information to other processes such as the Android framework\n and other apps.\n\n - `MediaParser` APIs (new in Android 11) allow\n ExoPlayer to make efficient use of framework media container parsers to\n extract media samples from media containers.\n\n - Compatible media transcoding (new in Android 12)\n enables the platform's compatible media transcoding feature.\n\n- **Media Codecs module.** Includes updatable software Codec2 components.\n\nFor details on these modules and components, see the\n[Media](/docs/core/media) section.\n\nModule format\n-------------\n\nThe Media module (`com.android.media`) and Media Codec module\n(`com.android.media.swcodec`) are in [APEX](/docs/core/ota/apex)\nformat and are available for devices running Android\n10 or higher.\n\nCustomization\n-------------\n\nFor details on adding custom extractors and decoders, see [Customizing Media\nComponents](/docs/core/media/updatable-media)."]]