2019-06-04 17:37:33 +08:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0 */
|
2016-05-03 18:11:24 +08:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2016 MediaTek Inc.
|
|
|
|
* Author: Daniel Hsiao <daniel.hsiao@mediatek.com>
|
|
|
|
* Jungchang Tsao <jungchang.tsao@mediatek.com>
|
|
|
|
* Tiffany Lin <tiffany.lin@mediatek.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _VENC_DRV_BASE_
|
|
|
|
#define _VENC_DRV_BASE_
|
|
|
|
|
|
|
|
#include "mtk_vcodec_drv.h"
|
|
|
|
|
|
|
|
#include "venc_drv_if.h"
|
|
|
|
|
|
|
|
struct venc_common_if {
|
|
|
|
/**
|
|
|
|
* (*init)() - initialize driver
|
|
|
|
* @ctx: [in] mtk v4l2 context
|
|
|
|
* @handle: [out] driver handle
|
|
|
|
*/
|
2019-06-14 15:56:21 +08:00
|
|
|
int (*init)(struct mtk_vcodec_ctx *ctx);
|
2016-05-03 18:11:24 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* (*encode)() - trigger encode
|
|
|
|
* @handle: [in] driver handle
|
|
|
|
* @opt: [in] encode option
|
|
|
|
* @frm_buf: [in] frame buffer to store input frame
|
|
|
|
* @bs_buf: [in] bitstream buffer to store output bitstream
|
|
|
|
* @result: [out] encode result
|
|
|
|
*/
|
2019-06-14 15:56:21 +08:00
|
|
|
int (*encode)(void *handle, enum venc_start_opt opt,
|
2016-05-03 18:11:24 +08:00
|
|
|
struct venc_frm_buf *frm_buf,
|
|
|
|
struct mtk_vcodec_mem *bs_buf,
|
|
|
|
struct venc_done_result *result);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* (*set_param)() - set driver's parameter
|
|
|
|
* @handle: [in] driver handle
|
|
|
|
* @type: [in] parameter type
|
|
|
|
* @in: [in] buffer to store the parameter
|
|
|
|
*/
|
2019-06-14 15:56:21 +08:00
|
|
|
int (*set_param)(void *handle, enum venc_set_param_type type,
|
2016-05-03 18:11:24 +08:00
|
|
|
struct venc_enc_param *in);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* (*deinit)() - deinitialize driver.
|
|
|
|
* @handle: [in] driver handle
|
|
|
|
*/
|
2019-06-14 15:56:21 +08:00
|
|
|
int (*deinit)(void *handle);
|
2016-05-03 18:11:24 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|