Skip to content
The Chat Archive
gpt-3.5-turbo-0301· OpenAI WildChat-4.8M (AI2)

ret = SHBShareBufGetOneFrame(gimageManager.metaDataBuf, sizeof(HNYFrameHeaderS) +…

  1. User

    ret = SHB_ShareBufGetOneFrame(g_imageManager.metaDataBuf, sizeof(HNY_FrameHeader_S) + sizeof(HNY_AiFaceRectInfo_S), pBuf); if(ret <= 0) { usleep(50*1000); cnt ++; if(cnt < 3) continue; }

    	if(cnt >= 3)
    	{
    		cnt = 0;
    		expWin.h_offs = 0;
    		expWin.v_offs = 0;
    		expWin.h_size = 1920;
    		expWin.v_size = 1080;
    
  2. Assistant

    // If we have been trying to get a frame for too long, reset the display window to default values displayCtrl->SetExpWin(expWin); }

    	if(ret >= sizeof(HNY_FrameHeader_S))
    	{
    		HNY_FrameHeader_S* pHeader = (HNY_FrameHeader_S*)pBuf;
    		if(pHeader->uMagicNum != FRAME_HEADER_MAGIC_NUM)
    			continue;
    
    		if(pHeader->uVersion != FRAME_HEADER_VERSION)
    			continue;
    
    		if(pHeader->uFrameSize != sizeof(HNY_AiFaceRectInfo_S))
    			continue;
    
    		if(ret >= sizeof(HNY_FrameHeader_S) + sizeof(HNY_AiFaceRectInfo_S))
    		{
    			HNY_AiFaceRectInfo_S* pAiInfo = (HNY_AiFaceRectInfo_S*)((char*)pBuf + sizeof(HNY_FrameHeader_S));
    			// Process and display face detection result
    			ProcessResult(pAiInfo);
    			UpdateDisplay(displayCtrl, pAiInfo);
    		}
    	}
    
  3. User

    ret = SHB_ShareBufGetOneFrame(g_imageManager.metaDataBuf, sizeof(HNY_FrameHeader_S) + sizeof(HNY_AiFaceRectInfo_S), pBuf); if(ret <= 0) { usleep(50*1000); cnt ++; if(cnt < 3) continue; }

    	if(cnt >= 3)
    	{
    		cnt = 0;
    		expWin.h_offs = 0;
    		expWin.v_offs = 0;
    		expWin.h_size = 1920;
    		expWin.v_size = 1080;中文翻译
    
  4. Assistant

    从共享缓冲区获取一帧大小为sizeof(HNY_FrameHeader_S) + sizeof(HNY_AiFaceRectInfo_S)的数据,如果返回值小于等于0,则等待50ms,重试3次。如果重试3次后仍然没有获取到数据,则将显示窗口的参数重置为默认值(1920x1080的全屏窗口)。如果成功获取到一帧数据,并且符合格式要求,则对人脸检测结果进行处理和显示。