vdec_drv_base.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. * Copyright (c) 2016 MediaTek Inc.
  3. * Author: PC Chen <pc.chen@mediatek.com>
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. */
  14. #ifndef _VDEC_DRV_BASE_
  15. #define _VDEC_DRV_BASE_
  16. #include "mtk_vcodec_drv.h"
  17. #include "vdec_drv_if.h"
  18. struct vdec_common_if {
  19. /**
  20. * (*init)() - initialize decode driver
  21. * @ctx : [in] mtk v4l2 context
  22. * @h_vdec : [out] driver handle
  23. */
  24. int (*init)(struct mtk_vcodec_ctx *ctx, unsigned long *h_vdec);
  25. /**
  26. * (*decode)() - trigger decode
  27. * @h_vdec : [in] driver handle
  28. * @bs : [in] input bitstream
  29. * @fb : [in] frame buffer to store decoded frame
  30. * @res_chg : [out] resolution change happen
  31. */
  32. int (*decode)(unsigned long h_vdec, struct mtk_vcodec_mem *bs,
  33. struct vdec_fb *fb, bool *res_chg);
  34. /**
  35. * (*get_param)() - get driver's parameter
  36. * @h_vdec : [in] driver handle
  37. * @type : [in] input parameter type
  38. * @out : [out] buffer to store query result
  39. */
  40. int (*get_param)(unsigned long h_vdec, enum vdec_get_param_type type,
  41. void *out);
  42. /**
  43. * (*deinit)() - deinitialize driver.
  44. * @h_vdec : [in] driver handle to be deinit
  45. */
  46. void (*deinit)(unsigned long h_vdec);
  47. };
  48. #endif