Lines Matching refs:mHalCamCtrl
91 format = mHalCamCtrl->getPreviewFormatInfo().Hal_format;
106 mHalCamCtrl->mPreviewMemoryLock.lock();
107 mHalCamCtrl->mPreviewMemory.buffer_count = kPreviewBufferCount + numMinUndequeuedBufs;
108 if(mHalCamCtrl->isZSLMode()) {
109 if(mHalCamCtrl->getZSLQueueDepth() > numMinUndequeuedBufs)
110 mHalCamCtrl->mPreviewMemory.buffer_count +=
111 mHalCamCtrl->getZSLQueueDepth() - numMinUndequeuedBufs;
113 err = mPreviewWindow->set_buffer_count(mPreviewWindow, mHalCamCtrl->mPreviewMemory.buffer_count );
156 for (int cnt = 0; cnt < mHalCamCtrl->mPreviewMemory.buffer_count; cnt++) {
159 &mHalCamCtrl->mPreviewMemory.buffer_handle[cnt],
160 &mHalCamCtrl->mPreviewMemory.stride[cnt]);
162 ALOGV("%s: dequeue buf hdl =%p", __func__, *mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]);
164 mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]);
166 ALOGV("%s: camera call genlock_lock, hdl=%p", __FUNCTION__, (*mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]));
167 if (GENLOCK_NO_ERROR != genlock_lock_buffer((native_handle_t *)(*mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]),
170 mHalCamCtrl->mPreviewMemory.local_flag[cnt] = BUFFER_UNLOCKED;
171 //mHalCamCtrl->mPreviewMemoryLock.unlock();
174 ALOGV("%s: genlock_lock_buffer hdl =%p", __FUNCTION__, *mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]);
175 mHalCamCtrl->mPreviewMemory.local_flag[cnt] = BUFFER_LOCKED;
178 mHalCamCtrl->mPreviewMemory.local_flag[cnt] = BUFFER_NOT_OWNED;
182 ALOGV("%s: dequeue buf: %p\n", __func__, mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]);
189 if (BUFFER_LOCKED == mHalCamCtrl->mPreviewMemory.local_flag[i]) {
192 (*(mHalCamCtrl->mPreviewMemory.buffer_handle[i])))) {
193 ALOGE("%s: genlock_unlock_buffer failed: hdl =%p", __FUNCTION__, (*(mHalCamCtrl->mPreviewMemory.buffer_handle[i])) );
194 //mHalCamCtrl->mPreviewMemoryLock.unlock();
197 mHalCamCtrl->mPreviewMemory.local_flag[i] = BUFFER_UNLOCKED;
200 if( mHalCamCtrl->mPreviewMemory.local_flag[i] != BUFFER_NOT_OWNED) {
202 mHalCamCtrl->mPreviewMemory.buffer_handle[i]);
204 mHalCamCtrl->mPreviewMemory.local_flag[i] = BUFFER_NOT_OWNED;
205 ALOGV("%s: cancel_buffer: hdl =%p", __func__, (*mHalCamCtrl->mPreviewMemory.buffer_handle[i]));
206 mHalCamCtrl->mPreviewMemory.buffer_handle[i] = NULL;
208 memset(&mHalCamCtrl->mPreviewMemory, 0, sizeof(mHalCamCtrl->mPreviewMemory));
212 mHalCamCtrl->mPreviewMemory.private_buffer_handle[cnt] =
213 (struct private_handle_t *)(*mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]);
215 mHalCamCtrl->mPreviewMemory.main_ion_fd[cnt] = open("/dev/ion", O_RDONLY);
216 if (mHalCamCtrl->mPreviewMemory.main_ion_fd[cnt] < 0) {
219 mHalCamCtrl->mPreviewMemory.ion_info_fd[cnt].fd =
220 mHalCamCtrl->mPreviewMemory.private_buffer_handle[cnt]->fd;
221 if (ioctl(mHalCamCtrl->mPreviewMemory.main_ion_fd[cnt],
222 ION_IOC_IMPORT, &mHalCamCtrl->mPreviewMemory.ion_info_fd[cnt]) < 0)
226 mHalCamCtrl->mPreviewMemory.camera_memory[cnt] =
227 mHalCamCtrl->mGetMemory(mHalCamCtrl->mPreviewMemory.private_buffer_handle[cnt]->fd,
228 mHalCamCtrl->mPreviewMemory.private_buffer_handle[cnt]->size, 1, (void *)this);
230 cnt, mHalCamCtrl->mPreviewMemory.private_buffer_handle[cnt]->fd,
231 mHalCamCtrl->mPreviewMemory.private_buffer_handle[cnt]->size,
232 mHalCamCtrl->mPreviewMemory.private_buffer_handle[cnt]->offset);
237 if( mHalCamCtrl->mPreviewMemory.local_flag[i] != BUFFER_NOT_OWNED) {
238 err = mPreviewWindow->cancel_buffer(mPreviewWindow, mHalCamCtrl->mPreviewMemory.buffer_handle[i]);
240 mHalCamCtrl->mPreviewMemory.local_flag[i] = BUFFER_NOT_OWNED;
243 memset(&mHalCamCtrl->mMetadata, 0, sizeof(mHalCamCtrl->mMetadata));
244 memset(mHalCamCtrl->mFace, 0, sizeof(mHalCamCtrl->mFace));
249 mHalCamCtrl->mPreviewMemoryLock.unlock();
260 mHalCamCtrl->mPreviewMemoryLock.lock();
261 for (int cnt = 0; cnt < mHalCamCtrl->mPreviewMemory.buffer_count; cnt++) {
262 if (cnt < mHalCamCtrl->mPreviewMemory.buffer_count) {
263 if (NO_ERROR != mHalCamCtrl->sendUnMappingBuf(MSM_V4L2_EXT_CAPTURE_MODE_PREVIEW, cnt, mCameraId,
267 if(mHalCamCtrl->isZSLMode()) {
268 if (NO_ERROR != mHalCamCtrl->sendUnMappingBuf(MSM_V4L2_EXT_CAPTURE_MODE_THUMBNAIL, cnt, mCameraId,
275 mHalCamCtrl->mPreviewMemory.camera_memory[cnt]->release(mHalCamCtrl->mPreviewMemory.camera_memory[cnt]);
278 ion_handle.handle = mHalCamCtrl->mPreviewMemory.ion_info_fd[cnt].handle;
279 if (ioctl(mHalCamCtrl->mPreviewMemory.main_ion_fd[cnt], ION_IOC_FREE, &ion_handle)
282 close(mHalCamCtrl->mPreviewMemory.main_ion_fd[cnt]);
284 if (BUFFER_LOCKED == mHalCamCtrl->mPreviewMemory.local_flag[cnt]) {
287 (*(mHalCamCtrl->mPreviewMemory.buffer_handle[cnt])))) {
288 ALOGE("%s: genlock_unlock_buffer failed, handle =%p", __FUNCTION__, (*(mHalCamCtrl->mPreviewMemory.buffer_handle[cnt])));
290 //mHalCamCtrl->mPreviewMemoryLock.unlock();
294 ALOGV("%s: genlock_unlock_buffer, handle =%p", __FUNCTION__, (*(mHalCamCtrl->mPreviewMemory.buffer_handle[cnt])));
295 mHalCamCtrl->mPreviewMemory.local_flag[cnt] = BUFFER_UNLOCKED;
298 if( mHalCamCtrl->mPreviewMemory.local_flag[cnt] != BUFFER_NOT_OWNED) {
299 err = mPreviewWindow->cancel_buffer(mPreviewWindow, mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]);
300 ALOGV("%s: cancel_buffer: hdl =%p", __func__, (*mHalCamCtrl->mPreviewMemory.buffer_handle[cnt]));
302 mHalCamCtrl->mPreviewMemory.local_flag[cnt] = BUFFER_NOT_OWNED;
312 mHalCamCtrl->mPreviewMemoryLock.unlock();
313 memset(&mHalCamCtrl->mPreviewMemory, 0, sizeof(mHalCamCtrl->mPreviewMemory));
335 mHalCamCtrl->mPreviewMemoryLock.lock();
336 mHalCamCtrl->mNoDispPreviewMemory.buffer_count = kPreviewBufferCount;
337 if(mHalCamCtrl->isZSLMode()) {
338 if(mHalCamCtrl->getZSLQueueDepth() > kPreviewBufferCount - 3)
339 mHalCamCtrl->mNoDispPreviewMemory.buffer_count =
340 mHalCamCtrl->getZSLQueueDepth() + 3;
354 if (mHalCamCtrl->initHeapMem(&mHalCamCtrl->mNoDispPreviewMemory,
355 mHalCamCtrl->mNoDispPreviewMemory.buffer_count,
362 memset(&mHalCamCtrl->mMetadata, 0, sizeof(mHalCamCtrl->mMetadata));
363 memset(mHalCamCtrl->mFace, 0, sizeof(mHalCamCtrl->mFace));
368 mHalCamCtrl->mPreviewMemoryLock.unlock();
381 mHalCamCtrl->mPreviewMemoryLock.lock();
382 for (int cnt = 0; cnt < mHalCamCtrl->mNoDispPreviewMemory.buffer_count; cnt++) {
383 if (cnt < mHalCamCtrl->mNoDispPreviewMemory.buffer_count) {
384 if (NO_ERROR != mHalCamCtrl->sendUnMappingBuf(MSM_V4L2_EXT_CAPTURE_MODE_PREVIEW,
388 if(mHalCamCtrl->isZSLMode()) {
389 if (NO_ERROR != mHalCamCtrl->sendUnMappingBuf(MSM_V4L2_EXT_CAPTURE_MODE_THUMBNAIL, cnt, mCameraId,
396 mHalCamCtrl->releaseHeapMem(&mHalCamCtrl->mNoDispPreviewMemory);
397 memset(&mHalCamCtrl->mNoDispPreviewMemory, 0, sizeof(mHalCamCtrl->mNoDispPreviewMemory));
403 mHalCamCtrl->mPreviewMemoryLock.unlock();
410 camera_memory_t *data = mHalCamCtrl->mGetMemory(-1, 1, 1, NULL);
416 memset(mHalCamCtrl->mFace, 0, sizeof(mHalCamCtrl->mFace));
417 mHalCamCtrl->mMetadata.faces = mHalCamCtrl->mFace;
418 mHalCamCtrl->mMetadata.number_of_faces = roi.d.hdr.num_face_detected;
419 if(mHalCamCtrl->mMetadata.number_of_faces > MAX_ROI)
420 mHalCamCtrl->mMetadata.number_of_faces = MAX_ROI;
423 if (mHalCamCtrl->mMetadata.number_of_faces == 0) {
425 mHalCamCtrl->mCallbackLock.lock();
426 camera_data_callback pcb = mHalCamCtrl->mDataCb;
427 mHalCamCtrl->mCallbackLock.unlock();
429 if (pcb && (mHalCamCtrl->mMsgEnabled & CAMERA_MSG_PREVIEW_METADATA)){
431 pcb(CAMERA_MSG_PREVIEW_METADATA, data, 0, &mHalCamCtrl->mMetadata, mHalCamCtrl->mCallbackCookie);
441 if (idx >= mHalCamCtrl->mMetadata.number_of_faces) {
443 ALOGE("%s: idx %d out of boundary %d", __func__, idx, mHalCamCtrl->mMetadata.number_of_faces);
447 mHalCamCtrl->mFace[idx].id = roi.d.data.face.id;
448 mHalCamCtrl->mFace[idx].score = roi.d.data.face.score;
451 mHalCamCtrl->mFace[idx].rect[0] =
452 roi.d.data.face.face_boundary.x*2000/mHalCamCtrl->mDimension.display_width - 1000;
454 mHalCamCtrl->mFace[idx].rect[1] =
455 roi.d.data.face.face_boundary.y*2000/mHalCamCtrl->mDimension.display_height - 1000;
457 mHalCamCtrl->mFace[idx].rect[2] = mHalCamCtrl->mFace[idx].rect[0] +
458 roi.d.data.face.face_boundary.dx*2000/mHalCamCtrl->mDimension.display_width;
460 mHalCamCtrl->mFace[idx].rect[3] = mHalCamCtrl->mFace[idx].rect[1] +
461 roi.d.data.face.face_boundary.dy*2000/mHalCamCtrl->mDimension.display_height;
464 mHalCamCtrl->mFace[idx].left_eye[0] =
465 roi.d.data.face.left_eye_center[0]*2000/mHalCamCtrl->mDimension.display_width - 1000;
466 mHalCamCtrl->mFace[idx].left_eye[1] =
467 roi.d.data.face.left_eye_center[1]*2000/mHalCamCtrl->mDimension.display_height - 1000;
470 mHalCamCtrl->mFace[idx].right_eye[0] =
471 roi.d.data.face.right_eye_center[0]*2000/mHalCamCtrl->mDimension.display_width - 1000;
472 mHalCamCtrl->mFace[idx].right_eye[1] =
473 roi.d.data.face.right_eye_center[1]*2000/mHalCamCtrl->mDimension.display_height - 1000;
476 mHalCamCtrl->mFace[idx].mouth[0] =
477 roi.d.data.face.mouth_center[0]*2000/mHalCamCtrl->mDimension.display_width - 1000;
478 mHalCamCtrl->mFace[idx].mouth[1] =
479 roi.d.data.face.mouth_center[1]*2000/mHalCamCtrl->mDimension.display_height - 1000;
481 mHalCamCtrl->mFace[idx].smile_degree = roi.d.data.face.smile_degree;
482 mHalCamCtrl->mFace[idx].smile_score = roi.d.data.face.smile_confidence;
483 mHalCamCtrl->mFace[idx].blink_detected = roi.d.data.face.blink_detected;
484 mHalCamCtrl->mFace[idx].face_recognised = roi.d.data.face.is_face_recognised;
485 mHalCamCtrl->mFace[idx].gaze_angle = roi.d.data.face.gaze_angle;
489 mHalCamCtrl->mFace[idx].updown_dir = roi.d.data.face.updown_dir*2;
490 mHalCamCtrl->mFace[idx].leftright_dir = roi.d.data.face.leftright_dir*2;
491 mHalCamCtrl->mFace[idx].roll_dir = roi.d.data.face.roll_dir*2;
493 mHalCamCtrl->mFace[idx].leye_blink = roi.d.data.face.left_blink;
494 mHalCamCtrl->mFace[idx].reye_blink = roi.d.data.face.right_blink;
495 mHalCamCtrl->mFace[idx].left_right_gaze = roi.d.data.face.left_right_gaze;
496 mHalCamCtrl->mFace[idx].top_bottom_gaze = roi.d.data.face.top_bottom_gaze;
498 mHalCamCtrl->mFace[idx].rect[0], mHalCamCtrl->mFace[idx].rect[1],
499 mHalCamCtrl->mFace[idx].rect[2], mHalCamCtrl->mFace[idx].rect[3],
500 mHalCamCtrl->mFace[idx].left_eye[0], mHalCamCtrl->mFace[idx].left_eye[1],
501 mHalCamCtrl->mFace[idx].right_eye[0], mHalCamCtrl->mFace[idx].right_eye[1],
502 mHalCamCtrl->mFace[idx].mouth[0], mHalCamCtrl->mFace[idx].mouth[1],
503 mHalCamCtrl->mFace[idx].smile_degree, mHalCamCtrl->mFace[idx].smile_score,
504 mHalCamCtrl->mFace[idx].face_recognised);
506 mHalCamCtrl->mFace[idx].gaze_angle, mHalCamCtrl->mFace[idx].left_right_gaze,
507 mHalCamCtrl->mFace[idx].top_bottom_gaze, mHalCamCtrl->mFace[idx].updown_dir,
508 mHalCamCtrl->mFace[idx].leftright_dir, mHalCamCtrl->mFace[idx].roll_dir,
509 mHalCamCtrl->mFace[idx].blink_detected,
510 mHalCamCtrl->mFace[idx].leye_blink, mHalCamCtrl->mFace[idx].reye_blink);
515 if (mNumFDRcvd == mHalCamCtrl->mMetadata.number_of_faces) {
516 mHalCamCtrl->mCallbackLock.lock();
517 camera_data_callback pcb = mHalCamCtrl->mDataCb;
518 mHalCamCtrl->mCallbackLock.unlock();
520 if (pcb && (mHalCamCtrl->mMsgEnabled & CAMERA_MSG_PREVIEW_METADATA)){
521 ALOGV("%s: Face detection RIO callback with %d faces detected (score=%d)", __func__, mNumFDRcvd, mHalCamCtrl->mFace[idx].score);
522 pcb(CAMERA_MSG_PREVIEW_METADATA, data, 0, &mHalCamCtrl->mMetadata, mHalCamCtrl->mCallbackCookie);
546 memset(&mHalCamCtrl->mMetadata, 0, sizeof(camera_frame_metadata_t));
547 mHalCamCtrl->mPreviewMemoryLock.lock();
548 memset(&mHalCamCtrl->mPreviewMemory, 0, sizeof(mHalCamCtrl->mPreviewMemory));
549 mHalCamCtrl->mPreviewMemoryLock.unlock();
574 mHalCamCtrl->mPreviewMemoryLock.lock();
576 this->mDisplayStreamBuf.num = mHalCamCtrl->mPreviewMemory.buffer_count;
596 if (mHalCamCtrl->mPreviewMemory.private_buffer_handle[i] == NULL)
598 mDisplayStreamBuf.frame[i].fd = mHalCamCtrl->mPreviewMemory.private_buffer_handle[i]->fd;
602 mHalCamCtrl->mPreviewMemory.addr_offset[i] =
603 mHalCamCtrl->mPreviewMemory.private_buffer_handle[i]->offset;
605 (long unsigned int)mHalCamCtrl->mPreviewMemory.camera_memory[i]->data;
606 mDisplayStreamBuf.frame[i].ion_alloc.len = mHalCamCtrl->mPreviewMemory.private_buffer_handle[i]->size;
607 mDisplayStreamBuf.frame[i].ion_dev_fd = mHalCamCtrl->mPreviewMemory.main_ion_fd[i];
608 mDisplayStreamBuf.frame[i].fd_data = mHalCamCtrl->mPreviewMemory.ion_info_fd[i];
612 mHalCamCtrl->mPreviewMemory.private_buffer_handle[i]->size,
614 mHalCamCtrl->mPreviewMemory.addr_offset[i],
617 ret = mHalCamCtrl->sendMappingBuf(
621 mHalCamCtrl->mPreviewMemory.private_buffer_handle[i]->size,
628 if(mHalCamCtrl->isZSLMode()) {
629 ret = mHalCamCtrl->sendMappingBuf(
633 mHalCamCtrl->mPreviewMemory.private_buffer_handle[i]->size,
641 mDisplayBuf.preview.buf.mp[i].frame_offset = mHalCamCtrl->mPreviewMemory.addr_offset[i];
671 mHalCamCtrl->mPreviewMemoryLock.unlock();
676 mHalCamCtrl->mPreviewMemoryLock.unlock();
697 memset(&mHalCamCtrl->mMetadata, 0, sizeof(camera_frame_metadata_t));
698 mHalCamCtrl->mPreviewMemoryLock.lock();
699 memset(&mHalCamCtrl->mNoDispPreviewMemory, 0, sizeof(mHalCamCtrl->mNoDispPreviewMemory));
700 mHalCamCtrl->mPreviewMemoryLock.unlock();
723 mHalCamCtrl->mPreviewMemoryLock.lock();
724 this->mDisplayStreamBuf.num = mHalCamCtrl->mNoDispPreviewMemory.buffer_count;
743 if (mHalCamCtrl->mNoDispPreviewMemory.camera_memory[i] == NULL)
745 mDisplayStreamBuf.frame[i].fd = mHalCamCtrl->mNoDispPreviewMemory.fd[i];
750 (long unsigned int)mHalCamCtrl->mNoDispPreviewMemory.camera_memory[i]->data;
751 mDisplayStreamBuf.frame[i].ion_dev_fd = mHalCamCtrl->mNoDispPreviewMemory.main_ion_fd[i];
752 mDisplayStreamBuf.frame[i].fd_data = mHalCamCtrl->mNoDispPreviewMemory.ion_info_fd[i];
760 if (NO_ERROR != mHalCamCtrl->sendMappingBuf(
764 mHalCamCtrl->mNoDispPreviewMemory.size,
769 if(mHalCamCtrl->isZSLMode()) {
770 if (NO_ERROR != mHalCamCtrl->sendMappingBuf(
774 mHalCamCtrl->mNoDispPreviewMemory.size,
810 mHalCamCtrl->mPreviewMemoryLock.unlock();
845 status_t ret = cam_config_get_parm(mHalCamCtrl->mCameraId,
881 if(mHalCamCtrl==NULL) {
887 if(mHalCamCtrl->mPauseFramedispatch) {
893 mHalCamCtrl->mCallbackLock.lock();
894 camera_data_timestamp_callback rcb = mHalCamCtrl->mDataCbTimestamp;
895 void *rdata = mHalCamCtrl->mCallbackCookie;
896 mHalCamCtrl->mCallbackLock.unlock();
905 if (UNLIKELY(mHalCamCtrl->mDebugFps)) {
906 mHalCamCtrl->debugShowPreviewFPS();
909 mHalCamCtrl->dumpFrameToFile(frame->def.frame, HAL_DUMP_FRM_PREVIEW);
911 mHalCamCtrl->mPreviewMemoryLock.lock();
915 mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]);
918 if (BUFFER_LOCKED == mHalCamCtrl->mPreviewMemory.local_flag[frame->def.idx]) {
919 ALOGV("%s: genlock_unlock_buffer hdl =%p", __FUNCTION__, (*mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]));
921 (*mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]))) {
923 //mHalCamCtrl->mPreviewMemoryLock.unlock();
926 mHalCamCtrl->mPreviewMemory.local_flag[frame->def.idx] = BUFFER_UNLOCKED;
930 mHalCamCtrl->mPreviewMemoryLock.unlock();
943 if (mHalCamCtrl->cache_ops(ion_fd, &cache_inv_data,
951 const char *str = mHalCamCtrl->mParameters.get(
959 (buffer_handle_t *)mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]);
969 (buffer_handle_t *)mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]);
972 (buffer_handle_t *)mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]);
975 (buffer_handle_t *)mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]);
978 (buffer_handle_t *)mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]);
983 ALOGV("%s: enqueue_buffer hdl=%p", __func__, *mHalCamCtrl->mPreviewMemory.buffer_handle[frame->def.idx]);
984 mHalCamCtrl->mPreviewMemory.local_flag[frame->def.idx] = BUFFER_NOT_OWNED;
993 for(i = 0; i < mHalCamCtrl->mPreviewMemory.buffer_count; i++) {
994 if(mHalCamCtrl->mPreviewMemory.buffer_handle[i] == buffer_handle) {
995 mHalCamCtrl->mPreviewMemory.local_flag[i] = BUFFER_UNLOCKED;
999 if (i < mHalCamCtrl->mPreviewMemory.buffer_count ) {
1005 //mHalCamCtrl->mPreviewMemoryLock.unlock();
1008 mHalCamCtrl->mPreviewMemory.local_flag[i] = BUFFER_LOCKED;
1021 mHalCamCtrl->mPreviewMemoryLock.unlock();
1023 mHalCamCtrl->mCallbackLock.lock();
1024 camera_data_callback pcb = mHalCamCtrl->mDataCb;
1025 mHalCamCtrl->mCallbackLock.unlock();
1026 ALOGV("Message enabled = 0x%x", mHalCamCtrl->mMsgEnabled);
1032 mHalCamCtrl->mMsgEnabled, mHalCamCtrl->mPreviewFormat);
1034 if(mHalCamCtrl->mMsgEnabled & CAMERA_MSG_PREVIEW_FRAME) {
1041 if ((mHalCamCtrl->mPreviewFormat == CAMERA_YUV_420_NV21) || (mHalCamCtrl->mPreviewFormat == CAMERA_YUV_420_NV12) ||
1042 (mHalCamCtrl->mPreviewFormat == CAMERA_YUV_420_YV12))
1044 if (mHalCamCtrl->mPreviewFormat == CAMERA_YUV_420_YV12) {
1045 previewBufSize = ((mHalCamCtrl->mPreviewWidth+15)/16) *16* mHalCamCtrl->mPreviewHeight +
1046 ((mHalCamCtrl->mPreviewWidth/2+15)/16)*16* mHalCamCtrl->mPreviewHeight;
1048 previewBufSize = mHalCamCtrl->mPreviewWidth * mHalCamCtrl->mPreviewHeight * 3/2;
1050 if(previewBufSize != mHalCamCtrl->mPreviewMemory.private_buffer_handle[frame->def.idx]->size) {
1051 previewMem = mHalCamCtrl->mGetMemory(mHalCamCtrl->mPreviewMemory.private_buffer_handle[frame->def.idx]->fd,
1052 previewBufSize, 1, mHalCamCtrl->mCallbackCookie);
1059 data = mHalCamCtrl->mPreviewMemory.camera_memory[frame->def.idx];
1061 data = mHalCamCtrl->mPreviewMemory.camera_memory[frame->def.idx];
1070 pcb(msgType, data, 0, metadata, mHalCamCtrl->mCallbackCookie);
1082 if(mHalCamCtrl->mStartRecording == true &&
1083 ( mHalCamCtrl->mMsgEnabled & CAMERA_MSG_VIDEO_FRAME))
1085 if (mHalCamCtrl->mStoreMetaDataInFrame)
1087 if(mHalCamCtrl->mRecordingMemory.metadata_memory[frame->def.idx])
1092 mHalCamCtrl->mRecordingMemory.metadata_memory[frame->def.idx],
1093 0, mHalCamCtrl->mCallbackCookie);
1102 mHalCamCtrl->mPreviewMemory.camera_memory[frame->def.idx],
1103 0, mHalCamCtrl->mCallbackCookie);
1108 Mutex::Autolock rLock(&mHalCamCtrl->mRecordFrameLock);
1109 if (mHalCamCtrl->mReleasedRecordingFrame != true) {
1110 mHalCamCtrl->mRecordWait.wait(mHalCamCtrl->mRecordFrameLock);
1112 mHalCamCtrl->mReleasedRecordingFrame = false;
1145 if(mHalCamCtrl==NULL) {
1151 if (UNLIKELY(mHalCamCtrl->mDebugFps)) {
1152 mHalCamCtrl->debugShowPreviewFPS();
1155 mHalCamCtrl->dumpFrameToFile(frame->def.frame, HAL_DUMP_FRM_PREVIEW);
1157 mHalCamCtrl->mPreviewMemoryLock.lock();
1163 mHalCamCtrl->mPreviewMemoryLock.unlock();
1165 mHalCamCtrl->mCallbackLock.lock();
1166 camera_data_callback pcb = mHalCamCtrl->mDataCb;
1167 mHalCamCtrl->mCallbackLock.unlock();
1168 ALOGV("Message enabled = 0x%x", mHalCamCtrl->mMsgEnabled);
1172 mHalCamCtrl->mParameters.getPreviewSize(&previewWidth, &previewHeight);
1183 if (mHalCamCtrl->cache_ops(ion_fd, &cache_inv_data,
1191 if(mHalCamCtrl->mMsgEnabled & CAMERA_MSG_PREVIEW_FRAME) {
1198 if( mHalCamCtrl->mPreviewFormat == CAMERA_YUV_420_NV21) {
1200 if(previewBufSize != mHalCamCtrl->mPreviewMemory.private_buffer_handle[frame->def.idx]->size) {
1201 previewMem = mHalCamCtrl->mGetMemory(mHalCamCtrl->mPreviewMemory.private_buffer_handle[frame->def.idx]->fd,
1202 previewBufSize, 1, mHalCamCtrl->mCallbackCookie);
1209 data = mHalCamCtrl->mPreviewMemory.camera_memory[frame->def.idx];//mPreviewHeap->mBuffers[frame->def.idx];
1211 data = mHalCamCtrl->mPreviewMemory.camera_memory[frame->def.idx];//mPreviewHeap->mBuffers[frame->def.idx];
1216 if(mHalCamCtrl->mMsgEnabled & CAMERA_MSG_PREVIEW_METADATA){
1218 metadata = &mHalCamCtrl->mMetadata;
1225 pcb(msgType, data, 0, metadata, mHalCamCtrl->mCallbackCookie);
1244 if (mHalCamCtrl->isNoDisplayMode()) {
1262 mHalCamCtrl = NULL;
1322 previewFmt = mHalCamCtrl->getPreviewFormat();
1325 if (mHalCamCtrl->isNoDisplayMode()) {
1430 if (! mHalCamCtrl->isNoDisplayMode() ) {