• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2016 MediaTek Inc.
3  * Author: PC Chen <pc.chen@mediatek.com>
4  *
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.
8  *
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.
13  */
14 
15 #ifndef _VDEC_DRV_BASE_
16 #define _VDEC_DRV_BASE_
17 
18 #include "mtk_vcodec_drv.h"
19 
20 #include "vdec_drv_if.h"
21 
22 struct vdec_common_if {
23 	/**
24 	 * (*init)() - initialize decode driver
25 	 * @ctx     : [in] mtk v4l2 context
26 	 * @h_vdec  : [out] driver handle
27 	 */
28 	int (*init)(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec);
29 
30 	/**
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
36 	 */
37 	int (*decode)(unsigned long h_vdec, struct mtk_vcodec_mem *bs,
38 		      struct vdec_fb *fb, bool *res_chg);
39 
40 	/**
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
45 	 */
46 	int (*get_param)(unsigned long h_vdec, enum vdec_get_param_type type,
47 			 void *out);
48 
49 	/**
50 	 * (*deinit)() - deinitialize driver.
51 	 * @h_vdec : [in] driver handle to be deinit
52 	 */
53 	void (*deinit)(unsigned long h_vdec);
54 };
55 
56 #endif
57