10.1_demo/lvgl/examples/libs/ffmpeg/lv_example_ffmpeg_1.c

32 lines
781 B
C
Executable File

#include "../../lv_examples.h"
#if LV_BUILD_EXAMPLES
#if LV_USE_FFMPEG && LV_FFMPEG_PLAYER_USE_LV_FS
/**
* Open an image from a file
*/
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, "A:lvgl/examples/libs/ffmpeg/ffmpeg.png");
lv_obj_center(img);
}
#else
void lv_example_ffmpeg_1(void)
{
/*TODO
*fallback for online examples*/
lv_obj_t * label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "FFmpeg is not installed");
lv_obj_center(label);
}
#endif
#endif