Linux 4.16.11
[linux/fpc-iii.git] / drivers / media / platform / mtk-vcodec / venc_drv_base.h
blob6308d44dedf6fd13b94d3a48290829df4691e159
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>
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.
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.
18 #ifndef _VENC_DRV_BASE_
19 #define _VENC_DRV_BASE_
21 #include "mtk_vcodec_drv.h"
23 #include "venc_drv_if.h"
25 struct venc_common_if {
26 /**
27 * (*init)() - initialize driver
28 * @ctx: [in] mtk v4l2 context
29 * @handle: [out] driver handle
31 int (*init)(struct mtk_vcodec_ctx *ctx, unsigned long *handle);
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
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);
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
52 int (*set_param)(unsigned long handle, enum venc_set_param_type type,
53 struct venc_enc_param *in);
55 /**
56 * (*deinit)() - deinitialize driver.
57 * @handle: [in] driver handle
59 int (*deinit)(unsigned long handle);
62 #endif