1 /*
2 * Copyright (c) 2019 Rockchip Corporation
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 */
17
18 #include "rk_aiq_user_api2_debug.h"
19 #include "RkAiqManager.h"
20 #ifdef RK_SIMULATOR_HW
21 #include "simulator/CamHwSimulator.h"
22 #else
23 #include "isp20/CamHwIsp20.h"
24 #endif
25
26 using namespace RkCam;
27 using namespace XCam;
28
29 typedef struct rk_aiq_sys_ctx_s {
30 const char* _sensor_entity_name;
31 SmartPtr<RkAiqManager> _rkAiqManager;
32 SmartPtr<ICamHw> _camHw;
33 SmartPtr<RkAiqCore> _analyzer;
34 #ifdef ISP_HW_V20
35 SmartPtr<RkLumaCore> _lumaAnalyzer;
36 #endif
37 #ifdef RKAIQ_ENABLE_PARSER_V1
38 CamCalibDbContext_t *_calibDb;
39 #endif
40 } rk_aiq_sys_ctx_t;
41
42 RKAIQ_BEGIN_DECLARE
43
44 XCamReturn
rk_aiq_uapi2_debug_captureRawYuvSync(const rk_aiq_sys_ctx_t * ctx,capture_raw_t type)45 rk_aiq_uapi2_debug_captureRawYuvSync(const rk_aiq_sys_ctx_t* ctx, capture_raw_t type)
46 {
47 ENTER_XCORE_FUNCTION();
48
49 XCamReturn ret = XCAM_RETURN_NO_ERROR;
50 ret = ctx->_camHw->capture_raw_ctl(type);
51 EXIT_XCORE_FUNCTION();
52
53 return ret;
54 }
55
56 XCamReturn
rk_aiq_uapi2_debug_captureRawSync(const rk_aiq_sys_ctx_t * ctx,capture_raw_t type,int count,const char * capture_dir,char * output_dir)57 rk_aiq_uapi2_debug_captureRawSync(const rk_aiq_sys_ctx_t* ctx, capture_raw_t type,
58 int count, const char* capture_dir,
59 char* output_dir)
60 {
61 ENTER_XCORE_FUNCTION();
62
63 XCamReturn ret = XCAM_RETURN_NO_ERROR;
64 ret = ctx->_camHw->capture_raw_ctl(type, count, capture_dir, output_dir);
65 EXIT_XCORE_FUNCTION();
66
67 return ret;
68 }
69
70 XCamReturn
rk_aiq_uapi2_debug_captureRawNotify(const rk_aiq_sys_ctx_t * ctx)71 rk_aiq_uapi2_debug_captureRawNotify(const rk_aiq_sys_ctx_t* ctx)
72 {
73 ENTER_XCORE_FUNCTION();
74
75 XCamReturn ret = XCAM_RETURN_NO_ERROR;
76 ret = ctx->_camHw->notify_capture_raw();
77 EXIT_XCORE_FUNCTION();
78
79 return ret;
80 }
81
82 RKAIQ_END_DECLARE
83