SAFR Windows SDK
All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events
RealNetworks.CameraKit.VideoPlayer Class Reference

A video player object which is able to play h.264 / h.265 video files and video streams. More...

Inheritance diagram for RealNetworks.CameraKit.VideoPlayer:

Classes

class  AcceleratorOption
 
class  ConnectionTimeoutOption
 
class  CredentialsOption
 
class  DidChangePausedStateEventArgs
 
class  DidDecodeEventArgs
 
class  DidDetectErrorEventArgs
 
class  FramePoolOption
 Initial size of the internal video decoder frame pool. FramePoolInitialSizePlatformDefault means that the size should be auto-configured for the platform. FramePoolInitialSizeDecoderDefault means that the size should be auto-configured for the decoder. Valid values for explicit sizes are 1 to 32. If 0 is specified it is considered invalid and will be bumped up to a size of 1. More...
 
class  LensCorrectionOption
 
class  MirroringOption
 
class  Option
 Options which control how the video player opens the video stream and how it should tread it. E.g. apply lens correction to it. More...
 
class  RotationOption
 Rotate the video image clock-wise. More...
 
class  RtspOption
 
class  SeekOperation
 
class  SyncToVideoClockOption
 
class  VideoCropOption
 

Public Types

enum  RtspTransport { RtspTransport.Tcp, RtspTransport.Udp, RtspTransport.UdpMulticast }
 The supported RTSP / RTP transport protocols. More...
 

Public Member Functions

delegate void SeekCompletion (Exception error)
 Seek callback. More...
 
 VideoPlayer (Uri url)
 A VideoPlayer allows you to play back a video file or a HTTP / RTSP video stream. Note that the video player supports video streams only - it does not support audio streams at all. More...
 
 VideoPlayer (Uri url, List< Option > options)
 
void Dispose ()
 
void Dispose (bool disposing)
 
void Stop ()
 Stops the video player in preparation for destruction. More...
 
void Preroll ()
 Preroll the video player if it hasn't already been prerolled. More...
 
void FrameStep (int frameCount)
 
void Seek (Microseconds time, bool exact, SeekCompletion completion)
 Seeks to the given time. Note that the seek operation will take a while. Invokes the completion handler once seeking is done. More...
 
void CancelSeek ()
 Cancels an active seek operation. More...
 

Properties

VideoPlayerStatistics Statistics [get]
 The current player statistics. More...
 
Uri Url [get]
 Returns the URL from which the player plays back. More...
 
List< OptionOptions [get]
 Returns the options with which the video player was created. More...
 
VideoSourceType SourceType [get]
 Returns the source type. More...
 
double LowLightThreshold [get, set]
 The contrast enhancement low-light-threshold. More...
 
double ExposureBoost [get, set]
 The contrast enhancement exposure boost. More...
 
bool ContrastEnhancementEnabled [get, set]
 Enables or disables contrast enhancement. More...
 
bool DetectionOnlyContrastEnhancement [get, set]
 Enables / disables deferring of contrast enhancement from the camera side to the face detector side. More...
 
double FrameRate [get]
 Returns the frame rate in frames per seconds. More...
 
Size VideoResolution [get]
 Returns the video resolution. More...
 
double PlaybackRate [get, set]
 Returns the playback rate. More...
 
bool Paused [get, set]
 Returns true if the player is paused. More...
 
Microseconds CurrentTime [get]
 Returns the current playback time. More...
 
Microseconds Duration [get]
 Returns the duration. More...
 

Events

EventHandler< DidDecodeEventArgsDidDecode
 Invoked after the player has decoded another video frame. More...
 
EventHandler< DidDetectErrorEventArgsDidDetectError
 Invoked if the video player has detected an error while trying to play back the video file / stream. More...
 
EventHandler DidFinishPrerolling
 Invoked after the video player has finished prerolling the video file / stream. More...
 
EventHandler DidChangePausedState
 Invoked after the state of the paused flag has changed. More...
 
EventHandler DidReachEndOfStream
 Invoked after the player has reached the end of a video file. More...
 

Detailed Description

A video player object which is able to play h.264 / h.265 video files and video streams.

Member Enumeration Documentation

◆ RtspTransport

The supported RTSP / RTP transport protocols.

Enumerator
Tcp 
Udp 
UdpMulticast 

Constructor & Destructor Documentation

◆ VideoPlayer() [1/2]

RealNetworks.CameraKit.VideoPlayer.VideoPlayer ( Uri  url)

A VideoPlayer allows you to play back a video file or a HTTP / RTSP video stream. Note that the video player supports video streams only - it does not support audio streams at all.

Create an instance of a video player and then register an event handler with the DidDecode event property to receive the decoded video frames. Then start playback by setting the Paused property to false. You can pause playback at any time by setting the Paused property to true.

You can stop playback altogether in preparation of disposing the video player by calling Stop(). You can stop playback and dispose the player at the same time by calling Dispose().

The video player enforces the video clock if the URL points to a video file but it does not enforce the video clock if the URL points to a HTTP or RTSP video stream. In this case the video player decodes video frames as fast as they arrive from the camera. It does this to minimize the video playback latency.

Parameters
urla file, HTTP or RTSP URL

◆ VideoPlayer() [2/2]

RealNetworks.CameraKit.VideoPlayer.VideoPlayer ( Uri  url,
List< Option options 
)

Member Function Documentation

◆ CancelSeek()

void RealNetworks.CameraKit.VideoPlayer.CancelSeek ( )

Cancels an active seek operation.

◆ Dispose() [1/2]

void RealNetworks.CameraKit.VideoPlayer.Dispose ( )

◆ Dispose() [2/2]

void RealNetworks.CameraKit.VideoPlayer.Dispose ( bool  disposing)

◆ FrameStep()

void RealNetworks.CameraKit.VideoPlayer.FrameStep ( int  frameCount)

◆ Preroll()

void RealNetworks.CameraKit.VideoPlayer.Preroll ( )

Preroll the video player if it hasn't already been prerolled.

◆ Seek()

void RealNetworks.CameraKit.VideoPlayer.Seek ( Microseconds  time,
bool  exact,
SeekCompletion  completion 
)

Seeks to the given time. Note that the seek operation will take a while. Invokes the completion handler once seeking is done.

Parameters
time
exact
completion

◆ SeekCompletion()

delegate void RealNetworks.CameraKit.VideoPlayer.SeekCompletion ( Exception  error)

Seek callback.

Parameters
errorSeek error or null

◆ Stop()

void RealNetworks.CameraKit.VideoPlayer.Stop ( )

Stops the video player in preparation for destruction.

Property Documentation

◆ ContrastEnhancementEnabled

bool RealNetworks.CameraKit.VideoPlayer.ContrastEnhancementEnabled
getset

Enables or disables contrast enhancement.

◆ CurrentTime

Microseconds RealNetworks.CameraKit.VideoPlayer.CurrentTime
get

Returns the current playback time.

◆ DetectionOnlyContrastEnhancement

bool RealNetworks.CameraKit.VideoPlayer.DetectionOnlyContrastEnhancement
getset

Enables / disables deferring of contrast enhancement from the camera side to the face detector side.

◆ Duration

Microseconds RealNetworks.CameraKit.VideoPlayer.Duration
get

Returns the duration.

◆ ExposureBoost

double RealNetworks.CameraKit.VideoPlayer.ExposureBoost
getset

The contrast enhancement exposure boost.

◆ FrameRate

double RealNetworks.CameraKit.VideoPlayer.FrameRate
get

Returns the frame rate in frames per seconds.

◆ LowLightThreshold

double RealNetworks.CameraKit.VideoPlayer.LowLightThreshold
getset

The contrast enhancement low-light-threshold.

◆ Options

List<Option> RealNetworks.CameraKit.VideoPlayer.Options
get

Returns the options with which the video player was created.

◆ Paused

bool RealNetworks.CameraKit.VideoPlayer.Paused
getset

Returns true if the player is paused.

◆ PlaybackRate

double RealNetworks.CameraKit.VideoPlayer.PlaybackRate
getset

Returns the playback rate.

◆ SourceType

VideoSourceType RealNetworks.CameraKit.VideoPlayer.SourceType
get

Returns the source type.

◆ Statistics

VideoPlayerStatistics RealNetworks.CameraKit.VideoPlayer.Statistics
get

The current player statistics.

◆ Url

Uri RealNetworks.CameraKit.VideoPlayer.Url
get

Returns the URL from which the player plays back.

◆ VideoResolution

Size RealNetworks.CameraKit.VideoPlayer.VideoResolution
get

Returns the video resolution.

Event Documentation

◆ DidChangePausedState

EventHandler RealNetworks.CameraKit.VideoPlayer.DidChangePausedState

Invoked after the state of the paused flag has changed.

◆ DidDecode

EventHandler<DidDecodeEventArgs> RealNetworks.CameraKit.VideoPlayer.DidDecode

Invoked after the player has decoded another video frame.

◆ DidDetectError

EventHandler<DidDetectErrorEventArgs> RealNetworks.CameraKit.VideoPlayer.DidDetectError

Invoked if the video player has detected an error while trying to play back the video file / stream.

◆ DidFinishPrerolling

EventHandler RealNetworks.CameraKit.VideoPlayer.DidFinishPrerolling

Invoked after the video player has finished prerolling the video file / stream.

◆ DidReachEndOfStream

EventHandler RealNetworks.CameraKit.VideoPlayer.DidReachEndOfStream

Invoked after the player has reached the end of a video file.