Files
UnrealEngineUWP/Engine/Source/Runtime/WebBrowser/Private/Android/AndroidJavaWebBrowser.h
Jack Porter 2792c7c559 Merging //UE4/Dev-Main to Dev-Mobile (//UE4/Dev-Mobile)
#jira 0
#rb None

[CL 4161603 by Jack Porter in Dev-Mobile branch]
2018-06-26 08:42:47 -04:00

84 lines
2.3 KiB
C++

// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved.
#pragma once
#if USE_ANDROID_JNI
#include "CoreMinimal.h"
#include "Android/AndroidJava.h"
#include "RHI.h"
#include "RHIResources.h"
// Wrapper for com/epicgames/ue4/CameraPlayer*.java.
class FJavaAndroidWebBrowser : public FJavaClassObject
{
public:
FJavaAndroidWebBrowser(bool swizzlePixels, bool vulkanRenderer, int32 width, int32 height, jlong widgetPtr, bool bEnableRemoteDebugging, bool bUseTransparency);
void Release();
bool GetVideoLastFrameData(void* & outPixels, int64 & outCount, bool *bRegionChanged);
bool GetVideoLastFrame(int32 destTexture);
bool DidResolutionChange();
bool UpdateVideoFrame(int32 ExternalTextureId, bool *bRegionChanged);
void ExecuteJavascript(const FString& Script);
void LoadURL(const FString& NewURL);
void LoadString(const FString& Contents, const FString& BaseUrl);
void StopLoad();
void Reload();
void Close();
void GoBack();
void GoForward();
void SetAndroid3DBrowser(bool InIsAndroid3DBrowser);
void Update(const int posX, const int posY, const int sizeX, const int sizeY);
private:
static FName GetClassName();
FJavaClassMethod ReleaseMethod;
FJavaClassMethod GetVideoLastFrameDataMethod;
FJavaClassMethod GetVideoLastFrameMethod;
FJavaClassMethod DidResolutionChangeMethod;
FJavaClassMethod UpdateVideoFrameMethod;
FJavaClassMethod UpdateMethod;
FJavaClassMethod ExecuteJavascriptMethod;
FJavaClassMethod LoadURLMethod;
FJavaClassMethod LoadStringMethod;
FJavaClassMethod StopLoadMethod;
FJavaClassMethod ReloadMethod;
FJavaClassMethod CloseMethod;
FJavaClassMethod GoBackOrForwardMethod;
FJavaClassMethod SetAndroid3DBrowserMethod;
// FrameUpdateInfo member field ids
jclass FrameUpdateInfoClass;
jfieldID FrameUpdateInfo_Buffer;
jfieldID FrameUpdateInfo_FrameReady;
jfieldID FrameUpdateInfo_RegionChanged;
FTextureRHIRef VideoTexture;
bool bVideoTextureValid;
public:
FTextureRHIRef GetVideoTexture()
{
return VideoTexture;
}
void SetVideoTexture(FTextureRHIRef Texture)
{
FPlatformMisc::LowLevelOutputDebugStringf(TEXT("Fetch RT: SetVideoTexture: %d"), Texture.IsValid());
VideoTexture = Texture;
}
void SetVideoTextureValid(bool Condition)
{
bVideoTextureValid = Condition;
}
bool IsVideoTextureValid()
{
return bVideoTextureValid;
}
};
#endif // USE_ANDROID_JNI