blob: 3d718411dc73a96cd45810dacda1a91f8d10cb71 [file] [log] [blame]
Alexandre Courbot9293e392019-06-04 05:37:33 -04001/* SPDX-License-Identifier: GPL-2.0 */
Tiffany Lin4e855a62016-05-03 07:11:24 -03002/*
3 * Copyright (c) 2016 MediaTek Inc.
4 * Author: Daniel Hsiao <daniel.hsiao@mediatek.com>
5 * Jungchang Tsao <jungchang.tsao@mediatek.com>
6 * Tiffany Lin <tiffany.lin@mediatek.com>
Tiffany Lin4e855a62016-05-03 07:11:24 -03007 */
8
9#ifndef _VENC_DRV_BASE_
10#define _VENC_DRV_BASE_
11
12#include "mtk_vcodec_drv.h"
13
14#include "venc_drv_if.h"
15
16struct venc_common_if {
17 /**
18 * (*init)() - initialize driver
19 * @ctx: [in] mtk v4l2 context
20 * @handle: [out] driver handle
21 */
Alexandre Courbot86aed3f2019-06-14 03:56:21 -040022 int (*init)(struct mtk_vcodec_ctx *ctx);
Tiffany Lin4e855a62016-05-03 07:11:24 -030023
24 /**
25 * (*encode)() - trigger encode
26 * @handle: [in] driver handle
27 * @opt: [in] encode option
28 * @frm_buf: [in] frame buffer to store input frame
29 * @bs_buf: [in] bitstream buffer to store output bitstream
30 * @result: [out] encode result
31 */
Alexandre Courbot86aed3f2019-06-14 03:56:21 -040032 int (*encode)(void *handle, enum venc_start_opt opt,
Tiffany Lin4e855a62016-05-03 07:11:24 -030033 struct venc_frm_buf *frm_buf,
34 struct mtk_vcodec_mem *bs_buf,
35 struct venc_done_result *result);
36
37 /**
38 * (*set_param)() - set driver's parameter
39 * @handle: [in] driver handle
40 * @type: [in] parameter type
41 * @in: [in] buffer to store the parameter
42 */
Alexandre Courbot86aed3f2019-06-14 03:56:21 -040043 int (*set_param)(void *handle, enum venc_set_param_type type,
Tiffany Lin4e855a62016-05-03 07:11:24 -030044 struct venc_enc_param *in);
45
46 /**
47 * (*deinit)() - deinitialize driver.
48 * @handle: [in] driver handle
49 */
Alexandre Courbot86aed3f2019-06-14 03:56:21 -040050 int (*deinit)(void *handle);
Tiffany Lin4e855a62016-05-03 07:11:24 -030051};
52
53#endif