* Copyright (c) Huawei Technologies Co., Ltd. 2020-2022. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* Description:
* Author: huawei
* Create: 2020-4-1
*/
#ifndef HI_PNGD_H_
#define HI_PNGD_H_
#include "hi_dvpp_common.h"
#include "hi_dvpp_vb.h"
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif
#define PNGD_MAX_CHN_NUM 128
#define HI_ERR_PNGD_INVALID_CHN_ID 0xA0408002
#define HI_ERR_PNGD_ILLEGAL_PARAM 0xA0408003
#define HI_ERR_PNGD_EXIST 0xA0408004
#define HI_ERR_PNGD_UNEXIST 0xA0408005
#define HI_ERR_PNGD_NULL_PTR 0xA0408006
#define HI_ERR_PNGD_NOT_CFG 0xA0408007
#define HI_ERR_PNGD_NOT_SUPPORT 0xA0408008
#define HI_ERR_PNGD_NOT_PERM 0xA0408009
#define HI_ERR_PNGD_NO_MEM 0xA040800C
#define HI_ERR_PNGD_NO_BUF 0xA040800D
#define HI_ERR_PNGD_BUF_EMPTY 0xA040800E
#define HI_ERR_PNGD_BUF_FULL 0xA040800F
#define HI_ERR_PNGD_SYS_NOT_READY 0xA0408010
#define HI_ERR_PNGD_BAD_ADDR 0xA0408011
#define HI_ERR_PNGD_BUSY 0xA0408012
#define HI_ERR_PNGD_TIMEOUT 0xA0408014
#define HI_ERR_PNGD_SYS_ERROR 0xA0408015
typedef hi_s32 hi_pngd_chn;
typedef struct {
hi_u32 stream_que_cnt;
hi_u64 reserved[4];
} hi_pngd_chn_attr;
* @brief create png decoder channel
* @param [in] chn: png decoder channel id [0, PNGD_MAX_CHN_NUM)
* @param [in] attr: pointer of png decoder channel attribute
* @return success: return 0
* fail: return error number
*/
hi_s32 hi_mpi_pngd_create_chn(hi_pngd_chn chn, const hi_pngd_chn_attr *attr);
* @brief destroy png decoder channel
* @param [in] chn: png decoder channel id [0, PNGD_MAX_CHN_NUM)
* @return success: return 0
* fail: return error number
*/
hi_s32 hi_mpi_pngd_destroy_chn(hi_pngd_chn chn);
* @brief send stream and outbuffer to png decoder channel
* @param [in] chn: png decoder channel id [0, PNGD_MAX_CHN_NUM)
* @param [in] stream: pointer of stream struct
* @param [in] png_pic_info: pointer of hi_pic_info struct
* @param [in] milli_sec: -1 is block,0 is no block,other positive number is timeout
* @return success: return 0
* fail: return error number
*/
hi_s32 hi_mpi_pngd_send_stream(hi_pngd_chn chn, const hi_img_stream *stream, hi_pic_info *png_pic_info,
hi_s32 milli_sec);
* @brief get frame from png decoder channel
* @param [in] chn: png decoder channel id [0, PNGD_MAX_CHN_NUM)
* @param [in] milli_sec: -1 is block,0 is no block,other positive number is timeout
* @param [out] png_pic_info: pointer of pic info struct
* @param [out] stream: pointer of stream struct
* @return success: return 0
* fail: return error number
*/
hi_s32 hi_mpi_pngd_get_image_data(hi_pngd_chn chn, hi_pic_info *png_pic_info, hi_img_stream *stream, hi_s32 milli_sec);
* @brief get input image's information parsed by dvpp
* @param [in] stream: stream info pointer
* @param [out] img_info: parsed image info pointer
* @return success: return 0
* fail: return error number
*/
hi_s32 hi_mpi_png_get_image_info(const hi_img_stream *png_stream, hi_img_info *img_info);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif
#endif