|
|
@ -160,6 +160,7 @@ int NdkCamera::open(const std::string& cameraId) {
|
|
|
|
DisplayDimension foundRes = disp;
|
|
|
|
DisplayDimension foundRes = disp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALOGD("Start ACameraManager_getCameraIdList");
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ACameraIdList *camera_id_list = 0;
|
|
|
|
ACameraIdList *camera_id_list = 0;
|
|
|
|
for (int retry = 0; retry < 2; retry++)
|
|
|
|
for (int retry = 0; retry < 2; retry++)
|
|
|
@ -194,6 +195,8 @@ int NdkCamera::open(const std::string& cameraId) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ALOGD("End ACameraManager_getCameraIdList");
|
|
|
|
|
|
|
|
|
|
|
|
if (!foundIt)
|
|
|
|
if (!foundIt)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
return 1;
|
|
|
@ -744,6 +747,7 @@ void NdkCamera::on_image(const unsigned char* nv21, int nv21_width, int nv21_hei
|
|
|
|
rotate_type = camera_facing == 0 ? 7 : 8;
|
|
|
|
rotate_type = camera_facing == 0 ? 7 : 8;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
cv::Mat nv21_rotated(h + h / 2, w, CV_8UC1);
|
|
|
|
cv::Mat nv21_rotated(h + h / 2, w, CV_8UC1);
|
|
|
|
ncnn::kanna_rotate_yuv420sp(nv21, nv21_width, nv21_height, nv21_rotated.data, w, h, rotate_type);
|
|
|
|
ncnn::kanna_rotate_yuv420sp(nv21, nv21_width, nv21_height, nv21_rotated.data, w, h, rotate_type);
|
|
|
|
|
|
|
|
|
|
|
@ -758,7 +762,16 @@ void NdkCamera::on_image(const unsigned char* nv21, int nv21_width, int nv21_hei
|
|
|
|
cv::Mat rgb(h, w, CV_8UC3);
|
|
|
|
cv::Mat rgb(h, w, CV_8UC3);
|
|
|
|
// ncnn::yuv420sp2rgb(nv21_rotated.data, w, h, rgb.data);
|
|
|
|
// ncnn::yuv420sp2rgb(nv21_rotated.data, w, h, rgb.data);
|
|
|
|
ncnn::yuv420sp2rgb_nv12(nv21_rotated.data, w, h, rgb.data);
|
|
|
|
ncnn::yuv420sp2rgb_nv12(nv21_rotated.data, w, h, rgb.data);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
w = nv21_width;
|
|
|
|
|
|
|
|
h = nv21_height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// nv21_rotated to rgb
|
|
|
|
|
|
|
|
cv::Mat rgb(h, w, CV_8UC3);
|
|
|
|
|
|
|
|
// ncnn::yuv420sp2rgb(nv21_rotated.data, w, h, rgb.data);
|
|
|
|
|
|
|
|
ncnn::yuv420sp2rgb_nv12(nv21, w, h, rgb.data);
|
|
|
|
|
|
|
|
#endif // 0
|
|
|
|
// cv::Mat rgb(h, w, CV_8UC3);
|
|
|
|
// cv::Mat rgb(h, w, CV_8UC3);
|
|
|
|
// ncnn::yuv420sp2rgb_nv12(nv21, w, h, rgb.data);
|
|
|
|
// ncnn::yuv420sp2rgb_nv12(nv21, w, h, rgb.data);
|
|
|
|
|
|
|
|
|
|
|
|