|
19 | 19 | /* Constants */ |
20 | 20 | #define LCD_DRAW_TASK_STACK_SIZE 4096 |
21 | 21 | #define PLAYER_TASK_STACK_SIZE 4096 |
| 22 | +#define PLAYER_TASK_PRIO 10 |
22 | 23 | #define AVI_PLAYER_STACK_SIZE 3072 |
23 | 24 | #define AVI_PLAYER_BUFFER_SIZE (16 * 1024) |
| 25 | +#define AVI_PLAYER_TASK_PRIO 3 |
24 | 26 | #define QUEUE_TIMEOUT_MS 1000 |
25 | 27 | #define FPS_REPORT_INTERVAL_US 1000000 |
26 | 28 | #define LCD_WIDTH BSP_LCD_H_RES |
@@ -199,7 +201,7 @@ static void player_task(void *arg) |
199 | 201 | .video_cb = avi_video_frame, |
200 | 202 | .avi_play_end_cb = avi_play_end, |
201 | 203 | .coreID = SPI_ISR_CPU_ID, |
202 | | - .priority = 5, |
| 204 | + .priority = AVI_PLAYER_TASK_PRIO, |
203 | 205 | .user_data = data_left, |
204 | 206 | .stack_size = AVI_PLAYER_STACK_SIZE, |
205 | 207 | .stack_in_psram = TASK_STACK_IN_PSRAM, |
@@ -237,6 +239,9 @@ static void player_task(void *arg) |
237 | 239 | ESP_LOGE(TAG, "Player error occurred"); |
238 | 240 | goto cleanup; |
239 | 241 | } |
| 242 | + if (value == (PLAYER_LEFT_END_BIT | PLAYER_RIGHT_END_BIT)) { |
| 243 | + break; |
| 244 | + } |
240 | 245 | } |
241 | 246 | } |
242 | 247 |
|
@@ -442,5 +447,5 @@ static jpeg_error_t esp_jpeg_decode_one_picture(uint8_t *input_buf, int len, uin |
442 | 447 | void avi_player_start(void) |
443 | 448 | { |
444 | 449 | 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); |
446 | 451 | } |
0 commit comments