Alexandre Courbot | 9293e39 | 2019-06-04 05:37:33 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Tiffany Lin | 4e855a6 | 2016-05-03 07:11:24 -0300 | [diff] [blame] | 2 | /* |
| 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 Lin | 4e855a6 | 2016-05-03 07:11:24 -0300 | [diff] [blame] | 7 | */ |
| 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 | |
| 16 | struct venc_common_if { |
| 17 | /** |
| 18 | * (*init)() - initialize driver |
| 19 | * @ctx: [in] mtk v4l2 context |
| 20 | * @handle: [out] driver handle |
| 21 | */ |
Alexandre Courbot | 86aed3f | 2019-06-14 03:56:21 -0400 | [diff] [blame] | 22 | int (*init)(struct mtk_vcodec_ctx *ctx); |
Tiffany Lin | 4e855a6 | 2016-05-03 07:11:24 -0300 | [diff] [blame] | 23 | |
| 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 Courbot | 86aed3f | 2019-06-14 03:56:21 -0400 | [diff] [blame] | 32 | int (*encode)(void *handle, enum venc_start_opt opt, |
Tiffany Lin | 4e855a6 | 2016-05-03 07:11:24 -0300 | [diff] [blame] | 33 | 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 Courbot | 86aed3f | 2019-06-14 03:56:21 -0400 | [diff] [blame] | 43 | int (*set_param)(void *handle, enum venc_set_param_type type, |
Tiffany Lin | 4e855a6 | 2016-05-03 07:11:24 -0300 | [diff] [blame] | 44 | struct venc_enc_param *in); |
| 45 | |
| 46 | /** |
| 47 | * (*deinit)() - deinitialize driver. |
| 48 | * @handle: [in] driver handle |
| 49 | */ |
Alexandre Courbot | 86aed3f | 2019-06-14 03:56:21 -0400 | [diff] [blame] | 50 | int (*deinit)(void *handle); |
Tiffany Lin | 4e855a6 | 2016-05-03 07:11:24 -0300 | [diff] [blame] | 51 | }; |
| 52 | |
| 53 | #endif |