// Copyright Epic Games Tools LLC // Licenced under the Unreal Engine EULA #pragma once #include "binkplugin.h" #include "MoviePlayer.h" class FSlateTexture2DRHIRef; DECLARE_LOG_CATEGORY_EXTERN(LogBinkMoviePlayer, Log, All); class FBinkMovieStreamer : public IMovieStreamer { public: FBinkMovieStreamer(); virtual ~FBinkMovieStreamer(); virtual bool Init(const TArray& MoviePaths, TEnumAsByte inPlaybackType) override; //virtual void PreviousViewportInterface(const TSharedPtr& PreviousViewportInterface) override; virtual void ForceCompletion() override; virtual bool Tick(float DeltaTime) override; virtual TSharedPtr GetViewportInterface() override { return MovieViewport; } virtual float GetAspectRatio() const override { return (float)MovieViewport->GetSize().X / (float)MovieViewport->GetSize().Y; } virtual FString GetMovieName() override; virtual bool IsLastMovieInPlaylist() override; virtual void Cleanup() override; virtual FTextureRHIRef GetTexture() override { return Texture->IsValid() ? Texture->GetRHIRef() : nullptr; } //virtual void TickPreEngine() override; //virtual void TickPostEngine() override; //virtual void TickPostRender() override; FOnCurrentMovieClipFinished OnCurrentMovieClipFinishedDelegate; virtual FOnCurrentMovieClipFinished& OnCurrentMovieClipFinished() override { return OnCurrentMovieClipFinishedDelegate; } bool OpenNextMovie(); void CloseMovie(); // A list of all the stored movie paths we have enqueued for playing TArray StoredMoviePaths; // Texture and viewport data for displaying to Slate TSharedPtr MovieViewport; TSharedPtr Texture; // List of textures pending deletion, need to keep this list because we can't immediately // destroy them since they could be getting used on the main thread TArray> TextureFreeList; /** if true, this sequence will loop when finsihed */ TEnumAsByte PlaybackType; // The index in to the playlist (StoredMoviePaths) that is currently playing int32 MovieIndex; BINKPLUGIN *bnk; };