2561
- 收藏
- 点赞
- 分享
- 举报
视频解码输出显示和UI叠加问题(QT)
我现在用VDEC和hifb的demo结合起来的demo;让视频解码输出和QT图像叠加起来;叠加没问题;一运行QT;解码就停止了,请大师帮指点一下,非常感谢!
代码如下:
static VO_DEV VoDev = SAMPLE_VO_DEV_DHD0;
static HI_CHAR gs_cExitFlag = 0;
static struct fb_bitfield s_a32 = {24,8,0};
static struct fb_bitfield s_r32 = {16,8,0};
static struct fb_bitfield s_g32 = {8,8,0};
static struct fb_bitfield s_b32 = {0,8,0};
#define WIDTH 1280
#define HEIGHT 800
#define GRAPHICS_LAYER_HC0 2
#define GRAPHICS_LAYER_G0 0
#define GRAPHICS_LAYER_G1 1
typedef struct hiPTHREAD_HIFB_SAMPLE
{
HI_S32 fd;
HI_S32 layer;
HI_S32 ctrlkey;
}PTHREAD_HIFB_SAMPLE_INFO;
VdecThreadParam stVdecSend[VDEC_MAX_CHN_NUM];
HI_S32 SAMPLE_HIFB_OneBufMode(HI_VOID)
{
HI_S32 i,s32Ret = HI_SUCCESS;
PTHREAD_HIFB_SAMPLE_INFO stInfo0;
SIZE_S stSize;
VO_LAYER VoLayer = 0;
VO_PUB_ATTR_S stPubAttr;
VO_VIDEO_LAYER_ATTR_S stLayerAttr;
HI_U32 u32VoFrmRate;
HI_CHAR file[12] = "/dev/fb0";
VB_CONF_S stVbConf;
HIFB_ALPHA_S stAlpha;
HIFB_COLORKEY_S stColorKey;
VO_DEV VoDev;
VoDev = SAMPLE_VO_DEV_DHD0;
HI_BOOL bShow;
HIFB_POINT_S stPoint = {0};
HIFB_LAYER_INFO_S stLayerInfo = {0};
struct fb_var_screeninfo stVarInfo;
//=====================================
VB_CONF_S stModVbConf;
VDEC_CHN_ATTR_S stVdecChnAttr[VDEC_MAX_CHN_NUM];
VdecThreadParam stVdecSend[VDEC_MAX_CHN_NUM];
VPSS_GRP_ATTR_S stVpssGrpAttr[VDEC_MAX_CHN_NUM];
SIZE_S stRotateSize;
HI_U32 u32VdCnt = 1, u32GrpCnt = 1;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
stSize.u32Width = 1280;
stSize.u32Height = 800;
/************************************************
step1: init SYS and common VB
*************************************************/
SAMPLE_COMM_VDEC_Sysconf(&stVbConf, &stSize);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConf);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/************************************************
step2: init mod common VB
*************************************************/
SAMPLE_COMM_VDEC_ModCommPoolConf(&stModVbConf, PT_H264, &stSize, u32VdCnt);
s32Ret = SAMPLE_COMM_VDEC_InitModCommVb(&stModVbConf);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/************************************************
step3: start VDEC
*************************************************/
SAMPLE_COMM_VDEC_ChnAttr(u32VdCnt, &stVdecChnAttr[0], PT_H264, &stSize);
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdCnt, &stVdecChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/************************************************
step4: start VPSS
*************************************************/
stRotateSize.u32Width = stRotateSize.u32Height = MAX2(stSize.u32Width, stSize.u32Height);
SAMPLE_COMM_VDEC_VpssGrpAttr(u32GrpCnt, &stVpssGrpAttr[0], &stRotateSize);
s32Ret = SAMPLE_COMM_VPSS_Start(u32GrpCnt, &stRotateSize, 1, &stVpssGrpAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/******************************************
step 3: start vo hd0.
*****************************************/
s32Ret = HI_MPI_VO_UnBindGraphicLayer(GRAPHICS_LAYER_HC0, VoDev);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("UnBindGraphicLayer failed with %d!\n", s32Ret);
return HI_NULL;
}
s32Ret = HI_MPI_VO_BindGraphicLayer(GRAPHICS_LAYER_HC0, VoDev);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("BindGraphicLayer failed with %d!\n", s32Ret);
return HI_NULL;
}
/******************************************
step 3: start vo hd0.
*****************************************/
stPubAttr.enIntfSync = VO_OUTPUT_1280x800_60;
stPubAttr.enIntfType = VO_INTF_VGA;
stPubAttr.u32BgColor = 0xff000000;
s32Ret = SAMPLE_COMM_VO_GetWH(stPubAttr.enIntfSync,&stSize.u32Width,\
&stSize.u32Height,&u32VoFrmRate);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("get vo wh failed with %d!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
memcpy(&stLayerAttr.stImageSize,&stSize,sizeof(stSize));
stLayerAttr.bClusterMode = HI_FALSE;
stLayerAttr.bDoubleFrame = HI_FALSE;
stLayerAttr.enPixFormat = PIXEL_FORMAT_YUV_SEMIPLANAR_420;
stLayerAttr.u32DispFrmRt = 25 ;
stLayerAttr.stDispRect.s32X = 0;
stLayerAttr.stDispRect.s32Y = 0;
stLayerAttr.stDispRect.u32Width = stSize.u32Width;
stLayerAttr.stDispRect.u32Height = stSize.u32Height;
VoDev = SAMPLE_VO_DEV_DHD0;
VoLayer = SAMPLE_VO_LAYER_VHD0;
s32Ret = SAMPLE_COMM_VO_StartDev(VoDev, &stPubAttr);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("start vo dev failed with %d!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
s32Ret = SAMPLE_COMM_VO_GetWH(stPubAttr.enIntfSync, \
&stLayerAttr.stDispRect.u32Width, &stLayerAttr.stDispRect.u32Height, &stLayerAttr.u32DispFrmRt);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
s32Ret = SAMPLE_COMM_VO_StartLayer(VoLayer, &stLayerAttr);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("SAMPLE_COMM_VO_StartLayer fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
s32Ret = SAMPLE_COMM_VO_StartChn(VoLayer, VO_MODE_1MUX);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
{
s32Ret = SAMPLE_COMM_VDEC_BindVpss(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
for(i=0; i
{
s32Ret = SAMPLE_COMM_VO_BindVpss(VoLayer, i, i, VPSS_CHN0);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
SAMPLE_COMM_VDEC_ThreadParam(u32VdCnt, &stVdecSend[0], &stVdecChnAttr[0], SAMPLE_1080P_H264_PATH);
SAMPLE_COMM_VDEC_StartSendStream(u32VdCnt, &stVdecSend[0], &VdecThread[0]);
/******************************************
step 4: start hifb.
*****************************************/
stInfo0.layer = 0;
stInfo0.fd = -1;
stInfo0.ctrlkey = 0;
switch (stInfo0.layer)
{
case GRAPHICS_LAYER_G0:
strcpy(file, "/dev/fb0");
break;
default:
strcpy(file, "/dev/fb0");
break;
}
/* 1. open framebuffer device overlay 0 */
stInfo0.fd = open(file, O_RDWR, 0);
if(stInfo0.fd < 0)
{
SAMPLE_PRT("open %s failed!\n",file);
return HI_NULL;
}
/* 3.set alpha */
stAlpha.bAlphaEnable = HI_TRUE;
stAlpha.bAlphaChannel = HI_TRUE;
stAlpha.u8Alpha0 = 0xff;
stAlpha.u8Alpha1 = 0xff;
stAlpha.u8GlobalAlpha = 0xff;
if (ioctl(stInfo0.fd, FBIOPUT_ALPHA_HIFB, &stAlpha) < 0)
{
printf("Set alpha failed!\n");
close(stInfo0.fd);
return HI_FALSE;
}
/*all layer surport colorkey*/
stColorKey.bKeyEnable = HI_TRUE;
stColorKey.u32Key = 0x0;
if (ioctl(stInfo0.fd, FBIOPUT_COLORKEY_HIFB, &stColorKey) < 0)
{
SAMPLE_PRT("FBIOPUT_COLORKEY_HIFB!\n");
close(stInfo0.fd);
return HI_NULL;
}
s32Ret = ioctl(stInfo0.fd, FBIOGET_VSCREENINFO, &stVarInfo);
if(s32Ret < 0)
{
SAMPLE_PRT("GET_VSCREENINFO failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
if (ioctl(stInfo0.fd, FBIOPUT_SCREEN_ORIGIN_HIFB, &stPoint) < 0)
{
SAMPLE_PRT("set screen original show position failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
stVarInfo.red = s_r32;
stVarInfo.green = s_g32;
stVarInfo.blue = s_b32;
stVarInfo.transp = s_a32;
stVarInfo.bits_per_pixel = 32;
stVarInfo.xres=WIDTH;
stVarInfo.yres=HEIGHT;
stVarInfo.activate=FB_ACTIVATE_NOW;
stVarInfo.xres_virtual=WIDTH;
stVarInfo.yres_virtual = HEIGHT;
stVarInfo.xoffset=0;
stVarInfo.yoffset=0;
s32Ret = ioctl(stInfo0.fd, FBIOPUT_VSCREENINFO, &stVarInfo);
if(s32Ret < 0)
{
SAMPLE_PRT("PUT_VSCREENINFO failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
switch (stInfo0.ctrlkey)
{
case 0 :
{
stLayerInfo.BufMode = HIFB_LAYER_BUF_ONE;
stLayerInfo.u32Mask = HIFB_LAYERMASK_BUFMODE;
break;
}
case 1 :
{
stLayerInfo.BufMode = HIFB_LAYER_BUF_DOUBLE;
stLayerInfo.u32Mask = HIFB_LAYERMASK_BUFMODE;
break;
}
default:
{
stLayerInfo.BufMode = HIFB_LAYER_BUF_NONE;
stLayerInfo.u32Mask = HIFB_LAYERMASK_BUFMODE;
}
}
s32Ret = ioctl(stInfo0.fd, FBIOPUT_LAYER_INFO, &stLayerInfo);
if(s32Ret < 0)
{
SAMPLE_PRT("PUT_LAYER_INFO failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
bShow = HI_TRUE;
if (ioctl(stInfo0.fd, FBIOPUT_SHOW_HIFB, &bShow) < 0)
{
SAMPLE_PRT("FBIOPUT_SHOW_HIFB failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
return s32Ret;
SAMPLE_HIFB_OneBufMode_2:
HI_MPI_VO_DisableVideoLayer(VoLayer);
SAMPLE_HIFB_OneBufMode_1:
HI_MPI_VO_Disable(VoDev);
SAMPLE_HIFB_OneBufMode_0:
return s32Ret;
}
代码如下:
static VO_DEV VoDev = SAMPLE_VO_DEV_DHD0;
static HI_CHAR gs_cExitFlag = 0;
static struct fb_bitfield s_a32 = {24,8,0};
static struct fb_bitfield s_r32 = {16,8,0};
static struct fb_bitfield s_g32 = {8,8,0};
static struct fb_bitfield s_b32 = {0,8,0};
#define WIDTH 1280
#define HEIGHT 800
#define GRAPHICS_LAYER_HC0 2
#define GRAPHICS_LAYER_G0 0
#define GRAPHICS_LAYER_G1 1
typedef struct hiPTHREAD_HIFB_SAMPLE
{
HI_S32 fd;
HI_S32 layer;
HI_S32 ctrlkey;
}PTHREAD_HIFB_SAMPLE_INFO;
VdecThreadParam stVdecSend[VDEC_MAX_CHN_NUM];
HI_S32 SAMPLE_HIFB_OneBufMode(HI_VOID)
{
HI_S32 i,s32Ret = HI_SUCCESS;
PTHREAD_HIFB_SAMPLE_INFO stInfo0;
SIZE_S stSize;
VO_LAYER VoLayer = 0;
VO_PUB_ATTR_S stPubAttr;
VO_VIDEO_LAYER_ATTR_S stLayerAttr;
HI_U32 u32VoFrmRate;
HI_CHAR file[12] = "/dev/fb0";
VB_CONF_S stVbConf;
HIFB_ALPHA_S stAlpha;
HIFB_COLORKEY_S stColorKey;
VO_DEV VoDev;
VoDev = SAMPLE_VO_DEV_DHD0;
HI_BOOL bShow;
HIFB_POINT_S stPoint = {0};
HIFB_LAYER_INFO_S stLayerInfo = {0};
struct fb_var_screeninfo stVarInfo;
//=====================================
VB_CONF_S stModVbConf;
VDEC_CHN_ATTR_S stVdecChnAttr[VDEC_MAX_CHN_NUM];
VdecThreadParam stVdecSend[VDEC_MAX_CHN_NUM];
VPSS_GRP_ATTR_S stVpssGrpAttr[VDEC_MAX_CHN_NUM];
SIZE_S stRotateSize;
HI_U32 u32VdCnt = 1, u32GrpCnt = 1;
pthread_t VdecThread[2*VDEC_MAX_CHN_NUM];
stSize.u32Width = 1280;
stSize.u32Height = 800;
/************************************************
step1: init SYS and common VB
*************************************************/
SAMPLE_COMM_VDEC_Sysconf(&stVbConf, &stSize);
s32Ret = SAMPLE_COMM_SYS_Init(&stVbConf);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init sys fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/************************************************
step2: init mod common VB
*************************************************/
SAMPLE_COMM_VDEC_ModCommPoolConf(&stModVbConf, PT_H264, &stSize, u32VdCnt);
s32Ret = SAMPLE_COMM_VDEC_InitModCommVb(&stModVbConf);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("init mod common vb fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/************************************************
step3: start VDEC
*************************************************/
SAMPLE_COMM_VDEC_ChnAttr(u32VdCnt, &stVdecChnAttr[0], PT_H264, &stSize);
s32Ret = SAMPLE_COMM_VDEC_Start(u32VdCnt, &stVdecChnAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VDEC fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/************************************************
step4: start VPSS
*************************************************/
stRotateSize.u32Width = stRotateSize.u32Height = MAX2(stSize.u32Width, stSize.u32Height);
SAMPLE_COMM_VDEC_VpssGrpAttr(u32GrpCnt, &stVpssGrpAttr[0], &stRotateSize);
s32Ret = SAMPLE_COMM_VPSS_Start(u32GrpCnt, &stRotateSize, 1, &stVpssGrpAttr[0]);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("start VPSS fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/******************************************
step 3: start vo hd0.
*****************************************/
s32Ret = HI_MPI_VO_UnBindGraphicLayer(GRAPHICS_LAYER_HC0, VoDev);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("UnBindGraphicLayer failed with %d!\n", s32Ret);
return HI_NULL;
}
s32Ret = HI_MPI_VO_BindGraphicLayer(GRAPHICS_LAYER_HC0, VoDev);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("BindGraphicLayer failed with %d!\n", s32Ret);
return HI_NULL;
}
/******************************************
step 3: start vo hd0.
*****************************************/
stPubAttr.enIntfSync = VO_OUTPUT_1280x800_60;
stPubAttr.enIntfType = VO_INTF_VGA;
stPubAttr.u32BgColor = 0xff000000;
s32Ret = SAMPLE_COMM_VO_GetWH(stPubAttr.enIntfSync,&stSize.u32Width,\
&stSize.u32Height,&u32VoFrmRate);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("get vo wh failed with %d!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
memcpy(&stLayerAttr.stImageSize,&stSize,sizeof(stSize));
stLayerAttr.bClusterMode = HI_FALSE;
stLayerAttr.bDoubleFrame = HI_FALSE;
stLayerAttr.enPixFormat = PIXEL_FORMAT_YUV_SEMIPLANAR_420;
stLayerAttr.u32DispFrmRt = 25 ;
stLayerAttr.stDispRect.s32X = 0;
stLayerAttr.stDispRect.s32Y = 0;
stLayerAttr.stDispRect.u32Width = stSize.u32Width;
stLayerAttr.stDispRect.u32Height = stSize.u32Height;
VoDev = SAMPLE_VO_DEV_DHD0;
VoLayer = SAMPLE_VO_LAYER_VHD0;
s32Ret = SAMPLE_COMM_VO_StartDev(VoDev, &stPubAttr);
if (HI_SUCCESS != s32Ret)
{
SAMPLE_PRT("start vo dev failed with %d!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
s32Ret = SAMPLE_COMM_VO_GetWH(stPubAttr.enIntfSync, \
&stLayerAttr.stDispRect.u32Width, &stLayerAttr.stDispRect.u32Height, &stLayerAttr.u32DispFrmRt);
if (s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("failed with %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
s32Ret = SAMPLE_COMM_VO_StartLayer(VoLayer, &stLayerAttr);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("SAMPLE_COMM_VO_StartLayer fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
s32Ret = SAMPLE_COMM_VO_StartChn(VoLayer, VO_MODE_1MUX);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
/************************************************
step6: VDEC bind VPSS
*************************************************/
for(i=0; i
s32Ret = SAMPLE_COMM_VDEC_BindVpss(i, i);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vdec bind vpss fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
}
/************************************************
step7: VPSS bind VO
*************************************************/
for(i=0; i
s32Ret = SAMPLE_COMM_VO_BindVpss(VoLayer, i, i, VPSS_CHN0);
if(s32Ret != HI_SUCCESS)
{
SAMPLE_PRT("vpss bind vo fail for %#x!\n", s32Ret);
goto SAMPLE_HIFB_OneBufMode_0;
}
}
/************************************************
step8: send stream to VDEC
*************************************************/
SAMPLE_COMM_VDEC_ThreadParam(u32VdCnt, &stVdecSend[0], &stVdecChnAttr[0], SAMPLE_1080P_H264_PATH);
SAMPLE_COMM_VDEC_StartSendStream(u32VdCnt, &stVdecSend[0], &VdecThread[0]);
/******************************************
step 4: start hifb.
*****************************************/
stInfo0.layer = 0;
stInfo0.fd = -1;
stInfo0.ctrlkey = 0;
switch (stInfo0.layer)
{
case GRAPHICS_LAYER_G0:
strcpy(file, "/dev/fb0");
break;
default:
strcpy(file, "/dev/fb0");
break;
}
/* 1. open framebuffer device overlay 0 */
stInfo0.fd = open(file, O_RDWR, 0);
if(stInfo0.fd < 0)
{
SAMPLE_PRT("open %s failed!\n",file);
return HI_NULL;
}
/* 3.set alpha */
stAlpha.bAlphaEnable = HI_TRUE;
stAlpha.bAlphaChannel = HI_TRUE;
stAlpha.u8Alpha0 = 0xff;
stAlpha.u8Alpha1 = 0xff;
stAlpha.u8GlobalAlpha = 0xff;
if (ioctl(stInfo0.fd, FBIOPUT_ALPHA_HIFB, &stAlpha) < 0)
{
printf("Set alpha failed!\n");
close(stInfo0.fd);
return HI_FALSE;
}
/*all layer surport colorkey*/
stColorKey.bKeyEnable = HI_TRUE;
stColorKey.u32Key = 0x0;
if (ioctl(stInfo0.fd, FBIOPUT_COLORKEY_HIFB, &stColorKey) < 0)
{
SAMPLE_PRT("FBIOPUT_COLORKEY_HIFB!\n");
close(stInfo0.fd);
return HI_NULL;
}
s32Ret = ioctl(stInfo0.fd, FBIOGET_VSCREENINFO, &stVarInfo);
if(s32Ret < 0)
{
SAMPLE_PRT("GET_VSCREENINFO failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
if (ioctl(stInfo0.fd, FBIOPUT_SCREEN_ORIGIN_HIFB, &stPoint) < 0)
{
SAMPLE_PRT("set screen original show position failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
stVarInfo.red = s_r32;
stVarInfo.green = s_g32;
stVarInfo.blue = s_b32;
stVarInfo.transp = s_a32;
stVarInfo.bits_per_pixel = 32;
stVarInfo.xres=WIDTH;
stVarInfo.yres=HEIGHT;
stVarInfo.activate=FB_ACTIVATE_NOW;
stVarInfo.xres_virtual=WIDTH;
stVarInfo.yres_virtual = HEIGHT;
stVarInfo.xoffset=0;
stVarInfo.yoffset=0;
s32Ret = ioctl(stInfo0.fd, FBIOPUT_VSCREENINFO, &stVarInfo);
if(s32Ret < 0)
{
SAMPLE_PRT("PUT_VSCREENINFO failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
switch (stInfo0.ctrlkey)
{
case 0 :
{
stLayerInfo.BufMode = HIFB_LAYER_BUF_ONE;
stLayerInfo.u32Mask = HIFB_LAYERMASK_BUFMODE;
break;
}
case 1 :
{
stLayerInfo.BufMode = HIFB_LAYER_BUF_DOUBLE;
stLayerInfo.u32Mask = HIFB_LAYERMASK_BUFMODE;
break;
}
default:
{
stLayerInfo.BufMode = HIFB_LAYER_BUF_NONE;
stLayerInfo.u32Mask = HIFB_LAYERMASK_BUFMODE;
}
}
s32Ret = ioctl(stInfo0.fd, FBIOPUT_LAYER_INFO, &stLayerInfo);
if(s32Ret < 0)
{
SAMPLE_PRT("PUT_LAYER_INFO failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
bShow = HI_TRUE;
if (ioctl(stInfo0.fd, FBIOPUT_SHOW_HIFB, &bShow) < 0)
{
SAMPLE_PRT("FBIOPUT_SHOW_HIFB failed!\n");
close(stInfo0.fd);
return HI_NULL;
}
return s32Ret;
SAMPLE_HIFB_OneBufMode_2:
HI_MPI_VO_DisableVideoLayer(VoLayer);
SAMPLE_HIFB_OneBufMode_1:
HI_MPI_VO_Disable(VoDev);
SAMPLE_HIFB_OneBufMode_0:
return s32Ret;
}
我来回答
回答0个
时间排序
认可量排序
暂无数据
或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币
Markdown 语法
- 加粗**内容**
- 斜体*内容*
- 删除线~~内容~~
- 引用> 引用内容
- 代码`代码`
- 代码块```编程语言↵代码```
- 链接[链接标题](url)
- 无序列表- 内容
- 有序列表1. 内容
- 缩进内容
- 图片![alt](url)
相关问答
-
2018-07-12 17:09:44
-
2022-11-02 17:32:43
-
2018-09-07 18:34:38
-
2019-09-06 11:38:36
-
2017-12-11 17:12:00
-
2019-12-18 18:00:08
-
32013-04-27 13:43:55
-
2015-12-25 19:49:48
-
2013-05-07 17:46:25
-
2018-12-28 00:15:26
-
2017-08-30 19:58:56
-
2023-06-27 15:00:59
-
32014-11-25 08:42:26
-
2018-02-01 09:00:35
-
2015-03-18 12:12:13
-
2015-03-18 12:09:30
-
2017-08-09 10:47:15
-
2020-11-09 17:47:39
-
2014-06-16 23:35:03
无更多相似问答 去提问
点击登录
-- 积分
-- E币
提问
—
收益
—
被采纳
—
我要提问
切换马甲
上一页
下一页
悬赏问答
-
5Hi3516CV610 如何使用SD卡升级固件
-
5cat /dev/logmpp 报错 <3>[ vi] [func]:vi_send_frame_node [line]:99 [info]:vi pic queue is full!
-
50如何获取vpss chn的图像修改后发送至vo
-
5FPGA通过Bt1120传YUV422数据过来,vi接收不到数据——3516dv500
-
50SS928 运行PQtools 拼接 推到设备里有一半画面会异常
-
53536AV100的sample_vdec输出到CVBS显示
-
10海思板子mpp怎么在vi阶段改变视频数据尺寸
-
10HI3559AV100 多摄像头同步模式
-
9海思ss928单路摄像头vio中加入opencv处理并显示
-
10EB-RV1126-BC-191板子运行自己编码的程序
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
提醒
你的问题还没有最佳答案,是否结题,结题后将扣除20%的悬赏金
取消
确认
提醒
你的问题还没有最佳答案,是否结题,结题后将根据回答情况扣除相应悬赏金(1回答=1E币)
取消
确认