2358
- 收藏
- 点赞
- 分享
- 举报
我使用的是3519Av100的板子 如何通过hdmi到显示器上显示图片啊
HI_VOID SAMPLE_VDEC_HandleSig(HI_S32 signo)
{
signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN);
if (SIGINT == signo || SIGTSTP == signo || SIGTERM == signo)
{
SAMPLE_COMM_VO_HdmiStop();
SAMPLE_COMM_SYS_Exit();
printf("\033[0;31mprogram exit abnormally!\033[0;39m\n");
}
exit(0);
}
#endif
HI_VOID SAMPLE_VDEC_Usage(char *sPrgNm)
{
printf("\n/************************************/\n");
printf("Usage : %s \n", sPrgNm);
printf("index:\n");
printf("\t0: VDEC(H265 PLAYBACK)-VPSS-VO\n");
printf("\t1: VDEC(H264 PLAYBACK)-VPSS-VO\n");
printf("\t2: VDEC(JPEG PLAYBACK)-VPSS-VO\n");
printf("\t3: VDEC(H264 PREVIEW)-VPSS-VOPIP\n");
printf("\t4: VDEC(H264)->VPSS-VO(DHD0-hdmi,DHD1-mipi_tx)\n");
printf("\nIntfSync :\n");
printf("\t0: VO HDMI 4K@30fps.\n");
printf("\t1: VO BT1120 1080P@30fps.\n");
printf("/************************************/\n\n");
}
VO_INTF_SYNC_E g_enIntfSync = VO_OUTPUT_3840x2160_30;
HI_S32 SAMPLE_H265_VDEC_VPSS_VO(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSize;
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfig;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
VO_INTF_TYPE_E enVoIntfType;
u32VdecChnNum = 1;
VpssGrpNum = u32VdecChnNum;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
enVoIntfType = VO_INTF_HDMI;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
enVoIntfType = VO_INTF_BT1120;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSize);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSize.u32Width, stDispSize.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
{
astSampleVdec.enType = PT_H265;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecVideo.enDecMode = VIDEO_DEC_MODE_IP;
astSampleVdec.stSapmleVdecVideo.enBitWidth = DATA_BITWIDTH_8;
astSampleVdec.stSapmleVdecVideo.u32RefFrameNum = 2;
astSampleVdec.u32DisplayFrameNum = 2;
astSampleVdec.u32FrameBufCnt = astSampleVdec.stSapmleVdecVideo.u32RefFrameNum + astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = 3840;
stVpssGrpAttr.u32MaxH = 2160;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[1] = HI_TRUE;
astVpssChnAttr[1].u32Width = stDispSize.u32Width;
astVpssChnAttr[1].u32Height = stDispSize.u32Height;
astVpssChnAttr[1].enChnMode = VPSS_CHN_MODE_AUTO;
astVpssChnAttr[1].enCompressMode = COMPRESS_MODE_SEG;
astVpssChnAttr[1].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[1].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[1].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[1].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[1].u32Depth = 0;
astVpssChnAttr[1].bMirror = HI_FALSE;
astVpssChnAttr[1].bFlip = HI_FALSE;
astVpssChnAttr[1].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[1].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
{
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
/************************************************
step5: start VO
*************************************************/
stVoConfig.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfig.enVoIntfType = enVoIntfType;
stVoConfig.enIntfSync = enIntfSync;
stVoConfig.enPicSize = enDispPicSize;
stVoConfig.u32BgColor = COLOR_RGB_BLUE;
stVoConfig.u32DisBufLen = 3;
stVoConfig.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfig.enVoMode = VO_MODE_1MUX;
stVoConfig.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfig.stDispRect.s32X = 0;
stVoConfig.stDispRect.s32Y = 0;
stVoConfig.stDispRect.u32Width = stDispSize.u32Width;
stVoConfig.stDispRect.u32Height = stDispSize.u32Height;
stVoConfig.stImageSize.u32Width = stDispSize.u32Width;
stVoConfig.stImageSize.u32Height = stDispSize.u32Height;
stVoConfig.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO fail for %#x!\n", s32Ret);
goto END5;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END6;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
VoLayer = stVoConfig.VoDev;
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
for(i=0; i
{
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160_8bit.h265");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_CmdCtrl(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END7:
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo fail for %#x!\n", s32Ret);
}
}
END6:
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END5:
SAMPLE_COMM_VO_StopVO(&stVoConfig);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
HI_S32 SAMPLE_H264_VDEC_VPSS_VO(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSize;
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfig;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
VO_INTF_TYPE_E enVoIntfType;
u32VdecChnNum = 1;
VpssGrpNum = u32VdecChnNum;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
enVoIntfType = VO_INTF_HDMI;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
enVoIntfType = VO_INTF_BT1120;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSize);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSize.u32Width, stDispSize.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
{
astSampleVdec.enType = PT_H264;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecVideo.enDecMode = VIDEO_DEC_MODE_IP;
astSampleVdec.stSapmleVdecVideo.enBitWidth = DATA_BITWIDTH_8;
astSampleVdec.stSapmleVdecVideo.u32RefFrameNum = 2;
astSampleVdec.u32DisplayFrameNum = 2;
astSampleVdec.u32FrameBufCnt = astSampleVdec.stSapmleVdecVideo.u32RefFrameNum + astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = 3840;
stVpssGrpAttr.u32MaxH = 2160;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[1] = HI_TRUE;
astVpssChnAttr[1].u32Width = stDispSize.u32Width;
astVpssChnAttr[1].u32Height = stDispSize.u32Height;
astVpssChnAttr[1].enChnMode = VPSS_CHN_MODE_AUTO;
astVpssChnAttr[1].enCompressMode = COMPRESS_MODE_SEG;
astVpssChnAttr[1].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[1].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[1].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[1].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[1].u32Depth = 0;
astVpssChnAttr[1].bMirror = HI_FALSE;
astVpssChnAttr[1].bFlip = HI_FALSE;
astVpssChnAttr[1].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[1].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
{
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
/************************************************
step5: start VO
*************************************************/
stVoConfig.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfig.enVoIntfType = enVoIntfType;
stVoConfig.enIntfSync = enIntfSync;
stVoConfig.enPicSize = enDispPicSize;
stVoConfig.u32BgColor = COLOR_RGB_BLUE;
stVoConfig.u32DisBufLen = 3;
stVoConfig.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfig.enVoMode = VO_MODE_1MUX;
stVoConfig.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfig.stDispRect.s32X = 0;
stVoConfig.stDispRect.s32Y = 0;
stVoConfig.stDispRect.u32Width = stDispSize.u32Width;
stVoConfig.stDispRect.u32Height = stDispSize.u32Height;
stVoConfig.stImageSize.u32Width = stDispSize.u32Width;
stVoConfig.stImageSize.u32Height = stDispSize.u32Height;
stVoConfig.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO fail for %#x!\n", s32Ret);
goto END5;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END6;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
VoLayer = stVoConfig.VoDev;
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
for(i=0; i
{
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160_8bit.h264");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_CmdCtrl(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END7:
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo fail for %#x!\n", s32Ret);
}
}
END6:
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END5:
SAMPLE_COMM_VO_StopVO(&stVoConfig);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
HI_S32 SAMPLE_H264_VDEC_VPSS_VO_PIP(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSize;
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfig;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
VO_INTF_TYPE_E enVoIntfType;
VPSS_CROP_INFO_S stCropInfo;
u32VdecChnNum = 1;
VpssGrpNum = 2;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
enVoIntfType = VO_INTF_HDMI;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
enVoIntfType = VO_INTF_BT1120;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSize);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSize.u32Width, stDispSize.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
{
astSampleVdec.enType = PT_H264;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecVideo.enDecMode = VIDEO_DEC_MODE_IPB;
astSampleVdec.stSapmleVdecVideo.enBitWidth = DATA_BITWIDTH_8;
astSampleVdec.stSapmleVdecVideo.u32RefFrameNum = 3;
astSampleVdec.u32DisplayFrameNum = 2;
astSampleVdec.u32FrameBufCnt = astSampleVdec.stSapmleVdecVideo.u32RefFrameNum + astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
for(i=0; i
{
s32Ret = HI_MPI_VDEC_SetDisplayMode(i, VIDEO_DISPLAY_MODE_PREVIEW);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("Set VDEC DisplayMode fail for %#x!\n", s32Ret);
goto END3;
}
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = astSampleVdec[0].u32Width;
stVpssGrpAttr.u32MaxH = astSampleVdec[0].u32Height;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[1] = HI_TRUE;
astVpssChnAttr[1].u32Width = stDispSize.u32Width/4;
astVpssChnAttr[1].u32Height = stDispSize.u32Height/4;
astVpssChnAttr[1].enChnMode = VPSS_CHN_MODE_USER;
astVpssChnAttr[1].enCompressMode = COMPRESS_MODE_NONE;
astVpssChnAttr[1].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[1].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[1].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[1].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[1].u32Depth = 0;
astVpssChnAttr[1].bMirror = HI_FALSE;
astVpssChnAttr[1].bFlip = HI_FALSE;
astVpssChnAttr[1].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[1].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
{
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
VpssGrp = 1;
stCropInfo.bEnable = HI_TRUE;
stCropInfo.enCropCoordinate = VPSS_CROP_ABS_COOR;
stCropInfo.stCropRect.s32X = ALIGN_UP(astSampleVdec[0].u32Width/4, 2);
stCropInfo.stCropRect.s32Y = ALIGN_UP(astSampleVdec[0].u32Height/4, 2);
stCropInfo.stCropRect.u32Width = ALIGN_UP(astSampleVdec[0].u32Width/2, 2);
stCropInfo.stCropRect.u32Height = ALIGN_UP(astSampleVdec[0].u32Height/2, 2);
s32Ret = HI_MPI_VPSS_SetGrpCrop(VpssGrp, &stCropInfo);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
/************************************************
step5: start VO
*************************************************/
stVoConfig.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfig.enVoIntfType = enVoIntfType;
stVoConfig.enIntfSync = enIntfSync;
stVoConfig.enPicSize = enDispPicSize;
stVoConfig.u32BgColor = COLOR_RGB_BLUE;
stVoConfig.u32DisBufLen = 3;
stVoConfig.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfig.enVoMode = VO_MODE_1MUX;
stVoConfig.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfig.stDispRect.s32X = 0;
stVoConfig.stDispRect.s32Y = 0;
stVoConfig.stDispRect.u32Width = stDispSize.u32Width;
stVoConfig.stDispRect.u32Height = stDispSize.u32Height;
stVoConfig.stImageSize.u32Width = stDispSize.u32Width;
stVoConfig.stImageSize.u32Height = stDispSize.u32Height;
stVoConfig.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO fail for %#x!\n", s32Ret);
goto END5;
}
s32Ret = SAMPLE_COMM_VO_StartPIP(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO PIP fail for %#x!\n", s32Ret);
goto END5;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(0, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END6;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
VoLayer = stVoConfig.VoDev;
for(i=0; i
{
VoLayer = (i==0) ? 0 : 2;
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 1, VoLayer, 0);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
for(i=0; i
{
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160_8bit.h264");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
printf("\nSAMPLE_TEST:press any key to exit!\n");
getchar();
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END7:
for(i=0; i
{
VoLayer = (i==0) ? 0 : 2;
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 1, VoLayer, 0);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo fail for %#x!\n", s32Ret);
}
}
END6:
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END5:
SAMPLE_COMM_VO_StopPIP(&stVoConfig);
SAMPLE_COMM_VO_StopVO(&stVoConfig);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
HI_S32 SAMPLE_JPEG_VDEC_VPSS_VO(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSize;
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfig;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
VO_INTF_TYPE_E enVoIntfType;
u32VdecChnNum = 1;
VpssGrpNum = u32VdecChnNum;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
enVoIntfType = VO_INTF_HDMI;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
enVoIntfType = VO_INTF_BT1120;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSize);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSize.u32Width, stDispSize.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
{
astSampleVdec.enType = PT_JPEG;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecPicture.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astSampleVdec.stSapmleVdecPicture.u32Alpha = 255;
astSampleVdec.u32DisplayFrameNum = 4;
astSampleVdec.u32FrameBufCnt = astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = 3840;
stVpssGrpAttr.u32MaxH = 2160;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[1] = HI_TRUE;
astVpssChnAttr[1].u32Width = stDispSize.u32Width;
astVpssChnAttr[1].u32Height = stDispSize.u32Height;
astVpssChnAttr[1].enChnMode = VPSS_CHN_MODE_AUTO;
astVpssChnAttr[1].enCompressMode = COMPRESS_MODE_SEG;
astVpssChnAttr[1].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[1].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[1].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[1].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[1].u32Depth = 0;
astVpssChnAttr[1].bMirror = HI_FALSE;
astVpssChnAttr[1].bFlip = HI_FALSE;
astVpssChnAttr[1].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[1].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
{
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
/************************************************
step5: start VO
*************************************************/
stVoConfig.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfig.enVoIntfType = enVoIntfType;
stVoConfig.enIntfSync = enIntfSync;
stVoConfig.enPicSize = enDispPicSize;
stVoConfig.u32BgColor = COLOR_RGB_BLUE;
stVoConfig.u32DisBufLen = 3;
stVoConfig.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfig.enVoMode = VO_MODE_1MUX;
stVoConfig.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfig.stDispRect.s32X = 0;
stVoConfig.stDispRect.s32Y = 0;
stVoConfig.stDispRect.u32Width = stDispSize.u32Width;
stVoConfig.stDispRect.u32Height = stDispSize.u32Height;
stVoConfig.stImageSize.u32Width = stDispSize.u32Width;
stVoConfig.stImageSize.u32Height = stDispSize.u32Height;
stVoConfig.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO fail for %#x!\n", s32Ret);
goto END5;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END6;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
VoLayer = stVoConfig.VoDev;
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
for(i=0; i
{
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160.jpg");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_CmdCtrl(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END7:
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo fail for %#x!\n", s32Ret);
}
}
END6:
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END5:
SAMPLE_COMM_VO_StopVO(&stVoConfig);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
HI_S32 SAMPLE_H264_VDEC_VPSS_VO_MIPI_Tx(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSizeUHD = {0};
SIZE_S stDispSizeHD = {0};
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfigUHD;
SAMPLE_VO_CONFIG_S stVoConfigHD;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
u32VdecChnNum = 1;
VpssGrpNum = u32VdecChnNum;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSizeUHD);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSizeUHD.u32Width, stDispSizeUHD.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
{
astSampleVdec.enType = PT_H264;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecVideo.enDecMode = VIDEO_DEC_MODE_IPB;
astSampleVdec.stSapmleVdecVideo.enBitWidth = DATA_BITWIDTH_8;
astSampleVdec.stSapmleVdecVideo.u32RefFrameNum = 3;
astSampleVdec.u32DisplayFrameNum = 2;
astSampleVdec.u32FrameBufCnt = astSampleVdec.stSapmleVdecVideo.u32RefFrameNum + astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = 3840;
stVpssGrpAttr.u32MaxH = 2160;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[0] = HI_TRUE;
astVpssChnAttr[0].u32Width = stDispSizeUHD.u32Width;
astVpssChnAttr[0].u32Height = stDispSizeUHD.u32Height;
astVpssChnAttr[0].enChnMode = VPSS_CHN_MODE_USER;
astVpssChnAttr[0].enCompressMode = COMPRESS_MODE_SEG;
astVpssChnAttr[0].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[0].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[0].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[0].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[0].u32Depth = 0;
astVpssChnAttr[0].bMirror = HI_FALSE;
astVpssChnAttr[0].bFlip = HI_FALSE;
astVpssChnAttr[0].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[0].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
{
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
/************************************************
step5: start VO Dev UHD(DHD0-hdmi)
*************************************************/
stVoConfigUHD.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfigUHD.enVoIntfType = VO_INTF_HDMI;
stVoConfigUHD.enIntfSync = enIntfSync;
stVoConfigUHD.enPicSize = enDispPicSize;
stVoConfigUHD.u32BgColor = COLOR_RGB_BLUE;
stVoConfigUHD.u32DisBufLen = 3;
stVoConfigUHD.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfigUHD.enVoMode = VO_MODE_1MUX;
stVoConfigUHD.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfigUHD.stDispRect.s32X = 0;
stVoConfigUHD.stDispRect.s32Y = 0;
stVoConfigUHD.stDispRect.u32Width = stDispSizeUHD.u32Width;
stVoConfigUHD.stDispRect.u32Height = stDispSizeUHD.u32Height;
stVoConfigUHD.stImageSize.u32Width = stDispSizeUHD.u32Width;
stVoConfigUHD.stImageSize.u32Height = stDispSizeUHD.u32Height;
stVoConfigUHD.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfigUHD);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO %d fail for %#x!\n", stVoConfigUHD.VoDev, s32Ret);
goto END5;
}
/************************************************
step6: start VO Dev HD(DHD1-mipi_tx)
*************************************************/
stDispSizeHD.u32Width = 1080;
stDispSizeHD.u32Height = 1920;
stVoConfigHD.VoDev = SAMPLE_VO_DEV_HD;
stVoConfigHD.enVoIntfType = VO_INTF_MIPI;
stVoConfigHD.enIntfSync = VO_OUTPUT_1080x1920_60;
stVoConfigHD.enPicSize = enDispPicSize;
stVoConfigHD.u32BgColor = COLOR_RGB_CYN;
stVoConfigHD.u32DisBufLen = 3;
stVoConfigHD.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfigHD.enVoMode = VO_MODE_1MUX;
stVoConfigHD.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfigHD.stDispRect.s32X = 0;
stVoConfigHD.stDispRect.s32Y = 0;
stVoConfigHD.stDispRect.u32Width = stDispSizeHD.u32Width;
stVoConfigHD.stDispRect.u32Height = stDispSizeHD.u32Height;
stVoConfigHD.stImageSize.u32Width = stDispSizeHD.u32Width;
stVoConfigHD.stImageSize.u32Height = stDispSizeHD.u32Height;
stVoConfigHD.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfigHD);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO %d fail for %#x!\n", stVoConfigHD.VoDev, s32Ret);
goto END6;
}
/************************************************
step7: VDEC bind VPSS
*************************************************/
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: VPSS bind VO Layer 0
*************************************************/
VoLayer = stVoConfigUHD.VoDev;
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 0, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END8;
}
}
/************************************************
step9: VPSS bind VO Layer 1
*************************************************/
VoLayer = stVoConfigHD.VoDev;
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 0, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END9;
}
}
/************************************************
step10: send stream to VDEC
*************************************************/
for(i=0; i
{
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160_8bit.h264");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_CmdCtrl(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END9:
VoLayer = stVoConfigHD.VoDev;
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 0, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo (%d,%d) fail for %#x!\n",VoLayer, i, s32Ret);
}
}
END8:
VoLayer = stVoConfigUHD.VoDev;
for(i=0; i
{
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 0, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo (%d,%d) fail for %#x!\n",VoLayer, i, s32Ret);
}
}
END7:
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END6:
SAMPLE_COMM_VO_StopVO(&stVoConfigHD);
END5:
SAMPLE_COMM_VO_StopVO(&stVoConfigUHD);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
/******************************************************************************
* function : main()
* Description : video vdec sample
******************************************************************************/
#ifdef __HuaweiLite__
int app_main(int argc, char *argv[])
#else
int main(int argc, char *argv[])
#endif
{
HI_S32 s32Ret = HI_SUCCESS;
if ((argc < 2) || (1 != strlen(argv[1])))
{
printf("\nInvaild input! For examples:\n");
SAMPLE_VDEC_Usage(argv[0]);
return HI_FAILURE;
}
if ((argc > 2) && ('1' == *argv[2]))
{
g_enIntfSync = VO_OUTPUT_1080P30;
}
else
{
g_enIntfSync = VO_OUTPUT_3840x2160_30;
}
#ifndef __HuaweiLite__
signal(SIGINT, SAMPLE_VDEC_HandleSig);
signal(SIGTERM, SAMPLE_VDEC_HandleSig);
#endif
/******************************************
choose the case
******************************************/
switch (*argv[1])
{
case '0':
{
s32Ret = SAMPLE_H265_VDEC_VPSS_VO();
break;
}
case '1':
{
s32Ret = SAMPLE_H264_VDEC_VPSS_VO();
break;
}
case '2':
{
s32Ret = SAMPLE_JPEG_VDEC_VPSS_VO();
break;
}
case '3':
{
s32Ret = SAMPLE_H264_VDEC_VPSS_VO_PIP();
break;
}
case '4':
{
s32Ret = SAMPLE_H264_VDEC_VPSS_VO_MIPI_Tx();
break;
}
default :
{
SAMPLE_PRT("the index is invaild!\n");
SAMPLE_VDEC_Usage(argv[0]);
s32Ret = HI_FAILURE;
break;
}
}
if (HI_SUCCESS == s32Ret)
{
SAMPLE_PRT("program exit normally!\n");
}
else
{
SAMPLE_PRT("program exit abnormally!\n");
}
return s32Ret;
}
{
signal(SIGINT, SIG_IGN);
signal(SIGTERM, SIG_IGN);
if (SIGINT == signo || SIGTSTP == signo || SIGTERM == signo)
{
SAMPLE_COMM_VO_HdmiStop();
SAMPLE_COMM_SYS_Exit();
printf("\033[0;31mprogram exit abnormally!\033[0;39m\n");
}
exit(0);
}
#endif
HI_VOID SAMPLE_VDEC_Usage(char *sPrgNm)
{
printf("\n/************************************/\n");
printf("Usage : %s
printf("index:\n");
printf("\t0: VDEC(H265 PLAYBACK)-VPSS-VO\n");
printf("\t1: VDEC(H264 PLAYBACK)-VPSS-VO\n");
printf("\t2: VDEC(JPEG PLAYBACK)-VPSS-VO\n");
printf("\t3: VDEC(H264 PREVIEW)-VPSS-VOPIP\n");
printf("\t4: VDEC(H264)->VPSS-VO(DHD0-hdmi,DHD1-mipi_tx)\n");
printf("\nIntfSync :\n");
printf("\t0: VO HDMI 4K@30fps.\n");
printf("\t1: VO BT1120 1080P@30fps.\n");
printf("/************************************/\n\n");
}
VO_INTF_SYNC_E g_enIntfSync = VO_OUTPUT_3840x2160_30;
HI_S32 SAMPLE_H265_VDEC_VPSS_VO(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSize;
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfig;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
VO_INTF_TYPE_E enVoIntfType;
u32VdecChnNum = 1;
VpssGrpNum = u32VdecChnNum;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
enVoIntfType = VO_INTF_HDMI;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
enVoIntfType = VO_INTF_BT1120;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSize);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSize.u32Width, stDispSize.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
astSampleVdec.enType = PT_H265;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecVideo.enDecMode = VIDEO_DEC_MODE_IP;
astSampleVdec.stSapmleVdecVideo.enBitWidth = DATA_BITWIDTH_8;
astSampleVdec.stSapmleVdecVideo.u32RefFrameNum = 2;
astSampleVdec.u32DisplayFrameNum = 2;
astSampleVdec.u32FrameBufCnt = astSampleVdec.stSapmleVdecVideo.u32RefFrameNum + astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = 3840;
stVpssGrpAttr.u32MaxH = 2160;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[1] = HI_TRUE;
astVpssChnAttr[1].u32Width = stDispSize.u32Width;
astVpssChnAttr[1].u32Height = stDispSize.u32Height;
astVpssChnAttr[1].enChnMode = VPSS_CHN_MODE_AUTO;
astVpssChnAttr[1].enCompressMode = COMPRESS_MODE_SEG;
astVpssChnAttr[1].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[1].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[1].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[1].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[1].u32Depth = 0;
astVpssChnAttr[1].bMirror = HI_FALSE;
astVpssChnAttr[1].bFlip = HI_FALSE;
astVpssChnAttr[1].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[1].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
/************************************************
step5: start VO
*************************************************/
stVoConfig.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfig.enVoIntfType = enVoIntfType;
stVoConfig.enIntfSync = enIntfSync;
stVoConfig.enPicSize = enDispPicSize;
stVoConfig.u32BgColor = COLOR_RGB_BLUE;
stVoConfig.u32DisBufLen = 3;
stVoConfig.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfig.enVoMode = VO_MODE_1MUX;
stVoConfig.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfig.stDispRect.s32X = 0;
stVoConfig.stDispRect.s32Y = 0;
stVoConfig.stDispRect.u32Width = stDispSize.u32Width;
stVoConfig.stDispRect.u32Height = stDispSize.u32Height;
stVoConfig.stImageSize.u32Width = stDispSize.u32Width;
stVoConfig.stImageSize.u32Height = stDispSize.u32Height;
stVoConfig.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO fail for %#x!\n", s32Ret);
goto END5;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END6;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
VoLayer = stVoConfig.VoDev;
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
for(i=0; i
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160_8bit.h265");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_CmdCtrl(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END7:
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo fail for %#x!\n", s32Ret);
}
}
END6:
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END5:
SAMPLE_COMM_VO_StopVO(&stVoConfig);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
HI_S32 SAMPLE_H264_VDEC_VPSS_VO(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSize;
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfig;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
VO_INTF_TYPE_E enVoIntfType;
u32VdecChnNum = 1;
VpssGrpNum = u32VdecChnNum;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
enVoIntfType = VO_INTF_HDMI;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
enVoIntfType = VO_INTF_BT1120;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSize);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSize.u32Width, stDispSize.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
astSampleVdec.enType = PT_H264;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecVideo.enDecMode = VIDEO_DEC_MODE_IP;
astSampleVdec.stSapmleVdecVideo.enBitWidth = DATA_BITWIDTH_8;
astSampleVdec.stSapmleVdecVideo.u32RefFrameNum = 2;
astSampleVdec.u32DisplayFrameNum = 2;
astSampleVdec.u32FrameBufCnt = astSampleVdec.stSapmleVdecVideo.u32RefFrameNum + astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = 3840;
stVpssGrpAttr.u32MaxH = 2160;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[1] = HI_TRUE;
astVpssChnAttr[1].u32Width = stDispSize.u32Width;
astVpssChnAttr[1].u32Height = stDispSize.u32Height;
astVpssChnAttr[1].enChnMode = VPSS_CHN_MODE_AUTO;
astVpssChnAttr[1].enCompressMode = COMPRESS_MODE_SEG;
astVpssChnAttr[1].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[1].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[1].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[1].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[1].u32Depth = 0;
astVpssChnAttr[1].bMirror = HI_FALSE;
astVpssChnAttr[1].bFlip = HI_FALSE;
astVpssChnAttr[1].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[1].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
/************************************************
step5: start VO
*************************************************/
stVoConfig.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfig.enVoIntfType = enVoIntfType;
stVoConfig.enIntfSync = enIntfSync;
stVoConfig.enPicSize = enDispPicSize;
stVoConfig.u32BgColor = COLOR_RGB_BLUE;
stVoConfig.u32DisBufLen = 3;
stVoConfig.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfig.enVoMode = VO_MODE_1MUX;
stVoConfig.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfig.stDispRect.s32X = 0;
stVoConfig.stDispRect.s32Y = 0;
stVoConfig.stDispRect.u32Width = stDispSize.u32Width;
stVoConfig.stDispRect.u32Height = stDispSize.u32Height;
stVoConfig.stImageSize.u32Width = stDispSize.u32Width;
stVoConfig.stImageSize.u32Height = stDispSize.u32Height;
stVoConfig.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO fail for %#x!\n", s32Ret);
goto END5;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END6;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
VoLayer = stVoConfig.VoDev;
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
for(i=0; i
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160_8bit.h264");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_CmdCtrl(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END7:
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo fail for %#x!\n", s32Ret);
}
}
END6:
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END5:
SAMPLE_COMM_VO_StopVO(&stVoConfig);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
HI_S32 SAMPLE_H264_VDEC_VPSS_VO_PIP(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSize;
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfig;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
VO_INTF_TYPE_E enVoIntfType;
VPSS_CROP_INFO_S stCropInfo;
u32VdecChnNum = 1;
VpssGrpNum = 2;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
enVoIntfType = VO_INTF_HDMI;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
enVoIntfType = VO_INTF_BT1120;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSize);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSize.u32Width, stDispSize.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
astSampleVdec.enType = PT_H264;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecVideo.enDecMode = VIDEO_DEC_MODE_IPB;
astSampleVdec.stSapmleVdecVideo.enBitWidth = DATA_BITWIDTH_8;
astSampleVdec.stSapmleVdecVideo.u32RefFrameNum = 3;
astSampleVdec.u32DisplayFrameNum = 2;
astSampleVdec.u32FrameBufCnt = astSampleVdec.stSapmleVdecVideo.u32RefFrameNum + astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
for(i=0; i
s32Ret = HI_MPI_VDEC_SetDisplayMode(i, VIDEO_DISPLAY_MODE_PREVIEW);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("Set VDEC DisplayMode fail for %#x!\n", s32Ret);
goto END3;
}
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = astSampleVdec[0].u32Width;
stVpssGrpAttr.u32MaxH = astSampleVdec[0].u32Height;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[1] = HI_TRUE;
astVpssChnAttr[1].u32Width = stDispSize.u32Width/4;
astVpssChnAttr[1].u32Height = stDispSize.u32Height/4;
astVpssChnAttr[1].enChnMode = VPSS_CHN_MODE_USER;
astVpssChnAttr[1].enCompressMode = COMPRESS_MODE_NONE;
astVpssChnAttr[1].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[1].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[1].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[1].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[1].u32Depth = 0;
astVpssChnAttr[1].bMirror = HI_FALSE;
astVpssChnAttr[1].bFlip = HI_FALSE;
astVpssChnAttr[1].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[1].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
VpssGrp = 1;
stCropInfo.bEnable = HI_TRUE;
stCropInfo.enCropCoordinate = VPSS_CROP_ABS_COOR;
stCropInfo.stCropRect.s32X = ALIGN_UP(astSampleVdec[0].u32Width/4, 2);
stCropInfo.stCropRect.s32Y = ALIGN_UP(astSampleVdec[0].u32Height/4, 2);
stCropInfo.stCropRect.u32Width = ALIGN_UP(astSampleVdec[0].u32Width/2, 2);
stCropInfo.stCropRect.u32Height = ALIGN_UP(astSampleVdec[0].u32Height/2, 2);
s32Ret = HI_MPI_VPSS_SetGrpCrop(VpssGrp, &stCropInfo);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
/************************************************
step5: start VO
*************************************************/
stVoConfig.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfig.enVoIntfType = enVoIntfType;
stVoConfig.enIntfSync = enIntfSync;
stVoConfig.enPicSize = enDispPicSize;
stVoConfig.u32BgColor = COLOR_RGB_BLUE;
stVoConfig.u32DisBufLen = 3;
stVoConfig.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfig.enVoMode = VO_MODE_1MUX;
stVoConfig.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfig.stDispRect.s32X = 0;
stVoConfig.stDispRect.s32Y = 0;
stVoConfig.stDispRect.u32Width = stDispSize.u32Width;
stVoConfig.stDispRect.u32Height = stDispSize.u32Height;
stVoConfig.stImageSize.u32Width = stDispSize.u32Width;
stVoConfig.stImageSize.u32Height = stDispSize.u32Height;
stVoConfig.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO fail for %#x!\n", s32Ret);
goto END5;
}
s32Ret = SAMPLE_COMM_VO_StartPIP(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO PIP fail for %#x!\n", s32Ret);
goto END5;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(0, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END6;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
VoLayer = stVoConfig.VoDev;
for(i=0; i
VoLayer = (i==0) ? 0 : 2;
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 1, VoLayer, 0);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
for(i=0; i
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160_8bit.h264");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
printf("\nSAMPLE_TEST:press any key to exit!\n");
getchar();
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END7:
for(i=0; i
VoLayer = (i==0) ? 0 : 2;
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 1, VoLayer, 0);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo fail for %#x!\n", s32Ret);
}
}
END6:
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END5:
SAMPLE_COMM_VO_StopPIP(&stVoConfig);
SAMPLE_COMM_VO_StopVO(&stVoConfig);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
HI_S32 SAMPLE_JPEG_VDEC_VPSS_VO(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSize;
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfig;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
VO_INTF_TYPE_E enVoIntfType;
u32VdecChnNum = 1;
VpssGrpNum = u32VdecChnNum;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
enVoIntfType = VO_INTF_HDMI;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
enVoIntfType = VO_INTF_BT1120;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSize);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSize.u32Width, stDispSize.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
astSampleVdec.enType = PT_JPEG;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecPicture.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astSampleVdec.stSapmleVdecPicture.u32Alpha = 255;
astSampleVdec.u32DisplayFrameNum = 4;
astSampleVdec.u32FrameBufCnt = astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = 3840;
stVpssGrpAttr.u32MaxH = 2160;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[1] = HI_TRUE;
astVpssChnAttr[1].u32Width = stDispSize.u32Width;
astVpssChnAttr[1].u32Height = stDispSize.u32Height;
astVpssChnAttr[1].enChnMode = VPSS_CHN_MODE_AUTO;
astVpssChnAttr[1].enCompressMode = COMPRESS_MODE_SEG;
astVpssChnAttr[1].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[1].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[1].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[1].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[1].u32Depth = 0;
astVpssChnAttr[1].bMirror = HI_FALSE;
astVpssChnAttr[1].bFlip = HI_FALSE;
astVpssChnAttr[1].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[1].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
/************************************************
step5: start VO
*************************************************/
stVoConfig.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfig.enVoIntfType = enVoIntfType;
stVoConfig.enIntfSync = enIntfSync;
stVoConfig.enPicSize = enDispPicSize;
stVoConfig.u32BgColor = COLOR_RGB_BLUE;
stVoConfig.u32DisBufLen = 3;
stVoConfig.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfig.enVoMode = VO_MODE_1MUX;
stVoConfig.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfig.stDispRect.s32X = 0;
stVoConfig.stDispRect.s32Y = 0;
stVoConfig.stDispRect.u32Width = stDispSize.u32Width;
stVoConfig.stDispRect.u32Height = stDispSize.u32Height;
stVoConfig.stImageSize.u32Width = stDispSize.u32Width;
stVoConfig.stImageSize.u32Height = stDispSize.u32Height;
stVoConfig.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO fail for %#x!\n", s32Ret);
goto END5;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END6;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
VoLayer = stVoConfig.VoDev;
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
for(i=0; i
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160.jpg");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_CmdCtrl(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END7:
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 1, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo fail for %#x!\n", s32Ret);
}
}
END6:
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END5:
SAMPLE_COMM_VO_StopVO(&stVoConfig);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
HI_S32 SAMPLE_H264_VDEC_VPSS_VO_MIPI_Tx(HI_VOID)
{
VB_CONFIG_S stVbConfig;
HI_S32 i, s32Ret = HI_SUCCESS;
VDEC_THREAD_PARAM_S stVdecSend[VDEC_MAX_CHN_NUM];
SIZE_S stDispSizeUHD = {0};
SIZE_S stDispSizeHD = {0};
VO_LAYER VoLayer;
HI_U32 u32VdecChnNum, VpssGrpNum;
VPSS_GRP VpssGrp;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
PIC_SIZE_E enDispPicSize;
SAMPLE_VDEC_ATTR astSampleVdec[VDEC_MAX_CHN_NUM];
VPSS_CHN_ATTR_S astVpssChnAttr[VPSS_MAX_CHN_NUM];
SAMPLE_VO_CONFIG_S stVoConfigUHD;
SAMPLE_VO_CONFIG_S stVoConfigHD;
VPSS_GRP_ATTR_S stVpssGrpAttr;
HI_BOOL abChnEnable[VPSS_MAX_CHN_NUM];
VO_INTF_SYNC_E enIntfSync;
u32VdecChnNum = 1;
VpssGrpNum = u32VdecChnNum;
/************************************************
step1: init SYS, init common VB(for VPSS and VO)
*************************************************/
if(VO_OUTPUT_3840x2160_30 == g_enIntfSync)
{
enDispPicSize = PIC_3840x2160;
enIntfSync = VO_OUTPUT_3840x2160_30;
}
else
{
enDispPicSize = PIC_1080P;
enIntfSync = VO_OUTPUT_1080P30;
}
s32Ret = SAMPLE_COMM_SYS_GetPicSize(enDispPicSize, &stDispSizeUHD);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("sys get pic size fail for %#x!\n", s32Ret);
goto END1;
}
memset(&stVbConfig, 0, sizeof(VB_CONFIG_S));
stVbConfig.u32MaxPoolCnt = 1;
stVbConfig.astCommPool[0].u32BlkCnt = 10*u32VdecChnNum;
stVbConfig.astCommPool[0].u64BlkSize = COMMON_GetPicBufferSize(stDispSizeUHD.u32Width, stDispSizeUHD.u32Height,
PIXEL_FORMAT_YVU_SEMIPLANAR_420, DATA_BITWIDTH_8, COMPRESS_MODE_SEG, 0);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConfig);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto END1;
}
/************************************************
step2: init module VB or user VB(for VDEC)
*************************************************/
for(i=0; i
astSampleVdec.enType = PT_H264;
astSampleVdec.u32Width = 3840;
astSampleVdec.u32Height = 2160;
astSampleVdec.enMode = VIDEO_MODE_FRAME;
astSampleVdec.stSapmleVdecVideo.enDecMode = VIDEO_DEC_MODE_IPB;
astSampleVdec.stSapmleVdecVideo.enBitWidth = DATA_BITWIDTH_8;
astSampleVdec.stSapmleVdecVideo.u32RefFrameNum = 3;
astSampleVdec.u32DisplayFrameNum = 2;
astSampleVdec.u32FrameBufCnt = astSampleVdec.stSapmleVdecVideo.u32RefFrameNum + astSampleVdec.u32DisplayFrameNum + 1;
}
s32Ret = SAMPLE_COMM_VDEC_InitVBPool(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto END2;
}
/************************************************
step3: start VDEC
*************************************************/
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdecChnNum, &astSampleVdec[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto END3;
}
/************************************************
step4: start VPSS
*************************************************/
stVpssGrpAttr.u32MaxW = 3840;
stVpssGrpAttr.u32MaxH = 2160;
stVpssGrpAttr.stFrameRate.s32SrcFrameRate = -1;
stVpssGrpAttr.stFrameRate.s32DstFrameRate = -1;
stVpssGrpAttr.enDynamicRange = DYNAMIC_RANGE_SDR8;
stVpssGrpAttr.enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVpssGrpAttr.bNrEn = HI_FALSE;
memset(abChnEnable, 0, sizeof(abChnEnable));
abChnEnable[0] = HI_TRUE;
astVpssChnAttr[0].u32Width = stDispSizeUHD.u32Width;
astVpssChnAttr[0].u32Height = stDispSizeUHD.u32Height;
astVpssChnAttr[0].enChnMode = VPSS_CHN_MODE_USER;
astVpssChnAttr[0].enCompressMode = COMPRESS_MODE_SEG;
astVpssChnAttr[0].enDynamicRange = DYNAMIC_RANGE_SDR8;
astVpssChnAttr[0].enPixelFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
astVpssChnAttr[0].stFrameRate.s32SrcFrameRate = -1;
astVpssChnAttr[0].stFrameRate.s32DstFrameRate = -1;
astVpssChnAttr[0].u32Depth = 0;
astVpssChnAttr[0].bMirror = HI_FALSE;
astVpssChnAttr[0].bFlip = HI_FALSE;
astVpssChnAttr[0].stAspectRatio.enMode = ASPECT_RATIO_NONE;
astVpssChnAttr[0].enVideoFormat = VIDEO_FORMAT_LINEAR;
for(i=0; i
VpssGrp = i;
s32Ret = SAMPLE_COMM_VPSS_Start(VpssGrp, &abChnEnable[0], &stVpssGrpAttr, &astVpssChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto END4;
}
}
/************************************************
step5: start VO Dev UHD(DHD0-hdmi)
*************************************************/
stVoConfigUHD.VoDev = SAMPLE_VO_DEV_UHD;
stVoConfigUHD.enVoIntfType = VO_INTF_HDMI;
stVoConfigUHD.enIntfSync = enIntfSync;
stVoConfigUHD.enPicSize = enDispPicSize;
stVoConfigUHD.u32BgColor = COLOR_RGB_BLUE;
stVoConfigUHD.u32DisBufLen = 3;
stVoConfigUHD.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfigUHD.enVoMode = VO_MODE_1MUX;
stVoConfigUHD.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfigUHD.stDispRect.s32X = 0;
stVoConfigUHD.stDispRect.s32Y = 0;
stVoConfigUHD.stDispRect.u32Width = stDispSizeUHD.u32Width;
stVoConfigUHD.stDispRect.u32Height = stDispSizeUHD.u32Height;
stVoConfigUHD.stImageSize.u32Width = stDispSizeUHD.u32Width;
stVoConfigUHD.stImageSize.u32Height = stDispSizeUHD.u32Height;
stVoConfigUHD.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfigUHD);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO %d fail for %#x!\n", stVoConfigUHD.VoDev, s32Ret);
goto END5;
}
/************************************************
step6: start VO Dev HD(DHD1-mipi_tx)
*************************************************/
stDispSizeHD.u32Width = 1080;
stDispSizeHD.u32Height = 1920;
stVoConfigHD.VoDev = SAMPLE_VO_DEV_HD;
stVoConfigHD.enVoIntfType = VO_INTF_MIPI;
stVoConfigHD.enIntfSync = VO_OUTPUT_1080x1920_60;
stVoConfigHD.enPicSize = enDispPicSize;
stVoConfigHD.u32BgColor = COLOR_RGB_CYN;
stVoConfigHD.u32DisBufLen = 3;
stVoConfigHD.enDstDynamicRange = DYNAMIC_RANGE_SDR8;
stVoConfigHD.enVoMode = VO_MODE_1MUX;
stVoConfigHD.enPixFormat = PIXEL_FORMAT_YVU_SEMIPLANAR_420;
stVoConfigHD.stDispRect.s32X = 0;
stVoConfigHD.stDispRect.s32Y = 0;
stVoConfigHD.stDispRect.u32Width = stDispSizeHD.u32Width;
stVoConfigHD.stDispRect.u32Height = stDispSizeHD.u32Height;
stVoConfigHD.stImageSize.u32Width = stDispSizeHD.u32Width;
stVoConfigHD.stImageSize.u32Height = stDispSizeHD.u32Height;
stVoConfigHD.enVoPartMode = VO_PART_MODE_SINGLE;
s32Ret = SAMPLE_COMM_VO_StartVO(&stVoConfigHD);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VO %d fail for %#x!\n", stVoConfigHD.VoDev, s32Ret);
goto END6;
}
/************************************************
step7: VDEC bind VPSS
*************************************************/
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_Bind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto END7;
}
}
/************************************************
step8: VPSS bind VO Layer 0
*************************************************/
VoLayer = stVoConfigUHD.VoDev;
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 0, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END8;
}
}
/************************************************
step9: VPSS bind VO Layer 1
*************************************************/
VoLayer = stVoConfigHD.VoDev;
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_Bind_VO(i, 0, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto END9;
}
}
/************************************************
step10: send stream to VDEC
*************************************************/
for(i=0; i
snprintf(stVdecSend.cFileName, sizeof(stVdecSend.cFileName), "3840x2160_8bit.h264");
snprintf(stVdecSend.cFilePath, sizeof(stVdecSend.cFilePath), "%s", SAMPLE_STREAM_PATH);
stVdecSend.enType = astSampleVdec.enType;
stVdecSend.s32StreamMode = astSampleVdec.enMode;
stVdecSend.s32ChnId = i;
stVdecSend.s32IntervalTime = 1000;
stVdecSend.u64PtsInit = 0;
stVdecSend.u64PtsIncrease = 0;
stVdecSend.eThreadCtrl = THREAD_CTRL_START;
stVdecSend.bCircleSend = HI_TRUE;
stVdecSend.s32MilliSec = 0;
stVdecSend.s32MinBufSize = (astSampleVdec.u32Width * astSampleVdec.u32Height * 3)>>1;
}
SAMPLE_COMM_VDEC_StartSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_CmdCtrl(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
SAMPLE_COMM_VDEC_StopSendStream(u32VdecChnNum, &stVdecSend[0], &VdecThread[0]);
END9:
VoLayer = stVoConfigHD.VoDev;
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 0, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo (%d,%d) fail for %#x!\n",VoLayer, i, s32Ret);
}
}
END8:
VoLayer = stVoConfigUHD.VoDev;
for(i=0; i
s32Ret = SAMPLE_COMM_VPSS_UnBind_VO(i, 0, VoLayer, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss unbind vo (%d,%d) fail for %#x!\n",VoLayer, i, s32Ret);
}
}
END7:
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_UnBind_VPSS(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec unbind vpss fail for %#x!\n", s32Ret);
}
}
END6:
SAMPLE_COMM_VO_StopVO(&stVoConfigHD);
END5:
SAMPLE_COMM_VO_StopVO(&stVoConfigUHD);
END4:
for(i = VpssGrp; i >= 0; i--)
{
VpssGrp = i;
SAMPLE_COMM_VPSS_Stop(VpssGrp, &abChnEnable[0]);
}
END3:
SAMPLE_COMM_VDEC_Stop(u32VdecChnNum);
END2:
SAMPLE_COMM_VDEC_ExitVBPool();
END1:
SAMPLE_COMM_SYS_Exit();
return s32Ret;
}
/******************************************************************************
* function : main()
* Description : video vdec sample
******************************************************************************/
#ifdef __HuaweiLite__
int app_main(int argc, char *argv[])
#else
int main(int argc, char *argv[])
#endif
{
HI_S32 s32Ret = HI_SUCCESS;
if ((argc < 2) || (1 != strlen(argv[1])))
{
printf("\nInvaild input! For examples:\n");
SAMPLE_VDEC_Usage(argv[0]);
return HI_FAILURE;
}
if ((argc > 2) && ('1' == *argv[2]))
{
g_enIntfSync = VO_OUTPUT_1080P30;
}
else
{
g_enIntfSync = VO_OUTPUT_3840x2160_30;
}
#ifndef __HuaweiLite__
signal(SIGINT, SAMPLE_VDEC_HandleSig);
signal(SIGTERM, SAMPLE_VDEC_HandleSig);
#endif
/******************************************
choose the case
******************************************/
switch (*argv[1])
{
case '0':
{
s32Ret = SAMPLE_H265_VDEC_VPSS_VO();
break;
}
case '1':
{
s32Ret = SAMPLE_H264_VDEC_VPSS_VO();
break;
}
case '2':
{
s32Ret = SAMPLE_JPEG_VDEC_VPSS_VO();
break;
}
case '3':
{
s32Ret = SAMPLE_H264_VDEC_VPSS_VO_PIP();
break;
}
case '4':
{
s32Ret = SAMPLE_H264_VDEC_VPSS_VO_MIPI_Tx();
break;
}
default :
{
SAMPLE_PRT("the index is invaild!\n");
SAMPLE_VDEC_Usage(argv[0]);
s32Ret = HI_FAILURE;
break;
}
}
if (HI_SUCCESS == s32Ret)
{
SAMPLE_PRT("program exit normally!\n");
}
else
{
SAMPLE_PRT("program exit abnormally!\n");
}
return s32Ret;
}
我来回答
回答2个
时间排序
认可量排序
认可0
认可0
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2020-10-12 16:41:27
-
2016-09-03 13:01:32
-
2020-04-17 17:18:21
-
2020-05-07 16:57:38
-
2017-11-23 13:57:06
-
2020-03-30 10:31:00
-
2021-02-20 18:24:33
-
2020-03-18 16:10:50
-
2019-10-05 23:33:02
-
2021-09-18 15:41:38
-
2018-02-08 13:38:50
-
2019-01-27 22:24:19
-
2015-08-06 15:58:52
-
2020-03-19 09:37:25
-
2024-03-04 16:13:49
-
2018-11-14 09:15:31
-
2020-11-04 16:35:53
-
2020-02-10 14:43:01
-
2020-04-26 15:16:55
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5SS928的emmc有32GB,bootargs设置使用16GB,但是为啥能用的只有rootfs的大小
-
33SS928怎样烧写ubuntu系统
-
10ToolPlatform下载rootfs提示网络失败
-
10谁有GK7205V500的SDK
-
5Hi3516CV610 烧录不进去
-
10Hi3559AV100 芯片硬解码h265编码格式的视频时出现视频播放错误,解码错误信息 s32PackErr:码流有错
-
5海思SS928 / SD3403的sample_venc.c摄像头编码Demo中,采集到的摄像头的YUV数据在哪个相关的函数中?
-
5海鸥派openEuler无法启动网卡,连接WIFI存在问题
-
66有没有ISP相关的巨佬帮忙看看SS928对接IMX347的图像问题
-
50求助hi3559与FPGA通过SLVS-EC接口对接问题
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认