1 /* SPDX-License-Identifier: GPL-2.0 */
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>
9 #ifndef _VENC_DRV_BASE_
10 #define _VENC_DRV_BASE_
12 #include "mtk_vcodec_drv.h"
14 #include "venc_drv_if.h"
16 struct venc_common_if
{
18 * (*init)() - initialize driver
19 * @ctx: [in] mtk v4l2 context
20 * @handle: [out] driver handle
22 int (*init
)(struct mtk_vcodec_ctx
*ctx
);
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
32 int (*encode
)(void *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
);
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
43 int (*set_param
)(void *handle
, enum venc_set_param_type type
,
44 struct venc_enc_param
*in
);
47 * (*deinit)() - deinitialize driver.
48 * @handle: [in] driver handle
50 int (*deinit
)(void *handle
);