1 /* 2 * RkAiqCamgroupHandle.h 3 * 4 * Copyright (c) 2019 Rockchip Corporation 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 */ 19 20 #ifndef _RK_AIQ_CAMGROUP_HANDLE_H_ 21 #define _RK_AIQ_CAMGROUP_HANDLE_H_ 22 23 #include "algos/rk_aiq_algo_des.h" 24 #include "rk_aiq_algo_camgroup_types.h" 25 #include "xcore/xcam_mutex.h" 26 27 namespace RkCam { 28 29 class RkAiqCamGroupManager; 30 class RkAiqCore; 31 32 class RkAiqCamgroupHandle { 33 public: 34 explicit RkAiqCamgroupHandle(RkAiqAlgoDesComm* des, 35 RkAiqCamGroupManager* camGroupMg); 36 virtual ~RkAiqCamgroupHandle (); 37 virtual XCamReturn prepare(RkAiqCore* aiqCore); 38 virtual XCamReturn processing(rk_aiq_singlecam_3a_result_t** resArray); setEnable(bool enable)39 void setEnable(bool enable) { mEnable = enable; }; getEnable()40 bool getEnable() { return mEnable; }; getAlgoCtx()41 RkAiqAlgoContext* getAlgoCtx() { return mAlgoCtx; } getAlgoId()42 int getAlgoId() { return mDes->id; } getAlgoType()43 int getAlgoType() { return mDes->type; } setNextHdl(RkAiqCamgroupHandle * next)44 void setNextHdl(RkAiqCamgroupHandle* next) { mNextHdl = next; } setParentHdl(RkAiqCamgroupHandle * parent)45 void setParentHdl(RkAiqCamgroupHandle* parent) { mParentHdl = parent; } getNextHdl()46 RkAiqCamgroupHandle* getNextHdl() { return mNextHdl; } getParent()47 RkAiqCamgroupHandle* getParent() { return mParentHdl; } updateConfig(bool)48 virtual XCamReturn updateConfig(bool /* needSync */) { return XCAM_RETURN_NO_ERROR; }; 49 protected: 50 virtual void init(); 51 virtual void deInit(); 52 void waitSignal(rk_aiq_uapi_mode_sync_e sync = RK_AIQ_UAPI_MODE_DEFAULT); 53 void sendSignal(rk_aiq_uapi_mode_sync_e sync = RK_AIQ_UAPI_MODE_DEFAULT); 54 enum { 55 RKAIQ_CONFIG_COM_PREPARE, 56 RKAIQ_CONFIG_COM_PROC, 57 }; 58 RkAiqAlgoCom* mConfig; 59 RkAiqAlgoCom* mProcInParam; 60 RkAiqAlgoResCom* mProcOutParam; 61 RkAiqAlgoDesComm* mDes; 62 RkAiqAlgoContext* mAlgoCtx; 63 RkAiqCamGroupManager* mGroupMg; 64 RkAiqCore* mAiqCore; 65 bool mEnable; 66 XCam::Mutex mCfgMutex; 67 bool updateAtt; 68 XCam::Cond mUpdateCond; 69 RkAiqCamgroupHandle* mNextHdl; 70 RkAiqCamgroupHandle* mParentHdl; 71 }; 72 73 } // namespace RkCam 74 75 #endif 76