void Http2Base::PingProc(const Http2_header* header) { if((header->flags & ACK_F) == 0) { Http2_header *header_back = (Http2_header *)p_memdup(header, sizeof(Http2_header) + get24(header->length)); header_back->flags |= ACK_F; PushFrame(header_back); } }
void Http2Base::PushData(uint32_t id, const void* data, size_t size){ size_t left = size; while(left > remoteframebodylimit){ Http2_header* const header=(Http2_header *)p_move(p_malloc(remoteframebodylimit), -(char)sizeof(Http2_header)); memset(header, 0, sizeof(Http2_header)); set32(header->id, id); set24(header->length, remoteframebodylimit); memcpy(header+1, data, remoteframebodylimit); PushFrame(header); data = (char*)data + remoteframebodylimit; left -= remoteframebodylimit; } Http2_header* const header=(Http2_header *)p_move(p_malloc(left), -(char)sizeof(Http2_header)); memset(header, 0, sizeof(Http2_header)); set32(header->id, id); set24(header->length, left); if(size == 0) { LOGD(DHTTP2, "<guest2> [%d]: set stream end\n", id); header->flags = END_STREAM_F; }else{ memcpy(header+1, data, left); } PushFrame(header); }
void Http2Base::SettingsProc(const Http2_header* header) { const Setting_Frame *sf = (const Setting_Frame *)(header + 1); if((header->flags & ACK_F) == 0) { while((char *)sf-(char *)(header+1) < get24(header->length)){ uint32_t value = get32(sf->value); switch(get16(sf->identifier)){ case SETTINGS_HEADER_TABLE_SIZE: LOGD(DHTTP2, "set head table size:%d\n", value); request_table.set_dynamic_table_size_limit_max(value); break; case SETTINGS_INITIAL_WINDOW_SIZE: if(value >= (uint32_t)1<<31u){ LOGE("ERROR window overflow\n"); ErrProc(ERR_FLOW_CONTROL_ERROR); return; } AdjustInitalFrameWindowSize((ssize_t)value - (ssize_t)remoteframewindowsize); remoteframewindowsize = value; LOGD(DHTTP2, "set inital frame window size:%d\n", remoteframewindowsize); break; case SETTINGS_MAX_FRAME_SIZE: if(value > 0xffffff || value < FRAMEBODYLIMIT){ LOGE("ERROR frame size overflow\n"); ErrProc(ERR_FRAME_SIZE_ERROR); return; } remoteframebodylimit = value; LOGD(DHTTP2, "set frame body size limit: %d\n", remoteframebodylimit); break; default: LOG("Get a unkown setting(%d): %d\n", get16(sf->identifier), value); break; } sf++; } Http2_header *header_back = (Http2_header *)p_memdup(header, sizeof(Http2_header)); set24(header_back->length, 0); header_back->flags |= ACK_F; PushFrame(header_back); }else if(get24(header->length) != 0){ LOGE("ERROR setting ack with content\n"); ErrProc(ERR_FRAME_SIZE_ERROR); } }
void FGearVRSplash::Show(EShowType InShowType) { check(IsInGameThread()); Hide(InShowType); ShowType = InShowType; FCustomPresent* pCustomPresent = pPlugin->GetCustomPresent_Internal(); if (pCustomPresent) { bool ReadyToPush = IsLoadingIconMode(); LayerMgr->RemoveAllLayers(); // scope lock { FScopeLock ScopeLock(&SplashScreensLock); // Make sure all UTextures are loaded and contain Resource->TextureRHI bool bWaitForRT = false; for (int32 i = 0; i < SplashScreenDescs.Num(); ++i) { if (!SplashScreenDescs[i].TexturePath.IsEmpty()) { // load temporary texture (if TexturePath was specified) LoadTexture(SplashScreenDescs[i]); } if (SplashScreenDescs[i].LoadingTexture->IsValidLowLevel()) { SplashScreenDescs[i].LoadingTexture->UpdateResource(); bWaitForRT = true; } } if (bWaitForRT) { FlushRenderingCommands(); } for (int32 i = 0; i < SplashScreenDescs.Num(); ++i) { //@DBG BEGIN if (!SplashScreenDescs[i].LoadingTexture->IsValidLowLevel()) { continue; } if (!SplashScreenDescs[i].LoadingTexture->Resource) { UE_LOG(LogHMD, Warning, TEXT("Splash, %s - no Resource"), *SplashScreenDescs[i].LoadingTexture->GetDesc()); } else { UE_CLOG(!SplashScreenDescs[i].LoadingTexture->Resource->TextureRHI, LogHMD, Warning, TEXT("Splash, %s - no TextureRHI"), *SplashScreenDescs[i].LoadingTexture->GetDesc()); } //@DBG END if (SplashScreenDescs[i].LoadingTexture->Resource && SplashScreenDescs[i].LoadingTexture->Resource->TextureRHI) { if (IsLoadingIconMode()) { pPlugin->SetLoadingIconTexture(SplashScreenDescs[i].LoadingTexture->Resource->TextureRHI); } else { FRenderSplashInfo RenSplash; // use X (depth) as layers priority const uint32 Prio = FHMDLayerDesc::MaxPriority - uint32(SplashScreenDescs[i].TransformInMeters.GetTranslation().X * 1000.f); TSharedPtr<FHMDLayerDesc> layer = LayerMgr->AddLayer(FHMDLayerDesc::Quad, Prio, FHMDLayerManager::Layer_TorsoLocked, RenSplash.SplashLID); check(layer.IsValid()); layer->SetTexture(SplashScreenDescs[i].LoadingTexture->Resource->TextureRHI); layer->SetTransform(SplashScreenDescs[i].TransformInMeters); layer->SetQuadSize(SplashScreenDescs[i].QuadSizeInMeters); RenSplash.Desc = SplashScreenDescs[i]; FScopeLock ScopeLock2(&RenderSplashScreensLock); RenderSplashScreens.Add(RenSplash); } ReadyToPush = true; } } } // this will push black frame, if texture is not loaded if (ReadyToPush) { ShowingBlack = false; PushFrame(); } else { PushBlackFrame(); } pCustomPresent->LockSubmitFrame(); UE_LOG(LogHMD, Log, TEXT("FGearVRSplash::Show")); SplashIsShown = true; } }