1、同步BR28。add 文件传输crc校验心跳包,防止传输大文件校验超时;
2、修正科大讯飞、摄像头测试问题;
This commit is contained in:
@@ -705,13 +705,6 @@ static int AI_dial_time_onchange(void *ctr, enum element_change_event e, void *a
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
REGISTER_UI_EVENT_HANDLER(AI_DIALOGUE)
|
||||
.onchange = AI_dialogue_onchange,
|
||||
.onkey = NULL,
|
||||
.ontouch = NULL,
|
||||
};
|
||||
|
||||
REGISTER_UI_EVENT_HANDLER(AI_DIALOGUE)
|
||||
.onchange = AI_dialogue_onchange,
|
||||
.onkey = NULL,
|
||||
|
||||
@@ -692,7 +692,7 @@ REGISTER_UI_EVENT_HANDLER(CAM_CAMERA_TIME_LAYOUT)
|
||||
//****************************************************************************************//
|
||||
// 相册
|
||||
//****************************************************************************************//
|
||||
void *animig_open(char *name, int window_id, int arg);
|
||||
/* void *animig_open(char *name, int window_id, int arg); */
|
||||
/* ------------------------------------------------------------------------------------*/
|
||||
/**
|
||||
* @brief cam_photo_list_child_onchange 子控件
|
||||
@@ -1033,14 +1033,17 @@ static int cam_show_layout_onchange1(void *ctrl, enum element_change_event event
|
||||
struct ui_grid *grid = (struct ui_grid *)ctrl;
|
||||
struct element *elm = (struct element *)ctrl;
|
||||
struct draw_context *dc = (struct draw_context *)arg;
|
||||
AVI_PARAM param;
|
||||
switch (event) {
|
||||
case ON_CHANGE_INIT:
|
||||
if (!__this->sel_path) {
|
||||
break;
|
||||
}
|
||||
if (__this->view_video) {
|
||||
param.is_dial = 0;
|
||||
param.is_audio_mute = 0;
|
||||
set_avi_play_mode(0);
|
||||
animig_open(__this->sel_path, 0, 3);
|
||||
animig_open(__this->sel_path, param, 3);
|
||||
}
|
||||
break;
|
||||
case ON_CHANGE_SHOW_POST:
|
||||
|
||||
@@ -251,6 +251,8 @@ void cube_effect_init(struct element *curr_elm, struct rect *lcd_rect)
|
||||
if (__this->init) {
|
||||
return;
|
||||
}
|
||||
|
||||
__this->init = 1;
|
||||
struct ui_platform_api *platform_api = ui_get_platform_api();
|
||||
ASSERT(platform_api);
|
||||
struct draw_context dc_tmp = {0};
|
||||
@@ -411,7 +413,7 @@ void cube_effect_init(struct element *curr_elm, struct rect *lcd_rect)
|
||||
}
|
||||
|
||||
__this->dial_page_index = -1;
|
||||
__this->init = 1;
|
||||
/* __this->init = 1; */
|
||||
for (int i = 1; i < 6; i++) {
|
||||
win = __this->page_id[i];
|
||||
if (win == DIAL_PAGE_0) {
|
||||
|
||||
@@ -519,6 +519,7 @@ void cube_reflection_effect_init(struct element *curr_elm)
|
||||
return;
|
||||
}
|
||||
|
||||
__this->init = 1;
|
||||
struct ui_platform_api *platform_api = ui_get_platform_api();
|
||||
ASSERT(platform_api);
|
||||
struct draw_context dc_tmp = {0};
|
||||
@@ -653,7 +654,7 @@ void cube_reflection_effect_init(struct element *curr_elm)
|
||||
|
||||
__this->curr_elm = curr_elm;
|
||||
|
||||
__this->init = 1;
|
||||
/* __this->init = 1; */
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -750,6 +750,8 @@ static int watch_dial_bgp_deinit(struct watch_param *param)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern char *watch_avi_get_related_path(u8 cur_watch);
|
||||
static int watch_dial_bgp_init(struct watch_param *param)
|
||||
{
|
||||
watch_dial_bgp_deinit(param);
|
||||
@@ -757,19 +759,22 @@ static int watch_dial_bgp_init(struct watch_param *param)
|
||||
char *bg_path;
|
||||
u8 watch_mode_type = 0;
|
||||
#if TCFG_VIDEO_DIAL_ENABLE
|
||||
AVI_PARAM avi_dial_param;
|
||||
syscfg_read(CFG_DIAL_TYPE_SEL, (u8 *)&watch_mode_type, 1);
|
||||
if (watch_mode_type == 1) {
|
||||
|
||||
extern char *watch_avi_get_related_path(u8 cur_watch);
|
||||
bg_path = watch_avi_get_related_path(watch_get_style());
|
||||
|
||||
log_debug("cur watch style %d, bgp_path:%s\n\n\n\n\n", watch_get_style(), bg_path);
|
||||
/* bg_path=NULL; */
|
||||
|
||||
if (bg_path) {
|
||||
animig_open((char *)bg_path, 0, 3); // 缓存3帧可以达到流畅播放30FPS
|
||||
avi_dial_param.is_dial = 1;
|
||||
avi_dial_param.is_audio_mute = 0;
|
||||
set_avi_play_mode(AVI_PLAY_LOOP);
|
||||
animig_open((char *)bg_path, avi_dial_param, 3); // 缓存3帧可以达到流畅播放30FPS
|
||||
avi_set_avi_playtimer_id(0);
|
||||
if (ui_in_effect()) {
|
||||
if (ui_in_effect() || dial_sel_state()) {
|
||||
if (get_aviplay_handle() != NULL) {
|
||||
avi_pause();
|
||||
}
|
||||
@@ -859,6 +864,7 @@ static int WATCH_onchange(void *ctr, enum element_change_event e, void *arg)
|
||||
u8 slow_sec = 0;
|
||||
#if TCFG_VIDEO_DIAL_ENABLE
|
||||
u16 avi_playtimer ;
|
||||
static u8 watch_mode_type = 0;
|
||||
#endif
|
||||
/* printf("%s %d", __func__, e); */
|
||||
switch (e) {
|
||||
@@ -887,10 +893,24 @@ static int WATCH_onchange(void *ctr, enum element_change_event e, void *arg)
|
||||
ui_page_move_en_callback(is_ui_page_move_enable);
|
||||
watch_load_sidebar(elm);
|
||||
watch_dial_bgp_init(&dial_param);
|
||||
#if TCFG_VIDEO_DIAL_ENABLE
|
||||
syscfg_read(CFG_DIAL_TYPE_SEL, (u8 *)&watch_mode_type, 1);
|
||||
#endif
|
||||
ui_auto_shut_down_enable();
|
||||
break;
|
||||
#if TCFG_VIDEO_DIAL_ENABLE
|
||||
case ON_CHANGE_SHOW_POST:
|
||||
if (watch_mode_type == 1) {
|
||||
|
||||
if (ui_in_effect() || ui_page_get_busy() || dial_sel_state()) {
|
||||
char *bg_path = watch_avi_get_related_path(watch_get_style());
|
||||
if (bg_path) {
|
||||
extern int jpeg_image_file_psram(struct draw_context * dc, int left, int top, int width, int height, char *path, int path_len, int scale_en, float scale_f);
|
||||
jpeg_image_file_psram(dc, 0, 0, 320, 384, bg_path, strlen(bg_path), 0, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 保护措施,防止avi资源释放后访问空指针
|
||||
if (get_avi_pause_status()) {
|
||||
// printf("\n\n avi_player is already free!!!!!!!\n");
|
||||
|
||||
@@ -709,6 +709,7 @@ void hexagon_effect_init(struct element *curr_elm, bool list_flag)
|
||||
if (__this->init) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (polytope == POLYTOPE_SIX) {
|
||||
__this->polytope_type = POLYTOPE_SIX;
|
||||
} else if (polytope == POLYTOPE_EIGHT) {
|
||||
@@ -721,6 +722,7 @@ void hexagon_effect_init(struct element *curr_elm, bool list_flag)
|
||||
return;
|
||||
}
|
||||
|
||||
__this->init = 1;
|
||||
struct ui_platform_api *platform_api = ui_get_platform_api();
|
||||
ASSERT(platform_api);
|
||||
struct draw_context dc_tmp = {0};
|
||||
@@ -892,7 +894,7 @@ void hexagon_effect_init(struct element *curr_elm, bool list_flag)
|
||||
}
|
||||
}
|
||||
|
||||
__this->init = 1;
|
||||
/* __this->init = 1; */
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -742,6 +742,7 @@ void reflection_effect_init(struct element *curr_elm, bool list_flag)
|
||||
return;
|
||||
}
|
||||
|
||||
__this->init = 1;
|
||||
struct ui_platform_api *platform_api = ui_get_platform_api();
|
||||
ASSERT(platform_api);
|
||||
struct draw_context dc_tmp = {0};
|
||||
@@ -879,7 +880,7 @@ void reflection_effect_init(struct element *curr_elm, bool list_flag)
|
||||
}
|
||||
}
|
||||
|
||||
__this->init = 1;
|
||||
/* __this->init = 1; */
|
||||
}
|
||||
|
||||
/* ------------------------------------------------------------------------------------*/
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
|
||||
// ui参数
|
||||
struct ifly_ui_t {
|
||||
u8 vad_button; // 判断vad是否按下,防止多次开启
|
||||
u8 net_fail;
|
||||
u16 time_id; // 定时器
|
||||
u16 task_create_timer;
|
||||
@@ -86,6 +87,17 @@ static bool ifly_check_net_connect(void)
|
||||
return false;
|
||||
}
|
||||
|
||||
static void ui_ifly_vad_button_touch(u8 flag)
|
||||
{
|
||||
ifly_ui->vad_button = flag;
|
||||
}
|
||||
|
||||
static u8 ui_ifly_vad_button_get_touch()
|
||||
{
|
||||
return ifly_ui->vad_button;
|
||||
}
|
||||
|
||||
|
||||
static int ui_ifly_ai_event_cb(ifly_ai_event_enum evt, void *param)
|
||||
{
|
||||
switch (evt) {
|
||||
@@ -121,6 +133,7 @@ static int ui_ifly_vad_event_cb(ifly_vad_event_enum evt, void *param)
|
||||
sys_timeout_del(ifly_ui->vad_recv_timer);
|
||||
ifly_ui->vad_recv_timer = 0;
|
||||
}
|
||||
ui_ifly_vad_button_touch(0);
|
||||
break;
|
||||
case IFLY_VAD_EVT_NETWORK_RECV_ERROR:
|
||||
UI_MSG_POST("vad_network_recv_error");
|
||||
@@ -414,33 +427,37 @@ static void vad_recv_timer_handler(void *priv)
|
||||
sys_timeout_del(ifly_ui->vad_recv_timer);
|
||||
ifly_ui->vad_recv_timer = 0;
|
||||
}
|
||||
ui_ifly_vad_button_touch(0);
|
||||
}
|
||||
|
||||
static int ifly_vad_button_ontouch(void *ctr, struct element_touch_event *e)
|
||||
{
|
||||
switch (e->event) {
|
||||
case ELM_EVENT_TOUCH_DOWN:
|
||||
if (!ifly_vad_is_work()) {
|
||||
// 开始
|
||||
if (ifly_check_net_connect() == false) {
|
||||
UI_MSG_POST("vad_network_no_connect");
|
||||
break;
|
||||
}
|
||||
ui_hide(IFLY_LAYOUT_VAD);
|
||||
ui_show(IFLY_LAYOUT_CONNECTTING);
|
||||
if (!ui_ifly_vad_button_get_touch()) {
|
||||
if (!ifly_vad_is_work()) {
|
||||
// 开始
|
||||
if (ifly_check_net_connect() == false) {
|
||||
UI_MSG_POST("vad_network_no_connect");
|
||||
break;
|
||||
}
|
||||
ui_hide(IFLY_LAYOUT_VAD);
|
||||
ui_show(IFLY_LAYOUT_CONNECTTING);
|
||||
|
||||
ifly_vad_stop(1, 10);
|
||||
p_ifly_net->vad_param.vad_res = p_ifly_net->local_text;
|
||||
p_ifly_net->vad_param.vad_res_len = MAX_VAD_LEN;
|
||||
p_ifly_net->vad_param.event_cb = ui_ifly_vad_event_cb;
|
||||
p_ifly_net->vad_param.vad_res[0] = 0;
|
||||
ifly_vad_start(&p_ifly_net->vad_param);
|
||||
} else {
|
||||
// 停止
|
||||
ifly_vad_stop(0, 2000);
|
||||
log_info("stop recording\n");
|
||||
if (!ifly_ui->vad_recv_timer) {
|
||||
ifly_ui->vad_recv_timer = sys_timeout_add(NULL, vad_recv_timer_handler, 3000);
|
||||
ifly_vad_stop(1, 10);
|
||||
p_ifly_net->vad_param.vad_res = p_ifly_net->local_text;
|
||||
p_ifly_net->vad_param.vad_res_len = MAX_VAD_LEN;
|
||||
p_ifly_net->vad_param.event_cb = ui_ifly_vad_event_cb;
|
||||
p_ifly_net->vad_param.vad_res[0] = 0;
|
||||
ifly_vad_start(&p_ifly_net->vad_param);
|
||||
} else {
|
||||
// 停止
|
||||
if (!ifly_ui->vad_recv_timer) {
|
||||
ifly_ui->vad_recv_timer = sys_timeout_add(NULL, vad_recv_timer_handler, 3000);
|
||||
}
|
||||
ui_ifly_vad_button_touch(1);
|
||||
ifly_vad_stop(0, 2000);
|
||||
log_info("stop recording\n");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -646,6 +663,7 @@ static int vad_network_fail()
|
||||
ifly_ui->cur_layout = IFLY_LAYOUT_CONNECTTING;
|
||||
ifly_ui->show_layout = IFLY_LAYOUT_CONNECT_FAIL;
|
||||
ifly_no_content(IFLY_VAD_NO_CONN_CNT_MAX);
|
||||
ui_ifly_vad_button_touch(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -655,6 +673,7 @@ static int vad_network_recv_error()
|
||||
ifly_ui->cur_layout = IFLY_LAYOUT_VAD;
|
||||
ifly_ui->show_layout = IFLY_LAYOUT_CONNECT_FAIL;
|
||||
ifly_no_content(IFLY_VAD_NO_CONN_CNT_MAX);
|
||||
ui_ifly_vad_button_touch(1);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user