init lvgl code
This commit is contained in:
BIN
LVGL.Simulator/lvgl/examples/libs/ffmpeg/birds.mp4
Normal file
BIN
LVGL.Simulator/lvgl/examples/libs/ffmpeg/birds.mp4
Normal file
Binary file not shown.
BIN
LVGL.Simulator/lvgl/examples/libs/ffmpeg/ffmpeg.png
Normal file
BIN
LVGL.Simulator/lvgl/examples/libs/ffmpeg/ffmpeg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
12
LVGL.Simulator/lvgl/examples/libs/ffmpeg/index.rst
Normal file
12
LVGL.Simulator/lvgl/examples/libs/ffmpeg/index.rst
Normal file
@@ -0,0 +1,12 @@
|
||||
Decode image
|
||||
"""""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. lv_example:: libs/ffmpeg/lv_example_ffmpeg_1
|
||||
:language: c
|
||||
|
||||
Decode video
|
||||
"""""""""""""""""""""""""""""""""""
|
||||
|
||||
.. lv_example:: libs/ffmpeg/lv_example_ffmpeg_2
|
||||
:language: c
|
||||
|
||||
39
LVGL.Simulator/lvgl/examples/libs/ffmpeg/lv_example_ffmpeg.h
Normal file
39
LVGL.Simulator/lvgl/examples/libs/ffmpeg/lv_example_ffmpeg.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @file lv_example_ffmpeg.h
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef LV_EXAMPLE_FFMPEG_H
|
||||
#define LV_EXAMPLE_FFMPEG_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*********************
|
||||
* INCLUDES
|
||||
*********************/
|
||||
|
||||
/*********************
|
||||
* DEFINES
|
||||
*********************/
|
||||
|
||||
/**********************
|
||||
* TYPEDEFS
|
||||
**********************/
|
||||
|
||||
/**********************
|
||||
* GLOBAL PROTOTYPES
|
||||
**********************/
|
||||
void lv_example_ffmpeg_1(void);
|
||||
void lv_example_ffmpeg_2(void);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
**********************/
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif /*LV_EXAMPLE_FFMPEG_H*/
|
||||
@@ -0,0 +1,29 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_BUILD_EXAMPLES
|
||||
#if LV_USE_FFMPEG
|
||||
|
||||
|
||||
/**
|
||||
* Open an image from a file
|
||||
*/
|
||||
void lv_example_ffmpeg_1(void)
|
||||
{
|
||||
lv_obj_t * img = lv_img_create(lv_scr_act());
|
||||
lv_img_set_src(img, "./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_scr_act());
|
||||
lv_label_set_text(label, "FFmpeg is not installed");
|
||||
lv_obj_center(label);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@@ -0,0 +1,32 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_BUILD_EXAMPLES
|
||||
#if LV_USE_FFMPEG
|
||||
|
||||
/**
|
||||
* Open a video from a file
|
||||
*/
|
||||
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*/
|
||||
lv_obj_t * player = lv_ffmpeg_player_create(lv_scr_act());
|
||||
lv_ffmpeg_player_set_src(player, "./lvgl/examples/libs/ffmpeg/birds.mp4");
|
||||
lv_ffmpeg_player_set_auto_restart(player, true);
|
||||
lv_ffmpeg_player_set_cmd(player, LV_FFMPEG_PLAYER_CMD_START);
|
||||
lv_obj_center(player);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void lv_example_ffmpeg_2(void)
|
||||
{
|
||||
/*TODO
|
||||
*fallback for online examples*/
|
||||
|
||||
lv_obj_t * label = lv_label_create(lv_scr_act());
|
||||
lv_label_set_text(label, "FFmpeg is not installed");
|
||||
lv_obj_center(label);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
Reference in New Issue
Block a user