完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
《 》
diff --git a/CameraHal/CameraHal_board_xml_parse.cpp b/CameraHal/CameraHal_board_xml_parse.cpp 索引 89ecdf4..552f295 100755 --- a/CameraHal/CameraHal_board_xml_parse.cpp +++ b/CameraHal/CameraHal_board_xml_parse.cpp @@ -2395 ,7 +2395,7 @@ int camera_board_profiles::ProduceNewXml(camera_board_profiles* profile) int fileexit = access(RK_DST_MEDIA_PROFILES_XML_PATH, 0); ALOGD(“判断媒体配置文件 xml fileexit = %dn”, fileexit); //if((int)nCamNum》=1){ - if((int)nCamNum》=1 && fileexit == -1){ + if((int)nCamNum》=1){^M LOG1(“输入产生新的 xmln”); //新的xml文件名 strlcpy(default_file, RK_DEFAULT_MEDIA_PROFILES_XML_PATH, sizeof(default_file)); @@ -2444,6 +2444,8 @@ int camera_board_profiles::LoadSensor(camera_board_profiles*profiles) if(!fp){ ALOGE(“不存在,全部注册n”); 转到错误结束; + } else {^M + goto err_end;^M } //读取传感器名称 差异 --git a/CameraHal/CameraHal_Module.cpp b/CameraHal/CameraHal_Module.cpp index 01afa0d..07380f2 100755 --- a/CameraHal/CameraHal_Module .cpp +++ b/CameraHal/CameraHal_Module.cpp @@ -712,6 +712,7 @@ int camera_get_number_of_cameras(void) int cam_cnt=0,fd=-1,rk29_cam[CAMERAS_SUPPORT_MAX]; struct v4l2_capability 能力; rk_cam_info_t camInfoTmp[CAMERAS_SUPPORT_MAX]; + char u***cameraPlug[PROPERTY_VALUE_MAX]; 字符 *ptr,**ptrr; 字符版本[PROPERTY_VALUE_MAX]; 字符属性[PROPERTY_VALUE_MAX]; @@ -722,7 +723,10 @@ int camera_get_number_of_cameras(void) struct timeval t0, t1; ::gettimeofday(&t0, NULL); - if (gCamerasNumber 》 0) + property_get(“persist.sys.u***camera.status”, u***cameraPlug, “”); + bool plugstate = (strcmp(u***cameraPlug, “add”) == 0) + || (strcmp(u***cameraPlug, “删除”) == 0); + if (gCamerasNumber 》 0 && ! { @@ -835,7 +839,7 @@ int camera_get_number_of_cameras(void) fd = open(cam_path, O_RDONLY); if (fd 《 0) { LOGE(“打开 %s 失败!strr: %s”,cam_path,strerror(errno)); - 休息; +继续; } LOGD(“打开 %s 成功!”,cam_path); @@ -849,13 +853,13 @@ int camera_get_number_of_cameras(void) LOGD(“Video device(%s): video capture not supported.n”,cam_path); } else { rk_cam_total_info* pNewCamInfo = new rk_cam_total_info(); - memset(camInfoTmp[cam_cnt&0x01].device_path,0x00, sizeof(camInfoTmp[cam_cnt&0x01].device_path)); - strcat(camInfoTmp[cam_cnt&0x01].device_path,cam_path); - memset(camInfoTmp[cam_cnt&0x01].fival_list,0x00, sizeof(camInfoTmp[cam_cnt&0x01].fival_list)); - memcpy(camInfoTmp[cam_cnt&0x01].driver,capability.driver, sizeof(camInfoTmp[cam_cnt&0x01].driver)); - camInfoTmp[cam_cnt&0x01].version = 能力.version; + memset(camInfoTmp[cam_cnt].device_path,0x00, sizeof(camInfoTmp[cam_cnt].device_path)); + strcat(camInfoTmp[cam_cnt].device_path,cam_path); + memset(camInfoTmp[cam_cnt].fival_list,0x00, sizeof(camInfoTmp[cam_cnt].fival_list)); + memcpy(camInfoTmp[cam_cnt].driver,capability.driver, sizeof(camInfoTmp[cam_cnt].driver)); + camInfoTmp[cam_cnt].version = 能力.version; if (strstr((char*)&capability.card[0], “front”) != NULL) { - camInfoTmp[cam_cnt&0x01].facing_info.facing = CAMERA_FACING_FRONT; + camInfoTmp[cam_cnt].facing_info.facing = CAMERA_FACING_FRONT; #ifdef LAPTOP } else if (strstr((char*)&capability.card[0], “HP HD”) != NULL || strstr((char*)&capability.card[0], “HP IR”)) { @@ -866,14 +870,14 @@ int camera_get_number_of_cameras(void) LOGD(“Camera %d name: %s”, (cam_cnt&0x01), gU***CameraNames[cam_cnt&0x01].string()); #endif } else { - camInfoTmp[cam_cnt&0x01].facing_info.facing = CAMERA_FACING_BACK; + camInfoTmp[cam_cnt].facing_info.facing = CAMERA_FACING_BACK; } ptr = strstr((char*)&capability.card[0],“-”); if (ptr != NULL) { ptr++; - camInfoTmp[cam_cnt&0x01].facing_info.orientation = atoi(ptr); + camInfoTmp[cam_cnt].facing_info.orientation = atoi(ptr); } else { - camInfoTmp[cam_cnt&0x01].face_info.orientation = 0; + camInfoTmp[cam_cnt].facing_info.orientation = 0; } memset(版本,0x00,sizeof(版本)); @@ -1207,8 +1211,11 @@ int camera_get_number_of_cameras(void) } #endif - memcpy(&gCamInfos[0], &camInfoTmp[0], sizeof(rk_cam_info_t)); - memcpy(&gCamInfos[1], &camInfoTmp[1], sizeof(rk_cam_info_t)); + for (int i = 0; i 《 gCamerasNumber; i++) { + memcpy(&gCamInfos , &camInfoTmp , sizeof(rk_cam_info_t)); + } + //memcpy(&gCamInfos[0], &camInfoTmp[0], + //memcpy(&gCamInfos[1], &camInfoTmp[1], sizeof(rk_cam_info_t)); property_get(“ro.sf.hwrotation”, property, “0”); @@ -1235,6 +1235,8 @@ int camera_get_number_of_cameras(void) camera_get_number_of_cameras_end: LOGD(“%s(%d): Current board have %d cameras attached.”,__FUNCTION__, __LINE__, gCamerasNumber); + property_set(“persist.sys.u***camera.status”, “”); + ::gettimeofday(&t1, NULL); LOGD(“meida_profiles_xml_control time (%ld)usn”, (t1.tv_sec*1000000 + t1.tv_usec) - (t0.tv_sec*1000000 + t0.tv_usec)); #ifdef LAPTOP diff --git a/CameraHal/CameraHal_Module.h b/CameraHal/CameraHal_Module.h index 45c81ec..69be491 100755 --- a/CameraHal/CameraHal_Module.h +++ b/CameraHal/CameraHal_Module.h @@ -11,11 +11,11 @@ using namespace android; #define CAMERA_DEFAULT_PREVIEW_FPS_MIN 8000 //8 fps #define CAMERA_DEFAULT_PREVIEW_FPS_MAX 15000 #endif -#define CAMERAS_SUPPORT_MAX 2 +#define CAMERAS_SUPPORT_MAX 10 #if defined(TARGET_RK3399) - #define CAMERAS_SUPPORTED_SIMUL_MAX 2 + #define CAMERAS_SUPPORTED_SIMUL_MAX 10 #else - #define CAMERAS_SUPPORTED_SIMUL_MAX 1 + #define CAMERAS_SUPPORTED_SIMUL_MAX 10 #endif #define CAMERA_DEVICE_NAME “/dev/video” #define CAMERA_MODULE_NAME “RK29_ICS_CameraHal_Module” |
|
|
|
你正在撰写答案
如果你是对答案或其他答案精选点评或询问,请使用“评论”功能。
1906 浏览 1 评论
synopsys 的design ware:DW_fpv_div,浮点数除法器,默认32位下,想提升覆盖率(TMAX),如果用功能case去提升覆盖率呢?
2382 浏览 1 评论
RK3588 GStreamer调试四路鱼眼摄像头四宫格显示报错
5175 浏览 1 评论
【飞凌嵌入式OK3576-C开发板体验】RKNN神经网络-YOLO图像识别
254 浏览 0 评论
【飞凌嵌入式OK3576-C开发板体验】SSH远程登录网络配置及CAN通讯
1336 浏览 0 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 06:14 , Processed in 0.469908 second(s), Total 71, Slave 54 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号