// Copyright Epic Games, Inc. All Rights Reserved. #pragma once #include "RHI.h" #include "RHIResources.h" #include "MediaVideoDecoderOutput.h" class FElectraSamplesTextureManager { public: FElectraSamplesTextureManager(); virtual ~FElectraSamplesTextureManager(); TSharedPtr CreateTexture(const FIntPoint& Dim, EPixelFormat Fmt = PF_Unknown); FTextureRHIRef GetRHITextureFromPlatformTexture(void* PlatformTexture); protected: virtual TSharedPtr PlatformCreateTexture(const FIntPoint& Dim, EPixelFormat Fmt) = 0; virtual FTextureRHIRef PlatformGetTextureRHI(IVideoDecoderTexture *Texture) = 0; virtual void* PlatformGetTexturePlatform(IVideoDecoderTexture* Texture) = 0; void PlatformAddSharedTextureRef(TSharedPtr InTextureRef); void PlatformRemoveSharedTextureRef(TSharedPtr InTextureRef); private: void CleanupMap(); FCriticalSection AccessCS; TMap> KnownTextures; };