1、摄像头添加SD卡录满处理;

2、修复摄像头、科大讯飞等相关问题;
This commit is contained in:
huxi
2026-01-08 11:29:46 +08:00
parent dc11ee3fc4
commit 36e62db3a4
65 changed files with 3092 additions and 2904 deletions
@@ -56,34 +56,36 @@ REGISTER_UI_STYLE(STYLE_NAME)
#define VIDEO_PATH DEV_ROOT VIDEO_DIR VIDEO_NAME "." VIDEO_EXT //视频路径
#define VIEW_ITEM_NUM 6
#define PHOTO_CONTINUE_SAVE 3
struct brower_set_info {
int flist_index; //文件列表首项所指的索引
int cur_total; //文件数
FILE *file; //文件句柄
struct vfscan *fs; //文件系统句柄
FS_DIR_INFO *dir_buf; //文件(夹)信息
int show_temp; //显示项
int flist_index; //文件列表首项所指的索引
int cur_total; //文件数
FILE *file; //文件句柄
struct vfscan *fs; //文件系统句柄
FS_DIR_INFO *dir_buf; //文件(夹)信息
int show_temp; //显示项
#if (TCFG_LFN_EN)
u8 lfn_buf[512]; //长文件名
#endif//TCFG_LFN_EN
};
#define PHOTO_CONTINUE_SAVE 3
struct camera_ctrl {
u32 layout_curr; //当前布局id
u32 video_rec_time; //录像开始时间戳,用于计时
u8 view_video; //1 查看录像 0 查看照片
u8 video_doing; //录像中状态
u16 view_remap[VIEW_ITEM_NUM];
u8 view_vaild[VIEW_ITEM_NUM];
volatile s8 photo_save_cnt; //
struct brower_set_info brower_info; //文件浏览
char *sel_path;
u32 layout_curr; //当前布局id
u32 video_rec_time; //录像开始时间戳,用于计时
u8 view_video; //1 查看录像 0 查看照片
u8 video_doing; //录像中状态
u16 view_remap[VIEW_ITEM_NUM];
u8 view_vaild[VIEW_ITEM_NUM];
s8 error_status; //
volatile s8 photo_save_cnt; //
struct brower_set_info brower_info; //文件浏览
char *sel_path;
} __camera_ctrl;
#define __this (&__camera_ctrl) //相机句柄
static int cam_camera_video_sw();
//****************************************************************************************//
// 功能接口
@@ -93,6 +95,7 @@ static int cam_ctrl_init()
__this->layout_curr = CAM_MAIN_LAYOUT;
__this->video_rec_time = 0;
__this->video_doing = 0;
__this->error_status = 0;
/* __this->view_video = 1; */
return 0;
}
@@ -105,7 +108,7 @@ static int cam_ctrl_deinit()
* @brief camera_dec_reflush_sync相机画面刷新 (外部调用,线程同步)
*/
/* ------------------------------------------------------------------------------------*/
static void camera_dec_flush(void)
static void camera_dec_flush(void *p)
{
struct element *elm;
elm = ui_core_get_element_by_id(CAM_CAMERA_LAYOUT);
@@ -115,8 +118,13 @@ static void camera_dec_flush(void)
/* printf("CAM_CAMERA_LAYOUT REDRAW_EXIT"); */
}
}
static void camera_rec_err()
static void camera_rec_err(int status)
{
if (__this) {
__this->error_status = status;
}
/* printf("%s status:%d !!\n", __func__, status); */
cam_camera_video_sw();
ui_show(CAM_WARNING_LAYOUT);
}
@@ -136,7 +144,8 @@ void camera_dec_reflush_sync(int status)
msg[0] = (int) camera_rec_err;
}
msg[1] = 1;
msg[2] = 0;
msg[2] = status;
int ret = os_taskq_post_type("ui", Q_CALLBACK, 3, msg);
@@ -411,6 +420,29 @@ REGISTER_UI_EVENT_HANDLER(CAM_WARNING_LAYOUT)
.onkey = NULL,
.ontouch = cam_warning_layout_ontouch,
};
static int cam_warning_text_onchange(void *ctrl, enum element_change_event event, void *arg)
{
switch (event) {
case ON_CHANGE_SHOW_PROBE:
int index = 0;
if (__this) {
index = (__this->error_status < 0) ? -1 * __this->error_status : __this->error_status;
index -= 1;
}
/* printf("%s index:%d err:%d", __func__, index, __this->error_status); */
ui_text_set_index((struct ui_text *)ctrl, index);
break;
default:
break;
}
return false;
}
REGISTER_UI_EVENT_HANDLER(CAM_WARNING_TEXT)
.onchange = cam_warning_text_onchange,
.onkey = NULL,
.ontouch = NULL,
};
//****************************************************************************************//
// 主页面
//****************************************************************************************//
@@ -966,7 +998,7 @@ void video_dec_reflush_sync(int status)
{
void jlui_malloc_ram_info_dump();
/* jlui_malloc_ram_info_dump(); */
log_debug("%s status:%d !!\n", __func__, status);
/* log_debug("%s status:%d !!\n", __func__, status); */
int msg[3] = {0};
@@ -6594,6 +6594,40 @@ REGISTER_UI_EVENT_HANDLER(SETTING_ANIMATION_PIC11)//通用-垂直列表
//-----------------------蓝牙设置---------------------------------//
#if TCFG_USER_BT_CLASSIC_ENABLE
static int ui_edr_button_handler(const char *type, u32 arg)
{
log_info("%s arg:%d", __func__, arg);
ui_pic_show_image_by_id(SETTING_EDR_BUTTON, arg);
return true;
}
static int ui_ble_button_handler(const char *type, u32 arg)
{
log_info("%s arg:%d", __func__, arg);
ui_pic_show_image_by_id(SETTING_BLE_BUTTON, arg);
return true;
}
static const struct uimsg_handl bt_button_msg_handler[] = {
{ "edr_button", ui_edr_button_handler },
{ "ble_button", ui_ble_button_handler },
{ NULL, NULL}, /* 必须以此结尾! */
};
static int set_edr_layout_onchange(void *ctr, enum element_change_event e, void *arg)
{
switch (e) {
case ON_CHANGE_INIT:
ui_register_msg_handler(ID_WINDOW_SETTING, bt_button_msg_handler);
break;
case ON_CHANGE_RELEASE:
ui_register_msg_handler(ID_WINDOW_SETTING, NULL);
break;
default:
break;
}
return false;
}
static int set_edr_layout_ontouch(void *ctr, struct element_touch_event *e)
{
struct layout *layout = (struct layout *)ctr;
@@ -6612,7 +6646,7 @@ static int set_edr_layout_ontouch(void *ctr, struct element_touch_event *e)
}
REGISTER_UI_EVENT_HANDLER(SETTING_EDR_LAYOUT)//通用-垂直列表
.onchange = NULL,
.onchange = set_edr_layout_onchange,
.onkey = NULL,
.ontouch = set_edr_layout_ontouch,
};
@@ -118,6 +118,7 @@ int ui_ram_image_attrs_set(struct ui_image_attrs *img, u8 *data, int data_len, i
return 0;
}
static void (*jlgpu_create_task_list_by_image_cb_func)(JLGPUTaskParam_t *param);
pJLGPUTaskHead_t jlgpu_create_task_list_by_image(pJLGPUTaskHead_t head, struct ui_image_attrs *image_attr, int xoffset, int yoffset)
{
@@ -382,7 +383,7 @@ int page_mode_mode_cube_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (map_head) {
jlgpu_set_task_list_out_format(map_head, out_format);
new_head = jlgpu_task_list_copy_create(NULL, map_head, &matrix, 0);
jlgpu_task_list_copy_destroy(map_head);
jlgpu_delete_task_list_head(map_head);
} else {
new_head = jlgpu_task_list_copy_create(NULL, jlgpu_mult_task_head_by_index(mult_list, idx), &matrix, 0);
}
@@ -394,7 +395,7 @@ int page_mode_mode_cube_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
pJLGPUTaskHead_t map_head = jlgpu_task_list_map_window_id(other_win);
if (map_head) {
jlgpu_task_list_copy_create(new_head, map_head, &matrix, 1);
jlgpu_task_list_copy_destroy(map_head);
jlgpu_delete_task_list_head(map_head);
} else {
jlgpu_task_list_copy_create(new_head, jlgpu_mult_task_head_by_index(mult_list, idx_other), &matrix, 1);
}
@@ -419,6 +420,7 @@ int page_mode_mode_cube_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (tmp_head) {
jlgpu_set_task_list_out_format(tmp_head, out_format);
draw->new_list_create |= BIT(set_idx);
draw->normal_list_flag |= BIT(set_idx);
} else {
tmp_head = jlgpu_mult_task_head_by_index(mult_list, idx);
if (/*curr_win != DIAL_PAGE_0*/0) {
@@ -442,6 +444,7 @@ int page_mode_mode_cube_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (tmp_head) {
jlgpu_set_task_list_out_format(tmp_head, out_format);
draw->new_list_create |= BIT(set_idx);
draw->normal_list_flag |= BIT(set_idx);
} else {
tmp_head = jlgpu_mult_task_head_by_index(mult_list, idx_other);
if (/*other_win != DIAL_PAGE_0*/0) {
@@ -531,7 +534,7 @@ int page_mode_mode_drift_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (map_head) {
jlgpu_set_task_list_out_format(map_head, out_format);
new_head = jlgpu_task_list_copy_create(NULL, map_head, &matrix, 0);
jlgpu_task_list_copy_destroy(map_head);
jlgpu_delete_task_list_head(map_head);
} else {
new_head = jlgpu_task_list_copy_create(NULL, jlgpu_mult_task_head_by_index(mult_list, idx), &matrix, 0);
}
@@ -552,7 +555,7 @@ int page_mode_mode_drift_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (map_head) {
jlgpu_set_task_list_out_format(map_head, out_format);
new_head = jlgpu_task_list_copy_create(NULL, map_head, &matrix, 0);
jlgpu_task_list_copy_destroy(map_head);
jlgpu_delete_task_list_head(map_head);
} else {
new_head = jlgpu_task_list_copy_create(NULL, jlgpu_mult_task_head_by_index(mult_list, idx_other), &matrix, 0);
}
@@ -574,6 +577,7 @@ int page_mode_mode_drift_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (tmp_head) {
jlgpu_set_task_list_out_format(tmp_head, out_format);
draw->new_list_create |= BIT(set_idx);
draw->normal_list_flag |= BIT(set_idx);
} else {
tmp_head = jlgpu_mult_task_head_by_index(mult_list, idx);
if (/*curr_win != DIAL_PAGE_0*/0) {
@@ -596,6 +600,7 @@ int page_mode_mode_drift_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (tmp_head) {
jlgpu_set_task_list_out_format(tmp_head, out_format);
draw->new_list_create |= BIT(set_idx);
draw->normal_list_flag |= BIT(set_idx);
} else {
tmp_head = jlgpu_mult_task_head_by_index(mult_list, idx_other);
if (/*other_win != DIAL_PAGE_0*/0) {
@@ -623,7 +628,7 @@ int page_mode_mode_drift_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (map_head) {
jlgpu_set_task_list_out_format(map_head, out_format);
new_head = jlgpu_task_list_copy_create(NULL, map_head, &matrix, 0);
jlgpu_task_list_copy_destroy(map_head);
jlgpu_delete_task_list_head(map_head);
} else {
new_head = jlgpu_task_list_copy_create(NULL, jlgpu_mult_task_head_by_index(mult_list, idx_other), &matrix, 0);
}
@@ -645,7 +650,7 @@ int page_mode_mode_drift_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (map_head) {
jlgpu_set_task_list_out_format(map_head, out_format);
new_head = jlgpu_task_list_copy_create(NULL, map_head, &matrix, 0);
jlgpu_task_list_copy_destroy(map_head);
jlgpu_delete_task_list_head(map_head);
} else {
new_head = jlgpu_task_list_copy_create(NULL, jlgpu_mult_task_head_by_index(mult_list, idx), &matrix, 0);
}
@@ -666,6 +671,7 @@ int page_mode_mode_drift_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (tmp_head) {
jlgpu_set_task_list_out_format(tmp_head, out_format);
draw->new_list_create |= BIT(set_idx);
draw->normal_list_flag |= BIT(set_idx);
} else {
tmp_head = jlgpu_mult_task_head_by_index(mult_list, idx_other);
if (/*other_win != DIAL_PAGE_0*/0) {
@@ -690,6 +696,7 @@ int page_mode_mode_drift_filp_effect_draw(pJLGPUMultTaskList_t mult_list, struct
if (tmp_head) {
jlgpu_set_task_list_out_format(tmp_head, out_format);
draw->new_list_create |= BIT(set_idx);
draw->normal_list_flag |= BIT(set_idx);
} else {
tmp_head = jlgpu_mult_task_head_by_index(mult_list, idx);
if (/*curr_win != DIAL_PAGE_0*/0) {
@@ -1638,3 +1645,4 @@ int ui_page_switch_effect_stop()
#endif
#endif