PX30-ANDROID8.1-USB前后置摄像头切换

修改文件:

hardware\rockchip\camera\CameraHal\CameraHal_Module.cpp
 //默认前置置摄像头
camInfoTmp[cam_cnt&0x01].facing_info.facing = CAMERA_FACING_FRONT ;
 //默认后置置摄像头
camInfoTmp[cam_cnt&0x01].facing_info.facing = CAMERA_FACING_BACK;

所以将CAMERA_FACING_BACKCAMERA_FACING_FRONT对换即可
源代码:

#ifdef LAPTOP
                } else if (strstr((char*)&capability.card[0], "HP HD") != NULL
                    || strstr((char*)&capability.card[0], "HP IR")) {
                    camInfoTmp[cam_cnt&0x01].facing_info.facing = CAMERA_FACING_FRONT;
                    if (strstr((char*)&capability.card[0], "HP IR"))
                        gCamerasUnavailabled++;
                    gUsbCameraNames[cam_cnt&0x01] = String8((char*)&capability.card[0]);
                    LOGD("Camera %d name: %s", (cam_cnt&0x01), gUsbCameraNames[cam_cnt&0x01].string());
#endif
                } else {
                    camInfoTmp[cam_cnt&0x01].facing_info.facing = CAMERA_FACING_BACK;
                }  
				
				if ((cam_cnt&0x01) == 0)
				//默认前置摄像头
			        camInfoTmp[cam_cnt&0x01].facing_info.facing = CAMERA_FACING_FRONT ;
		        else
		         //默认后置置摄像头
			       camInfoTmp[cam_cnt&0x01].facing_info.facing = CAMERA_FACING_BACK;
			       :
			       :
			       :
			       :
			       :
			       :
				

你可能感兴趣的:(PX30-ANDROID8.1-USB前后置摄像头切换)