VideoOS.Platform.Client.RawSource Class Reference

This class wraps RawVideoSource and RawLiveSource, handling buffering video, synchronizing with the given PlaybackController and ensuring a uniform return of frames whether live or playback. More...

Public Member Functions

void Close (bool wait=false)
 Close the initialized class. The background thread is flagged to stop, and if the wait parameter is true the method will wait for it to finish, max wait time is 5 seconds.
 
void Init ()
 Initializes the class and starts a background thread.
 
void LiveStart ()
 Start live stream.
 
void LiveStop ()
 Stop live stream.
 
void PlaybackStart ()
 Start playback mode.
 
delegate void RawLiveStatusEventHandler (object sender, EventArgs eventArgs)
 Event handler for passing changes in live status.
 
 RawSource ()
 Constructor.
 
delegate void RawVideoErrorHandler (string error)
 Event handler for any errors during gathering of frames.
 
delegate void RawVideoSampleEventHandler (DateTime timeStamp, byte[] content, string privacyMask)
 Event handler for passing frames.
 

Public Attributes

RawLiveStatusEventHandler LiveStatusEvent
 Event for passing changes in live status.
 

Properties

bool IsInitialized [get]
 Returns true when Init has been called, and false after Close(bool) has been called.
 
Item Item [get, set]
 The camera that is streaming or has recorded the video in question.
 
FQID PlaybackFQID [get, set]
 FQID for the Playback Controller.
 
bool Selected [get, set]
 Bool determining whether the source has been selected.
 
Guid StreamId [get, set]
 The id of the stream to be used for the live stream.
 

Events

RawVideoErrorHandler ErrorOccuredEvent
 Event for passing error messages through.
 
RawVideoSampleEventHandler NewRawVideoSampleEvent
 Subscribe to this event to receive each time a frame is available.
 

Detailed Description

This class wraps RawVideoSource and RawLiveSource, handling buffering video, synchronizing with the given PlaybackController and ensuring a uniform return of frames whether live or playback.

Constructor & Destructor Documentation

◆ RawSource()

VideoOS.Platform.Client.RawSource.RawSource ( )
inline

Constructor.

Member Function Documentation

◆ Close()

void VideoOS.Platform.Client.RawSource.Close ( bool wait = false)
inline

Close the initialized class. The background thread is flagged to stop, and if the wait parameter is true the method will wait for it to finish, max wait time is 5 seconds.

Parameters
waitIf true, the method will wait up to five seconds for the internal threads to finish.

◆ Init()

void VideoOS.Platform.Client.RawSource.Init ( )
inline

Initializes the class and starts a background thread.

This method should only be called once, until Close(bool) has been called.

◆ LiveStart()

void VideoOS.Platform.Client.RawSource.LiveStart ( )
inline

Start live stream.

◆ LiveStop()

void VideoOS.Platform.Client.RawSource.LiveStop ( )
inline

Stop live stream.

◆ PlaybackStart()

void VideoOS.Platform.Client.RawSource.PlaybackStart ( )
inline

Start playback mode.

◆ RawLiveStatusEventHandler()

delegate void VideoOS.Platform.Client.RawSource.RawLiveStatusEventHandler ( object sender,
EventArgs eventArgs )

Event handler for passing changes in live status.

Parameters
senderThe sender of the event. Can be null
eventArgsThe containing status.

◆ RawVideoErrorHandler()

delegate void VideoOS.Platform.Client.RawSource.RawVideoErrorHandler ( string error)

Event handler for any errors during gathering of frames.

Parameters
errorThe error message

◆ RawVideoSampleEventHandler()

delegate void VideoOS.Platform.Client.RawSource.RawVideoSampleEventHandler ( DateTime timeStamp,
byte[] content,
string privacyMask )

Event handler for passing frames.

Parameters
timeStampTimestamp of the frame
contentThe frame
privacyMaskPrivacy mask information. If no mask on current frame it will be null. It is the consumer of this event who is responsible for how to handle privacy mask.

Member Data Documentation

◆ LiveStatusEvent

RawLiveStatusEventHandler VideoOS.Platform.Client.RawSource.LiveStatusEvent

Event for passing changes in live status.

Property Documentation

◆ IsInitialized

bool VideoOS.Platform.Client.RawSource.IsInitialized
get

Returns true when Init has been called, and false after Close(bool) has been called.

◆ Item

Item VideoOS.Platform.Client.RawSource.Item
getset

The camera that is streaming or has recorded the video in question.

◆ PlaybackFQID

FQID VideoOS.Platform.Client.RawSource.PlaybackFQID
getset

FQID for the Playback Controller.

◆ Selected

bool VideoOS.Platform.Client.RawSource.Selected
getset

Bool determining whether the source has been selected.

◆ StreamId

Guid VideoOS.Platform.Client.RawSource.StreamId
getset

The id of the stream to be used for the live stream.

Default value is Guid.Empty and will provide the default live stream.

When changing the StreamId while a live stream is being shown, call LiveStart to utilize the new StreamId.

Event Documentation

◆ ErrorOccuredEvent

RawVideoErrorHandler VideoOS.Platform.Client.RawSource.ErrorOccuredEvent

Event for passing error messages through.

◆ NewRawVideoSampleEvent

RawVideoSampleEventHandler VideoOS.Platform.Client.RawSource.NewRawVideoSampleEvent

Subscribe to this event to receive each time a frame is available.