From 850426b793cb7aa22738a288f55b516670131ab0 Mon Sep 17 00:00:00 2001 From: liamHowatt Date: Thu, 6 Mar 2025 11:08:26 +0100 Subject: [PATCH] docs(ffmpeg): images always loaded with lvgl fs --- docs/src/details/libs/ffmpeg.rst | 3 +++ examples/libs/ffmpeg/lv_example_ffmpeg_1.c | 3 +++ examples/libs/ffmpeg/lv_example_ffmpeg_2.c | 2 ++ 3 files changed, 8 insertions(+) diff --git a/docs/src/details/libs/ffmpeg.rst b/docs/src/details/libs/ffmpeg.rst index 08d4ef080..9667b1a36 100644 --- a/docs/src/details/libs/ffmpeg.rst +++ b/docs/src/details/libs/ffmpeg.rst @@ -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. diff --git a/examples/libs/ffmpeg/lv_example_ffmpeg_1.c b/examples/libs/ffmpeg/lv_example_ffmpeg_1.c index aa88240a8..f8637d208 100644 --- a/examples/libs/ffmpeg/lv_example_ffmpeg_1.c +++ b/examples/libs/ffmpeg/lv_example_ffmpeg_1.c @@ -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); diff --git a/examples/libs/ffmpeg/lv_example_ffmpeg_2.c b/examples/libs/ffmpeg/lv_example_ffmpeg_2.c index 73784910f..f396aeb8b 100644 --- a/examples/libs/ffmpeg/lv_example_ffmpeg_2.c +++ b/examples/libs/ffmpeg/lv_example_ffmpeg_2.c @@ -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);