1 /* 2 * Copyright (c) 2019-2021 Rockchip Eletronics Co., Ltd. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef _I_RK_AIQ_RESOURCE_TRANSLATOR_H_ 17 #define _I_RK_AIQ_RESOURCE_TRANSLATOR_H_ 18 19 #include "smartptr.h" 20 #include "xcam_log.h" 21 #include "video_buffer.h" 22 #include "rk_aiq_pool.h" 23 24 namespace RkCam { 25 26 class IRkAiqResourceTranslator { 27 public: IRkAiqResourceTranslator()28 IRkAiqResourceTranslator () 29 : mCamPhyId(-1) 30 , mIsGroupMode(false) 31 , mModuleRotation(0) {}; ~IRkAiqResourceTranslator()32 virtual ~IRkAiqResourceTranslator () {}; 33 translateIspStats(const SmartPtr<VideoBuffer> & from,SmartPtr<RkAiqIspStatsIntProxy> & to,const SmartPtr<RkAiqAecStatsProxy> & aecStat,const SmartPtr<RkAiqAwbStatsProxy> & awbStat,const SmartPtr<RkAiqAfStatsProxy> & afStat,const SmartPtr<RkAiqAtmoStatsProxy> & tmoStat,const SmartPtr<RkAiqAdehazeStatsProxy> & dehazeStat)34 virtual XCamReturn translateIspStats(const SmartPtr<VideoBuffer>& from, 35 SmartPtr<RkAiqIspStatsIntProxy>& to, 36 const SmartPtr<RkAiqAecStatsProxy>& aecStat, 37 const SmartPtr<RkAiqAwbStatsProxy>& awbStat, 38 const SmartPtr<RkAiqAfStatsProxy>& afStat, 39 const SmartPtr<RkAiqAtmoStatsProxy>& tmoStat, 40 const SmartPtr<RkAiqAdehazeStatsProxy>& dehazeStat) { 41 return XCAM_RETURN_BYPASS; 42 } translateAecStats(const SmartPtr<VideoBuffer> & from,SmartPtr<RkAiqAecStatsProxy> & to)43 virtual XCamReturn translateAecStats(const SmartPtr<VideoBuffer>& from, 44 SmartPtr<RkAiqAecStatsProxy>& to) { 45 return XCAM_RETURN_BYPASS; 46 } translateAwbStats(const SmartPtr<VideoBuffer> & from,SmartPtr<RkAiqAwbStatsProxy> & to)47 virtual XCamReturn translateAwbStats(const SmartPtr<VideoBuffer>& from, 48 SmartPtr<RkAiqAwbStatsProxy>& to) { 49 return XCAM_RETURN_BYPASS; 50 } translateAfStats(const SmartPtr<VideoBuffer> & from,SmartPtr<RkAiqAfStatsProxy> & to)51 virtual XCamReturn translateAfStats(const SmartPtr<VideoBuffer>& from, 52 SmartPtr<RkAiqAfStatsProxy>& to) { 53 return XCAM_RETURN_BYPASS; 54 } translateOrbStats(const SmartPtr<VideoBuffer> & from,SmartPtr<RkAiqOrbStatsProxy> & to)55 virtual XCamReturn translateOrbStats(const SmartPtr<VideoBuffer>& from, 56 SmartPtr<RkAiqOrbStatsProxy>& to) { 57 return XCAM_RETURN_BYPASS; 58 } translateAtmoStats(const SmartPtr<VideoBuffer> & from,SmartPtr<RkAiqAtmoStatsProxy> & to)59 virtual XCamReturn translateAtmoStats(const SmartPtr<VideoBuffer>& from, 60 SmartPtr<RkAiqAtmoStatsProxy>& to) { 61 return XCAM_RETURN_BYPASS; 62 } translateAdehazeStats(const SmartPtr<VideoBuffer> & from,SmartPtr<RkAiqAdehazeStatsProxy> & to)63 virtual XCamReturn translateAdehazeStats(const SmartPtr<VideoBuffer>& from, 64 SmartPtr<RkAiqAdehazeStatsProxy>& to) { 65 return XCAM_RETURN_BYPASS; 66 } 67 #if RKAIQ_HAVE_PDAF translatePdafStats(const SmartPtr<VideoBuffer> & from,SmartPtr<RkAiqPdafStatsProxy> & to,bool sns_mirror)68 virtual XCamReturn translatePdafStats (const SmartPtr<VideoBuffer> &from, 69 SmartPtr<RkAiqPdafStatsProxy> &to, bool sns_mirror) { 70 return XCAM_RETURN_BYPASS; 71 } 72 #endif getParams(const SmartPtr<VideoBuffer> & from)73 virtual XCamReturn getParams(const SmartPtr<VideoBuffer>& from) { 74 return XCAM_RETURN_BYPASS; 75 } releaseParams()76 virtual void releaseParams() {} setCamPhyId(int phyId)77 void setCamPhyId(int phyId) { 78 mCamPhyId = phyId; 79 } setGroupMode(bool bGroup)80 void setGroupMode(bool bGroup) { 81 mIsGroupMode = bGroup; 82 } setModuleRot(int rot)83 void setModuleRot(int rot) { 84 mModuleRotation = rot; 85 } setWorkingMode(int working_mode)86 void setWorkingMode(int working_mode) { 87 mWorkingMode = working_mode; 88 } getWorkingMode()89 int getWorkingMode() { 90 return mWorkingMode; 91 } 92 93 protected: 94 int mCamPhyId; 95 bool mIsGroupMode; 96 int mModuleRotation; 97 int mWorkingMode; 98 99 private: 100 XCAM_DEAD_COPY (IRkAiqResourceTranslator); 101 }; 102 103 } 104 105 #endif //_I_RK_AIQ_CONFIG_TRANSLATOR_H_ 106