Google is committed to advancing racial equity for Black communities. See how.

Media

Media modules handle media types and codecs, interact with ExoPlayer, expose transport controls and playback information to the framework, optimize indexed metadata, and so on. Modules are updatable, meaning they can receive updates to functionality outside of the normal Android release cycle. Media components are a frequent target of attacks (many recent security bugs are media related), so tightening security by accelerating updates for security bugs and features should reduce the number of security bugs that can be exploited by attacks. The media framework remains extensible; partners can continue to extend media codecs and media format extractors.

Updatable media components

Updatable media components exist in the following modules.

  • Media module. Includes the following media components.

    • Media extractors handle different types of media. Each extractor is an individual .so file with a sniffer function to determine whether the extractor can handle a given media file and a factory function that creates an instance of the extractor for that media file.

    • MediaSession2 APIs allow media apps to expose their transport controls and playback information to other processes such as the Android framework and other apps.

    • MediaParser APIs (new in Android 11) allow ExoPlayer to make efficient use of framework media container parsers to extract media samples from media containers.

  • Media Codecs module. Includes updatable software Codec2 components.

  • MediaProvider module. Optimizes indexed metadata (audio, video, and images from SD cards and USB devices) and makes that data available to apps through the MediaStore public APIs.

For details on these modules and components, see the Media section.

Module format

The Media module (com.android.media) and Media Codec module (com.android.media.swcodec) are in APEX format and are available for devices running Android 10 or higher. The MediaProvider module (com.google.android.mediaprovider) is in APK-in-APEX format and is available for devices running Android 11 or higher.

Customizing

For details on adding custom extractors and decoders, see Customizing Media Components. For details on addding new media formats, influencing which storage devices are indexed, and replacing the MTP stack, see MediaProvider.