Audio & Video Codecs Subsystem
Media codec diagnostics inspects the device hardware encoders and decoders (VPU/DSP silicon), software fallback libraries, supported MIME types, profile-level boundaries, and Digital Rights Management (DRM) engines.
What Are Codec Aliases and Why Does Android Have Them?
In Android 10 (API 29), Google introduced MediaCodecInfo.isAlias() and getCanonicalName(). As Android transitioned from legacy OpenMAX (OMX) media frameworks to modern Codec 2.0 (c2.*), silicon vendors registered legacy names as aliases pointing to new canonical implementations (e.g. OMX.qcom.video.decoder.avc aliased to c2.qti.avc.decoder). This guarantees older apps continue working while modern applications utilize standardized components. Voodoo reports canonical names and resolves alias chains.
Voodoo groups codecs into six precise categories defined in Manifesto Section 5.14: Video HW, Video SW (Google AOSP), Video Vendor SW, Audio HW, Audio SW, and Audio Vendor SW.
Listing HEVC 4K60 encoder capability indicates the hardware VPU can compress frames at that rate. It does not guarantee a camera app can capture, process, and write that bitstream without dropping frames or triggering thermal throttling.
How Voodoo Inspects Media Codecs
1. Primary Call & API-Level Fallback Chain
Extracted from CodecCollector.kt. Uses MediaCodecList(MediaCodecList.ALL_CODECS) on API 21+, falling back to legacy single-argument constructor on API 16–20, and parses /system/etc/media_profiles.xml on Android 2.3–4.0:
// Excerpt from com.tool3.hardwareinfo.categories.codec.CodecCollector.kt
val codecList = if (Build.VERSION.SDK_INT >= 21) {
MediaCodecList(MediaCodecList.ALL_CODECS).codecInfos
} else if (Build.VERSION.SDK_INT >= 16) {
// Legacy API 16-20 MediaCodecList iteration
Api16CodecHelper.getAllCodecs()
} else {
// Android 2.3 fallback: parse /system/etc/media_profiles.xml
LegacyMediaProfilesParser.parse()
}
// API 29+ Hardware vs Software classification
val isHardware = if (Build.VERSION.SDK_INT >= 29) {
codecInfo.isHardwareAccelerated
} else {
CodecClassificationHelper.inferHardwareFromName(codecInfo.name)
}
2. Permission & Privilege Gate
Media codec enumeration and DRM querying require zero permissions. All capabilities are queried directly from the media framework.
3. Interpretation & Normalization Logic
- Hardware Acceleration Classifier (
CodecClassificationHelper.kt): On API 29+, readsisHardwareAccelerated. On older versions, uses strict name prefixes: hardware vendors (OMX.qcom.,OMX.Exynos.,c2.qti.,c2.exynos.) vs software prefixes (OMX.google.,c2.android.). - DRM Querying (
ModernDrmHelper.kt): UsesMediaDrmwith Widevine UUID (edef8ba9-79d6-4ace-a3c8-27dcd51d21ed) to query security level (L1 hardware vs L3 software).
4. Availability-State Triggers
MediaCodecon Android < 4.1 triggersAvailabilityState.UNSUPPORTED, routing through the XML fallback parser.- Devices lacking Widevine DRM return
AvailabilityState.UNAVAILABLEfor DRM fields.
Subsystem Field Inventory
| Field ID | Display Name | Type | Primary Source / API | Min API |
|---|---|---|---|---|
| codec.video_hw_count | Video Hardware Codecs | INTEGER | MediaCodecList classified Video HW | API 16 |
| codec.video_sw_count | Video Software Codecs | INTEGER | MediaCodecList classified Video SW | API 16 |
| codec.audio_hw_count | Audio Hardware Codecs | INTEGER | MediaCodecList classified Audio HW | API 16 |
| codec.widevine_level | Widevine DRM Security Level | STRING | MediaDrm(Widevine UUID).getPropertyString("securityLevel") | API 18 |