.. | .. |
---|
55 | 55 | static int eb_yuv_count = 0; |
---|
56 | 56 | static int eb_jpeg_count = 0; |
---|
57 | 57 | static int dq_yuv_count = 0; |
---|
| 58 | +static int cb_yuv_count = 0; |
---|
58 | 59 | const int output_counts = 10; |
---|
59 | 60 | #endif |
---|
60 | 61 | |
---|
.. | .. |
---|
64 | 65 | V4L2Stream* V4L2Stream::NewV4L2Stream( |
---|
65 | 66 | const int id, |
---|
66 | 67 | const std::string device_path, |
---|
67 | | - std::shared_ptr<CCameraConfig> pCameraCfg) { |
---|
68 | | - return new V4L2Stream(id, device_path, pCameraCfg); |
---|
| 68 | + std::shared_ptr<CCameraConfig> pCameraCfg, |
---|
| 69 | + int merge_status |
---|
| 70 | + ) { |
---|
| 71 | + return new V4L2Stream(id, device_path, pCameraCfg, merge_status); |
---|
69 | 72 | } |
---|
70 | 73 | |
---|
71 | 74 | V4L2Stream::V4L2Stream(const int id, const std::string device_path, |
---|
72 | | - std::shared_ptr<CCameraConfig> pCameraCfg) |
---|
| 75 | + std::shared_ptr<CCameraConfig> pCameraCfg, |
---|
| 76 | + int merge_status |
---|
| 77 | + ) |
---|
73 | 78 | : mCameraConfig(pCameraCfg), |
---|
74 | 79 | device_path_(std::move(device_path)), |
---|
75 | 80 | device_fd_(-1), |
---|
.. | .. |
---|
87 | 92 | HAL_LOG_ENTER(); |
---|
88 | 93 | int pipefd[2]; |
---|
89 | 94 | int ret = -1; |
---|
90 | | - if (device_path_.compare(MAIN_STREAM_PATH) == 0) { |
---|
| 95 | + if (merge_status) { |
---|
| 96 | + if (device_path_.compare(MAIN_MERGE_STREAM_PATH) == 0) { |
---|
| 97 | + device_ss_ = MAIN_STREAM; |
---|
| 98 | + } else if (device_path_.compare(SUB_0_MERGE_STREAM_PATH) == 0) { |
---|
| 99 | + device_ss_ = SUB_0_STREAM; |
---|
| 100 | + } |
---|
| 101 | + } else { |
---|
| 102 | + if (device_path_.compare(MAIN_STREAM_PATH) == 0) { |
---|
91 | 103 | device_ss_ = MAIN_STREAM; |
---|
92 | 104 | } else if (device_path_.compare(SUB_0_STREAM_PATH) == 0) { |
---|
93 | 105 | device_ss_ = SUB_0_STREAM; |
---|
.. | .. |
---|
95 | 107 | device_ss_ = MAIN_STREAM; |
---|
96 | 108 | } else if (device_path_.compare(SUB_0_FRONT_STREAM_PATH) == 0) { |
---|
97 | 109 | device_ss_ = SUB_0_STREAM; |
---|
| 110 | + } |
---|
98 | 111 | } |
---|
99 | 112 | |
---|
100 | 113 | memset(&jpeg_crop_rect, 0, sizeof(cam_crop_rect_t)); |
---|
| 114 | + reduce_call_num = 0; |
---|
| 115 | + reducecallnum_dst_width = 0; |
---|
| 116 | + reducecallnum_dst_height = 0; |
---|
| 117 | + reducecallnum_src_width = 0; |
---|
| 118 | + reducecallnum_src_height = 0; |
---|
101 | 119 | ret = pipe(pipefd); |
---|
102 | 120 | if (ret == -1) { |
---|
103 | 121 | ALOGE("V4L2Stream create pipe failed"); |
---|
.. | .. |
---|
116 | 134 | close(write_fd_); |
---|
117 | 135 | } |
---|
118 | 136 | |
---|
119 | | -int V4L2Stream::Connect() { |
---|
| 137 | +int V4L2Stream::Connect(int merge_status) { |
---|
120 | 138 | HAL_LOG_ENTER(); |
---|
121 | 139 | std::lock_guard<std::mutex> lock(connection_lock_); |
---|
122 | 140 | |
---|
.. | .. |
---|
146 | 164 | |
---|
147 | 165 | device_fd_ = fd; |
---|
148 | 166 | ++connection_count_; |
---|
| 167 | + |
---|
| 168 | + struct dma_merge picture_merge; |
---|
| 169 | + HAL_LOGE("bill merge_status = %d", merge_status); |
---|
| 170 | + if(device_id_ == 0 && merge_status) { |
---|
| 171 | + picture_merge.en = 1; |
---|
| 172 | + } else if(device_id_ == 0 && !merge_status) { |
---|
| 173 | + picture_merge.en = 2; |
---|
| 174 | + } else { |
---|
| 175 | + picture_merge.en = 0; |
---|
| 176 | + } |
---|
| 177 | + |
---|
| 178 | + HAL_LOGD("device_id_:%d picture_merge.en:%d", device_id_, picture_merge.en); |
---|
| 179 | + |
---|
| 180 | + if (TEMP_FAILURE_RETRY( |
---|
| 181 | + ioctl(fd, VIDIOC_SET_DMA_MERGE, &picture_merge)) != 0) { |
---|
| 182 | + HAL_LOGE("VIDIOC_SET_DMA_MERGE on %d error: %s.", |
---|
| 183 | + picture_merge.en, |
---|
| 184 | + strerror(errno)); |
---|
| 185 | + } |
---|
149 | 186 | |
---|
150 | 187 | HAL_LOGV("Detect camera stream %s, stream serial:%d.", |
---|
151 | 188 | device_path_.c_str(), device_ss_); |
---|
.. | .. |
---|
268 | 305 | if (getSingleCameraId() < 0) { |
---|
269 | 306 | mIspId = mAWIspApi->awIspGetIspId(mDevice_id); |
---|
270 | 307 | } |
---|
271 | | - if (mIspId >= 0) { |
---|
272 | | - mAWIspApi->awIspStart(mIspId); |
---|
273 | | - HAL_LOGD("ISP turned on."); |
---|
| 308 | + //if (mIspId >= 0) { |
---|
| 309 | + // mAWIspApi->awIspStart(mIspId); |
---|
| 310 | + // HAL_LOGD("ISP turned on."); |
---|
| 311 | + //} else { |
---|
| 312 | + // HAL_LOGE("ISP turned on failed!"); |
---|
| 313 | + //} |
---|
| 314 | + |
---|
| 315 | + if(device_id_ == 0 && |
---|
| 316 | + device_path_.compare(MAIN_MERGE_STREAM_PATH) == 0) { |
---|
| 317 | + mDevice_id = 0; |
---|
| 318 | + mIspId = mAWIspApi->awIspGetIspId(mDevice_id); |
---|
| 319 | + if (mIspId >= 0) { |
---|
| 320 | + mAWIspApi->awIspStart(mIspId); |
---|
| 321 | + HAL_LOGD("ISP turned on. mDevice_id = %d", mDevice_id); |
---|
| 322 | + } else { |
---|
| 323 | + HAL_LOGE("ISP turned on failed!"); |
---|
| 324 | + } |
---|
| 325 | + |
---|
| 326 | + } else if(device_id_ == 0 && |
---|
| 327 | + device_path_.compare(SUB_0_MERGE_STREAM_PATH) == 0) { |
---|
| 328 | + mDevice_id = 1; |
---|
| 329 | + mIspId = mAWIspApi->awIspGetIspId(mDevice_id); |
---|
| 330 | + if (mIspId >= 0) { |
---|
| 331 | + mAWIspApi->awIspStart(mIspId); |
---|
| 332 | + HAL_LOGD("ISP turned on. mDevice_id = %d", mDevice_id); |
---|
| 333 | + } else { |
---|
| 334 | + HAL_LOGE("ISP turned on failed!"); |
---|
| 335 | + } |
---|
| 336 | + |
---|
| 337 | + } else if(device_id_ == 1 && format_->GetMergeStreamFlag()) { |
---|
| 338 | + mDevice_id = 0; |
---|
| 339 | + mIspId = mAWIspApi->awIspGetIspId(mDevice_id); |
---|
| 340 | + if (mIspId >= 0) { |
---|
| 341 | + mAWIspApi->awIspStart(mIspId); |
---|
| 342 | + HAL_LOGD("ISP turned on. mDevice_id = %d", mDevice_id); |
---|
| 343 | + } else { |
---|
| 344 | + HAL_LOGE("ISP turned on failed!"); |
---|
| 345 | + } |
---|
| 346 | + |
---|
274 | 347 | } else { |
---|
275 | | - HAL_LOGE("ISP turned on failed!"); |
---|
276 | | - } |
---|
| 348 | + mIspId = mAWIspApi->awIspGetIspId(mDevice_id); |
---|
| 349 | + if (mIspId >= 0) { |
---|
| 350 | + mAWIspApi->awIspStart(mIspId); |
---|
| 351 | + HAL_LOGD("ISP turned on. mDevice_id = %d", mDevice_id); |
---|
| 352 | + } else { |
---|
| 353 | + HAL_LOGE("ISP turned on failed!"); |
---|
| 354 | + } |
---|
| 355 | + } |
---|
| 356 | + |
---|
277 | 357 | #endif |
---|
278 | 358 | |
---|
279 | 359 | return 0; |
---|
.. | .. |
---|
614 | 694 | s.r.width = cam_crop_rect.width; |
---|
615 | 695 | s.r.height = cam_crop_rect.height; |
---|
616 | 696 | |
---|
617 | | - ret = IoctlLocked(VIDIOC_S_SELECTION, &s); |
---|
618 | | - HAL_LOGV("ret:%d device_fd_:%d left:%d top:%d width:%d height:%d", |
---|
619 | | - ret, device_fd_, s.r.left, s.r.top, s.r.width, s.r.height); |
---|
620 | | - if (ret < 0) { |
---|
621 | | - HAL_LOGE("failed, %s", strerror(errno)); |
---|
622 | | - } else { |
---|
623 | | - HAL_LOGV("ok, %s", strerror(errno)); |
---|
| 697 | + if (mCameraConfig->supportReducecallnumSize()) { |
---|
| 698 | + HAL_LOGV("####SetCropRect supportReducecallnumSize!~"); |
---|
| 699 | + }else { |
---|
| 700 | + ret = IoctlLocked(VIDIOC_S_SELECTION, &s); |
---|
| 701 | + HAL_LOGV("ret:%d device_fd_:%d left:%d top:%d width:%d height:%d", |
---|
| 702 | + ret, device_fd_, s.r.left, s.r.top, s.r.width, s.r.height); |
---|
| 703 | + if (ret < 0) { |
---|
| 704 | + HAL_LOGE("failed, %s", strerror(errno)); |
---|
| 705 | + } else { |
---|
| 706 | + HAL_LOGV("ok, %s", strerror(errno)); |
---|
| 707 | + } |
---|
624 | 708 | } |
---|
625 | 709 | return ret; |
---|
626 | 710 | } |
---|
.. | .. |
---|
669 | 753 | return 0; |
---|
670 | 754 | } |
---|
671 | 755 | |
---|
672 | | -int V4L2Stream::SetParm(int mCapturemode) { |
---|
| 756 | +int V4L2Stream::SetParm(int mCapturemode, uint32_t width, uint32_t height) { |
---|
673 | 757 | HAL_LOG_ENTER(); |
---|
674 | 758 | |
---|
675 | 759 | struct v4l2_streamparm params; |
---|
676 | 760 | memset(¶ms, 0, sizeof(params)); |
---|
677 | 761 | |
---|
678 | 762 | params.parm.capture.timeperframe.numerator = 1; |
---|
679 | | - params.parm.capture.timeperframe.denominator = 30; |
---|
| 763 | + |
---|
| 764 | + |
---|
680 | 765 | params.parm.capture.reserved[0] = 0; |
---|
681 | 766 | params.type = V4L2_CAPTURE_TYPE; |
---|
682 | 767 | params.parm.capture.capturemode = mCapturemode; |
---|
| 768 | + |
---|
| 769 | + if (width * height > 2112*1568) { |
---|
| 770 | + HAL_LOGV("SetParm %dx%d",width,height); |
---|
| 771 | + params.parm.capture.timeperframe.denominator = 25; |
---|
| 772 | + } else { |
---|
| 773 | + params.parm.capture.timeperframe.denominator = 30; |
---|
| 774 | + } |
---|
| 775 | + if (width * height > 4000*3000) { |
---|
| 776 | + params.parm.capture.timeperframe.denominator = 24; |
---|
| 777 | + params.parm.capture.reserved[2] = 3; |
---|
| 778 | + } else { |
---|
| 779 | + if (device_id_ == 0 && |
---|
| 780 | + device_path_.compare(SUB_0_MERGE_STREAM_PATH) == 0) { |
---|
| 781 | + params.parm.capture.timeperframe.denominator = 24; |
---|
| 782 | + params.parm.capture.reserved[2] = 3; |
---|
| 783 | + } else { |
---|
| 784 | + params.parm.capture.reserved[2] = 0; |
---|
| 785 | + } |
---|
| 786 | + } |
---|
| 787 | + HAL_LOGI("params.parm.capture.timeperframe.denominator:%d reserved:%d", |
---|
| 788 | + params.parm.capture.timeperframe.denominator, params.parm.capture.reserved[2]); |
---|
683 | 789 | |
---|
684 | 790 | if (IoctlLocked(VIDIOC_S_PARM, ¶ms) < 0) { |
---|
685 | 791 | HAL_LOGE("S_PARM fails: %s", strerror(errno)); |
---|
.. | .. |
---|
800 | 906 | } |
---|
801 | 907 | |
---|
802 | 908 | int V4L2Stream::SetFormat(const StreamFormat& desired_format, |
---|
803 | | - uint32_t* result_max_buffers) { |
---|
| 909 | + uint32_t* result_max_buffers, |
---|
| 910 | + bool merge_stream_flag) { |
---|
804 | 911 | HAL_LOG_ENTER(); |
---|
805 | 912 | |
---|
806 | 913 | if (format_ && desired_format == *format_) { |
---|
.. | .. |
---|
856 | 963 | new_format.fmt.pix_mp.width = interpolation_src_width; |
---|
857 | 964 | new_format.fmt.pix_mp.height = interpolation_src_height; |
---|
858 | 965 | setFormatFlag = 1; |
---|
859 | | - } |
---|
| 966 | + } |
---|
| 967 | + |
---|
| 968 | + } |
---|
| 969 | + |
---|
| 970 | + if(mCameraConfig->supportReducecallnumSize()) |
---|
| 971 | + { |
---|
| 972 | + char * value; |
---|
| 973 | + value = mCameraConfig->supportReducecallnumSizeValue(); |
---|
| 974 | + parse_pair(value, &reducecallnum_src_width, &reducecallnum_src_height, 'x'); |
---|
| 975 | + |
---|
| 976 | + char *reduce_call_num_char; |
---|
| 977 | + reduce_call_num_char = mCameraConfig->ReduceCallNumValue(); |
---|
| 978 | + reduce_call_num = atoi(reduce_call_num_char); |
---|
| 979 | + |
---|
| 980 | + new_format.fmt.pix_mp.width = reducecallnum_src_width; |
---|
| 981 | + new_format.fmt.pix_mp.height = reducecallnum_src_height; |
---|
| 982 | + |
---|
| 983 | + struct buf_merge buf_merge; |
---|
| 984 | + buf_merge.en = 1; |
---|
| 985 | + buf_merge.buffer_num = reduce_call_num; |
---|
| 986 | + |
---|
| 987 | + if (IoctlLocked(VIDIOC_SET_BUFFER_MERGE, &buf_merge) < 0) { |
---|
| 988 | + HAL_LOGE("VIDIOC_SET_BUFFER_MERGE failed: %s", strerror(errno)); |
---|
| 989 | + return -ENODEV; |
---|
| 990 | + } |
---|
860 | 991 | } |
---|
861 | 992 | |
---|
862 | 993 | // TODO(b/29334616): When async, this will need to check if the stream |
---|
.. | .. |
---|
871 | 1002 | return -ENODEV; |
---|
872 | 1003 | } |
---|
873 | 1004 | |
---|
| 1005 | + if(mCameraConfig->supportReducecallnumSize()) |
---|
| 1006 | + { |
---|
| 1007 | + char * value1; |
---|
| 1008 | + value1 = mCameraConfig->defaultReducecallnumSizeValue(); |
---|
| 1009 | + parse_pair(value1, &reducecallnum_dst_width, &reducecallnum_dst_height, 'x'); |
---|
| 1010 | + |
---|
| 1011 | + new_format.fmt.pix_mp.width = reducecallnum_dst_width; |
---|
| 1012 | + new_format.fmt.pix_mp.height = reducecallnum_dst_height; |
---|
| 1013 | + } |
---|
| 1014 | + |
---|
874 | 1015 | // Check that the driver actually set to the requested values. |
---|
875 | | - if (desired_format != StreamFormat(new_format)) { |
---|
| 1016 | + if (desired_format != StreamFormat(new_format, merge_stream_flag)) { |
---|
876 | 1017 | HAL_LOGE("Device doesn't support desired stream configuration."); |
---|
877 | 1018 | } |
---|
878 | 1019 | |
---|
.. | .. |
---|
881 | 1022 | new_format.fmt.pix_mp.height = cur_height; |
---|
882 | 1023 | } |
---|
883 | 1024 | // Keep track of our new format. |
---|
884 | | - format_.reset(new StreamFormat(new_format)); |
---|
| 1025 | + format_.reset(new StreamFormat(new_format, merge_stream_flag)); |
---|
885 | 1026 | |
---|
886 | 1027 | // Format changed, request new buffers. |
---|
887 | 1028 | int res = RequestBuffers(*result_max_buffers); |
---|
.. | .. |
---|
1169 | 1310 | #if DBG_SAVE_OUTPUT |
---|
1170 | 1311 | char yuv_path[100]; |
---|
1171 | 1312 | dq_yuv_count = dq_yuv_count % output_counts; |
---|
1172 | | - sprintf(yuv_path, "/data/camera/dq_yuv_%d.bin", dq_yuv_count++); |
---|
| 1313 | + sprintf(yuv_path, "/data/camera/dq_yuv_%dx%d_%d.bin", |
---|
| 1314 | + format_->width(), |
---|
| 1315 | + format_->height(), |
---|
| 1316 | + dq_yuv_count++); |
---|
1173 | 1317 | int copy_size = ALIGN_16B(format_->width())*ALIGN_16B(format_->height())*3/2; |
---|
1174 | 1318 | saveBuffers(yuv_path, *src_addr_, copy_size, true); |
---|
1175 | 1319 | #endif |
---|
.. | .. |
---|
1264 | 1408 | } |
---|
1265 | 1409 | } |
---|
1266 | 1410 | |
---|
1267 | | - memcpy(dst_addr_ycbcr->y, src_addr, width*height); |
---|
1268 | | - memcpy(dst_addr_ycbcr->cr, |
---|
1269 | | - reinterpret_cast<char*>(src_addr) + width*height, width*height/2); |
---|
| 1411 | + if(mCameraConfig->supportReducecallnumSize()) |
---|
| 1412 | + { |
---|
| 1413 | + int i,cur_width,cur_height; |
---|
| 1414 | + cur_width = reducecallnum_src_width; |
---|
| 1415 | + cur_height = reducecallnum_src_height; |
---|
| 1416 | + |
---|
| 1417 | + for(i = 0 ;i < reduce_call_num; i++) |
---|
| 1418 | + { |
---|
| 1419 | + memcpy((char *)dst_addr_ycbcr->y + i*(cur_width * cur_height), |
---|
| 1420 | + (char *)src_addr + i*(cur_width * cur_height * 3 / 2), |
---|
| 1421 | + cur_width*cur_height); |
---|
| 1422 | + /*memcpy((char *)dst_addr_ycbcr->cr + i*(cur_width * cur_height / 2), |
---|
| 1423 | + (char *)src_addr + (i + 1)*(cur_width * cur_height) + i * (cur_width*cur_height / 2), |
---|
| 1424 | + cur_width*cur_height / 2);*/ |
---|
| 1425 | + } |
---|
| 1426 | + memcpy(dst_addr_ycbcr->cr, (char*)src_addr + width*height, width*height/2); |
---|
| 1427 | + } |
---|
| 1428 | + else { |
---|
| 1429 | + memcpy(dst_addr_ycbcr->y, src_addr, width*height); |
---|
| 1430 | + memcpy(dst_addr_ycbcr->cr, (char*)src_addr + width*height, width*height/2); |
---|
| 1431 | + } |
---|
| 1432 | + |
---|
| 1433 | +#if DBG_SAVE_OUTPUT |
---|
| 1434 | + char yuv_path[100]; |
---|
| 1435 | + sprintf(yuv_path, "/data/camera/yuv_preview_%dx%d_%d.bin", |
---|
| 1436 | + width, height, |
---|
| 1437 | + (cb_yuv_count++) % 10); |
---|
| 1438 | + int y_size = width * height; |
---|
| 1439 | + int cr_size = width * height/2; |
---|
| 1440 | + saveBuffers(yuv_path, |
---|
| 1441 | + dst_addr_ycbcr->y, |
---|
| 1442 | + dst_addr_ycbcr->cr, |
---|
| 1443 | + y_size, |
---|
| 1444 | + cr_size, |
---|
| 1445 | + true); |
---|
| 1446 | +#endif |
---|
| 1447 | + |
---|
1270 | 1448 | return 0; |
---|
1271 | 1449 | } |
---|
1272 | 1450 | |
---|
.. | .. |
---|
1372 | 1550 | if (mCameraConfig->supportInterpolationSize()) { |
---|
1373 | 1551 | jpeg_enc.quality = 100; |
---|
1374 | 1552 | sjpegInfo.quality = 100; |
---|
1375 | | - } else { |
---|
| 1553 | + } else if (format_->width() * format_->height() > 3264 * 2448) { |
---|
| 1554 | + jpeg_enc.quality = 100; |
---|
| 1555 | + sjpegInfo.quality = 100; |
---|
| 1556 | + } |
---|
| 1557 | + else { |
---|
1376 | 1558 | sjpegInfo.quality = jpeg_enc.quality; |
---|
1377 | 1559 | } |
---|
1378 | 1560 | |
---|
.. | .. |
---|
1509 | 1691 | return false; |
---|
1510 | 1692 | } |
---|
1511 | 1693 | |
---|
| 1694 | + int isp_3a_param_size = 0; |
---|
| 1695 | + int isp_debug_msg_size = 0; |
---|
| 1696 | + |
---|
1512 | 1697 | camera3_jpeg_3a_blob_t jpeg_3a_header; |
---|
1513 | 1698 | jpeg_3a_header.jpeg_3a_header_id = CAMERA3_JPEG_3A_PARAM_BLOB_ID; |
---|
1514 | | - jpeg_3a_header.jpeg_3a_size = sizeof(camera3_jpeg_3a_blob_t) + |
---|
1515 | | - ISP_3A_PARAM_SIZE; |
---|
1516 | | - ALOGV("3a jpeg_3a_size = %d sizeof struct = %zu", |
---|
1517 | | - jpeg_3a_header.jpeg_3a_size, sizeof(camera3_jpeg_3a_blob_t)); |
---|
1518 | 1699 | strncpy(jpeg_3a_header.magic_str, ISP_DEBUG_MAGIC_STR, 8); |
---|
1519 | 1700 | |
---|
1520 | 1701 | camera3_jpeg_isp_msg_blob_t jpeg_isp_msg_header; |
---|
1521 | 1702 | jpeg_isp_msg_header.jpeg_isp_msg_header_id = CAMERA3_JPEG_ISP_MSG_BLOB_ID; |
---|
1522 | | - jpeg_isp_msg_header.jpeg_isp_msg_size = |
---|
1523 | | - sizeof(camera3_jpeg_isp_msg_blob_t) + ISP_DEBUG_MSG_SIZE; |
---|
1524 | | - ALOGV("isp jpeg_isp_size = %d sizeof struct = %zu", |
---|
1525 | | - jpeg_isp_msg_header.jpeg_isp_msg_size, |
---|
1526 | | - sizeof(camera3_jpeg_isp_msg_blob_t)); |
---|
1527 | 1703 | strncpy(jpeg_isp_msg_header.magic_str, ISP_DEBUG_MAGIC_STR, 8); |
---|
1528 | 1704 | |
---|
1529 | 1705 | camera3_jpeg_blob_t jpegHeader; |
---|
1530 | 1706 | jpegHeader.jpeg_blob_id = CAMERA3_JPEG_BLOB_ID; |
---|
1531 | | - jpegHeader.jpeg_size = |
---|
1532 | | - bufSize + jpeg_3a_header.jpeg_3a_size + |
---|
1533 | | - jpeg_isp_msg_header.jpeg_isp_msg_size; |
---|
1534 | 1707 | |
---|
1535 | 1708 | unsigned long jpeg_eof_offset = |
---|
1536 | 1709 | (unsigned long)(mJpegBufferSizes - (unsigned long)sizeof(jpegHeader)); |
---|
1537 | 1710 | char *jpeg_eof = reinterpret_cast<char *>(jpeg_buf) + jpeg_eof_offset; |
---|
1538 | | - memcpy(jpeg_eof, &jpegHeader, sizeof(jpegHeader)); |
---|
1539 | 1711 | |
---|
1540 | 1712 | char *jpeg_isp_3a_params = reinterpret_cast<char *>(jpeg_buf + bufSize); |
---|
| 1713 | + isp_3a_param_size = |
---|
| 1714 | + mAWIspApi->awIspGet3AParameters(reinterpret_cast<void*>( |
---|
| 1715 | + jpeg_isp_3a_params + sizeof(jpeg_3a_header))); |
---|
| 1716 | + jpeg_3a_header.jpeg_3a_size = sizeof(camera3_jpeg_3a_blob_t) + |
---|
| 1717 | + isp_3a_param_size; |
---|
1541 | 1718 | memcpy(jpeg_isp_3a_params, &jpeg_3a_header, sizeof(jpeg_3a_header)); |
---|
1542 | | - mAWIspApi->awIspGet3AParameters(reinterpret_cast<void*>( |
---|
1543 | | - jpeg_isp_3a_params + sizeof(jpeg_3a_header))); |
---|
1544 | 1719 | |
---|
1545 | 1720 | char *jpeg_isp_debug_msg = reinterpret_cast<char *>(jpeg_buf + bufSize + |
---|
1546 | 1721 | jpeg_3a_header.jpeg_3a_size); |
---|
| 1722 | + isp_debug_msg_size = |
---|
| 1723 | + mAWIspApi->awIspGetDebugMessage(reinterpret_cast<void*>( |
---|
| 1724 | + jpeg_isp_debug_msg + sizeof(jpeg_isp_msg_header))); |
---|
| 1725 | + jpeg_isp_msg_header.jpeg_isp_msg_size = |
---|
| 1726 | + sizeof(camera3_jpeg_isp_msg_blob_t) + isp_debug_msg_size; |
---|
1547 | 1727 | memcpy(jpeg_isp_debug_msg, &jpeg_isp_msg_header, sizeof(jpeg_isp_msg_header)); |
---|
1548 | | - mAWIspApi->awIspGetDebugMessage(reinterpret_cast<void*>( |
---|
1549 | | - jpeg_isp_debug_msg + sizeof(jpeg_isp_msg_header))); |
---|
| 1728 | + |
---|
| 1729 | + jpegHeader.jpeg_size = |
---|
| 1730 | + bufSize + jpeg_3a_header.jpeg_3a_size + |
---|
| 1731 | + jpeg_isp_msg_header.jpeg_isp_msg_size; |
---|
| 1732 | + memcpy(jpeg_eof, &jpegHeader, sizeof(jpegHeader)); |
---|
| 1733 | + |
---|
| 1734 | + HAL_LOGV("####jpeg_size:%d jpeg_3a_size:%d jpeg_isp_msg_size:%d", |
---|
| 1735 | + jpegHeader.jpeg_size,jpeg_3a_header.jpeg_3a_size, |
---|
| 1736 | + jpeg_isp_msg_header.jpeg_isp_msg_size); |
---|
1550 | 1737 | |
---|
1551 | 1738 | return 0; |
---|
1552 | 1739 | } |
---|