[RK3288][Android6.0] 调试笔记 --- USB Camera旋转图像方法

Platform: Rockchip
OS: Android 6.0
Kernel: 3.10.92

HAL层修改:

通过修改orientation的值。

int camera_get_number_of_cameras(void)
{
......
if (ptr != NULL) {
ptr++;
camInfoTmp[cam_cnt&0x01].facing_info.orientation = atoi(ptr);
} else {
ALOGE("null");
camInfoTmp[cam_cnt&0x01].facing_info.orientation = 0;
}
......
}

驱动层修改:

通过修改驱动对应的capability.

static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
{
......
case VIDIOC_QUERYCAP:
{
struct v4l2_capability *cap = arg;
......
strlcpy(cap->card, vdev->name, sizeof cap->card);
}
......

}


上层获取当前orientation:

int camera_get_camera_info(int camera_id, struct camera_info *info)
{

......

    info->facing = gCamInfos[camera_id].facing_info.facing;

......

}

你可能感兴趣的:(子类__Camera)