How rockchip-linux/mpp works
Rockchip MPP is a media-processing framework exposing an MPI API for hardware-assisted video decoding, encoding, and video processing. The principal workflow is an application submitting packets or frames through MPI, MPP dispatching to a codec path, codec parsing or preparation feeding the hardware abstraction layer, and the device service communicating with codec hardware; results are exposed through MPP buffers, frames, and packets. The README documents broad codec and platform support. Internal wiring beyond the documented framework is represented conservatively because the sampled implementation excerpts cover only selected parsers and OSAL service code.
Main entry points: mpp_hal.c Hardware Abstraction · mpp.c MPP Context · mpi.c MPI Interface · mpp_enc_impl.c Encoder Engine
Components 19
Public API
- MPI Interface
mpp/mpi.c - MPP Context
mpp/mpp.c
Codec Processing
- Decoder Engine
mpp/codec/mpp_dec.c - Codec Decoders
mpp/codec/dec - Encoder Engine
mpp/codec/mpp_enc_impl.c - Codec Encoders
mpp/codec/enc - Rate Control
mpp/codec/rc - Video Processing
mpp/vproc
Hardware Access
- Hardware Abstraction
mpp/hal/mpp_hal.c - Decoder HALs
mpp/hal/rkdec - Encoder HALs
mpp/hal/rkenc - VPU HALs
mpp/hal/vpu - Device Layer
osal/driver/mpp_device.c - MPP Service
osal/driver/mpp_service.c - Vcodec Service
osal/driver/vcodec_service.c
Shared Runtime
- Media Objects
mpp/base - Memory Allocators
osal/allocator
Other components
- Media Client
- Kernel Codec Device
Connections 21
- Media Client → MPI Interface: submits media
- MPI Interface → MPP Context: creates and controls
- MPP Context → Decoder Engine: dispatches decode
- MPP Context → Encoder Engine: dispatches encode
- MPP Context → Video Processing: dispatches processing
- Decoder Engine → Codec Decoders: selects codec parser
- Codec Decoders → Hardware Abstraction: provides syntax
- Encoder Engine → Codec Encoders: selects codec
- Encoder Engine → Rate Control: configures rate
- Codec Encoders → Hardware Abstraction: prepares encode
- Hardware Abstraction → Decoder HALs: dispatches decode
- Hardware Abstraction → Encoder HALs: dispatches encode
- Hardware Abstraction → VPU HALs: dispatches VPU work
- Hardware Abstraction → Device Layer: submits device work
- Device Layer → MPP Service: uses service ioctl
- Device Layer → Vcodec Service: uses VPU ioctl
- MPP Service → Kernel Codec Device: sends ioctl requests
- Vcodec Service → Kernel Codec Device: sends register ioctls
- MPI Interface → Media Objects: exchanges media objects
- Media Objects → Memory Allocators: allocates storage
- Hardware Abstraction → Media Objects: uses frame buffers