venc_drv_base.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. #ifndef _VENC_DRV_BASE_
  18. #define _VENC_DRV_BASE_
  19. #include "mtk_vcodec_drv.h"
  20. #include "venc_drv_if.h"
  21. struct venc_common_if {
  22. /**
  23. * (*init)() - initialize driver
  24. * @ctx: [in] mtk v4l2 context
  25. * @handle: [out] driver handle
  26. */
  27. int (*init)(struct mtk_vcodec_ctx *ctx, unsigned long *handle);
  28. /**
  29. * (*encode)() - trigger encode
  30. * @handle: [in] driver handle
  31. * @opt: [in] encode option
  32. * @frm_buf: [in] frame buffer to store input frame
  33. * @bs_buf: [in] bitstream buffer to store output bitstream
  34. * @result: [out] encode result
  35. */
  36. int (*encode)(unsigned long handle, enum venc_start_opt opt,
  37. struct venc_frm_buf *frm_buf,
  38. struct mtk_vcodec_mem *bs_buf,
  39. struct venc_done_result *result);
  40. /**
  41. * (*set_param)() - set driver's parameter
  42. * @handle: [in] driver handle
  43. * @type: [in] parameter type
  44. * @in: [in] buffer to store the parameter
  45. */
  46. int (*set_param)(unsigned long handle, enum venc_set_param_type type,
  47. struct venc_enc_param *in);
  48. /**
  49. * (*deinit)() - deinitialize driver.
  50. * @handle: [in] driver handle
  51. */
  52. int (*deinit)(unsigned long handle);
  53. };
  54. #endif