自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
媒體
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
媒體模組會處理媒體類型和編解碼、與 ExoPlayer 互動、將傳輸控制項和播放資訊公開給架構,並執行其他媒體相關功能。
媒體元件經常成為攻擊目標 (許多近期的安全錯誤都與媒體有關),因此加快更新安全性錯誤和功能,可強化安全性,並減少攻擊者可利用的安全性錯誤數量。媒體架構仍可擴充,合作夥伴可以繼續擴充媒體轉碼器和媒體格式擷取器。
媒體模組和元件
可更新的媒體元件位於下列模組中。
如要進一步瞭解這些模組和元件,請參閱「媒體」一節。
媒體模組 (com.android.media
) 和媒體編解碼模組 (com.android.media.swcodec
) 採用 APEX 格式,適用於搭載 Android 10 以上版本的裝置。
自訂
如要進一步瞭解如何新增自訂擷取器和解碼器,請參閱「自訂媒體元件」。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-27 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2025-07-27 (世界標準時間)。"],[],[],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)."]]