//----------------------------------------------------------------------------- PictureHolder::PictureHolder() { dataSlicesArray.fill(nullptr); stridesArray.fill(0); format = -1; dimension = MSize(0,0); }
CTaskStk *TaskStkNew(I64 stk_size,CTask *task) { CTaskStk *temps=MAlloc(stk_size+offset(CTaskStk.stk_base),task); temps->next_stk=NULL; temps->stk_ptr=NULL; temps->stk_size=MSize(temps)-offset(CTaskStk.stk_base); return temps; }
void OnSize(HWND hWnd) { if (!g_bInited) return; g_sv.clear(); MRect rcClient; ::GetClientRect(hWnd, &rcClient); for (int i = 0; i < c_nCtrls; ++i) { MRect rcCtrl(MPoint(0, c_height * i), MSize(rcClient.Width(), c_height)); g_sv.AddCtrlInfo(g_ahwndCtrls[i], rcCtrl); } g_sv.SetExtentForAllCtrls(); g_sv.UpdateAll(); }
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); } } }
/******************************************************************************* * Config CamIO Pipe /floria ********************************************************************************/ int Ts_UT:: main_ts_IOPipe_ZSD(int count) { // int count = 1000; //enque, deque loop iterations printf("[iopipetest] E\n"); //for Enqueue, raw buf MUINT32 u4RawBufSize = (u4SensorWidth * u4SensorHeight * 2 + L1_CACHE_BYTES-1) & ~(L1_CACHE_BYTES-1); //for buffer per frame int BufIdx = BUF_NUM, nCt = BUF_NUM; #ifdef USE_IMAGEBUF_HEAP MUINT32 bufStridesInBytes[3] = {1600, 0, 0}; MINT32 bufBoundaryInBytes[3] = {0, 0, 0}; #endif #if 0 ringbuffer* mpRingImgo = new ringbuffer( 2,//PASS1_FULLRAW PORT_IMGO, 0//fakeResized ? PASS1_RESIZEDRAW : 0 ); #endif MY_LOGD("+"); /*------------------------------ * (1) Create Instance *-----------------------------*/ /* eScenarioID_VSS, eScenarioFmt_RAW */ MUINT mSensorIdx = 0;//0:MAIN const char Name = '1'; MUINT mIspEnquePeriod = 1; prepareSensor();//test IHalSensor printf("[iopipetest] INormalPipe::createInstance\n"); mpCamIO = (INormalPipe*)INormalPipe::createInstance(mSensorIdx, &Name, mIspEnquePeriod); #if 0//camera 3.0, should create INormalPipe_FrmB class instance mpCamIO = (IHalCamIO*)INormalPipe_FrmB::createInstance(mSensorIdx, &Name, mIspEnquePeriod); #endif /*------------------------------ test 3A build pass ------------------------------*/ #if 0 MINT32 handle; MBOOL fgRet = mpCamIO->sendCommand(NSImageio_FrmB::NSIspio_FrmB::EPIPECmd_GET_MODULE_HANDLE, NSImageio_FrmB::NSIspio_FrmB::EModule_AF, (MINT32)&handle, (MINT32)(&("AFMgr::setFlkWinConfig()"))); MINT32 wintmp; IOPIPE_SET_MODUL_REG(handle, CAM_AF_WINX01, wintmp); #endif /*------------------------------ * (2) init *-----------------------------*/ printf("[iopipetest] mpCamIO->init\n"); if(!mpCamIO->init()) { printf("[iopipetest] mpCamIO->init failed!!\n"); } /*------------------------------ * (3). Config pipe + RAW10 *-----------------------------*/ MSize mDstSize; mDstSize.w = u4SensorWidth; mDstSize.h = u4SensorHeight; //prepare sensor config vector<IHalSensor::ConfigParam> vSensorCfg; IHalSensor::ConfigParam sensorCfg = { mSensorIdx, /* index */ mDstSize, /* crop no reference in NormalPipe */ u4Scenario, /* scenarioId */ 0, /* isBypassScenario */ 1, /* isContinuous */ 0, /* iHDROn */ 0, /* framerate */ 0, /* two pixel on */ 0, /* debugmode */ }; vSensorCfg.push_back(sensorCfg); printf("[iopipetest] sensor %dx%d, sce %d, bypass %d, con %d, hdr %d, fps %d, twopxl %d\n", sensorCfg.crop.w, sensorCfg.crop.h, sensorCfg.scenarioId, sensorCfg.isBypassScenario, sensorCfg.isContinuous, sensorCfg.HDRMode, sensorCfg.framerate, sensorCfg.twopixelOn); // vector<portInfo> vPortInfo; // portInfo OutPort( PORT_IMGO, eImgFmt_BAYER10, mDstSize, //dst size 0, //pPortCfg->mCrop, //crop u4SensorWidth, //pPortCfg->mStrideInByte[0], 0, //pPortCfg->mStrideInByte[1], 0, //pPortCfg->mStrideInByte[2], 0, // pureraw MTRUE //packed ); vPortInfo.push_back(OutPort); printf("[iopipetest] config portID(0x%x), fmt(%u), size(%dx%d), crop(%u,%u,%u,%u)\n", OutPort.mPortID, OutPort.mFmt, OutPort.mDstSize.w, OutPort.mDstSize.h, OutPort.mCropRect.p.x, OutPort.mCropRect.p.y, OutPort.mCropRect.s.w, OutPort.mCropRect.s.h); printf("[iopipetest] stride(%u,%u,%u), pureRaw(%u), pack(%d)\n", OutPort.mStride[0], OutPort.mStride[1], OutPort.mStride[2], OutPort.mPureRaw, OutPort.mPureRawPak); // QInitParam halCamIOinitParam( 0, u4Bitdepth, vSensorCfg, vPortInfo); printf("[iopipetest] mpCamIO->configPipe\n"); if(!mpCamIO->configPipe(halCamIOinitParam, eScenarioID_VSS)) { printf("[iopipetest] mpCamIO->configPipe failed!!\n"); goto TEST_EXIT; } /*------------------------------ * (4). Enqueue * 4.1, raw buf *-----------------------------*/ #ifdef _USE_THREAD_QUE_ if(vRawMem.size() > 0) { freeRawMem(); TS_Thread_UnInit(); } nCt--; #else // int nReplace; printf("*****************************************\n"); printf("Buffer per frame(1:y; else:n)\n"); scanf("%d", &nReplace); printf("*****************************************\n"); if(nReplace != 1) { nCt--; } #endif /* * * * * * * * * * * * * buffer per frame * nReplace = 1 * size = BUF_NUM + 1 *(replace buffer) * * * * * * * * * * * * * sequential buffer * nReplace != 1 * size = BUF_NUM *(no replace buffer) * * * * * * * * * * * */ printf("[iopipetest] allocMem: RawBuff\n"); for (int i = 0; i <= nCt; i++) //BUF_NUM=3 { IMEM_BUF_INFO rBuf; rBuf.size = u4RawBufSize; allocMem(rBuf); #ifdef USE_IMAGEBUF_HEAP PortBufInfo_v1 portBufInfo = PortBufInfo_v1( rBuf.memID,rBuf.virtAddr,0,rBuf.bufSecu, rBuf.bufCohe); IImageBufferAllocator::ImgParam imgParam = IImageBufferAllocator::ImgParam((eImgFmt_BAYER10), MSize(1280, 720), bufStridesInBytes, bufBoundaryInBytes, 1); sp<ImageBufferHeap> pHeap = ImageBufferHeap::create( LOG_TAG, imgParam,portBufInfo,MTRUE); IImageBuffer* tempBuffer = pHeap->createImageBuffer(); tempBuffer->incStrong(tempBuffer); tempBuffer->lockBuf(LOG_TAG,eBUFFER_USAGE_HW_CAMERA_READWRITE | eBUFFER_USAGE_SW_READ_OFTEN); // BufInfo rBufInfo; rBufInfo.mPortID = PORT_IMGO; rBufInfo.mBuffer = tempBuffer; rBufInfo.FrameBased.mMagicNum_tuning = 0; rBufInfo.FrameBased.mDstSize = mDstSize; rBufInfo.FrameBased.mCropRect = MRect(MPoint(0, 0), mDstSize);//no crop rRawBuf.mvOut.push_back(rBufInfo); #endif vRawMem.push_back(rBuf); printf("[iopipetest] vRawMem(%d)PA(0x%x)VA(0x%x)\n", i, vRawMem.at(i).phyAddr,vRawMem.at(i).virtAddr); } //for deque for (int i = 0; i <= 0; i++) { IMEM_BUF_INFO rBuf; rBuf.size = u4RawBufSize; allocMem(rBuf); #ifdef USE_IMAGEBUF_HEAP PortBufInfo_v1 portBufInfo = PortBufInfo_v1( rBuf.memID,rBuf.virtAddr,0,rBuf.bufSecu, rBuf.bufCohe); IImageBufferAllocator::ImgParam imgParam = IImageBufferAllocator::ImgParam((eImgFmt_BAYER10), MSize(1280, 720), bufStridesInBytes, bufBoundaryInBytes, 1); sp<ImageBufferHeap> pHeap = ImageBufferHeap::create( LOG_TAG, imgParam,portBufInfo,MTRUE); IImageBuffer* tempBuffer = pHeap->createImageBuffer(); tempBuffer->incStrong(tempBuffer); tempBuffer->lockBuf(LOG_TAG,eBUFFER_USAGE_HW_CAMERA_READWRITE | eBUFFER_USAGE_SW_READ_OFTEN); // BufInfo rBufInfo; rBufInfo.mPortID = PORT_IMGO; rBufInfo.mBuffer = tempBuffer; rDequeBuf.mvOut.push_back(rBufInfo); #endif vDequeMem.push_back(rBuf); printf("[iopipetest] vDequeMem(%d)PA(0x%x)VA(0x%x)\n", i, vDequeMem.at(i).phyAddr, vDequeMem.at(i).virtAddr); } /* enque 3 buffers */ for (int i = 0; i < BUF_NUM; i++) { #if 1 QBufInfo rInBuf; rInBuf.mvOut.clear(); #ifdef USE_IMAGEBUF_HEAP BufInfo rBufInfo(PORT_IMGO, rRawBuf.mvOut.at(i).mBuffer, rRawBuf.mvOut.at(i).mSize, rRawBuf.mvOut.at(i).mVa, rRawBuf.mvOut.at(i).mPa); #else BufInfo rBufInfo(PORT_IMGO, NULL, vRawMem.at(i).size, vRawMem.at(i).virtAddr, vRawMem.at(i).phyAddr); #endif rInBuf.mvOut.push_back(rBufInfo); rInBuf.mvOut.at(0).FrameBased.mMagicNum_tuning = 0; rInBuf.mvOut.at(0).FrameBased.mDstSize = mDstSize; rInBuf.mvOut.at(0).FrameBased.mCropRect = MRect(MPoint(0, 0), mDstSize);//no crop #ifdef USE_IMAGEBUF_HEAP printf("[iopipetest] enque.PA(0x%x)VA(0x%x)buf(0x%x)\n", rInBuf.mvOut.at(0).mBuffer->getBufPA(0), rInBuf.mvOut.at(0).mBuffer->getBufVA(0), rInBuf.mvOut.at(0).mBuffer); #else printf("[iopipetest] enque.PA(0x%x)VA(0x%x)\n", rInBuf.mvOut.at(0).mPa, rInBuf.mvOut.at(0).mVa); #endif printf("[iopipetest] enque(%d)\n", i); if(!mpCamIO->enque(rInBuf)) { printf("[iopipetest] enque failed!!\n"); goto TEST_EXIT; } #else /* * * * * * * * * * * * * * * * * * * * * * * * * * * test: * if enque a buffer,and it's port is not IMGO, * mpCamIO->enque(rRawBuf)will return MFALSE * * * * * * * * * * * * * * * * * * * * * * * * * */ QBufInfo rInBuf; rInBuf.mvOut.clear(); #ifdef USE_IMAGEBUF_HEAP BufInfo rBufInfo2(PORT_IMGO, rRawBuf.mvOut.at(i).mBuffer, rRawBuf.mvOut.at(i).mSize, rRawBuf.mvOut.at(i).mVa, rRawBuf.mvOut.at(i).mPa); #else BufInfo rBufInfo2(PORT_IMG2O, NULL, vRawMem.at(i).size, vRawMem.at(i).virtAddr, vRawMem.at(i).phyAddr); #endif rInBuf.mvOut.push_back(rBufInfo2); printf("[iopipetest] enque(%d)\n", i); if(!mpCamIO->enque(rInBuf)){//try to enque IMGO port printf("[iopipetest] enque(%d) again\n", i); rInBuf.mvOut.clear(); BufInfo rBufInfo(PORT_IMGO, NULL, vRawMem.at(i).size, vRawMem.at(i).virtAddr, vRawMem.at(i).phyAddr); rInBuf.mvOut.push_back(rBufInfo); if(!mpCamIO->enque(rInBuf)) { printf("[iopipetest] enque failed!!\n"); goto TEST_EXIT; } } #endif } /*------------------------------ * (5). start *-----------------------------*/ printf("[iopipetest] mpCamIO->start\n"); if(!mpCamIO->start()) { printf("[iopipetest] mpCamIO->start failed!!\n"); goto TEST_EXIT; } #if 0//for debug // test: wait VSYNC printf("[iopipetest] mpCamIO->irq(VSYNC)\n"); if(!mpCamIO->wait(mSensorIdx, EPipeSignal_SOF)) { printf("[iopipetest] wait VSYNC failed!!\n"); goto TEST_EXIT; } // test: wait pass1 done printf("[iopipetest] mpCamIO->irq(p1done)\n"); if(!mpCamIO->wait(mSensorIdx, EPipeSignal_EOF)) { printf("[iopipetest] wait p1done failed!!\n"); goto TEST_EXIT; } #endif /*------------------------------ * (6). deque/enque loop * --> dequeue * --> enqueue *-----------------------------*/ #ifdef _USE_THREAD_QUE_ TS_Thread_Init(count); #else do { printf("-------------------------------------------\n"); QBufInfo halCamIOOutQBuf; QBufInfo rEnBuf; // halCamIOOutQBuf.mvOut.clear(); #ifdef USE_IMAGEBUF_HEAP BufInfo rDeBufInfo(PORT_IMGO, rDequeBuf.mvOut.at(0).mBuffer, rDequeBuf.mvOut.at(0).mSize, rDequeBuf.mvOut.at(0).mVa, rDequeBuf.mvOut.at(0).mPa); #else BufInfo rDeBufInfo(PORT_IMGO, NULL, vDequeMem.at(0).size, vDequeMem.at(0).virtAddr, vDequeMem.at(0).phyAddr); #endif halCamIOOutQBuf.mvOut.push_back(rDeBufInfo); #ifdef USE_IMAGEBUF_HEAP //do nothing #else printf("[iopipetest] dequeBuf.PA(0x%x)VA(0x%x)size(%d)\n", halCamIOOutQBuf.mvOut.at(0).mPa, halCamIOOutQBuf.mvOut.at(0).mVa, halCamIOOutQBuf.mvOut.size()); #endif // printf("[iopipetest] dequeBuf count(%d)\n", count); if(!mpCamIO->deque(halCamIOOutQBuf)) { printf("[iopipetest] deque failed!!\n"); goto TEST_EXIT; } #ifdef USE_IMAGEBUF_HEAP printf("[iopipetest] dequeBuf.PA(0x%x)VA(0x%x)buf(0x%x)\n", halCamIOOutQBuf.mvOut.at(0).mBuffer->getBufPA(0), halCamIOOutQBuf.mvOut.at(0).mBuffer->getBufVA(0), halCamIOOutQBuf.mvOut.at(0).mBuffer); #else printf("[iopipetest] dequeBuf.PA(0x%x)VA(0x%x)\n", halCamIOOutQBuf.mvOut.at(0).mPa, halCamIOOutQBuf.mvOut.at(0).mVa); #endif /* * * * * * * * * * * * * get ResultMetadata * * * * * * * * * * * */ ResultMetadata result = halCamIOOutQBuf.mvOut.at(0).mMetaData; /* * * * * * * * * * * * * check dummy frame * * * * * * * * * * * */ if(halCamIOOutQBuf.mvOut.at(0).mMetaData.m_bDummyFrame == MTRUE) { printf("[iopipetest] this is a dummy frame\n"); } /* * * * * * * * * * * * * sequential buffer *(no replace buffer) * * * * * * * * * * * */ if(nReplace != 1) { rEnBuf.mvOut.clear(); BufInfo rBufInfo(PORT_IMGO, #ifdef USE_IMAGEBUF_HEAP halCamIOOutQBuf.mvOut.at(0).mBuffer, #else NULL, #endif halCamIOOutQBuf.mvOut.at(0).mSize, halCamIOOutQBuf.mvOut.at(0).mVa, halCamIOOutQBuf.mvOut.at(0).mPa); rEnBuf.mvOut.push_back(rBufInfo); } /* * * * * * * * * * * * * buffer per frame *(replace buffer) * * * * * * * * * * * */ else { rEnBuf.mvOut.clear(); #ifdef USE_IMAGEBUF_HEAP BufInfo rBufInfo(PORT_IMGO, rRawBuf.mvOut.at(BufIdx).mBuffer, rRawBuf.mvOut.at(BufIdx).mSize, rRawBuf.mvOut.at(BufIdx).mVa, rRawBuf.mvOut.at(BufIdx).mPa); #else BufInfo rBufInfo(PORT_IMGO, NULL, vRawMem.at(BufIdx).size, vRawMem.at(BufIdx).virtAddr, vRawMem.at(BufIdx).phyAddr); #endif rEnBuf.mvOut.push_back(rBufInfo); } #ifdef USE_IMAGEBUF_HEAP printf("[iopipetest] enqueBuf.PA(0x%x)VA(0x%x),BufId(%d)\n", rEnBuf.mvOut.at(0).mBuffer->getBufPA(0), rEnBuf.mvOut.at(0).mBuffer->getBufVA(0), BufIdx); #else printf("[iopipetest] enqueBuf.PA(0x%x)VA(0x%x),BufId(%d)\n", rEnBuf.mvOut.at(0).mPa, rEnBuf.mvOut.at(0).mVa, BufIdx); #endif /* * * * * * * * * * * * * setting before enque * * * * * * * * * * * */ rEnBuf.mvOut.at(0).FrameBased.mMagicNum_tuning = 0; rEnBuf.mvOut.at(0).FrameBased.mDstSize = mDstSize; rEnBuf.mvOut.at(0).FrameBased.mCropRect = MRect(MPoint(0, 0), mDstSize);//no crop // printf("[iopipetest] enque count(%d)\n", count); if(!mpCamIO->enque(rEnBuf)) { printf("[iopipetest] enque failed!!\n"); goto TEST_EXIT; } // if(++BufIdx > BUF_NUM) BufIdx = 0; // } while(--count > 0); #endif /*------------------------------ * (7). Stop *-----------------------------*/ printf("[iopipetest] mpCamIO->stop\n"); mpCamIO->stop(); TEST_EXIT: /*------------------------------ * (8). uninit *-----------------------------*/ printf("[iopipetest] mpCamIO->uninit\n"); if( !mpCamIO->uninit() ) { MY_LOGE("uninit failed"); } /*------------------------------ * (9). destory instance *-----------------------------*/ printf("[iopipetest] mpCamIO->destroyInstance\n"); mpCamIO->destroyInstance(&Name); mpCamIO = NULL; printf("[iopipetest] X\n"); return 0; }
/******************************************************************************* * Sensor init ********************************************************************************/ int Ts_IT::sensorInit() { #if FAKE_SENSOR == 1 TS_FakeSensorList *pHalSensorList = 0; #else IHalSensorList *pHalSensorList = 0; #endif MUINT32 sensorNum = 0; MINT32 supportedSensorDev = 0; MINT32 ret; MY_LOGD("E\n"); mSensorDev = m_CurDev; MUINT32 tg_grab_w = 0; MUINT32 tg_grab_h = 0; MUINT32 max_prv_w = 0; MUINT32 max_prv_h = 0; #if FAKE_SENSOR == 1 pHalSensorList = TS_FakeSensorList::get(); #else pHalSensorList = IHalSensorList::get(); #endif pHalSensorList->searchSensors(); sensorNum = pHalSensorList->queryNumberOfSensors(); if (sensorNum == 0) { MY_LOGE("Sensor Not found"); return -1; } //Get sensor information for (MUINT i = 0; i < sensorNum; i++){ MY_LOGD("name:%s type:%d", pHalSensorList->queryDriverName(i), 0/*pHalSensorList->queryType(i)*/);//debug MY_LOGD("index:%d, SensorDevIdx:%d",i ,pHalSensorList->querySensorDevIdx(i));//debug supportedSensorDev |= pHalSensorList->querySensorDevIdx(i); } //====================================================== // Open sensor device //====================================================== for (MUINT i = 0; i < sensorNum; i++){ if (pHalSensorList->querySensorDevIdx(i) == mSensorDev) { mSensorIndex = i; break; } } MY_LOGD("mSensorIndex = %d",mSensorIndex); //====== Sensor Init====== //set current sensor device mpSensorHal = pHalSensorList->createSensor(mSensorCallerName, 1, &mSensorIndex);//modify if (mpSensorHal == NULL) { MY_LOGE("mpSensorHal is NULL"); return -1; } //mSensorInit = MTRUE; //====================================================== // Get sensor size //====================================================== pHalSensorList->querySensorStaticInfo(mSensorDev, &sensorStaticInfo[0]); u4SensorHalfWidth = sensorStaticInfo[0].previewWidth; u4SensorHalfHeight = sensorStaticInfo[0].previewHeight; u4SensorFullWidth = sensorStaticInfo[0].captureWidth; u4SensorFullHeight = sensorStaticInfo[0].captureHeight; MY_LOGD("Sensor resolution, Prv(%d,%d),Full(%d,%d)\n",u4SensorHalfWidth, u4SensorHalfHeight, u4SensorFullWidth, u4SensorFullHeight); //mSensorModeNum = sensorStaticInfo[0].SensorModeNum; //====================================================== // Sensor power on //====================================================== mpSensorHal->powerOn(mSensorCallerName, 1, &mSensorIndex); //====== Get Sensor Size ====== if (mode == 0) { u4SensorWidth = u4SensorHalfWidth; u4SensorHeight = u4SensorHalfHeight; } else { u4SensorWidth = u4SensorFullWidth; u4SensorHeight = u4SensorFullHeight; } IHalSensor::ConfigParam configParam[2]; configParam[0].index = mSensorIndex; configParam[0].isBypassScenario = 0; configParam[0].isContinuous = 1; configParam[0].HDRMode = 0; configParam[0].framerate = 0; configParam[0].twopixelOn = 0; configParam[0].debugMode = 0; //1 for output test model from seninf if (mode == 0) { configParam[0].scenarioId = SENSOR_SCENARIO_ID_NORMAL_PREVIEW; configParam[0].crop = MSize(sensorStaticInfo[0].previewWidth, sensorStaticInfo[0].previewHeight); } else { // sensor full size configParam[0].scenarioId = SENSOR_SCENARIO_ID_NORMAL_CAPTURE; configParam[0].crop = MSize(sensorStaticInfo[0].captureWidth, sensorStaticInfo[0].captureHeight); } mpSensorHal->configure(1, &configParam[0]); mpSensorHal->querySensorDynamicInfo(mSensorDev, &sensorDynamicInfo[0]); if (m_TestCase == 0) { MINT32 u32Enable = 1; mpSensorHal->sendCommand(mSensorDev, SENSOR_CMD_SET_TEST_PATTERN_OUTPUT, (MUINTPTR)&u32Enable, 0, 0); MY_LOGD("Sensor Test Pattern"); } MY_LOGD("X\n"); return 0; }
MBOOL EngBufHandlerImpl:: dequeBuffer(MUINT32 const data, ImgRequest * pImgReq) { Mutex::Autolock _l(mLock); // MBOOL isDequeProvider = MFALSE; MBOOL doCacheInvalid = MFALSE; MINT32 bufQueIdx = mapNode2Dst(data); ImgBufQueNode node; list<MAP_PORT_INFO>::iterator iterMapPort; // #if 0 MY_LOGD("data(0x%08X)",data); #endif // if(bufQueIdx == -1) { return MFALSE; } // for(iterMapPort = mlMapPort[bufQueIdx].begin(); iterMapPort != mlMapPort[bufQueIdx].end(); iterMapPort++) { #if 0 MY_LOGD("bufQueIdx(%d),data(%d,%d),bufType(%d)", bufQueIdx,data, (*iterMapPort).nodeType, (*iterMapPort).bufType); #endif if(data == (*iterMapPort).nodeType) { sp<IImgBufProvider> bufProvider = NULL; pImgReq->mUsage = NSIoPipe::EPortCapbility_None; switch((*iterMapPort).bufType) { case eBuf_Disp: { bufProvider = mspImgBufProvidersMgr->getDisplayPvdr(); pImgReq->mUsage = NSIoPipe::EPortCapbility_Disp; break; } case eBuf_Rec: { bufProvider = mspImgBufProvidersMgr->getRecCBPvdr(); pImgReq->mUsage = NSIoPipe::EPortCapbility_Rcrd; break; } case eBuf_AP: { bufProvider = mspImgBufProvidersMgr->getPrvCBPvdr(); doCacheInvalid = MTRUE; break; } case eBuf_Generic: { bufProvider = mspImgBufProvidersMgr->getGenericBufPvdr(); break; } case eBuf_FD: { bufProvider = mspImgBufProvidersMgr->getFDBufPvdr(); break; } case eBuf_OT: { bufProvider = mspImgBufProvidersMgr->getOTBufPvdr(); break; } default: { MY_LOGE("un-supported bufType(%d)",(*iterMapPort).bufType); return MFALSE; } } // if(bufProvider != 0 && bufProvider->dequeProvider(node)) { node.setCookieDE((*iterMapPort).bufType); mvBufQueNode[bufQueIdx].push_back(node); isDequeProvider = MTRUE; break; } } } // if(isDequeProvider) { size_t bufStridesInBytes[] = { GET_IIMGBUF_IMG_STRIDE_IN_BYTE(node.getImgBuf(), 0), GET_IIMGBUF_IMG_STRIDE_IN_BYTE(node.getImgBuf(), 1), GET_IIMGBUF_IMG_STRIDE_IN_BYTE(node.getImgBuf(), 2)}; size_t bufBoundaryInBytes[] = {0,0,0}; IImageBufferAllocator::ImgParam imgParam = IImageBufferAllocator::ImgParam( Format::queryImageFormat(node.getImgBuf()->getImgFormat().string()), MSize( node.getImgBuf()->getImgWidth(), node.getImgBuf()->getImgHeight()), bufStridesInBytes, bufBoundaryInBytes, Format::queryPlaneCount(Format::queryImageFormat(node.getImgBuf()->getImgFormat().string()))); PortBufInfo_v1 portBufInfo = PortBufInfo_v1( node.getImgBuf()->getIonFd(), (MUINTPTR)node.getImgBuf()->getVirAddr(), 0, node.getImgBuf()->getBufSecu(), node.getImgBuf()->getBufCohe()); // sp<ImageBufferHeap> pHeap = ImageBufferHeap::create( LOG_TAG, imgParam, portBufInfo, mbEnableIImageBufferLog); if(pHeap == 0) { MY_LOGE("pHeap is NULL"); return MFALSE; } // IImageBuffer* tempBuffer = pHeap->createImageBuffer(); tempBuffer->incStrong(tempBuffer); tempBuffer->lockBuf( LOG_TAG, eBUFFER_USAGE_HW_CAMERA_READWRITE | eBUFFER_USAGE_SW_READ_OFTEN); if( doCacheInvalid ) { if( !tempBuffer->syncCache(eCACHECTRL_INVALID) ) MY_LOGE("invalid cache failed imgbuf 0x%x", tempBuffer); } pImgReq->mBuffer = tempBuffer; if(mbIsForceRotation) { pImgReq->mTransform = mRotationAnagle == 0 ? 0 : mRotationAnagle == 90 ? eTransform_ROT_90 : mRotationAnagle == 180 ? eTransform_ROT_180 : eTransform_ROT_270; } else { pImgReq->mTransform = node.getRotation() == 0 ? 0 : node.getRotation() == 90 ? eTransform_ROT_90 : node.getRotation() == 180 ? eTransform_ROT_180 : eTransform_ROT_270; } // #if 0 MY_LOGD("Node:DE(%d),VA(0x%08X),S(%d),Id(%d)", node.getCookieDE(), (MUINT32)node.getImgBuf()->getVirAddr(), node.getImgBuf()->getBufSize(), node.getImgBuf()->getIonFd()); MY_LOGD("Node:F(%s),W(%d),H(%d),Str(%d,%d,%d),Rot(%d)", node.getImgBuf()->getImgFormat().string(), node.getImgBuf()->getImgWidth(), node.getImgBuf()->getImgHeight(), GET_IIMGBUF_IMG_W_STRIDE(node.getImgBuf(), 0), GET_IIMGBUF_IMG_W_STRIDE(node.getImgBuf(), 1), GET_IIMGBUF_IMG_W_STRIDE(node.getImgBuf(), 2), node.getRotation()); #endif // #if 1 MY_LOGD("buf(%p),heap(%p),VA(0x%08X/0x%08X/0x%08X),PA(0x%08X/0x%08X/0x%08X),BS(%d=%d+%d+%d),Id(%d),F(0x%08X),S(%dx%d),Str(%d,%d,%d),R(%d),U(%d)", pImgReq->mBuffer, pImgReq->mBuffer->getImageBufferHeap(), GET_IIMAGEBUFFER_BUF_VA(pImgReq->mBuffer, 0), GET_IIMAGEBUFFER_BUF_VA(pImgReq->mBuffer, 1), GET_IIMAGEBUFFER_BUF_VA(pImgReq->mBuffer, 2), GET_IIMAGEBUFFER_BUF_PA(pImgReq->mBuffer, 0), GET_IIMAGEBUFFER_BUF_PA(pImgReq->mBuffer, 1), GET_IIMAGEBUFFER_BUF_PA(pImgReq->mBuffer, 2), ( GET_IIMAGEBUFFER_BUF_SIZE(pImgReq->mBuffer, 0)+ GET_IIMAGEBUFFER_BUF_SIZE(pImgReq->mBuffer, 1)+ GET_IIMAGEBUFFER_BUF_SIZE(pImgReq->mBuffer, 2)), GET_IIMAGEBUFFER_BUF_SIZE(pImgReq->mBuffer, 0), GET_IIMAGEBUFFER_BUF_SIZE(pImgReq->mBuffer, 1), GET_IIMAGEBUFFER_BUF_SIZE(pImgReq->mBuffer, 2), pImgReq->mBuffer->getFD(), pImgReq->mBuffer->getImgFormat(), pImgReq->mBuffer->getImgSize().w, pImgReq->mBuffer->getImgSize().h, GET_IIMAGEBUFFER_BUF_STRIDE_IN_BYTE(pImgReq->mBuffer, 0), GET_IIMAGEBUFFER_BUF_STRIDE_IN_BYTE(pImgReq->mBuffer, 1), GET_IIMAGEBUFFER_BUF_STRIDE_IN_BYTE(pImgReq->mBuffer, 2), pImgReq->mTransform, pImgReq->mUsage); #endif // return MTRUE; } // #if 0 MY_LOGD("empty data(0x%08X)",data); #endif return MFALSE; }
MImagePV() { sws = nullptr; lastCvtFmt = -1; lastCvtSize = MSize(0,0); }
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"); }