VR-Engage  2.2
Loading...
Searching...
No Matches
DtStreamingVideoUpdater Class Reference

Detailed Description

DtStreamingVideoUpdater manages streaming video capture from specified channels to external formats. It supports toggling streams on and off, selecting video sources, capturing screenshots, and automatically starting streams when channels are created. The component maintains state attributes for UI display and responds to messaging system events for control.

#include <streamingVideoUpdater.h>

Inheritance diagram for DtStreamingVideoUpdater:
[legend]

Public Member Functions

 DtStreamingVideoUpdater ()
 
virtual ~DtStreamingVideoUpdater () override
 
virtual bool initialize (makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
 
virtual void tick (double dt) override
 
virtual void shutdown () override
 
virtual const char * type () const override
 
virtual void startVideoStream ()
 
virtual void stopVideoStream ()
 
virtual void toggleVideoStream ()
 
virtual void selectVideoSource (const std::string &guiText, const std::string &window, const std::string &channel)
 
- Public Member Functions inherited from makVre::DtPlayerComponent
 DtPlayerComponent ()
 
virtual ~DtPlayerComponent ()
 
virtual bool postInitialize ()
 
virtual void setName (const std::string &name)
 
virtual const std::string & name ()
 
virtual DtPlayerStationplayer ()
 
virtual DtAttributeHandleplayerAttributeStore ()
 
virtual const DtAttributeHandleplayerAttributeStore () const
 

Protected Member Functions

virtual makVre::DtVreMessageResult handleToggleVideoStream (makVre::DtVreMessage *msg)
 
virtual makVre::DtVreMessageResult handleSelectVideoStreamChannel (makVre::DtVreMessage *msg)
 
virtual void slot_channelAdded (makVrv::DtChannelManager *mgr, makVrv::DtChannel *channel)
 
virtual void slot_channelToBeRemoved (makVrv::DtChannelManager *mgr, makVrv::DtChannel *channel)
 
virtual bool channelExists (const std::string &windowName, const std::string &channelName)
 
virtual makVre::DtVreMessageResult handleScreenCapture (makVre::DtVreMessage *msg)
 
virtual void updateStreamFilename (makVrv::DtVideoStream *stream)
 
- Protected Member Functions inherited from makVre::DtPlayerComponent
virtual void initializeStateAttributes ()
 

Protected Attributes

std::string myStreamName
 
std::string myReadBuffer
 
bool myAutoStartStream
 
std::string myStreamOutputFilenameOverride
 
bool myRetryAutoStart
 
- Protected Attributes inherited from makVre::DtPlayerComponent
std::string myName
 
DtInitTable myConfig
 
DtPlayerStationmyPlayer
 
makVrv::DtDe * myDe
 
DtEntityResolvermyResolver
 
DtAttributeCallbackManager myAttributeCallbacks
 

Constructor & Destructor Documentation

◆ DtStreamingVideoUpdater()

DtStreamingVideoUpdater::DtStreamingVideoUpdater ( )

Constructor for DtStreamingVideoUpdater.

Initializes the component with default stream settings

◆ ~DtStreamingVideoUpdater()

virtual DtStreamingVideoUpdater::~DtStreamingVideoUpdater ( )
overridevirtual

Virtual destructor for DtStreamingVideoUpdater.

Member Function Documentation

◆ initialize()

virtual bool DtStreamingVideoUpdater::initialize ( makVre::DtPlayerStation * player,
makVre::DtInitTable & config )
overridevirtual

Initializes the streaming video updater component.

Parameters
playerPointer to the player station this component belongs to
configConfiguration table containing streaming settings
Returns
True if initialization succeeded, false otherwise

Reads configuration settings including stream name, read buffer type, default source channel, and auto-start options. Sets up message handlers and channel connection signals.

Reimplemented from makVre::DtPlayerComponent.

References makVre::DtPlayerComponent::player().

◆ tick()

virtual void DtStreamingVideoUpdater::tick ( double dt)
overridevirtual

Called every frame to update the streaming state.

Parameters
dtDelta time since the last frame in seconds

Attempts auto-start of video streaming if the retry flag is set

Implements makVre::DtPlayerComponent.

◆ shutdown()

virtual void DtStreamingVideoUpdater::shutdown ( )
overridevirtual

Shuts down the streaming video updater component.

Stops active video streams and removes message handlers and channel signals

Reimplemented from makVre::DtPlayerComponent.

◆ type()

virtual const char * DtStreamingVideoUpdater::type ( ) const
overridevirtual

Returns the type identifier for this component.

Returns
The type string for DtStreamingVideoUpdater

Implements makVre::DtPlayerComponent.

◆ startVideoStream()

virtual void DtStreamingVideoUpdater::startVideoStream ( )
virtual

Starts the configured video stream.

Configures and activates the video stream with the current settings, applying any filename overrides if specified

◆ stopVideoStream()

virtual void DtStreamingVideoUpdater::stopVideoStream ( )
virtual

Stops the active video stream.

Halts the current video stream and updates the stream state attribute

◆ toggleVideoStream()

virtual void DtStreamingVideoUpdater::toggleVideoStream ( )
virtual

Toggles the video stream on or off.

Starts the stream if it's stopped or stops it if it's running

◆ selectVideoSource()

virtual void DtStreamingVideoUpdater::selectVideoSource ( const std::string & guiText,
const std::string & window,
const std::string & channel )
virtual

Selects a new video source for streaming.

Parameters
guiTextDisplay name for the source in the UI
windowName of the window containing the source channel
channelName of the channel to capture

Updates the video stream to use a different source channel, handling stream restart if necessary and updating state attributes

◆ handleToggleVideoStream()

virtual makVre::DtVreMessageResult DtStreamingVideoUpdater::handleToggleVideoStream ( makVre::DtVreMessage * msg)
protectedvirtual

Handles toggle video stream messages.

Parameters
msgToggle video stream message
Returns
Message handling result indicating the message was handled

Processes messages to toggle the video stream state

◆ handleSelectVideoStreamChannel()

virtual makVre::DtVreMessageResult DtStreamingVideoUpdater::handleSelectVideoStreamChannel ( makVre::DtVreMessage * msg)
protectedvirtual

Handles video source selection messages.

Parameters
msgSelect video source message
Returns
Message handling result indicating the message was handled

Processes messages to change the video stream source channel

◆ slot_channelAdded()

virtual void DtStreamingVideoUpdater::slot_channelAdded ( makVrv::DtChannelManager * mgr,
makVrv::DtChannel * channel )
protectedvirtual

Slot called when a channel is added to the system.

Parameters
mgrPointer to the channel manager
channelPointer to the newly added channel

Updates stream state when a new channel is added, enabling auto-start if the channel matches the current stream source

◆ slot_channelToBeRemoved()

virtual void DtStreamingVideoUpdater::slot_channelToBeRemoved ( makVrv::DtChannelManager * mgr,
makVrv::DtChannel * channel )
protectedvirtual

Slot called when a channel is about to be removed.

Parameters
mgrPointer to the channel manager
channelPointer to the channel being removed

Stops streaming and updates state when the current source channel is removed

◆ channelExists()

virtual bool DtStreamingVideoUpdater::channelExists ( const std::string & windowName,
const std::string & channelName )
protectedvirtual

Checks if a specified channel exists.

Parameters
windowNameName of the window
channelNameName of the channel
Returns
True if the channel exists, false otherwise

Verifies whether a specified window and channel combination exists in the system

◆ handleScreenCapture()

virtual makVre::DtVreMessageResult DtStreamingVideoUpdater::handleScreenCapture ( makVre::DtVreMessage * msg)
protectedvirtual

Handles screen capture messages.

Parameters
msgScreen capture message
Returns
Message handling result indicating the message was handled

Processes messages to capture a screenshot of the current video source

◆ updateStreamFilename()

virtual void DtStreamingVideoUpdater::updateStreamFilename ( makVrv::DtVideoStream * stream)
protectedvirtual

Updates the output filename for a video stream.

Parameters
streamPointer to the video stream to update

Modifies the stream's output filename based on the override setting, supporting timestamp substitution with [t] in the filename

Member Data Documentation

◆ myStreamName

std::string DtStreamingVideoUpdater::myStreamName
protected

Name of the video stream configuration to use.

◆ myReadBuffer

std::string DtStreamingVideoUpdater::myReadBuffer
protected

Buffer type to read for streaming (back, front, back_hardware, front_hardware)

Determines whether to include graphical overlays in the stream

◆ myAutoStartStream

bool DtStreamingVideoUpdater::myAutoStartStream
protected

Flag indicating whether to automatically start streaming when the channel appears.

◆ myStreamOutputFilenameOverride

std::string DtStreamingVideoUpdater::myStreamOutputFilenameOverride
protected

Optional override for the stream output filename.

If not empty, replaces the filename in the stream configuration

◆ myRetryAutoStart

bool DtStreamingVideoUpdater::myRetryAutoStart
protected

Flag indicating to retry auto-starting the stream on the next tick.


The documentation for this class was generated from the following file: