2 * Copyright (c) 2016 MediaTek Inc.
3 * Author: PC Chen <pc.chen@mediatek.com>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
15 #ifndef _VDEC_DRV_BASE_
16 #define _VDEC_DRV_BASE_
18 #include "mtk_vcodec_drv.h"
20 #include "vdec_drv_if.h"
22 struct vdec_common_if
{
24 * (*init)() - initialize decode driver
25 * @ctx : [in] mtk v4l2 context
26 * @h_vdec : [out] driver handle
28 int (*init
)(struct mtk_vcodec_ctx
*ctx
, unsigned long *h_vdec
);
31 * (*decode)() - trigger decode
32 * @h_vdec : [in] driver handle
33 * @bs : [in] input bitstream
34 * @fb : [in] frame buffer to store decoded frame
35 * @res_chg : [out] resolution change happen
37 int (*decode
)(unsigned long h_vdec
, struct mtk_vcodec_mem
*bs
,
38 struct vdec_fb
*fb
, bool *res_chg
);
41 * (*get_param)() - get driver's parameter
42 * @h_vdec : [in] driver handle
43 * @type : [in] input parameter type
44 * @out : [out] buffer to store query result
46 int (*get_param
)(unsigned long h_vdec
, enum vdec_get_param_type type
,
50 * (*deinit)() - deinitialize driver.
51 * @h_vdec : [in] driver handle to be deinit
53 void (*deinit
)(unsigned long h_vdec
);