void MetadataProvider:: updateData(IMetadata &rMetadata) { { MINT32 maxJpegsize = 0; IMetadata::IEntry blobEntry = rMetadata.entryFor(MTK_SCALER_AVAILABLE_STREAM_CONFIGURATIONS); for(size_t i = 0; i < blobEntry.count(); i+=4) { if (blobEntry.itemAt(0, Type2Type<MINT32>())!= HAL_PIXEL_FORMAT_BLOB) { continue; } //avaiblable blob size list should order in descedning. MSize maxBlob = MSize(blobEntry.itemAt(i+1, Type2Type<MINT32>()), blobEntry.itemAt(i+2, Type2Type<MINT32>())); MINT32 jpegsize = maxBlob.size()*1.2; //*2*0.6 if (jpegsize > maxJpegsize) { maxJpegsize = jpegsize; } IMetadata::IEntry entry(MTK_JPEG_MAX_SIZE); entry.push_back(maxJpegsize, Type2Type< MINT32 >()); rMetadata.update(MTK_JPEG_MAX_SIZE, entry); } } }
void prepareRequest(android::sp<IPipelineFrameControl> &pFrame) { printf("prepare request\n"); pFrame = IPipelineFrameControl::create(0); pFrame->setPipelineNodeMap(getPipelineNodeMapControl()); pFrame->setPipelineDAG(getPipelineDAG()); pFrame->setStreamInfoSet(getStreamInfoSet()); //P2 Node { IPipelineNode::NodeId_T const nodeId = NODE_ID_NODE1; // IPipelineFrame::InfoIOMapSet aInfoIOMapSet; IPipelineFrame::ImageInfoIOMapSet& rImageInfoIOMapSet = aInfoIOMapSet.mImageInfoIOMapSet; IPipelineFrame::MetaInfoIOMapSet& rMetaInfoIOMapSet = aInfoIOMapSet.mMetaInfoIOMapSet; // // sp<IPipelineNodeMapControl::INode> pNodeExt = getPipelineNodeMapControl()->getNodeFor(nodeId); sp<IStreamInfoSet const> pInStream = pNodeExt->getInStreams(); sp<IStreamInfoSet const> pOutStream= pNodeExt->getOutStreams(); // // Image { IPipelineFrame::ImageInfoIOMap& rMap = rImageInfoIOMapSet.editItemAt(rImageInfoIOMapSet.add()); // //Input for (size_t i = 0; i < pInStream->getImageInfoNum(); i++) { sp<IImageStreamInfo> p = pInStream->getImageInfoAt(i); rMap.vIn.add(p->getStreamId(), p); } // //Output for (size_t i = 0; i < pOutStream->getImageInfoNum(); i++) { sp<IImageStreamInfo> p = pOutStream->getImageInfoAt(i); rMap.vOut.add(p->getStreamId(), p); } } // // Meta { IPipelineFrame::MetaInfoIOMap& rMap = rMetaInfoIOMapSet.editItemAt(rMetaInfoIOMapSet.add()); // //Input for (size_t i = 0; i < pInStream->getMetaInfoNum(); i++) { sp<IMetaStreamInfo> p = pInStream->getMetaInfoAt(i); rMap.vIn.add(p->getStreamId(), p); } // //Output for (size_t i = 0; i < pOutStream->getMetaInfoNum(); i++) { sp<IMetaStreamInfo> p = pOutStream->getMetaInfoAt(i); rMap.vOut.add(p->getStreamId(), p); } } // // pFrame->addInfoIOMapSet(nodeId, aInfoIOMapSet); } //////////////////////////////////////////////////////////////////////////// // // pFrame->setStreamBufferSet(...); // //////////////////////////////////////////////////////////////////////////// //IAppPipeline::AppCallbackParams aAppCallbackParams; //aAppCallbackParams.mpBuffersCallback = pAppSimulator; sp<IStreamBufferSetControl> pBufferSetControl = IStreamBufferSetControl::create( 0, NULL ); // // { // StreamId_T const streamId = STREAM_ID_IN_BAYER; // sp<IImageStreamInfo> pStreamInfo = getStreamInfoSet()->getImageInfoFor(streamId); sp<HalImageStreamBuffer> pStreamBuffer; // //acquireFromPool MY_LOGD("[acquireFromPool] + %s ", pStreamInfo->getStreamName()); MERROR err = mpPool_HalImageRaw->acquireFromPool( "Tester", pStreamBuffer, ::s2ns(30) ); MY_LOGD("[acquireFromPool] - %s %p err:%d", pStreamInfo->getStreamName(), pStreamBuffer.get(), err); MY_LOGE_IF(OK!=err || pStreamBuffer==0, "pStreamBuffer==0"); // ssize_t userGroupIndex = 0; //User Group1 { sp<IUsersManager::IUserGraph> pUserGraph = pStreamBuffer->createGraph(); IUsersManager::User user; // user.mUserId = NODE_ID_NODE1; user.mCategory = IUsersManager::Category::CONSUMER; user.mUsage = pStreamInfo->getUsageForAllocator(); pUserGraph->addUser(user); userGroupIndex = pStreamBuffer->enqueUserGraph(pUserGraph.get()); } // pBufferSetControl->editMap_HalImage()->add(pStreamBuffer); } // { // StreamId_T const streamId = STREAM_ID_OUT_YUV_0; // sp<IImageStreamInfo> pStreamInfo = getStreamInfoSet()->getImageInfoFor(streamId); sp<HalImageStreamBuffer> pStreamBuffer; // //acquireFromPool MY_LOGD("[acquireFromPool] + %s ", pStreamInfo->getStreamName()); MERROR err = mpPool_HalImageYuv0->acquireFromPool( "Tester", pStreamBuffer, ::s2ns(30) ); MY_LOGD("[acquireFromPool] - %s %p err:%d", pStreamInfo->getStreamName(), pStreamBuffer.get(), err); MY_LOGE_IF(OK!=err || pStreamBuffer==0, "pStreamBuffer==0"); // ssize_t userGroupIndex = 0; //User Group1 { sp<IUsersManager::IUserGraph> pUserGraph = pStreamBuffer->createGraph(); IUsersManager::User user; // user.mUserId = NODE_ID_NODE1; user.mCategory = IUsersManager::Category::PRODUCER; user.mUsage = pStreamInfo->getUsageForAllocator(); pUserGraph->addUser(user); userGroupIndex = pStreamBuffer->enqueUserGraph(pUserGraph.get()); } // pBufferSetControl->editMap_HalImage()->add(pStreamBuffer); } // { // StreamId_T const streamId = STREAM_ID_OUT_YUV_1; // sp<IImageStreamInfo> pStreamInfo = getStreamInfoSet()->getImageInfoFor(streamId); sp<HalImageStreamBuffer> pStreamBuffer; // //acquireFromPool MY_LOGD("[acquireFromPool] + %s ", pStreamInfo->getStreamName()); MERROR err = mpPool_HalImageYuv1->acquireFromPool( "Tester", pStreamBuffer, ::s2ns(30) ); MY_LOGD("[acquireFromPool] - %s %p err:%d", pStreamInfo->getStreamName(), pStreamBuffer.get(), err); MY_LOGE_IF(OK!=err || pStreamBuffer==0, "pStreamBuffer==0"); // ssize_t userGroupIndex = 0; //User Group1 { sp<IUsersManager::IUserGraph> pUserGraph = pStreamBuffer->createGraph(); IUsersManager::User user; // user.mUserId = NODE_ID_NODE1; user.mCategory = IUsersManager::Category::PRODUCER; user.mUsage = pStreamInfo->getUsageForAllocator(); pUserGraph->addUser(user); userGroupIndex = pStreamBuffer->enqueUserGraph(pUserGraph.get()); } // pBufferSetControl->editMap_HalImage()->add(pStreamBuffer); } // #if (0) { //HAL/Meta/PLATFORM StreamId_T const streamId = STREAM_ID_HALMETADATA1; // sp<IMetaStreamInfo> pStreamInfo = getStreamInfoSet()->getMetaInfoFor(streamId); sp<HalMetaStreamBuffer> pStreamBuffer; // //acquireFromPool MY_LOGD("[acquireFromPool] + %s ", pStreamInfo->getStreamName()); MERROR err = mpPool_HalMetadataRequest->acquireFromPool( "Tester", pStreamBuffer, ::s2ns(30) ); MY_LOGD("[acquireFromPool] - %s %p err:%d", pStreamInfo->getStreamName(), pStreamBuffer.get(), err); MY_LOGE_IF(OK!=err || pStreamBuffer==0, "pStreamBuffer==0"); // ssize_t userGroupIndex = 0; //User Group1 { sp<IUsersManager::IUserGraph> pUserGraph = pStreamBuffer->createGraph(); IUsersManager::User user; // user.mUserId = NODE_ID_NODE1; user.mCategory = IUsersManager::Category::PRODUCER; user.mUsage = 0; pUserGraph->addUser(user); userGroupIndex = pStreamBuffer->enqueUserGraph(pUserGraph.get()); } //User Group2 { sp<IUsersManager::IUserGraph> pUserGraph = pStreamBuffer->createGraph(); IUsersManager::User user; // user.mUserId = NODE_ID_NODE2; user.mCategory = IUsersManager::Category::CONSUMER; user.mUsage = 0; pUserGraph->addUser(user); userGroupIndex = pStreamBuffer->enqueUserGraph(pUserGraph.get()); } // pBufferSetControl->editMap_HalMeta()->add(pStreamBuffer); } #endif // { //App:Meta:Result StreamId_T const streamId = STREAM_ID_APPMETADATA; // sp<IMetaStreamInfo> pStreamInfo = getStreamInfoSet()->getMetaInfoFor(streamId); sp<IMetaStreamBuffer> pStreamBuffer; // //alloc without default value typedef NSCam::v3::Utils::HalMetaStreamBuffer::Allocator StreamBufferAllocatorT; pStreamBuffer = StreamBufferAllocatorT(pStreamInfo.get())(); MY_LOGE_IF(pStreamBuffer==0, "pStreamBuffer==0"); // ssize_t userGroupIndex = 0; //User Group1 { sp<IUsersManager::IUserGraph> pUserGraph = pStreamBuffer->createGraph(); IUsersManager::User user; // user.mUserId = NODE_ID_NODE1; user.mCategory = IUsersManager::Category::PRODUCER; pUserGraph->addUser(user); // userGroupIndex = pStreamBuffer->enqueUserGraph(pUserGraph.get()); } // pBufferSetControl->editMap_AppMeta()->add(pStreamBuffer); } // { //APP/Meta/Request StreamId_T const streamId = STREAM_ID_APPREQUEST; // sp<IMetaStreamInfo> pStreamInfo = getStreamInfoSet()->getMetaInfoFor(streamId); sp<IMetaStreamBuffer> pStreamBuffer; // IMetadata appRequest; { IMetadata::IEntry entry1(MTK_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM); entry1.push_back(16, Type2Type< MFLOAT >()); appRequest.update(MTK_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM, entry1); } typedef NSCam::v3::Utils::HalMetaStreamBuffer::Allocator StreamBufferAllocatorT; pStreamBuffer = StreamBufferAllocatorT(pStreamInfo.get())(appRequest); MY_LOGE_IF(pStreamBuffer==0, "pStreamBuffer==0"); // ssize_t userGroupIndex = 0; //User Group1 { sp<IUsersManager::IUserGraph> pUserGraph = pStreamBuffer->createGraph(); IUsersManager::User user; // user.mUserId = NODE_ID_NODE1; user.mCategory = IUsersManager::Category::CONSUMER; pUserGraph->addUser(user); // // userGroupIndex = pStreamBuffer->enqueUserGraph(pUserGraph.get()); } // pBufferSetControl->editMap_AppMeta()->add(pStreamBuffer); } // { //HAL/Meta/Request StreamId_T const streamId = STREAM_ID_HALREQUEST; // sp<IMetaStreamInfo> pStreamInfo = getStreamInfoSet()->getMetaInfoFor(streamId); sp<IMetaStreamBuffer> pStreamBuffer; // typedef NSCam::v3::Utils::HalMetaStreamBuffer::Allocator StreamBufferAllocatorT; pStreamBuffer = StreamBufferAllocatorT(pStreamInfo.get())(); MY_LOGE_IF(pStreamBuffer==0, "pStreamBuffer==0"); // ssize_t userGroupIndex = 0; //User Group1 { sp<IUsersManager::IUserGraph> pUserGraph = pStreamBuffer->createGraph(); IUsersManager::User user; // user.mUserId = NODE_ID_NODE1; user.mCategory = IUsersManager::Category::PRODUCER; pUserGraph->addUser(user); // // userGroupIndex = pStreamBuffer->enqueUserGraph(pUserGraph.get()); } // pBufferSetControl->editMap_AppMeta()->add(pStreamBuffer); } // pFrame->setStreamBufferSet(pBufferSetControl); }
status_t MetadataProvider:: constructStaticMetadata(sp<IMetadataConverter> pConverter, camera_metadata*& rpDstMetadata, IMetadata& mtkMetadata) { MY_LOGD("construct static metadata\n"); status_t status = OK; //-----(1)-----// //get static informtation from customization (with camera_metadata format) //calculate its entry count and data count if ( OK != (status = impConstructStaticMetadata(mtkMetadata)) ) { MY_LOGE("Unable evaluate the size for camera static info - status[%s(%d)]\n", ::strerror(-status), -status); return status; } MY_LOGD("Allocating %d entries from customization", mtkMetadata.count()); //-----(2.1)------// //get static informtation from sensor hal moduls (with IMetadata format) IMetadata sensorMetadata = IHalSensorList::get()->queryStaticInfo(mInfo.getDeviceId()); MY_LOGD("Allocating %d entries from sensor HAL", sensorMetadata.count()); //--- (2.1.1) --- // //merge. for (size_t i = 0; i < sensorMetadata.count(); i++) { IMetadata::Tag_t mTag = sensorMetadata.entryAt(i).tag(); mtkMetadata.update(mTag, sensorMetadata.entryAt(i)); } MY_LOGD("Allocating %d entries from customization + sensor HAL", mtkMetadata.count()); #if 0 //-----(2.2)------// //get static informtation from other hal moduls (with IMetadata format) IMetadata halmetadata = IHalSensorList::get()->queryStaticInfo(mInfo.getDeviceId()); //calculate its entry count and data count entryCount = 0; dataCount = 0; status = AndroidMetadata::getIMetadata_dataCount(halmetadata, entryCount, dataCount); if (status != OK) { MY_LOGE("get Imetadata count error - status[%s(%d)", ::strerror(-status), -status); return status; } MY_LOGD( "Allocating %d entries, %d extra bytes from HAL modules", entryCount, dataCount ); addOrSizeInfo.mEntryCount += entryCount; addOrSizeInfo.mDataCount += dataCount; #endif //overwrite updateData(mtkMetadata); // #if (PLATFORM_SDK_VERSION >= 21) pConverter->convert(mtkMetadata, rpDstMetadata); // ::sort_camera_metadata(rpDstMetadata); #endif return status; }
MVOID HalSensorList::querySensorDrvInfo() { MUINT i = 0, ret = 0; MINT sensorDev; SensorDrv *const pSensorDrv = SensorDrv::get(); #ifdef MTK_MAIN2_IMGSENSOR for (sensorDev = SENSOR_MAIN; sensorDev <= SENSOR_MAIN_2; sensorDev <<= 1) { #else #ifdef MTK_SUB_IMGSENSOR for (sensorDev = SENSOR_MAIN; sensorDev <= SENSOR_SUB; sensorDev <<= 1) { #else for (sensorDev = SENSOR_MAIN; sensorDev < SENSOR_SUB; sensorDev <<= 1) { #endif #endif pSensorDrv->init((SENSOR_DEV_ENUM)sensorDev); pSensorDrv->getInfo2((SENSOR_DEV_ENUM)sensorDev,&sensorDrvInfo[i]); ret = getRawInfo((SENSOR_DEV_ENUM)sensorDev, &sensorRawInfo[i]); i++; pSensorDrv->uninit(); } querySensorInfo();//to remap data } MUINT HalSensorList::getRawInfo(SENSOR_DEV_ENUM sensorDevId, SENSOR_HAL_RAW_INFO_STRUCT *pInfo) { MUINT32 ret = 0; SensorDrv *const pSensorDrv = SensorDrv::get(); switch(sensorDevId) { case SENSOR_MAIN: pInfo->u1Order = sensorDrvInfo[0].SensorOutputDataFormat; break; case SENSOR_SUB: pInfo->u1Order = sensorDrvInfo[1].SensorOutputDataFormat; break; case SENSOR_MAIN_2: pInfo->u1Order = sensorDrvInfo[2].SensorOutputDataFormat; break; default: break; } /* Modify getSensorType from getInfo Ioctl to directly compute sensorType from pInfo->u1Order //sensorType = pSensorDrv->getCurrentSensorType(sensorDevId); */ // Compute sensorType from SensorOutputDataFormat if (pInfo->u1Order >= SENSOR_OUTPUT_FORMAT_RAW_B && pInfo->u1Order <= SENSOR_OUTPUT_FORMAT_RAW_R) { pInfo->sensorType = IMAGE_SENSOR_TYPE_RAW; } else if (pInfo->u1Order >= SENSOR_OUTPUT_FORMAT_RAW8_B && pInfo->u1Order <= SENSOR_OUTPUT_FORMAT_RAW8_R) { pInfo->sensorType = IMAGE_SENSOR_TYPE_RAW8; } else if (pInfo->u1Order >= SENSOR_OUTPUT_FORMAT_UYVY && pInfo->u1Order <= SENSOR_OUTPUT_FORMAT_YVYU) { pInfo->sensorType = IMAGE_SENSOR_TYPE_YUV; } else if (pInfo->u1Order >= SENSOR_OUTPUT_FORMAT_CbYCrY && pInfo->u1Order <= SENSOR_OUTPUT_FORMAT_YCrYCb) { pInfo->sensorType = IMAGE_SENSOR_TYPE_YCBCR; } else { MY_LOGE("Unsupport SensorOutputDataFormat \n"); } MY_LOGD("SensorOutputDataFormat: %d, ImageSensor Type: %d\n", pInfo->u1Order, pInfo->sensorType); switch (pInfo->sensorType) { case IMAGE_SENSOR_TYPE_RAW: pInfo->u4BitDepth = 10; pInfo->u4IsPacked = 1; break; case IMAGE_SENSOR_TYPE_RAW8: pInfo->u4BitDepth = 8; pInfo->u4IsPacked = 1; break; case IMAGE_SENSOR_TYPE_RAW12: pInfo->u4BitDepth = 12; pInfo->u4IsPacked = 1; break; case IMAGE_SENSOR_TYPE_RAW14: pInfo->u4BitDepth = 14; pInfo->u4IsPacked = 1; break; case IMAGE_SENSOR_TYPE_YUV: case IMAGE_SENSOR_TYPE_YCBCR: pInfo->u4BitDepth = 8; pInfo->u4IsPacked = 0; break; case IMAGE_SENSOR_TYPE_RGB565: pInfo->u4BitDepth = 8; pInfo->u4IsPacked = 0; break; default: MY_LOGE("Unsupport Sensor Type \n"); break; } return ret; } MVOID HalSensorList::querySensorInfo() { MUINT idx; //MUINT32 data1,data2; MUINTPTR data1,data2; SensorDrv *const pSensorDrv = SensorDrv::get(); #ifdef MTK_MAIN2_IMGSENSOR for(idx=0; idx<3; idx++) { #else #ifdef MTK_SUB_IMGSENSOR for(idx=0; idx<2; idx++) { #else for(idx=0; idx<1; idx++) { #endif #endif switch (idx) { case 0: pSensorDrv->init(SENSOR_MAIN); pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_MCLK_CONNECTION, (MUINTPTR)&data1); sensorPara[idx].mclkSrc = data1; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_MIPI_SENSOR_PORT, (MUINTPTR)&data1); sensorPara[idx].mipiPad = data1; sensorStaticInfo[idx].sensorDevID = pSensorDrv->getMainSensorID(); pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_SENSOR_ORIENTATION_ANGLE, (MUINTPTR)&data1); sensorStaticInfo[idx].orientationAngle = data1; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_SENSOR_FACING_DIRECTION, (MUINTPTR)&data1); sensorStaticInfo[idx].facingDirection = data1; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_FAKE_ORIENTATION, (MUINTPTR)&data1); sensorStaticInfo[idx].fakeOrientation = data1; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_SENSOR_VIEWANGLE, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].horizontalViewAngle =data1; sensorStaticInfo[idx].verticalViewAngle = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_PREVIEW; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].previewFrameRate = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_CAPTURE; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].captureFrameRate = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_VIDEO; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].videoFrameRate = data2; data1 = SENSOR_SCENARIO_ID_SLIM_VIDEO1; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video1FrameRate = data2; data1 = SENSOR_SCENARIO_ID_SLIM_VIDEO2; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM1; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM2; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM3; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM4; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM5; pSensorDrv->sendCommand(SENSOR_MAIN, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; pSensorDrv->uninit(); break; case 1: pSensorDrv->init(SENSOR_SUB); pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_MCLK_CONNECTION, (MUINTPTR)&data1); sensorPara[idx].mclkSrc = data1; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_MIPI_SENSOR_PORT, (MUINTPTR)&data1); sensorPara[idx].mipiPad = data1; sensorStaticInfo[idx].sensorDevID = pSensorDrv->getSubSensorID(); pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_SENSOR_ORIENTATION_ANGLE, (MUINTPTR)&data1); sensorStaticInfo[idx].orientationAngle = data1; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_SENSOR_FACING_DIRECTION, (MUINTPTR)&data1); sensorStaticInfo[idx].facingDirection = data1; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_FAKE_ORIENTATION, (MUINTPTR)&data1); sensorStaticInfo[idx].fakeOrientation = data1; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_SENSOR_VIEWANGLE, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].horizontalViewAngle =data1; sensorStaticInfo[idx].verticalViewAngle = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_PREVIEW; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].previewFrameRate = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_CAPTURE; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].captureFrameRate = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_VIDEO; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].videoFrameRate = data2; data1 = SENSOR_SCENARIO_ID_SLIM_VIDEO1; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video1FrameRate = data2; data1 = SENSOR_SCENARIO_ID_SLIM_VIDEO2; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM1; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM2; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM3; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM4; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM5; pSensorDrv->sendCommand(SENSOR_SUB, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; pSensorDrv->uninit(); break; case 2: pSensorDrv->init(SENSOR_MAIN_2); pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_MCLK_CONNECTION, (MUINTPTR)&data1); sensorPara[idx].mclkSrc = data1; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_MIPI_SENSOR_PORT, (MUINTPTR)&data1); sensorPara[idx].mipiPad = data1; sensorStaticInfo[idx].sensorDevID = pSensorDrv->getMain2SensorID(); pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_SENSOR_ORIENTATION_ANGLE, (MUINTPTR)&data1); sensorStaticInfo[idx].orientationAngle = data1; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_SENSOR_FACING_DIRECTION, (MUINTPTR)&data1); sensorStaticInfo[idx].facingDirection = data1; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_FAKE_ORIENTATION, (MUINTPTR)&data1); sensorStaticInfo[idx].fakeOrientation = data1; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_SENSOR_VIEWANGLE, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].horizontalViewAngle =data1; sensorStaticInfo[idx].verticalViewAngle = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_PREVIEW; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].previewFrameRate = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_CAPTURE; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].captureFrameRate = data2; data1 = SENSOR_SCENARIO_ID_NORMAL_VIDEO; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].videoFrameRate = data2; data1 = SENSOR_SCENARIO_ID_SLIM_VIDEO1; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video1FrameRate = data2; data1 = SENSOR_SCENARIO_ID_SLIM_VIDEO2; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM1; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM2; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM3; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM4; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; data1 = SENSOR_SCENARIO_ID_CUSTOM5; pSensorDrv->sendCommand(SENSOR_MAIN_2, CMD_SENSOR_GET_DEFAULT_FRAME_RATE_BY_SCENARIO, (MUINTPTR)&data1, (MUINTPTR)&data2); sensorStaticInfo[idx].video2FrameRate = data2; pSensorDrv->uninit(); break; default: break; } switch (sensorRawInfo[idx].sensorType) { case IMAGE_SENSOR_TYPE_RAW: sensorStaticInfo[idx].sensorType = SENSOR_TYPE_RAW; sensorStaticInfo[idx].rawSensorBit = RAW_SENSOR_10BIT; break; case IMAGE_SENSOR_TYPE_RAW8: sensorStaticInfo[idx].sensorType = SENSOR_TYPE_RAW; sensorStaticInfo[idx].rawSensorBit = RAW_SENSOR_8BIT; break; case IMAGE_SENSOR_TYPE_RAW12: sensorStaticInfo[idx].sensorType = SENSOR_TYPE_RAW; sensorStaticInfo[idx].rawSensorBit = RAW_SENSOR_12BIT; break; case IMAGE_SENSOR_TYPE_RAW14: sensorStaticInfo[idx].sensorType = SENSOR_TYPE_RAW; sensorStaticInfo[idx].rawSensorBit = RAW_SENSOR_14BIT; break; case IMAGE_SENSOR_TYPE_YUV: case IMAGE_SENSOR_TYPE_YCBCR: sensorStaticInfo[idx].sensorType = SENSOR_TYPE_YUV; sensorStaticInfo[idx].rawSensorBit = RAW_SENSOR_ERROR; break; case IMAGE_SENSOR_TYPE_RGB565: sensorStaticInfo[idx].sensorType = SENSOR_TYPE_RGB; sensorStaticInfo[idx].rawSensorBit = RAW_SENSOR_ERROR; break; case IMAGE_SENSOR_TYPE_JPEG: sensorStaticInfo[idx].sensorType = SENSOR_TYPE_JPEG; sensorStaticInfo[idx].rawSensorBit = RAW_SENSOR_ERROR; break; default: sensorStaticInfo[idx].sensorType = SENSOR_TYPE_UNKNOWN; sensorStaticInfo[idx].rawSensorBit = RAW_SENSOR_ERROR; break; } switch (sensorRawInfo[idx].u1Order) { case SENSOR_OUTPUT_FORMAT_RAW_B: case SENSOR_OUTPUT_FORMAT_RAW8_B: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_RAW_B; break; case SENSOR_OUTPUT_FORMAT_RAW_Gb: case SENSOR_OUTPUT_FORMAT_RAW8_Gb: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_RAW_Gb; break; case SENSOR_OUTPUT_FORMAT_RAW_Gr: case SENSOR_OUTPUT_FORMAT_RAW8_Gr: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_RAW_Gr; break; case SENSOR_OUTPUT_FORMAT_RAW_R: case SENSOR_OUTPUT_FORMAT_RAW8_R: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_RAW_R; break; case SENSOR_OUTPUT_FORMAT_UYVY: case SENSOR_OUTPUT_FORMAT_CbYCrY: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_UYVY; break; case SENSOR_OUTPUT_FORMAT_VYUY: case SENSOR_OUTPUT_FORMAT_CrYCbY: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_VYUY; break; case SENSOR_OUTPUT_FORMAT_YUYV: case SENSOR_OUTPUT_FORMAT_YCbYCr: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_YUYV; break; case SENSOR_OUTPUT_FORMAT_YVYU: case SENSOR_OUTPUT_FORMAT_YCrYCb: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_YVYU; break; default: sensorStaticInfo[idx].sensorFormatOrder = SENSOR_FORMAT_ORDER_NONE; break; } sensorStaticInfo[idx].iHDRSupport = sensorDrvInfo[idx].iHDRSupport; sensorStaticInfo[idx].PDAF_Support = sensorDrvInfo[idx].PDAF_Support; sensorStaticInfo[idx].previewWidth = sensorDrvInfo[idx].SensorPreviewWidth; sensorStaticInfo[idx].previewHeight = sensorDrvInfo[idx].SensorPreviewHeight; sensorStaticInfo[idx].captureWidth = sensorDrvInfo[idx].SensorCapWidth; sensorStaticInfo[idx].captureHeight = sensorDrvInfo[idx].SensorCapHeight; sensorStaticInfo[idx].videoWidth = sensorDrvInfo[idx].SensorVideoWidth; sensorStaticInfo[idx].videoHeight = sensorDrvInfo[idx].SensorVideoHeight; sensorStaticInfo[idx].video1Width = sensorDrvInfo[idx].SensorVideo1Width; sensorStaticInfo[idx].video1Height = sensorDrvInfo[idx].SensorVideo1Height; sensorStaticInfo[idx].video2Width = sensorDrvInfo[idx].SensorVideo2Width; sensorStaticInfo[idx].video2Height = sensorDrvInfo[idx].SensorVideo2Height; sensorStaticInfo[idx].SensorCustom1Width = sensorDrvInfo[idx].SensorCustom1Width; sensorStaticInfo[idx].SensorCustom1Height = sensorDrvInfo[idx].SensorCustom1Height; sensorStaticInfo[idx].SensorCustom2Width = sensorDrvInfo[idx].SensorCustom2Width; sensorStaticInfo[idx].SensorCustom2Height = sensorDrvInfo[idx].SensorCustom2Height; sensorStaticInfo[idx].SensorCustom3Width = sensorDrvInfo[idx].SensorCustom3Width; sensorStaticInfo[idx].SensorCustom3Height = sensorDrvInfo[idx].SensorCustom3Height; sensorStaticInfo[idx].SensorCustom4Width = sensorDrvInfo[idx].SensorCustom4Width; sensorStaticInfo[idx].SensorCustom4Height = sensorDrvInfo[idx].SensorCustom4Height; sensorStaticInfo[idx].SensorCustom5Width = sensorDrvInfo[idx].SensorCustom5Width; sensorStaticInfo[idx].SensorCustom5Height = sensorDrvInfo[idx].SensorCustom5Height; sensorStaticInfo[idx].previewDelayFrame = sensorDrvInfo[idx].PreviewDelayFrame; sensorStaticInfo[idx].captureDelayFrame = sensorDrvInfo[idx].CaptureDelayFrame; sensorStaticInfo[idx].videoDelayFrame = sensorDrvInfo[idx].VideoDelayFrame; sensorStaticInfo[idx].video1DelayFrame = sensorDrvInfo[idx].HighSpeedVideoDelayFrame; sensorStaticInfo[idx].video2DelayFrame = sensorDrvInfo[idx].SlimVideoDelayFrame; sensorStaticInfo[idx].Custom1DelayFrame = sensorDrvInfo[idx].Custom1DelayFrame; sensorStaticInfo[idx].Custom2DelayFrame = sensorDrvInfo[idx].Custom2DelayFrame; sensorStaticInfo[idx].Custom3DelayFrame = sensorDrvInfo[idx].Custom3DelayFrame; sensorStaticInfo[idx].Custom4DelayFrame = sensorDrvInfo[idx].Custom4DelayFrame; sensorStaticInfo[idx].Custom5DelayFrame = sensorDrvInfo[idx].Custom5DelayFrame; sensorStaticInfo[idx].aeShutDelayFrame = sensorDrvInfo[idx].AEShutDelayFrame; sensorStaticInfo[idx].aeSensorGainDelayFrame = sensorDrvInfo[idx].AESensorGainDelayFrame; sensorStaticInfo[idx].aeISPGainDelayFrame = sensorDrvInfo[idx].AEISPGainDelayFrame; sensorStaticInfo[idx].previewActiveWidth = sensorDrvInfo[idx].SensorEffectivePreviewWidth;//3d use onlyl? sensorStaticInfo[idx].previewActiveHeight = sensorDrvInfo[idx].SensorEffectivePreviewHeight;//3d use onlyl? sensorStaticInfo[idx].captureActiveWidth = sensorDrvInfo[idx].SensorEffectiveCapWidth;//3d use onlyl? sensorStaticInfo[idx].captureActiveHeight = sensorDrvInfo[idx].SensorEffectiveCapHeight;//3d use onlyl? sensorStaticInfo[idx].videoActiveWidth = sensorDrvInfo[idx].SensorEffectiveVideoWidth;//3d use onlyl? sensorStaticInfo[idx].videowActiveHeight = sensorDrvInfo[idx].SensorEffectiveVideoHeight;//3d use onlyl? sensorStaticInfo[idx].previewHoizontalOutputOffset = sensorDrvInfo[idx].SensorPreviewWidthOffset;//3d use onlyl? sensorStaticInfo[idx].previewVerticalOutputOffset = sensorDrvInfo[idx].SensorPreviewHeightOffset; //3d use onlyl? sensorStaticInfo[idx].captureHoizontalOutputOffset = sensorDrvInfo[idx].SensorCapWidthOffset;//3d use onlyl? sensorStaticInfo[idx].captureVerticalOutputOffset = sensorDrvInfo[idx].SensorCapHeightOffset; //3d use onlyl? sensorStaticInfo[idx].videoHoizontalOutputOffset = sensorDrvInfo[idx].SensorVideoWidthOffset;//3d use onlyl? sensorStaticInfo[idx].videoVerticalOutputOffset = sensorDrvInfo[idx].SensorVideoHeightOffset; //3d use onlyl? sensorStaticInfo[idx].virtualChannelSupport = sensorDrvInfo[idx].virtualChannelSupport; sensorStaticInfo[idx].iHDR_First_IS_LE = sensorDrvInfo[idx].iHDR_First_IS_LE; sensorStaticInfo[idx].SensorModeNum = sensorDrvInfo[idx].SensorModeNum; } MY_LOGD("MCLK Source: Main = %d, Sub = %d, Main_2 =%d\n",sensorPara[0].mclkSrc,sensorPara[1].mclkSrc,sensorPara[2].mclkSrc); MY_LOGD("MIPI pad: Main = %d, Sub = %d, Main_2 =%d\n",sensorPara[0].mipiPad,sensorPara[1].mipiPad,sensorPara[2].mipiPad); } MVOID HalSensorList::buildSensorMetadata() { MINT idx; MINT64 exposureTime1 = 0x4000; MINT64 exposureTime2 = 0x4000; MUINT8 u8Para = 0; MINT32 s32Para = 0; MY_LOGD("impBuildSensorInfo start!\n"); #ifdef MTK_MAIN2_IMGSENSOR for(idx=0; idx<3; idx++) { #else #ifdef MTK_SUB_IMGSENSOR for(idx=0; idx<2; idx++) { #else for(idx=0; idx<1; idx++) { #endif #endif IMetadata& metadataA = gSensorMetadata[idx]; { IMetadata::IEntry entryA(MTK_SENSOR_EXPOSURE_TIME); entryA.push_back(exposureTime1, Type2Type<MINT64>()); entryA.push_back(exposureTime2, Type2Type<MINT64>()); metadataA.update(MTK_SENSOR_EXPOSURE_TIME, entryA); } { //using full size? IMetadata::IEntry entryA(MTK_SENSOR_INFO_ACTIVE_ARRAY_REGION); MRect region1(MPoint(sensorStaticInfo[idx].captureHoizontalOutputOffset,sensorStaticInfo[idx].captureVerticalOutputOffset), MSize(sensorStaticInfo[idx].captureWidth,sensorStaticInfo[idx].captureHeight)); entryA.push_back(region1, Type2Type<MRect>()); metadataA.update(MTK_SENSOR_INFO_ACTIVE_ARRAY_REGION, entryA); } { IMetadata::IEntry entryA(MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT); switch(sensorStaticInfo[idx].sensorFormatOrder) { case SENSOR_FORMAT_ORDER_RAW_B: u8Para = 0x3;//BGGR break; case SENSOR_FORMAT_ORDER_RAW_Gb: u8Para = 0x2;//GBRG break; case SENSOR_FORMAT_ORDER_RAW_Gr: u8Para = 0x1;//GRBG break; case SENSOR_FORMAT_ORDER_RAW_R: u8Para = 0x0;//RGGB break; default: u8Para = 0x4;//BGR not bayer break; } entryA.push_back(u8Para, Type2Type<MUINT8>()); metadataA.update(MTK_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT, entryA); } { //need to add query from kernel IMetadata::IEntry entryA(MTK_SENSOR_INFO_EXPOSURE_TIME_RANGE); entryA.push_back(3000, Type2Type<MINT64>()); entryA.push_back(3000000000, Type2Type<MINT64>()); metadataA.update(MTK_SENSOR_INFO_EXPOSURE_TIME_RANGE, entryA); } { //need to add query from kernel IMetadata::IEntry entryA(MTK_SENSOR_INFO_MAX_FRAME_DURATION); entryA.push_back(50000000000, Type2Type<MINT64>()); metadataA.update(MTK_SENSOR_INFO_MAX_FRAME_DURATION, entryA); } { //need to add query from kernel IMetadata::IEntry entryA(MTK_SENSOR_INFO_PHYSICAL_SIZE); entryA.push_back(5.82, Type2Type<MFLOAT>()); entryA.push_back(4.76, Type2Type<MFLOAT>()); metadataA.update(MTK_SENSOR_INFO_PHYSICAL_SIZE, entryA); } { //need to add query from kernel IMetadata::IEntry entryA(MTK_SENSOR_INFO_PIXEL_ARRAY_SIZE); MSize Size1(4000,3000); entryA.push_back(Size1, Type2Type<MSize>()); metadataA.update(MTK_SENSOR_INFO_PIXEL_ARRAY_SIZE, entryA); } { //need to add query from kernel IMetadata::IEntry entryA(MTK_SENSOR_INFO_WHITE_LEVEL); switch (sensorStaticInfo[idx].rawSensorBit) { case RAW_SENSOR_8BIT: s32Para = 256; break; case RAW_SENSOR_10BIT: s32Para = 1024; break; case RAW_SENSOR_12BIT: s32Para = 4096; break; case RAW_SENSOR_14BIT: s32Para = 16384; break; default: s32Para = 256; break; } entryA.push_back(s32Para, Type2Type<MINT32>()); metadataA.update(MTK_SENSOR_INFO_WHITE_LEVEL, entryA); } { IMetadata::IEntry entryA(MTK_SENSOR_INFO_ORIENTATION); entryA.push_back((MINT32)sensorStaticInfo[idx].orientationAngle, Type2Type<MINT32>()); metadataA.update(MTK_SENSOR_INFO_ORIENTATION, entryA); } { IMetadata::IEntry entryA(MTK_SENSOR_INFO_PACKAGE); { IMetadata metadataB; { IMetadata::IEntry entryB(MTK_SENSOR_INFO_SCENARIO_ID); entryB.push_back((MINT32)SENSOR_SCENARIO_ID_NORMAL_PREVIEW,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_SCENARIO_ID, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_FRAME_RATE); entryB.push_back((MINT32)sensorStaticInfo[idx].previewFrameRate,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_FRAME_RATE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE); MSize size1(sensorStaticInfo[idx].previewWidth,sensorStaticInfo[idx].previewHeight); entryB.push_back(size1,Type2Type<MSize>()); metadataB.update(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY); MRect region1(MPoint(0,0), MSize(sensorStaticInfo[idx].previewWidth,sensorStaticInfo[idx].previewHeight)); entryB.push_back(region1,Type2Type<MRect>()); metadataB.update(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY, entryB); } entryA.push_back(metadataB,Type2Type<IMetadata>()); } { IMetadata metadataB; { IMetadata::IEntry entryB(MTK_SENSOR_INFO_SCENARIO_ID); entryB.push_back((MINT32)SENSOR_SCENARIO_ID_NORMAL_CAPTURE,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_SCENARIO_ID, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_FRAME_RATE); entryB.push_back((MINT32)sensorStaticInfo[idx].captureFrameRate,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_FRAME_RATE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE); MSize size1(sensorStaticInfo[idx].captureWidth,sensorStaticInfo[idx].captureHeight); entryB.push_back(size1,Type2Type<MSize>()); metadataB.update(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY); MRect region1(MPoint(0,0), MSize(sensorStaticInfo[idx].captureWidth,sensorStaticInfo[idx].captureHeight)); entryB.push_back(region1,Type2Type<MRect>()); metadataB.update(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY, entryB); } entryA.push_back(metadataB,Type2Type<IMetadata>()); } { IMetadata metadataB; { IMetadata::IEntry entryB(MTK_SENSOR_INFO_SCENARIO_ID); entryB.push_back((MINT32)SENSOR_SCENARIO_ID_NORMAL_VIDEO,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_SCENARIO_ID, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_FRAME_RATE); entryB.push_back((MINT32)sensorStaticInfo[idx].videoFrameRate,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_FRAME_RATE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE); MSize size1(sensorStaticInfo[idx].videoWidth,sensorStaticInfo[idx].videoHeight); entryB.push_back(size1,Type2Type<MSize>()); metadataB.update(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY); MRect region1(MPoint(0,0), MSize(sensorStaticInfo[idx].videoWidth,sensorStaticInfo[idx].videoHeight)); entryB.push_back(region1,Type2Type<MRect>()); metadataB.update(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY, entryB); } entryA.push_back(metadataB,Type2Type<IMetadata>()); } { IMetadata metadataB; { IMetadata::IEntry entryB(MTK_SENSOR_INFO_SCENARIO_ID); entryB.push_back((MINT32)SENSOR_SCENARIO_ID_SLIM_VIDEO1,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_SCENARIO_ID, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_FRAME_RATE); entryB.push_back((MINT32)sensorStaticInfo[idx].video1FrameRate,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_FRAME_RATE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE); MSize size1(sensorStaticInfo[idx].video1Width,sensorStaticInfo[idx].video1Height); entryB.push_back(size1,Type2Type<MSize>()); metadataB.update(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY); MRect region1(MPoint(0,0), MSize(sensorStaticInfo[idx].video1Width,sensorStaticInfo[idx].video1Height)); entryB.push_back(region1,Type2Type<MRect>()); metadataB.update(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY, entryB); } entryA.push_back(metadataB,Type2Type<IMetadata>()); } { IMetadata metadataB; { IMetadata::IEntry entryB(MTK_SENSOR_INFO_SCENARIO_ID); entryB.push_back((MINT32)SENSOR_SCENARIO_ID_SLIM_VIDEO2,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_SCENARIO_ID, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_FRAME_RATE); entryB.push_back((MINT32)sensorStaticInfo[idx].video2FrameRate,Type2Type<MINT32>()); metadataB.update(MTK_SENSOR_INFO_FRAME_RATE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE); MSize size1(sensorStaticInfo[idx].video2Width,sensorStaticInfo[idx].video2Height); entryB.push_back(size1,Type2Type<MSize>()); metadataB.update(MTK_SENSOR_INFO_REAL_OUTPUT_SIZE, entryB); } { IMetadata::IEntry entryB(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY); MRect region1(MPoint(0,0), MSize(sensorStaticInfo[idx].video2Width,sensorStaticInfo[idx].video2Height)); entryB.push_back(region1,Type2Type<MRect>()); metadataB.update(MTK_SENSOR_INFO_OUTPUT_REGION_ON_ACTIVE_ARRAY, entryB); } entryA.push_back(metadataB,Type2Type<IMetadata>()); } metadataA.update(MTK_SENSOR_INFO_PACKAGE, entryA); } metadataA.sort(); } MY_LOGD("impBuildSensorInfo end!\n"); }