Linux 5.2-rc4
[sfrench/cifs-2.6.git] / drivers / media / platform / mtk-vcodec / venc_drv_base.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3  * Copyright (c) 2016 MediaTek Inc.
4  * Author: Daniel Hsiao <daniel.hsiao@mediatek.com>
5  *      Jungchang Tsao <jungchang.tsao@mediatek.com>
6  *      Tiffany Lin <tiffany.lin@mediatek.com>
7  */
8
9 #ifndef _VENC_DRV_BASE_
10 #define _VENC_DRV_BASE_
11
12 #include "mtk_vcodec_drv.h"
13
14 #include "venc_drv_if.h"
15
16 struct venc_common_if {
17         /**
18          * (*init)() - initialize driver
19          * @ctx:        [in] mtk v4l2 context
20          * @handle: [out] driver handle
21          */
22         int (*init)(struct mtk_vcodec_ctx *ctx, unsigned long *handle);
23
24         /**
25          * (*encode)() - trigger encode
26          * @handle: [in] driver handle
27          * @opt: [in] encode option
28          * @frm_buf: [in] frame buffer to store input frame
29          * @bs_buf: [in] bitstream buffer to store output bitstream
30          * @result: [out] encode result
31          */
32         int (*encode)(unsigned long handle, enum venc_start_opt opt,
33                       struct venc_frm_buf *frm_buf,
34                       struct mtk_vcodec_mem *bs_buf,
35                       struct venc_done_result *result);
36
37         /**
38          * (*set_param)() - set driver's parameter
39          * @handle: [in] driver handle
40          * @type: [in] parameter type
41          * @in: [in] buffer to store the parameter
42          */
43         int (*set_param)(unsigned long handle, enum venc_set_param_type type,
44                          struct venc_enc_param *in);
45
46         /**
47          * (*deinit)() - deinitialize driver.
48          * @handle: [in] driver handle
49          */
50         int (*deinit)(unsigned long handle);
51 };
52
53 #endif