EdgeVisDecoderSDK::Stream Class Reference

Detailed Description

The Stream interface represent a service that is available on an Encoder.

The different types of Stream available include:

  • Media Stream (incorporating Video, Audio & GPS Data)
  • PTZ Stream
  • Pass Thru Stream
  • Full resolution Download Stream
  • Remote archive Retrieval Stream
  • SecureConnect stream

The class itself is the superclass for different stream classes that can be opened against an Encoder interface. The methods in this class are mainly used to open/close the stream and to retrieve the name and type of the stream. The appropriate methods of the subclass should then be used to interact with the functionality of the opened stream.

Availability

Available in version 6.0 of Decoder SDK. Requires a server version greater than 6.0

#include <Stream.h>

Public Member Functions

DB_EDGEVIS_SDK StreamType Type () const
 Gets the stream type. More...
 
DB_EDGEVIS_SDK std::wstring Name () const
 Gets the stream's name. More...
 
virtual DB_EDGEVIS_SDK OpResult SetTransport (TransportType trans)
 This is underlying transport type. More...
 
virtual DB_EDGEVIS_SDK TransportType GetTransport ()
 Gets the stream's transport. More...
 
DB_EDGEVIS_SDK Encoder GetEncoder () const
 Gets the Encoder object that the Stream is on. More...
 
DB_EDGEVIS_SDK OpResult Open ()
 Opens the stream. More...
 
DB_EDGEVIS_SDK void Close ()
 Closes this stream. More...
 
virtual DB_EDGEVIS_SDK bool IsConnected () const
 Determines if the stream is currently connected (in use). More...
 
DB_EDGEVIS_SDK void RegisterListener (IStreamListener *listener)
 Registers the specified listener to be notified when stream data is received. More...
 
DB_EDGEVIS_SDK void UnregisterListener (IStreamListener *listener)
 Removes the specified listener from the set of listeners to be notified about incoming stream data. More...
 
DB_EDGEVIS_SDK int64_t GetTotalBytesSent ()
 Returns the current total number of bytes sent on this stream. More...
 
DB_EDGEVIS_SDK int64_t GetTotalBytesReceived ()
 Returns the current total number of bytes received on this stream. More...
 
DB_EDGEVIS_SDK void ResetDataUsageStats ()
 Resets the count of the total number of bytes sent and received for this stream.
 
DB_EDGEVIS_SDK int64_t GetStreamUseDuration () const
 Get the duration in milliseconds that the stream has been open. More...
 
DB_EDGEVIS_SDK int64_t GetLastStreamUseDuration () const
 Get the duration in milliseconds that the stream was open on last use. More...
 
DB_EDGEVIS_SDK void SetEnableAnalyticsSync (bool enable)
 Enables or disables synchronization of analytics metadata with audio and video Enabled by default, to disable set to false. More...
 
DB_EDGEVIS_SDK bool GetEnableAnalyticsSync () const
 Returns true if Analytics Sync is enabled. More...
 

Member Function Documentation

DB_EDGEVIS_SDK StreamType EdgeVisDecoderSDK::Stream::Type ( ) const

Gets the stream type.

Returns
The stream type.
DB_EDGEVIS_SDK std::wstring EdgeVisDecoderSDK::Stream::Name ( ) const

Gets the stream's name.

Returns
The name of the stream.
virtual DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::Stream::SetTransport ( TransportType  trans)
virtual

This is underlying transport type.

You can set this property before opening the stream, otherwise the most appropriate transport type will be determined based on the configuration of the Encoder.

Generally you should not set this as the SDK will normally use the best performing transport for the stream you are opening. The only time it would be appropriate is in a TCP only environment where you are willing to sacrifice bandwidth by using TCP instead of UDP/RUDP.

Please refer to TransportType for a list of possible values.

Note
Do not change this property after calling Open() as it may not reflect the true state of the transport type.
Parameters
transThe type of the transport
virtual DB_EDGEVIS_SDK TransportType EdgeVisDecoderSDK::Stream::GetTransport ( )
virtual

Gets the stream's transport.

See also
SetTransport()
Returns
The transport used by this stream
DB_EDGEVIS_SDK Encoder EdgeVisDecoderSDK::Stream::GetEncoder ( ) const

Gets the Encoder object that the Stream is on.

Returns
Pointer to the Encoder object that the stream is on.
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::Stream::Open ( )

Opens the stream.

This opens the stream from the Encoder. Data should be received by an object that implements the IStreamListener interface via the the DataReceived() method. If the stream is already open then any calls to this method will be ignored.

Potential OpResults Returned:

OR_NotConnected - Encoder not connected to server
OR_InvalidStream - m_pimpl is nil or destroyed. You must retrieve a fresh list of encoders from the server

DB_EDGEVIS_SDK void EdgeVisDecoderSDK::Stream::Close ( )

Closes this stream.

This closes the stream from the Encoder. This call is ignored if the stream is not already open

virtual DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::Stream::IsConnected ( ) const
virtual

Determines if the stream is currently connected (in use).

Returns
True if the stream is open, false otherwise.

Reimplemented in EdgeVisDecoderSDK::PTZStream, EdgeVisDecoderSDK::MediaStream, EdgeVisDecoderSDK::PassThruStream, and EdgeVisDecoderSDK::AnalyticsStream.

DB_EDGEVIS_SDK void EdgeVisDecoderSDK::Stream::RegisterListener ( IStreamListener listener)

Registers the specified listener to be notified when stream data is received.

Parameters
listenerPointer to the listening object.
DB_EDGEVIS_SDK void EdgeVisDecoderSDK::Stream::UnregisterListener ( IStreamListener listener)

Removes the specified listener from the set of listeners to be notified about incoming stream data.

Parameters
listenerPointer to the listening object to remove.
DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::Stream::GetTotalBytesSent ( )

Returns the current total number of bytes sent on this stream.

Returns
The current total number of bytes sent
DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::Stream::GetTotalBytesReceived ( )

Returns the current total number of bytes received on this stream.

Returns
The current total number of bytes received
DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::Stream::GetStreamUseDuration ( ) const

Get the duration in milliseconds that the stream has been open.

Returns
The duration in milliseconds that the stream has been open, or 0 if the stream is closed.
DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::Stream::GetLastStreamUseDuration ( ) const

Get the duration in milliseconds that the stream was open on last use.

Returns
The duration in milliseconds that the stream was open on last use, or 0 if the stream has not been open this session.
DB_EDGEVIS_SDK void EdgeVisDecoderSDK::Stream::SetEnableAnalyticsSync ( bool  enable)

Enables or disables synchronization of analytics metadata with audio and video Enabled by default, to disable set to false.

Parameters
enableSet True to enable ONVIF metadata
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::Stream::GetEnableAnalyticsSync ( ) const

Returns true if Analytics Sync is enabled.

See also
SetEnableAnalyticsSync
Returns
True if Analytics Sync is enabled

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