• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * xcam_handle.h - image processing handles
3  *
4  *  Copyright (c) 2017 Intel 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  * Author: Wind Yuan <feng.yuan@intel.com>
19  */
20 
21 #ifndef C_XCAM_HANDLE_H
22 #define C_XCAM_HANDLE_H
23 
24 #include <base/xcam_defs.h>
25 #include <base/xcam_common.h>
26 #include <base/xcam_buffer.h>
27 
28 XCAM_BEGIN_DECLARE
29 
30 typedef struct _XCamHandle XCamHandle;
31 
32 /*! \brief    create xcam handle to process buffer
33  *
34  * \params[in]    name, filter name
35  * \return        XCamHandle    create correct hanle, else return NULL.
36  */
37 XCamHandle *xcam_create_handle (const char *name);
38 
39 /*! \brief    destroy xcam handle
40  *
41  * \params[in]    handle        handle need to destory
42  */
43 void xcam_destroy_handle (XCamHandle *handle);
44 
45 /*! \brief    xcam handle get usage how to set parameters
46  *
47  * \params[in]        handle       xcam handle
48  * \params[out]       usage_buf    buffer to store usage
49  * \params[in,out]    usage_len    buffer length
50  * \return            XCamReturn   XCAM_RETURN_NO_ERROR on sucess; others on errors.
51  */
52 XCamReturn xcam_handle_get_usage (XCamHandle *handle, char *usage_buf, int *usage_len);
53 
54 /*! \brief set handle parameters before init
55  *
56  * \params[in]    handle       xcam handle
57  * \params[in]    field0, value0, field1, value1, ..., fieldN, valueN    field and value in pairs
58  * \return        XCamReturn   XCAM_RETURN_NO_ERROR on sucess; others on errors.
59  */
60 XCamReturn xcam_handle_set_parameters (
61     XCamHandle *handle, const char *field, ...);
62 
63 /*! \brief    xcam handle initialize
64  *
65  * \params[in]        handle       xcam handle
66  * \return            XCamReturn   XCAM_RETURN_NO_ERROR on sucess; others on errors.
67  */
68 XCamReturn xcam_handle_init (XCamHandle *handle);
69 
70 /*! \brief    xcam handle uninitialize
71  *
72  * \params[in]        handle       xcam handle
73  * \return            XCamReturn   XCAM_RETURN_NO_ERROR on sucess; others on errors.
74  */
75 XCamReturn xcam_handle_uinit (XCamHandle *handle);
76 
77 // buf_out was allocated outside or inside ??
78 /*! \brief    xcam handle process buffer
79  *
80  * \params[in]        handle       xcam handle
81  * \params[in]        buf_in       input buffer
82  * \params[in,out]    buf_out      output buffer, can be allocated outside or inside,
83  *                                 if set param "alloc-out-buf" "true", allocate outside; else inside.
84  * \return            XCamReturn   XCAM_RETURN_NO_ERROR on sucess; others on errors.
85  */
86 XCamReturn xcam_handle_execute (XCamHandle *handle, XCamVideoBuffer *buf_in, XCamVideoBuffer **buf_out);
87 
88 XCAM_END_DECLARE
89 
90 #endif //C_XCAM_HANDLE_H
91