From ace86859f8ee7f72efd14fc8bbb6f8e7c2031bb8 Mon Sep 17 00:00:00 2001 From: xiehongyan Date: Wed, 3 Jan 2024 18:50:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E=E6=94=BE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2=E5=88=87=E6=8D=A2emmc=E5=92=8Csd=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c | 16 +++++++++---- .../UIFlowPlay/UIFlowPlayEventCallback.c | 23 ++++++++++--------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c b/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c index 6144b5d24..f3f818aeb 100755 --- a/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c +++ b/code/application/source/cardv/SrcCode/UIApp/Play/UIAppPlay_Exe.c @@ -34,6 +34,7 @@ IMAGEAPP_PLAY_CFG_DISP_INFO gPlay_Disp_Info; static HD_COMMON_MEM_INIT_CONFIG g_play_mem_cfg = {0}; static UINT32 g_PlayExifBufPa = 0, g_PlayExifBufVa = 0; +DCF_HANDLE ChangeHandle = -1; static ER PlayExe_InitExif(void) { @@ -258,10 +259,11 @@ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) UI_SetData(FL_IsUseFileDB, 0); #endif useFileDB = UI_GetData(FL_IsUseFileDB); + printf("[PlayExe_OnOpen]mode open\n"); if (useFileDB) { CHAR *rootPath = "A:\\"; //CHAR* defaultfolder="A:\\CarDV\\"; - + printf("[PlayExe_OnOpen]if file db\n"); PPBX_FLIST_OBJ pFlist = PBXFList_FDB_getObject(); pFlist->Config(PBX_FLIST_CONFIG_MEM, uiPoolAddr, POOL_SIZE_FILEDB); pFlist->Config(PBX_FLIST_CONFIG_MAX_FILENUM, 5000, 0); @@ -276,12 +278,16 @@ INT32 PlayExe_OnOpen(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) pFlist->Config(PBX_FLIST_CONFIG_SUPPORT_LONGNAME, 1, 0); PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)pFlist); } else { + printf("[PlayExe_OnOpen]else file %d\n", ChangeHandle); extern DCF_HANDLE System_Get_DCF_Handle(void); - + PPBX_FLIST_OBJ pFlist = PBXFList_DCF_getObject(); - DCF_HANDLE handle = System_Get_DCF_Handle(); + if (ChangeHandle == -1) + { + ChangeHandle = System_Get_DCF_Handle(); + } - pFlist->Config(PBX_FLIST_CONFIG_DCF_HANDLE, (UINT32)handle, 0); + pFlist->Config(PBX_FLIST_CONFIG_DCF_HANDLE, (UINT32)ChangeHandle, 0); PB_SetParam(PBPRMID_FILELIST_OBJ, (UINT32)pFlist); } PB_SetParam(PBPRMID_DEC_VIDEO_CALLBACK, (UINT32)PBDecVideoCB); @@ -362,7 +368,7 @@ INT32 PlayExe_OnClose(VControl *pCtrl, UINT32 paramNum, UINT32 *paramArray) #if _TODO //refer to NA51055-840 JIRA and using new method PBView_KeepLastView(); #endif - + printf("[PlayExe_OnClose] on close\n"); PlayExe_UninitExif(); ImageApp_Play_Close(); diff --git a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c index f00674c89..98d1e6f62 100755 --- a/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c +++ b/code/application/source/cardv/SrcCode/UIWnd/LVGL_SPORTCAM/UIFlowLVGL/UIFlowPlay/UIFlowPlayEventCallback.c @@ -62,6 +62,8 @@ static void stop_play(void); #define HANDLE_SD 1 #define HANDLE_EMMC 0 +DCF_HANDLE FirstHandle = -1; +extern DCF_HANDLE ChangeHandle; static BOOL g_PlayBgInitFileSys = FALSE; @@ -338,6 +340,7 @@ void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key) { printf(" ================================== switch sd card.\n"); ProfileSelected = 1; + ChangeHandle = ProfileSelected; Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PLAYBACK); } @@ -345,6 +348,7 @@ void Option_play_Selection_Key(lv_obj_t* obj, uint32_t key) { printf(" ================================== switch emmc.\n"); ProfileSelected = 0; + ChangeHandle = ProfileSelected; Ux_SendEvent(0, NVTEVT_SYSTEM_MODE, 1, PRIMARY_MODE_PLAYBACK); } @@ -1284,18 +1288,15 @@ static void set_indev_keypad_group(lv_obj_t* obj) static void UIFlowPlay_ScrOpen(lv_obj_t* obj) { - + if (FirstHandle == -1) + { + FirstHandle = System_Get_DCF_Handle(); + printf("[UIFlowPlay_ScrOpen][*x] select handle: %d.\n", FirstHandle); + ProfileSelected = FirstHandle; + } + DBG_IND("UIFlowPlay_ScrOpen\r\n"); - int SelectedHandle = System_Get_DCF_Handle(); - printf("[UIFlowPlay_ScrOpen][*x] select handle: %d.\n", SelectedHandle); - if (SelectedHandle == HANDLE_SD) - { - ProfileSelected = 1; - } - else if (SelectedHandle == HANDLE_EMMC) - { - ProfileSelected = 0; - } + set_indev_keypad_group(obj); if (UIStorageCheck(STORAGE_CHECK_ERROR, NULL) == TRUE) {