The VideoDecoder module provides the functions for video decoding.
The main capabilities provided by this module include:
Decoder creation and destruction: Creates a video decoder instance based on the MIME type or decoder name, and destroys the decoder instance to release resources.
Decoding parameter configuration: Configures the description information of the video to decode (resolution, frame rate, pixel format, etc.), sets the output surface, and sets the DRM decryption configuration.
Asynchronous callback mechanism: Registers callback functions to respond to events generated by the decoder, such as errors, stream changes, input buffer requests, and output buffer readiness.
Decoding control: Starts, stops, flushes, and resets the decoder to control the decoding process state.
Input and output processing: Submits input buffers filled with data, releases or renders output buffers, and supports both Buffer mode and Surface mode.
Synchronous mode support: Queries and obtains available input and output buffers to implement a synchronous decoding process.
Dynamic parameter setting: Sets dynamic parameters of the decoder during decoding.
DRM decryption support: Configures DRM sessions and supports both secure and non-secure video paths.
Applicable scenarios include playing local video files, decoding network video streams, video calls, video conferences, video recording playback, and decoding DRM‑protected video content — any scenario that requires decoding compressed video bitstreams into raw frame data.
For details about the development guide and sample, see Video Decoding.
System capability: SystemCapability.Multimedia.Media.VideoDecoder
Since: 9
| Name | Description |
|---|---|
| native_avcodec_videodecoder.h | Declares the native APIs used for video decoding. |