1 /*
2 * Copyright (c) 2019-2022 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 #include "rk_aiq_user_api_acp.h"
17
18 #include "algo_handlers/RkAiqAcpHandle.h"
19
20 RKAIQ_BEGIN_DECLARE
21
22 #ifdef RK_SIMULATOR_HW
23 #define CHECK_USER_API_ENABLE
24 #endif
25 #if RKAIQ_HAVE_ACP_V10
rk_aiq_user_api_acp_SetAttrib(const rk_aiq_sys_ctx_t * sys_ctx,const acp_attrib_t * attr)26 XCamReturn rk_aiq_user_api_acp_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx,
27 const acp_attrib_t* attr)
28 {
29 XCamReturn ret = XCAM_RETURN_NO_ERROR;
30 CHECK_USER_API_ENABLE2(sys_ctx);
31 CHECK_USER_API_ENABLE(RK_AIQ_ALGO_TYPE_ACP);
32 RKAIQ_API_SMART_LOCK(sys_ctx);
33
34 RkAiqAcpHandleInt* algo_handle =
35 algoHandle<RkAiqAcpHandleInt>(sys_ctx, RK_AIQ_ALGO_TYPE_ACP);
36
37 if (algo_handle) {
38 return algo_handle->setAttrib(attr);
39 }
40
41 return (ret);
42 }
43
rk_aiq_user_api_acp_GetAttrib(const rk_aiq_sys_ctx_t * sys_ctx,acp_attrib_t * attr)44 XCamReturn rk_aiq_user_api_acp_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx,
45 acp_attrib_t *attr)
46 {
47 RKAIQ_API_SMART_LOCK(sys_ctx);
48 XCamReturn ret = XCAM_RETURN_NO_ERROR;
49
50 RkAiqAcpHandleInt* algo_handle =
51 algoHandle<RkAiqAcpHandleInt>(sys_ctx, RK_AIQ_ALGO_TYPE_ACP);
52
53 if (algo_handle) {
54 return algo_handle->getAttrib(attr);
55 }
56
57 return (ret);
58
59 }
60 #else
61 XCamReturn rk_aiq_user_api_acp_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx,
62 const acp_attrib_t* attr)
63 {
64
65 return XCAM_RETURN_ERROR_UNKNOWN;
66 }
67
68 XCamReturn rk_aiq_user_api_acp_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx,
69 acp_attrib_t *attr)
70 {
71
72 return XCAM_RETURN_ERROR_UNKNOWN;
73
74 }
75 #endif
76 RKAIQ_END_DECLARE
77
78
79
80