修复类型错误

serial
BlueMatthew 1 year ago
parent a245e485b2
commit c08323d429

@ -751,32 +751,35 @@ void NdkCamera::on_image(const unsigned char* nv21, int nv21_width, int nv21_hei
} }
else else
{ {
co = (camera_orientation - (m_params.orientation - 1) * 90 + 360) % 360; co = (camera_orientation + (m_params.orientation - 1) * 90 + 360) % 360;
} }
XYLOG(XYLOG_SEVERITY_DEBUG, "Orientation=%d Facing=%d", co, camera_facing);
// int co = 0; // int co = 0;
if (co == 0) if (co == 0)
{ {
w = nv21_width; w = nv21_width;
h = nv21_height; h = nv21_height;
rotate_type = camera_facing == 0 ? 2 : 1; rotate_type = camera_facing == ACAMERA_LENS_FACING_FRONT ? 2 : 1;
} }
else if (co == 90) else if (co == 90)
{ {
w = nv21_height; w = nv21_height;
h = nv21_width; h = nv21_width;
rotate_type = camera_facing == 0 ? 5 : 6; rotate_type = camera_facing == ACAMERA_LENS_FACING_FRONT ? 5 : 6;
} }
else if (co == 180) else if (co == 180)
{ {
w = nv21_width; w = nv21_width;
h = nv21_height; h = nv21_height;
rotate_type = camera_facing == 0 ? 4 : 3; rotate_type = camera_facing == ACAMERA_LENS_FACING_FRONT ? 4 : 3;
} }
else if (co == 270) else if (co == 270)
{ {
w = nv21_height; w = nv21_height;
h = nv21_width; h = nv21_width;
rotate_type = camera_facing == 0 ? 7 : 8; rotate_type = camera_facing == ACAMERA_LENS_FACING_FRONT ? 7 : 8;
} }
nv21_rotated.create(h + h / 2, w, CV_8UC1); nv21_rotated.create(h + h / 2, w, CV_8UC1);
@ -787,6 +790,7 @@ void NdkCamera::on_image(const unsigned char* nv21, int nv21_width, int nv21_hei
{ {
w = nv21_width; w = nv21_width;
h = nv21_height; h = nv21_height;
XYLOG(XYLOG_SEVERITY_DEBUG, "NO Orientation Facing=%d", camera_facing);
} }
// nv21_rotated to rgb // nv21_rotated to rgb

@ -73,8 +73,8 @@ public:
unsigned int nightMode : 1; unsigned int nightMode : 1;
unsigned int autoFocus : 1; unsigned int autoFocus : 1;
unsigned int autoExposure : 1; unsigned int autoExposure : 1;
unsigned int orientation:2; unsigned int orientation:3;
unsigned int reserved : 26; unsigned int reserved : 25;
unsigned int exposureTime; // ms unsigned int exposureTime; // ms
unsigned int sensibility; unsigned int sensibility;
}; };

Loading…
Cancel
Save