1 /* SPDX-License-Identifier: GPL-2.0 */ 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); 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)(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); 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)(void *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)(void *handle); 51 }; 52 53 #endif 54