docs(ffmpeg): images always loaded with lvgl fs

This commit is contained in:
liamHowatt
2025-03-06 11:08:26 +01:00
committed by Liam Howatt
parent eecebd2156
commit 850426b793
3 changed files with 8 additions and 0 deletions

View File

@@ -62,6 +62,9 @@ Set the :c:macro:`LV_USE_FFMPEG` in ``lv_conf.h`` to ``1``.
Also set :c:macro:`LV_FFMPEG_PLAYER_USE_LV_FS` in ``lv_conf.h`` to ``1`` if you want
to integrate the LVGL :ref:`file_system` extension into FFmpeg.
This library can load videos and images. The LVGL file system
will always be used when an image is loaded with :cpp:func:`lv_image_set_src`
regardless of the value of :c:macro:`LV_FFMPEG_PLAYER_USE_LV_FS`.
See the examples below for how to correctly use this library.

View File

@@ -7,6 +7,9 @@
*/
void lv_example_ffmpeg_1(void)
{
/*It always uses the LVGL filesystem abstraction (not the OS filesystem)
*to open the image, unlike `lv_ffmpeg_player_set_src` which depends on
*the setting of `LV_FFMPEG_PLAYER_USE_LV_FS`.*/
lv_obj_t * img = lv_image_create(lv_screen_active());
lv_image_set_src(img, "./lvgl/examples/libs/ffmpeg/ffmpeg.png");
lv_obj_center(img);

View File

@@ -9,6 +9,8 @@ void lv_example_ffmpeg_2(void)
{
/*birds.mp4 is downloaded from http://www.videezy.com (Free Stock Footage by Videezy!)
*https://www.videezy.com/abstract/44864-silhouettes-of-birds-over-the-sunset*/
/*It will use the LVGL filesystem abstraction (not the OS filesystem)
*if `LV_FFMPEG_PLAYER_USE_LV_FS` is set.*/
lv_obj_t * player = lv_ffmpeg_player_create(lv_screen_active());
lv_ffmpeg_player_set_src(player, "./lvgl/examples/libs/ffmpeg/birds.mp4");
lv_ffmpeg_player_set_auto_restart(player, true);