Video Decoding
The Video Decoding section allows developers to enhance the TouchGFX HAL with either hardware or software video decoding capabilities.
Further reading
Video software decoding allows the use of a different Decoding Format, than the one used for the application framebuffer. Video hardware decoding only supports video RGB buffer(s) with the same pixel format as the application framebuffer.
Note
Audio is not supported.
Type
By default the "Type" of Video Decoding is disabled. If the required peripherals are not enabled in STM32CubeMX, both "Software" and "Hardware" will be greyed out. Hover the mouse over the greyed-out options the see which peripherals are required.
- Software - If LIBJPEG is enabled under the Middleware and Software Packs section in STM32CubeMX, the "Software" option can be selected and the software decoder will be generated. This means that TouchGFX Generator will generate a software MJPEG decoder.
- Hardware - If JPEG IP is enabled under the Multimedia section and a CMSIS compliant RTOS is selected in the TouchGFX Generator the "Hardware" option can be selected.
Further reading
Concurrent videos
The "Concurrent Videos" option is the largest amount of videos being decoded simultaneously on the same screen in the GUI at any given time. If you only wish to decode one video on a screen, the "Number of Videos" can be set to 1.
A maximum of 4 videos can be decoded simultaneously.
Strategy
The developer has three options when it comes to the video decoding strategy.
- Direct to Framebuffer - The video is decoded in the UI thread. It can be slower than the other strategies, but saves RAM by not having a buffer for the video frames.
- Single Buffer - Video is decoded in a separate task in a dedicated buffer. This buffer is allocated in internal memory.
- Double Buffer - Video is decoded in a separate task in two dedicated buffers for better performances at the cost of memory.
When working with the single or double framebuffer strategy it is necessary to enable a CMSIS compliant OS.
Note
Further reading
Decode Format
For Software decoding, developers can choose the pixel format of the RGB buffer regardless of the pixel format of the framebuffer. TouchGFX Generator generates code that allows DMA2D (ChromART) to do pixel-format-conversion between the formats if they're different.
- RGB565 - Video RGB buffer is 16-bit.
- RGB888 - Video RGB buffer is 24-bit.
- ARGB8888 - Video RGB buffer is 32-bit. Alpha value is 255.
Tip
Buffer size
The buffer width and height settings must be larger than or equal to the largest video dimensions in the application. The width must be divisible by 32.