xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/hwi/isp20/Isp20Evts.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * Isp20StatsBuffer.h - isp20 stats buffer
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 ISP20_EVTS_H
21 #define ISP20_EVTS_H
22 
23 #include "rk_aiq_pool.h"
24 #include "ICamHw.h"
25 #include "SensorHw.h"
26 
27 using namespace XCam;
28 
29 namespace RkCam {
30 
31 class Isp20Evt
32     : public ispHwEvt_t, public BufferData {
33 public:
Isp20Evt(ICamHw * camHw,SmartPtr<SensorHw> sensor)34     Isp20Evt(ICamHw *camHw, SmartPtr<SensorHw> sensor)
35         : mSensor(sensor), mCamHw(camHw), mTimestamp(-1) {
36         (void)(mCamHw);
37     }
~Isp20Evt()38     virtual ~Isp20Evt() {}
39 
40     XCamReturn getExpInfoParams(SmartPtr<RkAiqSensorExpParamsProxy>& expInfo, uint32_t frameId);
41 
setSofTimeStamp(int64_t timestamp)42     void setSofTimeStamp(int64_t timestamp) {
43         mTimestamp = timestamp;
44     }
45 
getSofTimeStamp()46     int64_t getSofTimeStamp() {
47         return mTimestamp;
48     }
49 
map()50     virtual uint8_t *map () {return NULL;}
unmap()51     virtual bool unmap () {return false;}
52 
53     uint32_t sequence = (uint32_t)(-1);
54     uint32_t expDelay = 2;
55 
56 private:
57     // XCAM_DEAD_COPY(Isp20Evt);
58     Mutex _mutex;
59     SmartPtr<SensorHw> mSensor;
60     ICamHw *mCamHw;
61     int64_t mTimestamp;
62 };
63 
64 class Isp20EvtBuffer
65     : public BufferProxy {
66 public:
Isp20EvtBuffer(SmartPtr<Isp20Evt> & buf,SmartPtr<V4l2Device> & device)67     explicit Isp20EvtBuffer(SmartPtr<Isp20Evt> &buf,
68                             SmartPtr<V4l2Device> &device)
69         : BufferProxy (buf) {}
~Isp20EvtBuffer()70     virtual ~Isp20EvtBuffer() {};
get_data()71     SmartPtr<Isp20Evt> get_data() {
72         SmartPtr<BufferData> buf = get_buffer_data ();
73         return buf.dynamic_cast_ptr<Isp20Evt>();
74     }
75 private:
76     XCAM_DEAD_COPY(Isp20EvtBuffer);
77     //SmartPtr<RkAiqSofInfoProxy> _sofParams;
78     //SmartPtr<RKAiqSofInfo_t> _sofInfo;
79     //SmartPtr<SofEventData> _event_data;
80 };
81 
82 }
83 
84 #endif
85