1.Linux下内存发送功能
This commit is contained in:
parent
faa09bbb37
commit
bc71398653
|
@ -6971,16 +6971,7 @@ INT32 PhotoExe_Preview_SliceEncode_CB3(void* user_data)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DBG_WRN("filesys not ready, store data into mem\n");
|
sf_mem_write_photo((UINT32)queue_ele_in->jpg_thumb_addr, queue_ele_in->jpg_thumb_size);
|
||||||
SYS_USRMEM usrmem = {0};
|
|
||||||
|
|
||||||
if(sys_usrmem_init(&usrmem) == E_OK){
|
|
||||||
sys_usrmem_write_photo(
|
|
||||||
&usrmem,
|
|
||||||
(UINT32) queue_ele_in->jpg_thumb_addr,
|
|
||||||
queue_ele_in->jpg_thumb_size
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(PhotoCapMsgCb){
|
if(PhotoCapMsgCb){
|
||||||
|
|
|
@ -1276,20 +1276,21 @@ SINT32 sf_cardv_file_to_app_send_thread(void) {
|
||||||
SINT32 s32ret = 0;
|
SINT32 s32ret = 0;
|
||||||
SF_FN_PARAM_S stpfncallback = {0};
|
SF_FN_PARAM_S stpfncallback = {0};
|
||||||
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
UIMenuStoreInfo *puiPara = sf_app_ui_para_get();
|
||||||
|
sf_share_mem_file_init();
|
||||||
|
|
||||||
if(SF_FAILURE == sf_check_sd())
|
if(SF_FAILURE == sf_check_sd())
|
||||||
{
|
{
|
||||||
MLOGE("ERROR sf_check_sd\n");
|
MLOGE("ERROR sf_check_sd\n");
|
||||||
|
|
||||||
#if SF_NO_SD_SEND == ENABLE
|
#if SF_NO_SD_SEND == ENABLE
|
||||||
if((0 == puiPara->SendType) && (0 == sf_usr_mem_photo_ch()))
|
if((0 == puiPara->SendType))
|
||||||
{
|
{
|
||||||
|
sf_4G_status_set(SF_4G_SENDING);
|
||||||
s32ret = sf_mem_send_file_to_ftp();
|
s32ret = sf_mem_send_file_to_ftp();
|
||||||
return s32ret;
|
sf_4G_status_set(SF_4G_FREE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
goto SEND_FILE_END;
|
||||||
return SF_FAILURE;
|
|
||||||
}
|
}
|
||||||
stpfncallback.pstParam = sf_customer_param_get();
|
stpfncallback.pstParam = sf_customer_param_get();
|
||||||
stpfncallback.pstaticParam = sf_app_ui_para_get();
|
stpfncallback.pstaticParam = sf_app_ui_para_get();
|
||||||
|
@ -1298,7 +1299,6 @@ SINT32 sf_cardv_file_to_app_send_thread(void) {
|
||||||
|
|
||||||
pthread_detach(pthread_self());
|
pthread_detach(pthread_self());
|
||||||
|
|
||||||
sf_share_mem_file_init();
|
|
||||||
// s32ret = app_file_send_check(stpfncallback.pstaticParam);
|
// s32ret = app_file_send_check(stpfncallback.pstaticParam);
|
||||||
s32ret = sf_check_ftp_send(1);
|
s32ret = sf_check_ftp_send(1);
|
||||||
if (s32ret != SF_SUCCESS) {
|
if (s32ret != SF_SUCCESS) {
|
||||||
|
@ -1317,6 +1317,7 @@ SINT32 sf_cardv_file_to_app_send_thread(void) {
|
||||||
sf_set_gprs_errno(s32ret);
|
sf_set_gprs_errno(s32ret);
|
||||||
}
|
}
|
||||||
// app_file_transfer_Error_return_server(&stpfncallback);
|
// app_file_transfer_Error_return_server(&stpfncallback);
|
||||||
|
SEND_FILE_END:
|
||||||
ThumbSend.IsRun = 0;
|
ThumbSend.IsRun = 0;
|
||||||
sf_file_thumb_cfg_clear();
|
sf_file_thumb_cfg_clear();
|
||||||
sf_share_mem_file_down(1, s32ret);
|
sf_share_mem_file_down(1, s32ret);
|
||||||
|
|
|
@ -209,4 +209,5 @@ void sf_mem_free(void);
|
||||||
void sf_cardv_battery_level_set(UINT32 val);
|
void sf_cardv_battery_level_set(UINT32 val);
|
||||||
void sf_cardv_statistics_param_reset(void);
|
void sf_cardv_statistics_param_reset(void);
|
||||||
void sf_cardv_set_wifi_en(UINT32 cnt);
|
void sf_cardv_set_wifi_en(UINT32 cnt);
|
||||||
|
INT32 sf_mem_write_photo(UINT32 buf, UINT32 size);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -3568,4 +3568,28 @@ void sf_cardv_set_wifi_en(UINT32 cnt)
|
||||||
}
|
}
|
||||||
gpio_set_value(SF_WIFI_EN, cnt);
|
gpio_set_value(SF_WIFI_EN, cnt);
|
||||||
printf("[%s:%d] e cnt:%d\n", __FUNCTION__, __LINE__,cnt);
|
printf("[%s:%d] e cnt:%d\n", __FUNCTION__, __LINE__,cnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
INT32 sf_mem_write_photo(UINT32 buf, UINT32 size)
|
||||||
|
{
|
||||||
|
UINT32 fd = 0;
|
||||||
|
|
||||||
|
MLOGD("filesys not ready, store data into mem\n");
|
||||||
|
system("rm -rf /tmp/MEMPHOTO.JPG");
|
||||||
|
system("sync");
|
||||||
|
fd = open("/tmp/MEMPHOTO.JPG", O_WRONLY | O_CREAT);
|
||||||
|
if(fd)
|
||||||
|
{
|
||||||
|
lseek(fd, 0, SEEK_END);
|
||||||
|
write(fd, (void*)buf, size);
|
||||||
|
close(fd);
|
||||||
|
system("sync");
|
||||||
|
if(SUCCESS == sf_share_mem_file_down(0, 0)){
|
||||||
|
sf_set_send_statu(TRUE);
|
||||||
|
}
|
||||||
|
MLOGD("MEMPHOTO.JPG size:%ld\n", size);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
MLOGE("MEMPHOTO.JPG size:%ld\n", size);
|
||||||
|
return 1;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user