• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2016 MediaTek Inc.
3  * Author: Daniel Hsiao <daniel.hsiao@mediatek.com>
4  *	Jungchang Tsao <jungchang.tsao@mediatek.com>
5  *	Tiffany Lin <tiffany.lin@mediatek.com>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify
9  * it under the terms of the GNU General Public License version 2 as
10  * published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  */
17 
18 #ifndef _VENC_DRV_BASE_
19 #define _VENC_DRV_BASE_
20 
21 #include "mtk_vcodec_drv.h"
22 
23 #include "venc_drv_if.h"
24 
25 struct venc_common_if {
26 	/**
27 	 * (*init)() - initialize driver
28 	 * @ctx:	[in] mtk v4l2 context
29 	 * @handle: [out] driver handle
30 	 */
31 	int (*init)(struct mtk_vcodec_ctx *ctx, unsigned long *handle);
32 
33 	/**
34 	 * (*encode)() - trigger encode
35 	 * @handle: [in] driver handle
36 	 * @opt: [in] encode option
37 	 * @frm_buf: [in] frame buffer to store input frame
38 	 * @bs_buf: [in] bitstream buffer to store output bitstream
39 	 * @result: [out] encode result
40 	 */
41 	int (*encode)(unsigned long handle, enum venc_start_opt opt,
42 		      struct venc_frm_buf *frm_buf,
43 		      struct mtk_vcodec_mem *bs_buf,
44 		      struct venc_done_result *result);
45 
46 	/**
47 	 * (*set_param)() - set driver's parameter
48 	 * @handle: [in] driver handle
49 	 * @type: [in] parameter type
50 	 * @in: [in] buffer to store the parameter
51 	 */
52 	int (*set_param)(unsigned long handle, enum venc_set_param_type type,
53 			 struct venc_enc_param *in);
54 
55 	/**
56 	 * (*deinit)() - deinitialize driver.
57 	 * @handle: [in] driver handle
58 	 */
59 	int (*deinit)(unsigned long handle);
60 };
61 
62 #endif
63