整理代码
This commit is contained in:
commit
c7b4e178ec
364 changed files with 59691 additions and 0 deletions
110
video/hisi/mpp5/System.cpp
Normal file
110
video/hisi/mpp5/System.cpp
Normal file
|
|
@ -0,0 +1,110 @@
|
|||
/*
|
||||
*******************************************************************************
|
||||
* INCLUDE
|
||||
*******************************************************************************
|
||||
*/
|
||||
#include "System.h"
|
||||
#include "Logger.h"
|
||||
#include <hi_buffer.h>
|
||||
#include <hi_common.h>
|
||||
#include <hi_mpi_tde.h>
|
||||
#include <hi_mpi_sys.h>
|
||||
#include <hi_mpi_vb.h>
|
||||
|
||||
/*
|
||||
*******************************************************************************
|
||||
* CONSTANTS
|
||||
*******************************************************************************
|
||||
*/
|
||||
#ifndef INPUT_IMAGE_WIDTH_MAX
|
||||
#define INPUT_IMAGE_WIDTH_MAX 3840
|
||||
#endif
|
||||
#ifndef INPUT_IMAGE_HEIGHT_MAX
|
||||
#define INPUT_IMAGE_HEIGHT_MAX 2160
|
||||
#endif
|
||||
|
||||
namespace Video
|
||||
{
|
||||
namespace MPP5
|
||||
{
|
||||
/*
|
||||
*******************************************************************************
|
||||
* CLASS DEFINE
|
||||
*******************************************************************************
|
||||
*/
|
||||
System::System()
|
||||
{
|
||||
hi_mpi_sys_exit();
|
||||
hi_mpi_vb_exit();
|
||||
|
||||
hi_vb_cfg vbcfg;
|
||||
memset(&vbcfg, 0, sizeof(vbcfg));
|
||||
vbcfg.max_pool_cnt = 16;
|
||||
|
||||
hi_pic_buf_attr attr;
|
||||
attr.width = INPUT_IMAGE_WIDTH_MAX;
|
||||
attr.height = INPUT_IMAGE_HEIGHT_MAX;
|
||||
attr.align = HI_DEFAULT_ALIGN;
|
||||
attr.bit_width = OT_DATA_BIT_WIDTH_8;
|
||||
attr.pixel_format = HI_PIXEL_FORMAT_YVU_SEMIPLANAR_422;
|
||||
attr.compress_mode = HI_COMPRESS_MODE_FRAME;
|
||||
uint32_t size = hi_common_get_pic_buf_size(&attr);
|
||||
|
||||
sprintf(vbcfg.common_pool[0].mmz_name, "%s", "anonymous");
|
||||
vbcfg.common_pool[0].remap_mode = OT_VB_REMAP_MODE_NONE;
|
||||
vbcfg.common_pool[0].blk_cnt = 32;
|
||||
vbcfg.common_pool[0].blk_size = size;
|
||||
|
||||
attr.width = 1920;
|
||||
attr.height = 1080;
|
||||
attr.align = HI_DEFAULT_ALIGN;
|
||||
attr.bit_width = OT_DATA_BIT_WIDTH_8;
|
||||
attr.pixel_format = HI_PIXEL_FORMAT_YVU_SEMIPLANAR_422;
|
||||
attr.compress_mode = HI_COMPRESS_MODE_FRAME;
|
||||
size = hi_common_get_pic_buf_size(&attr);
|
||||
|
||||
sprintf(vbcfg.common_pool[1].mmz_name, "%s", "anonymous");
|
||||
vbcfg.common_pool[1].remap_mode = OT_VB_REMAP_MODE_NONE;
|
||||
vbcfg.common_pool[1].blk_cnt = 32;
|
||||
vbcfg.common_pool[1].blk_size = size;
|
||||
|
||||
int rc = hi_mpi_vb_set_cfg(&vbcfg);
|
||||
if (rc != HI_SUCCESS)
|
||||
{
|
||||
logger().error("VB Set config FAIL: %#x", (uint32_t)rc);
|
||||
return;
|
||||
}
|
||||
|
||||
rc = hi_mpi_vb_init();
|
||||
if (rc != HI_SUCCESS)
|
||||
{
|
||||
logger().error("VB Initialize FAIL: %#x", (uint32_t)rc);
|
||||
return;
|
||||
}
|
||||
|
||||
rc = hi_mpi_sys_init();
|
||||
if (rc != HI_SUCCESS)
|
||||
{
|
||||
logger().error("SYS Initialize FAIL: %#x", (uint32_t)rc);
|
||||
return;
|
||||
}
|
||||
|
||||
hi_mpi_sys_init_pts_base(0);
|
||||
hi_tde_open();
|
||||
}
|
||||
|
||||
System::~System()
|
||||
{
|
||||
hi_tde_close();
|
||||
hi_mpi_sys_exit();
|
||||
hi_mpi_vb_exit();
|
||||
}
|
||||
|
||||
uint64_t System::getTimestamp()
|
||||
{
|
||||
hi_u64 now;
|
||||
hi_mpi_sys_get_cur_pts(&now);
|
||||
return now;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue