1 /* 2 * Copyright (C) 2017 Amlogic, Inc. All rights reserved. 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for 12 * more details. 13 * 14 * You should have received a copy of the GNU General Public License along 15 * with this program; if not, write to the Free Software Foundation, Inc., 16 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 * 18 * Description: 19 */ 20 #ifndef _VDEC_DRV_BASE_ 21 #define _VDEC_DRV_BASE_ 22 23 #include "aml_vcodec_drv.h" 24 25 #include "vdec_drv_if.h" 26 27 struct vdec_common_if { 28 /** 29 * (*init)() - initialize decode driver 30 * @ctx : [in] aml v4l2 context 31 * @h_vdec : [out] driver handle 32 */ 33 int (*init)(struct aml_vcodec_ctx *ctx, unsigned long *h_vdec); 34 35 int (*probe)(unsigned long h_vdec, 36 struct aml_vcodec_mem *bs, void *out); 37 38 /** 39 * (*decode)() - trigger decode 40 * @h_vdec : [in] driver handle 41 * @bs : [in] input bitstream 42 * @fb : [in] frame buffer to store decoded frame 43 * @res_chg : [out] resolution change happen 44 */ 45 int (*decode)(unsigned long h_vdec, struct aml_vcodec_mem *bs, 46 u64 pts, bool *res_chg); 47 48 /** 49 * (*get_param)() - get driver's parameter 50 * @h_vdec : [in] driver handle 51 * @type : [in] input parameter type 52 * @out : [out] buffer to store query result 53 */ 54 int (*get_param)(unsigned long h_vdec, 55 enum vdec_get_param_type type, void *out); 56 57 /** 58 * (*set_param)() - set driver's parameter 59 * @h_vdec : [in] driver handle 60 * @type : [in] input parameter type 61 * @in : [in] buffer to store query result 62 */ 63 int (*set_param)(unsigned long h_vdec, 64 enum vdec_set_param_type type, void *in); 65 66 /** 67 * (*deinit)() - deinitialize driver. 68 * @h_vdec : [in] driver handle to be deinit 69 */ 70 void (*deinit)(unsigned long h_vdec); 71 }; 72 73 #endif 74