Skip to content

Commit 9c49c19

Browse files
committed
Merge branch 'feature/support_avi_for_lvgl' into 'master'
feat(examples): Support dual eyes UI by avi player See merge request adf/esp-adf-internal!1461
2 parents fe93ed1 + 8e70e12 commit 9c49c19

File tree

10 files changed

+513
-17
lines changed

10 files changed

+513
-17
lines changed

examples/display/dual_eyes/README_CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ dispose(gd_GIF *gif)
248248

249249
- **帧率对比**
250250

251-
测试同样动画效果的的 GIF 和 AVI 文件(30 fps,240×240×2,双屏显示),实际 FPS 与 CPU Loading 如下:
251+
测试同样动画效果的 GIF 和 AVI 文件(30 fps,240×240×2,双屏显示),实际 FPS 与 CPU Loading 如下:
252252

253253
|测试条件|FPS|CPU Loading|
254254
|-------|---|-----------|

examples/display/dual_eyes/main/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
set(COMPONENT_SRCS
22
app_main.c
33
esp_dual_eye_ui.c
4+
esp_dual_eye_ui_avi.c
45
esp_dual_eye_player.c
56
)
67

examples/display/dual_eyes/main/app_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ void app_main(void)
2727
esp_log_level_set("avi player", ESP_LOG_WARN);
2828

2929
esp_littlefs_init("/littlefs", "storage");
30-
esp_mmap_init("assets", MMAP_IMAGES_FILES, MMAP_IMAGES_CHECKSUM);
30+
esp_mmap_init("assets", MMAP_ASSETS_FILES, MMAP_ASSETS_CHECKSUM);
3131
esp_sdcard_init();
3232

3333
#if ENABLE_BENCHMARK
@@ -41,6 +41,7 @@ void app_main(void)
4141
avi_player_start(); // If you show 240*240 and more, you can try this
4242
#else
4343
dual_eye_ui_start(); // If just show gif in 128*128, you can try this
44+
// dual_eye_ui_avi_start(); // If you show 240*240 and more with LVGL UI by avi player, you can try this
4445
#endif /* USE_AVI_PLAYER */
4546

4647
esp_gmf_oal_thread_create(NULL, "system_task", system_task, NULL, 4096, 15, true, 1);

examples/display/dual_eyes/main/dual_lcd/esp_dual_display.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ esp_err_t esp_dual_display_start(lv_disp_t **disp_left, lv_disp_t **disp_right)
1616
display_cfg_t cfg = {
1717
.lvgl_port_cfg = ESP_LVGL_PORT_INIT_CONFIG(),
1818
.double_buffer = true,
19-
.trans_size = TRANS_SIZE,
19+
.trans_size = 0,
2020
.buffer_size = BSP_LCD_H_RES * BSP_LCD_V_RES,
2121
.flags = {
2222
.buff_dma = false,

examples/display/dual_eyes/main/esp_dual_eye_player.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
/* Constants */
2020
#define LCD_DRAW_TASK_STACK_SIZE 4096
2121
#define PLAYER_TASK_STACK_SIZE 4096
22+
#define PLAYER_TASK_PRIO 10
2223
#define AVI_PLAYER_STACK_SIZE 3072
2324
#define AVI_PLAYER_BUFFER_SIZE (16 * 1024)
25+
#define AVI_PLAYER_TASK_PRIO 3
2426
#define QUEUE_TIMEOUT_MS 1000
2527
#define FPS_REPORT_INTERVAL_US 1000000
2628
#define LCD_WIDTH BSP_LCD_H_RES
@@ -199,7 +201,7 @@ static void player_task(void *arg)
199201
.video_cb = avi_video_frame,
200202
.avi_play_end_cb = avi_play_end,
201203
.coreID = SPI_ISR_CPU_ID,
202-
.priority = 5,
204+
.priority = AVI_PLAYER_TASK_PRIO,
203205
.user_data = data_left,
204206
.stack_size = AVI_PLAYER_STACK_SIZE,
205207
.stack_in_psram = TASK_STACK_IN_PSRAM,
@@ -237,6 +239,9 @@ static void player_task(void *arg)
237239
ESP_LOGE(TAG, "Player error occurred");
238240
goto cleanup;
239241
}
242+
if (value == (PLAYER_LEFT_END_BIT | PLAYER_RIGHT_END_BIT)) {
243+
break;
244+
}
240245
}
241246
}
242247

@@ -442,5 +447,5 @@ static jpeg_error_t esp_jpeg_decode_one_picture(uint8_t *input_buf, int len, uin
442447
void avi_player_start(void)
443448
{
444449
esp_gmf_oal_thread_create(NULL, "player_task", player_task, NULL,
445-
PLAYER_TASK_STACK_SIZE, 3, TASK_STACK_IN_PSRAM, 1);
450+
PLAYER_TASK_STACK_SIZE, PLAYER_TASK_PRIO, TASK_STACK_IN_PSRAM, 1);
446451
}

0 commit comments

Comments
 (0)