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_asd.h"
17
18 #include "algo_handlers/RkAiqAsdHandle.h"
19
20 RKAIQ_BEGIN_DECLARE
21
22 #ifdef RK_SIMULATOR_HW
23 #define CHECK_USER_API_ENABLE
24 #endif
25
26 #if RKAIQ_HAVE_ASD_V10
27 XCamReturn
rk_aiq_user_api_asd_SetAttrib(const rk_aiq_sys_ctx_t * sys_ctx,asd_attrib_t attr)28 rk_aiq_user_api_asd_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, asd_attrib_t attr)
29 {
30 CHECK_USER_API_ENABLE2(sys_ctx);
31 CHECK_USER_API_ENABLE(RK_AIQ_ALGO_TYPE_ASD);
32 RKAIQ_API_SMART_LOCK(sys_ctx);
33 RkAiqAsdHandleInt* algo_handle =
34 algoHandle<RkAiqAsdHandleInt>(sys_ctx, RK_AIQ_ALGO_TYPE_ASD);
35
36 if (algo_handle) {
37 return algo_handle->setAttrib(attr);
38 }
39
40 return XCAM_RETURN_NO_ERROR;
41 }
42
43 XCamReturn
rk_aiq_user_api_asd_GetAttrib(const rk_aiq_sys_ctx_t * sys_ctx,asd_attrib_t * attr)44 rk_aiq_user_api_asd_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, asd_attrib_t* attr)
45 {
46 RKAIQ_API_SMART_LOCK(sys_ctx);
47 RkAiqAsdHandleInt* algo_handle =
48 algoHandle<RkAiqAsdHandleInt>(sys_ctx, RK_AIQ_ALGO_TYPE_ASD);
49
50 if (algo_handle) {
51 return algo_handle->getAttrib(attr);
52 }
53
54 return XCAM_RETURN_NO_ERROR;
55 }
56 #else
57 XCamReturn
58 rk_aiq_user_api_asd_SetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, asd_attrib_t attr)
59 {
60 return XCAM_RETURN_NO_ERROR;
61 }
62
63 XCamReturn
64 rk_aiq_user_api_asd_GetAttrib(const rk_aiq_sys_ctx_t* sys_ctx, asd_attrib_t* attr)
65 {
66
67 return XCAM_RETURN_NO_ERROR;
68 }
69 #endif
70 RKAIQ_END_DECLARE
71