/****************************************************************************** * Compressed Image (not disable CAMERA_MSG_COMPRESSED_IMAGE) * int[0]: current shut index; 0: the first one shut. *******************************************************************************/ void CameraClient:: handleMtkExtDataCompressedImage(const sp<IMemory>& dataPtr, camera_frame_metadata_t *metadata) { MtkCamMsgExtDataHelper MtkExtDataHelper; if ( ! MtkExtDataHelper.init(dataPtr) ) { LOGE("[%s] MtkCamMsgExtDataHelper::init fail - dataPtr(%p), this(%p) \r\n", __FUNCTION__, dataPtr.get(), this); return; } // uint_t const*const pExtParam = (uint_t const*)MtkExtDataHelper.getExtParamBase(); uint_t const uShutIndex = pExtParam[0]; // size_t const imageSize = MtkExtDataHelper.getExtParamSize() - sizeof(uint_t) * 1; ssize_t const imageOffset = MtkExtDataHelper.getExtParamOffset() + sizeof(uint_t) * 1; sp<MemoryBase> image = new MemoryBase(MtkExtDataHelper.getHeap(), imageOffset, imageSize); // MtkExtDataHelper.uninit(); LOGD("[%s] current shut index:%d - (size, offset)=(%d, %ld) \r\n", __FUNCTION__, uShutIndex, imageSize, imageOffset); // if (image == 0) { LOGE("[%s] fail to new MemoryBase \r\n", __FUNCTION__); return; } // sp<ICameraClient> c = mCameraClient; mLock.unlock(); if (c != 0) { c->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, image, NULL); } }
/****************************************************************************** * Burst Shot (EV Shot) * int[0]: the total shut count. * int[1]: count-down shut number; 0: the last one shut. ******************************************************************************/ void CameraClient:: handleMtkExtDataBurstShot(const sp<IMemory>& dataPtr, camera_frame_metadata_t */*metadata*/) { MtkCamMsgExtDataHelper MtkExtDataHelper; if ( ! MtkExtDataHelper.init(dataPtr) ) { ALOGE("[%s] MtkCamMsgExtDataHelper::init fail - dataPtr(%p), this(%p) \r\n", __FUNCTION__, dataPtr.get(), this); return; } // uint_t const*const pExtParam = (uint_t const*)MtkExtDataHelper.getExtParamBase(); uint_t const uTotalShutCount = pExtParam[0]; uint_t const uCountdownIndex = pExtParam[1]; // size_t const imageSize = MtkExtDataHelper.getExtParamSize() - sizeof(uint_t) * 2; ssize_t const imageOffset = MtkExtDataHelper.getExtParamOffset() + sizeof(uint_t) * 2; sp<MemoryBase> image = new MemoryBase(MtkExtDataHelper.getHeap(), imageOffset, imageSize); // MtkExtDataHelper.uninit(); // // if (0 < uCountdownIndex) { // not the last one burst shut. ALOGD("[%s] count-down burst shut number:%d/%d - (size, offset)=(%d, %d) \r\n", __FUNCTION__, uCountdownIndex, uTotalShutCount, imageSize, imageOffset); } else { disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE); ALOGD("[%s] the last one burst shut - (size, offset)=(%d, %d) \r\n", __FUNCTION__, imageSize, imageOffset); } // if (image == 0) { ALOGE("[%s] fail to new MemoryBase \r\n", __FUNCTION__); return; } // sp<ICameraClient> c = mRemoteCallback; //!++ #if 1 #else mLock.unlock(); #endif //!-- if (c != 0) { c->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, image, NULL); } }
/****************************************************************************** * Continuous Shot * int[0]: current continuous shut number. ******************************************************************************/ void CameraClient:: handleMtkExtDataContinuousShot(const sp<IMemory>& dataPtr, camera_frame_metadata_t */*metadata*/) { MtkCamMsgExtDataHelper MtkExtDataHelper; if ( ! MtkExtDataHelper.init(dataPtr) ) { ALOGE("[%s] MtkCamMsgExtDataHelper::init fail - dataPtr(%p), this(%p) \r\n", __FUNCTION__, dataPtr.get(), this); return; } // uint_t const*const pExtParam = (uint_t const*)MtkExtDataHelper.getExtParamBase(); uint_t const uCurShutCount = pExtParam[0]; // size_t const imageSize = MtkExtDataHelper.getExtParamSize() - sizeof(uint_t) * 1; ssize_t const imageOffset = MtkExtDataHelper.getExtParamOffset() + sizeof(uint_t) * 1; sp<MemoryBase> image = new MemoryBase(MtkExtDataHelper.getHeap(), imageOffset, imageSize); // MtkExtDataHelper.uninit(); ALOGD("[%s] current continuous shut number:%d - (size, offset)=(%d, %d) \r\n", __FUNCTION__, uCurShutCount, imageSize, imageOffset); // if (image == 0) { ALOGE("[%s] fail to new MemoryBase \r\n", __FUNCTION__); return; } // sp<ICameraClient> c = mRemoteCallback; //!++ #if 1 #else mLock.unlock(); #endif //!-- if (c != 0) { c->dataCallback(CAMERA_MSG_COMPRESSED_IMAGE, image, NULL); } }