1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (c) 2016 MediaTek Inc. 4 * Author: PC Chen <pc.chen@mediatek.com> 5 */ 6 7 #ifndef _VDEC_DRV_BASE_ 8 #define _VDEC_DRV_BASE_ 9 10 #include "mtk_vcodec_drv.h" 11 12 #include "vdec_drv_if.h" 13 14 struct vdec_common_if { 15 /** 16 * (*init)() - initialize decode driver 17 * @ctx : [in] mtk v4l2 context 18 * @h_vdec : [out] driver handle 19 */ 20 int (*init)(struct mtk_vcodec_ctx *ctx); 21 22 /** 23 * (*decode)() - trigger decode 24 * @h_vdec : [in] driver handle 25 * @bs : [in] input bitstream 26 * @fb : [in] frame buffer to store decoded frame 27 * @res_chg : [out] resolution change happen 28 */ 29 int (*decode)(void *h_vdec, struct mtk_vcodec_mem *bs, 30 struct vdec_fb *fb, bool *res_chg); 31 32 /** 33 * (*get_param)() - get driver's parameter 34 * @h_vdec : [in] driver handle 35 * @type : [in] input parameter type 36 * @out : [out] buffer to store query result 37 */ 38 int (*get_param)(void *h_vdec, enum vdec_get_param_type type, 39 void *out); 40 41 /** 42 * (*deinit)() - deinitialize driver. 43 * @h_vdec : [in] driver handle to be deinit 44 */ 45 void (*deinit)(void *h_vdec); 46 }; 47 48 #endif 49