[Raspberry Pi Original Development] KonstaT:
Does not seem to be working on Android 12 with AOSP master and gerrit patches.

10-11 18:38:47.809 246 1586 E V4L2Device: No devices supporting H264 for type: 0
10-11 18:38:47.809 246 1586 E V4L2Decoder: Failed to open device for H264
10-11 18:38:47.809 246 1586 E V4L2DecodeComponent: Failed to create V4L2Decoder for H264
10-11 18:38:47.810 271 1582 E MediaCodec: Codec reported err 0x80000000, actionCode 0, while in state 5/STARTING
10-11 18:38:47.811 271 1582 D SurfaceUtils: disconnecting from surface 0xabc80018, reason disconnectFromSurface
10-11 18:38:47.811 271 1581 E NuPlayerDecoder: Failed to start [c2.v4l2.avc.decoder] decoder (err=-2147483648)

console:/ # v4l2-ctl -d /dev/video10 -D
Driver Info:
Driver name : bcm2835-codec
Card type : bcm2835-codec-decode
Bus info : platform:bcm2835-codec
Driver version : 5.10.63
Capabilities : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Media Driver Info:
Driver name : bcm2835-codec
Model : bcm2835-codec
Serial : 0000
Bus info : platform:bcm2835-codec
Media version : 5.10.63
Hardware revision: 0x00000001 (1)
Driver version : 5.10.63
Interface Info:
ID : 0x0300000c
Type : V4L Video
Entity Info:
ID : 0x00000001 (1)
Name : bcm2835-codec-decode-source
Function : V4L2 I/O
Pad 0x01000002 : 0: Source
Link 0x02000008: to remote pad 0x1000004 of entity 'bcm2835-codec-decode-proc': Data, Enabled, Immutable

console:/ # v4l2-ctl -d /dev/video10 --list-formats
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture Multiplanar

[0]: 'YU12' (Planar YUV 4:2:0)
[1]: 'YV12' (Planar YVU 4:2:0)
[2]: 'NV12' (Y/CbCr 4:2:0)
[3]: 'NV21' (Y/CrCb 4:2:0)
[4]: 'RGBP' (16-bit RGB 5-6-5)

console:/ # v4l2-ctl -d /dev/video11 -D
Driver Info:
Driver name : bcm2835-codec
Card type : bcm2835-codec-encode
Bus info : platform:bcm2835-codec
Driver version : 5.10.63
Capabilities : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Media Driver Info:
Driver name : bcm2835-codec
Model : bcm2835-codec
Serial : 0000
Bus info : platform:bcm2835-codec
Media version : 5.10.63
Hardware revision: 0x00000001 (1)
Driver version : 5.10.63
Interface Info:
ID : 0x0300001a
Type : V4L Video
Entity Info:
ID : 0x0000000f (15)
Name : bcm2835-codec-encode-source
Function : V4L2 I/O
Pad 0x01000010 : 0: Source
Link 0x02000016: to remote pad 0x1000012 of entity 'bcm2835-codec-encode-proc': Data, Enabled, Immutable

console:/ # v4l2-ctl -d /dev/video11 --list-formats
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture Multiplanar

[0]: 'H264' (H.264, compressed)
[1]: 'MJPG' (Motion-JPEG, compressed)

As discussed on disq.us/p/2flnqg7 H.264 might require Pi firmware (i.e. using fake/firmware FKMS vs. KMS used on Android). v4l2_codec only has dec/enc for H.264/VP8/VP9. Pi 4 has hw decoders for H.264/H.265 so that only leaves H.264. I guess memory allocation is expected to be a problem, too.

Edit. Confirmation from a Raspberry Pi engineer that H.264 works with KMS. https://github.com/raspberrypi/linux/issues/4651#issuecomment-950947950