The Stream interface represent a service that is available on an Encoder.
The different types of Stream available include:
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.
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. | |
| DB_EDGEVIS_SDK std::wstring | Name () const |
| Gets the stream's name. | |
| virtual DB_EDGEVIS_SDK OpResult | SetTransport (TransportType trans) |
| This is underlying transport type. | |
| virtual DB_EDGEVIS_SDK TransportType | GetTransport () |
| Gets the stream's transport. | |
| DB_EDGEVIS_SDK Encoder | GetEncoder () const |
| Gets the Encoder object that the Stream is on. | |
| DB_EDGEVIS_SDK OpResult | Open () |
| Opens the stream. | |
| DB_EDGEVIS_SDK void | Close () |
| Closes this stream. | |
| virtual DB_EDGEVIS_SDK bool | IsConnected () const |
| Determines if the stream is currently connected (in use). | |
| DB_EDGEVIS_SDK void | RegisterListener (IStreamListener *listener) |
| Registers the specified listener to be notified when stream data is received. | |
| DB_EDGEVIS_SDK void | UnregisterListener (IStreamListener *listener) |
| Removes the specified listener from the set of listeners to be notified about incoming stream data. | |
| DB_EDGEVIS_SDK int64_t | GetTotalBytesSent () |
| Returns the current total number of bytes sent on this stream. | |
| DB_EDGEVIS_SDK int64_t | GetTotalBytesReceived () |
| Returns the current total number of bytes received on this stream. | |
| 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. | |
| DB_EDGEVIS_SDK int64_t | GetLastStreamUseDuration () const |
| Get the duration in milliseconds that the stream was open on last use. | |
| DB_EDGEVIS_SDK StreamType EdgeVisDecoderSDK::Stream::Type | ( | ) | const |
Gets the stream type.
| DB_EDGEVIS_SDK std::wstring EdgeVisDecoderSDK::Stream::Name | ( | ) | const |
Gets the stream's name.
|
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.
| trans | The type of the transport |
|
virtual |
| DB_EDGEVIS_SDK Encoder EdgeVisDecoderSDK::Stream::GetEncoder | ( | ) | const |
| 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 |
Determines if the stream is currently connected (in use).
Reimplemented in EdgeVisDecoderSDK::AnalyticsStream, EdgeVisDecoderSDK::MediaStream, EdgeVisDecoderSDK::PassThruStream, and EdgeVisDecoderSDK::PTZStream.
| DB_EDGEVIS_SDK void EdgeVisDecoderSDK::Stream::RegisterListener | ( | IStreamListener * | listener | ) |
Registers the specified listener to be notified when stream data is received.
| listener | Pointer 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.
| listener | Pointer 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.
| DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::Stream::GetTotalBytesReceived | ( | ) |
Returns the current total number of bytes received on this stream.
| DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::Stream::GetStreamUseDuration | ( | ) | const |
Get the duration in milliseconds that the stream has been open.
| DB_EDGEVIS_SDK int64_t EdgeVisDecoderSDK::Stream::GetLastStreamUseDuration | ( | ) | const |
Get the duration in milliseconds that the stream was open on last use.