Files
UnrealEngineUWP/Engine/Source/Editor/EditorLiveStreaming/EditorLiveStreaming.h

68 lines
2.0 KiB
C
Raw Normal View History

// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
Work in progress: Live streaming support for editor and games This commit adds the framework APIs, editor and rendering features needed to support live streaming. Along with this, we're working on a new plugin that adds Twitch.tv support (waiting for legal approval to commit.) - Game live streaming - Allows general support for live internet streaming of game video and audio - Web cam video feed can be overlaid onto game viewports automatically - New 'Broadcast' Blueprint function library allows you to easily start broadcasting from your game - New IGameLiveStreaming API that allows you to start broadcasting through C++ - Editor live streaming - The editor UI now displays a "broadcast" button automatically when a live streaming service is available - Broadcasting of all desktop editor windows is supported (configured in preferences) - If you have a web cam, video will be displayed automatically while broadcasting in a new editor window - New "Live Streaming" editor preference tab with many new settings for configuring broadcasting - New IEditorLiveStreaming API that lets you control editor broadcasting directly, if needed - Added new 'Broadcast.Start' and 'Broadcast.Stop' console commands - These allow you to easily test live streaming in games without writing UI code - Built-in help is available for these new commands - To implement a live streaming plugin: - Inherit from the new ILiveStreamingService interface - Register your "LiveStreaming" feature with the IModularFeatures system - Other changes: - Eliminated broken screen quad drawing functions; replaced with publicly-exposed DrawRectangle() - Slate: Eliminated legacy code for 'marking windows as drawn' (not used anymore) - Slate: Added Slate rendering callback to find out when a frame buffer is ready to be presented [CL 2115377 by Mike Fricker in Main branch]
2014-06-24 12:11:51 -04:00
#pragma once
#include "IEditorLiveStreaming.h"
/**
* Handles broadcasting of the editor to a live internet stream
*/
class FEditorLiveStreaming
: public IEditorLiveStreaming
{
public:
/** Default constructor */
FEditorLiveStreaming();
/** IModuleInterface overrides */
virtual void StartupModule() override;
virtual void ShutdownModule() override;
/** IEditorLiveStreaming overrides */
virtual bool IsLiveStreamingAvailable() const override;
virtual bool IsBroadcastingEditor() const override;
virtual void StartBroadcastingEditor() override;
virtual void StopBroadcastingEditor() override;
virtual void BroadcastEditorVideoFrame() override;
protected:
/** Called by the live streaming service when streaming status has changed or an error has occurred */
void BroadcastStatusCallback( const struct FLiveStreamingStatus& Status );
/** Closes the window that shows the current status of the broadcast */
void CloseBroadcastStatusWindow();
/** Called by the live streaming service when we get a new chat message to display */
void OnChatMessage( const FText& UserName, const FText& ChatMessage );
Work in progress: Live streaming support for editor and games This commit adds the framework APIs, editor and rendering features needed to support live streaming. Along with this, we're working on a new plugin that adds Twitch.tv support (waiting for legal approval to commit.) - Game live streaming - Allows general support for live internet streaming of game video and audio - Web cam video feed can be overlaid onto game viewports automatically - New 'Broadcast' Blueprint function library allows you to easily start broadcasting from your game - New IGameLiveStreaming API that allows you to start broadcasting through C++ - Editor live streaming - The editor UI now displays a "broadcast" button automatically when a live streaming service is available - Broadcasting of all desktop editor windows is supported (configured in preferences) - If you have a web cam, video will be displayed automatically while broadcasting in a new editor window - New "Live Streaming" editor preference tab with many new settings for configuring broadcasting - New IEditorLiveStreaming API that lets you control editor broadcasting directly, if needed - Added new 'Broadcast.Start' and 'Broadcast.Stop' console commands - These allow you to easily test live streaming in games without writing UI code - Built-in help is available for these new commands - To implement a live streaming plugin: - Inherit from the new ILiveStreamingService interface - Register your "LiveStreaming" feature with the IModularFeatures system - Other changes: - Eliminated broken screen quad drawing functions; replaced with publicly-exposed DrawRectangle() - Slate: Eliminated legacy code for 'marking windows as drawn' (not used anymore) - Slate: Added Slate rendering callback to find out when a frame buffer is ready to be presented [CL 2115377 by Mike Fricker in Main branch]
2014-06-24 12:11:51 -04:00
private:
/** True if we're currently broadcasting anything */
bool bIsBroadcasting;
/** The live streaming implementation we're using for editor broadcasting */
class ILiveStreamingService* LiveStreamer;
/** Number of video frames we've submitted since we started broadcasting */
uint32 SubmittedVideoFrameCount;
/** A temporary pair of buffers that we write our video frames to */
void* ReadbackBuffers[2];
/** The current buffer index. We bounce between them to avoid stalls. */
int32 ReadbackBufferIndex;
/** Persistent Slate notification for live streaming status */
TWeakPtr< class SNotificationItem > NotificationWeakPtr;
/** Dynamic slate image brush for our web cam texture */
TSharedPtr< struct FSlateDynamicImageBrush > WebCamDynamicImageBrush;
/** Window for broadcast status */
TSharedPtr< class SWindow > BroadcastStatusWindow;
};