xref: /OK3568_Linux_fs/external/camera_engine_rkaiq/rkaiq/algos/awdr/rk_aiq_algo_awdr_itf.cpp (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /*
2  * rk_aiq_algo_awdr_itf.c
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 #include "awdr/rk_aiq_algo_awdr_itf.h"
21 #include "rk_aiq_algo_types.h"
22 #include "xcam_log.h"
23 
24 RKAIQ_BEGIN_DECLARE
25 
26 typedef struct _RkAiqAlgoContext {
27     void* place_holder;
28 } RkAiqAlgoContext;
29 
30 
31 static XCamReturn
create_context(RkAiqAlgoContext ** context,const AlgoCtxInstanceCfg * cfg)32 create_context(RkAiqAlgoContext **context, const AlgoCtxInstanceCfg* cfg)
33 {
34     RkAiqAlgoContext *ctx = new RkAiqAlgoContext();
35     if (ctx == NULL) {
36         LOGE_AWDR( "%s: create awdr context fail!\n", __FUNCTION__);
37         return XCAM_RETURN_ERROR_MEM;
38     }
39     *context = ctx;
40     return XCAM_RETURN_NO_ERROR;
41 }
42 
43 static XCamReturn
destroy_context(RkAiqAlgoContext * context)44 destroy_context(RkAiqAlgoContext *context)
45 {
46     delete context;
47     context = NULL;
48     return XCAM_RETURN_NO_ERROR;
49 }
50 
51 static XCamReturn
prepare(RkAiqAlgoCom * params)52 prepare(RkAiqAlgoCom* params)
53 {
54     return XCAM_RETURN_NO_ERROR;
55 }
56 
57 static XCamReturn
pre_process(const RkAiqAlgoCom * inparams,RkAiqAlgoResCom * outparams)58 pre_process(const RkAiqAlgoCom* inparams, RkAiqAlgoResCom* outparams)
59 {
60     return XCAM_RETURN_NO_ERROR;
61 }
62 
63 static XCamReturn
processing(const RkAiqAlgoCom * inparams,RkAiqAlgoResCom * outparams)64 processing(const RkAiqAlgoCom* inparams, RkAiqAlgoResCom* outparams)
65 {
66     return XCAM_RETURN_NO_ERROR;
67 }
68 
69 static XCamReturn
post_process(const RkAiqAlgoCom * inparams,RkAiqAlgoResCom * outparams)70 post_process(const RkAiqAlgoCom* inparams, RkAiqAlgoResCom* outparams)
71 {
72     return XCAM_RETURN_NO_ERROR;
73 }
74 
75 RkAiqAlgoDescription g_RkIspAlgoDescAwdr = {
76     .common = {
77         .version = RKISP_ALGO_AWDR_VERSION,
78         .vendor  = RKISP_ALGO_AWDR_VENDOR,
79         .description = RKISP_ALGO_AWDR_DESCRIPTION,
80         .type    = RK_AIQ_ALGO_TYPE_AWDR,
81         .id      = 0,
82         .create_context  = create_context,
83         .destroy_context = destroy_context,
84     },
85     .prepare = prepare,
86     .pre_process = NULL,
87     .processing = processing,
88     .post_process = NULL,
89 };
90 
91 RKAIQ_END_DECLARE
92