Stream Library - Class List
g is the description of classes presented in the Stream Library.
VideoCapabilities
Video capabilities.
Public Attributes
<li><a href = "#VideoCapabilities@videoCodec">videoCodec</a></li>
<li><a href = "#VideoCapabilities@videoResolution">videoResolution</a></li>
<li><a href = "#VideoCapabilities@fps">fps</a></li>
<li><a href = "#VideoCapabilities@bitRate">bitRate</a></li>
<li><a href = "#VideoCapabilities@triggerList">triggerList</a></li>
Public Member Data Documentation
Following is the detailed documentation of the public variables declared under the VideoCapabilities class.
/// Video codec.
VideoCodec videoCodec;
/// Video resolution.
VideoResolution videoResolution;
/// Maximum video frame per second.
int fps;
/// Maximum video bitrate.
long bitRate;
/// List of recording triggers.
std::vector<RecordingTriggers> triggerList;
AudioCapabilities
Audio capabilities.
Public Attributes
<li><a href = "#AudioCapabilities@audioCodec">audioCodec</a></li>
<li><a href = "#AudioCapabilities@audioSampleRate">audioSampleRate</a></li>
<li><a href = "#AudioCapabilities@bitRate">bitRate</a></li>
<li><a href = "#AudioCapabilities@triggerList">triggerList</a></li>
Public Member Data Documentation
Following is the detailed documentation of the public variables declared under the AudioCapabilities class.
/// Audio codec.
AudioCodec audioCodec;
/// Maximum audio sample rate.
SampleRate audioSampleRate;
/// Maximum audio bitrate.
long bitRate;
/// List of recording triggers.
std::vector<RecordingTriggers> triggerList;
RingBuffer
Buffer for Raw data
which will come from media layer
Public Attributes
<li><a href = "#RingBuffer@bufferSize">bufferSize</a></li>
<li><a href = "#RingBuffer@writeIndex">writeIndex</a></li>
<li><a href = "#RingBuffer@readIndex">readIndex</a></li>
<li><a href = "#RingBuffer@bigMask">bigMask</a></li>
<li><a href = "#RingBuffer@smallMask">smallMask</a></li>
<li><a href = "#RingBuffer@start_frame">start_frame</a></li>
<li><a href = "#RingBuffer@inputSource">inputSource</a></li>
<li><a href = "#RingBuffer@width">width</a></li>
<li><a href = "#RingBuffer@height">height</a></li>
<li><a href = "#RingBuffer@buffer">buffer</a></li>
<li><a href = "#RingBuffer@isMotionData">isMotionData</a></li>
<li><a href = "#RingBuffer@timestamp">timestamp</a></li>
Public Member Data Documentation
Following is the detailed documentation of the public variables declared under the RingBuffer class.
int32_t bufferSize; ///< Number of bytes in FIFO. Power of 2.
int32_t writeIndex; ///< Index of next writable byte.
int32_t readIndex; ///< Index of next readable byte.
int32_t bigMask; ///< Used for wrapping indices with extra bit to distinguish full/empty.
int32_t smallMask; ///< Used for fitting indices to buffer.
int32_t start_frame;
std::string inputSource;///< Used for input source name of this data.
int width;
int height;
unsigned char *buffer;
bool isMotionData;
u_int64_t timestamp;
StreamStatistics
Supported media types: audio, video and image.
Public Attributes
<li><a href = "#StreamStatistics@codecType">codecType</a></li>
<li><a href = "#StreamStatistics@codecDescription">codecDescription</a></li>
<li><a href = "#StreamStatistics@framesLost">framesLost</a></li>
<li><a href = "#StreamStatistics@framesReceived">framesReceived</a></li>
<li><a href = "#StreamStatistics@framesDropped">framesDropped</a></li>
<li><a href = "#StreamStatistics@framesRecovered">framesRecovered</a></li>
<li><a href = "#StreamStatistics@framesDisplayed">framesDisplayed</a></li>
<li><a href = "#StreamStatistics@framesImpaired">framesImpaired</a></li>
<li><a href = "#StreamStatistics@frameRate">frameRate</a></li>
<li><a href = "#StreamStatistics@packetsReceived">packetsReceived</a></li>
<li><a href = "#StreamStatistics@packetsLost">packetsLost</a></li>
<li><a href = "#StreamStatistics@bitRateVideoData">bitRateVideoData</a></li>
<li><a href = "#StreamStatistics@bitRateOverHead">bitRateOverHead</a></li>
<li><a href = "#StreamStatistics@packetLossRate">packetLossRate</a></li>
<li><a href = "#StreamStatistics@iFrameRate">iFrameRate</a></li>
<li><a href = "#StreamStatistics@bFrameRate">bFrameRate</a></li>
<li><a href = "#StreamStatistics@pFrameRate">pFrameRate</a></li>
<li><a href = "#StreamStatistics@senderQualityFactor">senderQualityFactor</a></li>
<li><a href = "#StreamStatistics@videoResolution">videoResolution</a></li>
<li><a href = "#StreamStatistics@averageDelay">averageDelay</a></li>
<li><a href = "#StreamStatistics@jitter">jitter</a></li>
<li><a href = "#StreamStatistics@averageRTT">averageRTT</a></li>
<li><a href = "#StreamStatistics@windowSize">windowSize</a></li>
<li><a href = "#StreamStatistics@bufferSize">bufferSize</a></li>
<li><a href = "#StreamStatistics@framesSent">framesSent</a></li>
<li><a href = "#StreamStatistics@packetsSent">packetsSent</a></li>
<li><a href = "#StreamStatistics@sampleRate">sampleRate</a></li>
Public Methods
<li><a href = "#StreamStatistics@StreamStatistics">StreamStatistics</a></li>
<li><a href = "#StreamStatistics@~StreamStatistics">~StreamStatistics</a></li>
Typedefs
<li><a href = "#StreamStatistics@Ptr">Ptr</a></li>
Public Member Data Documentation
Following is the detailed documentation of the public variables declared under the StreamStatistics class.
/// Media codec type.
std::string codecType;
/// Media codec description.
std::string codecDescription;
/// The number of lost frames.
unsigned int framesLost;
/// The number of received frames.
unsigned int framesReceived;
/// The number of dropped frames. These frames are completely received,
/// but not decoded and rendered, due to CPU overload.
unsigned int framesDropped;
/// The number of recovered frames. These frames are partially received but
/// can be recovered.
unsigned int framesRecovered;
/// The number of displayed frames.
unsigned int framesDisplayed;
/// The number of impaired frames. These frames are partially received.
unsigned int framesImpaired;
/// Received frame rate.
double frameRate;
/// The number of received packets.
unsigned int packetsReceived;
/// The number of lost packets.
unsigned int packetsLost;
/// Bitrate of video payload.
double bitRateVideoData;
/// Bitrate of stream header. Includes TCP/IP header, RTP header, Video
/// header and header extension.
double bitRateOverHead;
/// Packet loss rate.
double packetLossRate;
/// Received I-Frame rate.
double iFrameRate;
/// Received B-Frame rate.
double bFrameRate;
/// Received P-Frame rate.
double pFrameRate;
/// Video sending quality.
int senderQualityFactor;
/// Video resolution.
VideoResolution videoResolution;
/// Average delay in milliseconds for the preceding one second.
int averageDelay;
/// The jitter for the preceding one second.
unsigned int jitter;
/// The average packet round-trip time in milliseconds for the preceding one second.
double averageRTT;
/// The window size.
unsigned int windowSize;
/// The buffer size.
unsigned int bufferSize;
/// The number of frames sent.
unsigned int framesSent;
/// The number of sent packets.
unsigned int packetsSent;
/// Audio sample rate.
SampleRate sampleRate;
Public Member Function Documentation
Following is the detailed documentation of the public methods declared under the StreamStatistics class.
StreamStatistics();
virtual ~StreamStatistics();
Typedefs Documentation
Following is the detailed documentation of the typedefs declared under the StreamStatistics class.
/// Definition of a shared pointer to StreamStatistics.
typedef std::shared_ptr<StreamStatistics> Ptr;
FrameProperties
FrameProperties are different given the media type and the encoding scheme.
A frame is a coherent piece of data marked by the sampling timestamp value.
This is also called an access unit.
Public Attributes
<li><a href = "#FrameProperties@format">format</a></li>
<li><a href = "#FrameProperties@structure">structure</a></li>
Public Member Data Documentation
Following is the detailed documentation of the public variables declared under the FrameProperties class.
Format format;
Structure structure;
Stream
Interface for audio, video and image streaming.
Stream interface definition for the Stream object.
Public Methods
<li><a href = "#Stream@~Stream">~Stream</a></li>
<li><a href = "#Stream@start">start</a></li>
<li><a href = "#Stream@stop">stop</a></li>
<li><a href = "#Stream@getInputSources">getInputSources</a></li>
<li><a href = "#Stream@setInputSources">setInputSources</a></li>
<li><a href = "#Stream@removeInputSources">removeInputSources</a></li>
<li><a href = "#Stream@setAudioCapabilities">setAudioCapabilities</a></li>
<li><a href = "#Stream@setVideoCapabilities">setVideoCapabilities</a></li>
<li><a href = "#Stream@attachPreviewVideoWindow">attachPreviewVideoWindow</a></li>
<li><a href = "#Stream@attachVideoWindow">attachVideoWindow</a></li>
<li><a href = "#Stream@startStream">startStream</a></li>
<li><a href = "#Stream@onStreamReceive">onStreamReceive</a></li>
<li><a href = "#Stream@onStreamStart">onStreamStart</a></li>
<li><a href = "#Stream@stopStream">stopStream</a></li>
<li><a href = "#Stream@onStreamStop">onStreamStop</a></li>
<li><a href = "#Stream@pauseStream">pauseStream</a></li>
<li><a href = "#Stream@onStreamPause">onStreamPause</a></li>
<li><a href = "#Stream@resumeStream">resumeStream</a></li>
<li><a href = "#Stream@onStreamResume">onStreamResume</a></li>
<li><a href = "#Stream@onStreamConnectivityChange">onStreamConnectivityChange</a></li>
<li><a href = "#Stream@onReceivedVideoResolutionChange">onReceivedVideoResolutionChange</a></li>
<li><a href = "#Stream@onReceivedVideoSpecificData">onReceivedVideoSpecificData</a></li>
<li><a href = "#Stream@setRecordingBuffer">setRecordingBuffer</a></li>
<li><a href = "#Stream@startRecording">startRecording</a></li>
<li><a href = "#Stream@stopRecording">stopRecording</a></li>
<li><a href = "#Stream@getRecordingList">getRecordingList</a></li>
<li><a href = "#Stream@onRecordingCompleted">onRecordingCompleted</a></li>
<li><a href = "#Stream@pushEncodedFrame">pushEncodedFrame</a></li>
<li><a href = "#Stream@onReceiveFrame">onReceiveFrame</a></li>
<li><a href = "#Stream@setQoSTable">setQoSTable</a></li>
<li><a href = "#Stream@setQoS">setQoS</a></li>
<li><a href = "#Stream@setAEC">setAEC</a></li>
<li><a href = "#Stream@setAGC">setAGC</a></li>
<li><a href = "#Stream@setVideoQualityProfile">setVideoQualityProfile</a></li>
<li><a href = "#Stream@getSendStatistics">getSendStatistics</a></li>
<li><a href = "#Stream@getReceiveStatistics">getReceiveStatistics</a></li>
<li><a href = "#Stream@setRawDataCallback">setRawDataCallback</a></li>
Typedefs
<li><a href = "#Stream@Ptr">Ptr</a></li>
Public Member Function Documentation
Following is the detailed documentation of the public methods declared under the Stream class.
virtual ~Stream() {};
Starting Stream library. Resources are allocated waiting in idle state for a request to come in or to send a request issued by the application.
virtual StreamRet start() = 0;
Return Value: StreamRet::OK on successful resource allocation, other values on failure.
Stopping Stream library. Graceful shutdown of recording and any other cloud service running, gracefully stops media processing. Close active streams and free resources.
virtual StreamRet stop(stopHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | stopHandler | com::anyconnect::stream::stopHandler function invoked when stream has fully stopped. No callbacks will be invoked after stopHandler is called. |
Return Value: StreamRet::OK on successful resource releasion, other values on failure.
Get the list of input sources.
virtual StreamRet getInputSources(MediaType mediaType, std::vector<std::string> &sourceList) = 0;
Member | Datatype | Definition |
---|---|---|
mediaType | MediaType | selected media type |
sourceList | std::vector<std::string> & | list of input sources for the mediaType |
Return Value: StreamRet::OK on success, other values on failure.
Set the input sources.
virtual StreamRet setInputSources(MediaType mediaType, const std::vector<std::string> &sourceList, onSetInputSourcesHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
mediaType | MediaType | selected media type |
sourceList | const std::vector<std::string> & | list of input sources are going to be used by stream library in the following streaming |
handler | onSetInputSourcesHandler | function pointer called on setting input sources |
Return Value: StreamRet::OK on success, other values on failure.
Remove the input sources.
virtual StreamRet removeInputSources(MediaType mediaType, const std::vector<std::string> &sourceList, onSetInputSourcesHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
mediaType | MediaType | selected media type |
sourceList | const std::vector<std::string> & | list of input sources are going to be removed from stream library |
handler | onSetInputSourcesHandler | function pointer called on removing input sources |
Return Value: StreamRet::OK on success, other values on failure.
Set audio capabilities.
virtual StreamRet setAudioCapabilities(const std::string &inputSource, const AudioCapabilities &audioCapabilities) = 0;
Member | Datatype | Definition |
---|---|---|
inputSource | const std::string & | the audio input source |
audioCapabilities | const AudioCapabilities & | the audio capabilities which are going to be used by stream library in the following streaming. |
Return Value: StreamRet::OK on success, other values on failure.
Set video capabilities.
virtual StreamRet setVideoCapabilities(const std::string &inputSource, const VideoCapabilities &videoCapabilities) = 0;
Member | Datatype | Definition |
---|---|---|
inputSource | const std::string & | the video input source |
videoCapabilities | const VideoCapabilities & | the video capabilites which are going to be used by stream library in the following streaming. |
Return Value: StreamRet::OK on success, other values on failure.
Attach the self-video preview window. Attaching the self-video preview window to render the captured video from the camera. This will start rendering self-camera video when stream start with any endpoint. Note: this API is only supported for Android and iOS platforms
virtual StreamRet attachPreviewVideoWindow(long long viewId) = 0;
Member | Datatype | Definition |
---|---|---|
viewId | long long | ID of the view where self-video should render |
Return Value: StreamRet::OK on success, other values on failure.
Attach video window for remote. Attaching the video window to render the video received from remote endpoint. This will start rendering remote endpoint's video when library starts receiving video from remote endpoint. Note: this API is only supported for Android and iOS platforms and this API need to be invoked multiple times for multiple endpoint's video sources.
virtual StreamRet attachVideoWindow(const EndPointUUID &fromEndPoint, long long viewId) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndPoint | const EndPointUUID & | stream source endpoint UUID |
viewId | long long | ID of the view where remote video should render |
Return Value: StreamRet::OK on success, other values on failure.
Start a stream.
virtual void startStream(const EndPointUUID &fromEndPoint, const std::vector<MediaType> &mediaTypeList, onStreamRequestHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndPoint | const EndPointUUID & | source endpoint UUID |
mediaTypeList | const std::vector<MediaType> & | of mediaTypes |
handler | onStreamRequestHandler | pointer called when the request is issued Note: this API can be invoked multiple times to stream with multiple remote endpoints. |
Set callback to get notified when a stream requested.
virtual void onStreamReceive(onStreamReceiveHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onStreamReceiveHandler | pointer called when a stream has been requested. |
Set callback to get notified when a stream started.
virtual void onStreamStart(onStreamStartHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onStreamStartHandler | pointer called when the stream has started. |
Request to stop a stream.
virtual void stopStream(const EndPointUUID &fromEndPoint, onStreamStopHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndPoint | const EndPointUUID & | source endpoint UUID concerned by the stop request. |
handler | onStreamStopHandler | pointer called when the stream has been stopped. |
Set callback to get notified when a stream stopped.
virtual void onStreamStop(onStreamStopHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onStreamStopHandler | pointer which will be called when any stream has been stopped. |
Pause the transmission of selected media.
virtual void pauseStream(const EndPointUUID &fromEndPoint, const std::vector<MediaType> &mediaTypeList, onStreamPauseHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndPoint | const EndPointUUID & | source endpoint UUID |
mediaTypeList | const std::vector<MediaType> & | media types |
handler | onStreamPauseHandler | pointer called when the stream has been paused. |
Set callback to get notified when a stream paused.
virtual void onStreamPause(onStreamPauseHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onStreamPauseHandler | pointer which will be called when any stream has been paused. |
Resume the transmission of selected media.
virtual void resumeStream(const EndPointUUID &fromEndPoint, const std::vector<MediaType> &mediaTypeList, onStreamResumeHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndPoint | const EndPointUUID & | source endpoint UUID |
mediaTypeList | const std::vector<MediaType> & | media types |
handler | onStreamResumeHandler | pointer called when the stream has been resumed. |
Set callback to get notified when a stream resumed.
virtual void onStreamResume(onStreamResumeHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onStreamResumeHandler | pointer which will be called when any stream has been resumed. |
set callback to get notified when connectivity has changed for an ongoing stream session
virtual void onStreamConnectivityChange(onStreamConnectivityChangeHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onStreamConnectivityChangeHandler | pointer which will be called when connectivity of an ongoing streaming has changed. |
set callback to get notified when video resolution has changed for an ongoing stream session
virtual void onReceivedVideoResolutionChange(onReceivedVideoResolutionChangeHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onReceivedVideoResolutionChangeHandler | pointer which will be called when video resolution of an ongoing streaming has changed. |
set callback to get notified when received video specific data
virtual void onReceivedVideoSpecificData(onReceivedVideoSpecificDataHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onReceivedVideoSpecificDataHandler | pointer which will be called when video specific data of an ongoing streaming has received. |
Set video recording buffer.
virtual void setRecordingBuffer(int bufferTime, int duration) = 0;
Member | Datatype | Definition |
---|---|---|
bufferTime | int | time of the recording buffer in seconds. |
duration | int | duration of the recording in seconds. |
onStartRecordingHandler will tell if recording is started or not.
virtual bool startRecording(const EndPointUUID &fromEndPoint, time_t referenceTime, time_t actionTime, time_t duration, const std::vector<MediaType> &mediaTypeList, const std::vector<std::string> &sourceList, bool eventTrigger, onStartRecordingHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndPoint | const EndPointUUID & | source endpoint UUID |
referenceTime | time_t | UTC time |
actionTime | time_t | starting time of the recording |
duration | time_t | intended durtation of the recording. Setting it to 0 will cause the recording to continue indefinitely |
mediaTypeList | const std::vector<MediaType> & | media types (audio/video) |
sourceList | const std::vector<std::string> & | Id of the cameras for which recording has to be started |
eventTrigger | bool | if the recording initiated for an event. |
handler | onStartRecordingHandler | pointer for the callback. Note that, this API will be used by both the camera and the application to start the recording. When invoked from the camera the fromEndPoint will be empty. |
Request to stop the recording.
virtual void stopRecording(const EndPointUUID &fromEndPoint, const std::vector<MediaType> &mediaTypeList, onStopRecordingHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndPoint | const EndPointUUID & | source endpoint UUID |
mediaTypeList | const std::vector<MediaType> & | media types |
handler | onStopRecordingHandler | pointer for the callback. |
Request the list of recordings from the endpoint.
virtual void getRecordingList(const EndPointUUID &fromEndPoint, std::time_t startTime, std::time_t endTime, onRecordingListHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndPoint | const EndPointUUID & | source endpoint UUID |
startTime | std::time_t | of the newest recording. |
endTime | std::time_t | of the oldest recording. |
handler | onRecordingListHandler | pointer called when recording list has retrieved. |
Set callback to get notified when a recording completed.
virtual void onRecordingCompleted(onStopRecordingHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onStopRecordingHandler | pointer which will be called when a recording has completed. |
Provide compressed frame. This will send the already encoded frame to the endpoint
virtual int pushEncodedFrame(const EndPointUUID &toEndpoint, MediaType mediaType, void *framePtr, long size, FrameProperties frameProperties, time_t timestamp) = 0;
Member | Datatype | Definition |
---|---|---|
toEndpoint | const EndPointUUID & | stream sink endpoint UUID |
mediaType | MediaType | selected media type |
framePtr | void * | frame data |
size | long | size of the frame |
frameProperties | FrameProperties | properties of the frame |
timestamp | time_t | time stamp of the frame |
Set callback to get notified when a frame received.
virtual void onReceiveFrame(onReceiveFrameHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onReceiveFrameHandler | pointer which will be called when received a frame. |
Set custom Video Quality Table in JSON format.
virtual void setQoSTable(const QoSjson &table) = 0;
Enable or Disable Video Quality Control.
virtual void setQoS(bool enable) = 0;
Member | Datatype | Definition |
---|---|---|
enable | bool | true enables it and false disables it. |
Enable or Disable Audio Acoustic Echo Cancellation.
virtual void setAEC(bool enable) = 0;
Enable or Disable Audio Automatic Gain Control.
virtual void setAGC(bool enable) = 0;
Select video quality profile.
virtual void setVideoQualityProfile(VideoQualityProfile profile) = 0;
This will provide sending media statistics.
virtual void getSendStatistics(const EndPointUUID &toEndpoint, MediaType mediaType, StreamStatistics::Ptr streamStatistics) = 0;
Member | Datatype | Definition |
---|---|---|
toEndpoint | const EndPointUUID & | stream sink endpoint UUID |
mediaType | MediaType | selected media type |
streamStatistics | StreamStatistics::Ptr | statistics of audio sending to endpoint |
This will provide receiving media statistics.
virtual void getReceiveStatistics(const EndPointUUID &fromEndpoint, MediaType mediaType, StreamStatistics::Ptr streamStatistics) = 0;
Member | Datatype | Definition |
---|---|---|
fromEndpoint | const EndPointUUID & | stream source endpoint UUID |
mediaType | MediaType | selected media type |
streamStatistics | StreamStatistics::Ptr | streamStatistics of audio receiving from endpoint |
This will set RawData callback
virtual void setRawDataCallback(onRawDataHandler handler) = 0;
Member | Datatype | Definition |
---|---|---|
handler | onRawDataHandler | callback function for rawdata |
Typedefs Documentation
Following is the detailed documentation of the typedefs declared under the Stream class.
/// Definition of a shared pointer to Stream.
typedef std::shared_ptr<Stream> Ptr;
StreamBuilder
StreamBuilder builds a Stream object.
StreamBuilder builds a Stream object. It will return to
the caller an object which implements the Stream interface.
Private Attributes
<li><a href = "#StreamBuilder@access">access</a></li>
<li><a href = "#StreamBuilder@maxNetworkWaitTime">maxNetworkWaitTime</a></li>
<li><a href = "#StreamBuilder@receiveTimeout">receiveTimeout</a></li>
<li><a href = "#StreamBuilder@logDirectory">logDirectory</a></li>
<li><a href = "#StreamBuilder@pluginLibraryDirectory">pluginLibraryDirectory</a></li>
Private Methods
<li><a href = "#StreamBuilder@StreamBuilder">StreamBuilder</a></li>
Public Methods
<li><a href = "#StreamBuilder@StreamBuilder">StreamBuilder</a></li>
<li><a href = "#StreamBuilder@~StreamBuilder">~StreamBuilder</a></li>
<li><a href = "#StreamBuilder@setAccess">setAccess</a></li>
<li><a href = "#StreamBuilder@getAccess">getAccess</a></li>
<li><a href = "#StreamBuilder@setReceiveTimeout">setReceiveTimeout</a></li>
<li><a href = "#StreamBuilder@getReceiveTimeout">getReceiveTimeout</a></li>
<li><a href = "#StreamBuilder@setMaxNetworkChangeTime">setMaxNetworkChangeTime</a></li>
<li><a href = "#StreamBuilder@getMaxNetworkChangeTime">getMaxNetworkChangeTime</a></li>
<li><a href = "#StreamBuilder@setLogDirectory">setLogDirectory</a></li>
<li><a href = "#StreamBuilder@getLogDirectory">getLogDirectory</a></li>
<li><a href = "#StreamBuilder@setPluginLibraryDirectory">setPluginLibraryDirectory</a></li>
<li><a href = "#StreamBuilder@getPluginLibraryDirectory">getPluginLibraryDirectory</a></li>
<li><a href = "#StreamBuilder@build">build</a></li>
Typedefs
<li><a href = "#StreamBuilder@Ptr">Ptr</a></li>
Private Member Data Documentation
Following is the detailed documentation of the private variables declared under the StreamBuilder class.
com::anyconnect::access::Access::Ptr access;
unsigned int maxNetworkWaitTime;
unsigned int receiveTimeout;
std::string logDirectory;
std::string pluginLibraryDirectory;
Private Member Function Documentation
Following is the detailed documentation of the private methods declared under the StreamBuilder class.
StreamBuilder(const StreamBuilder &rsb) = delete;
Public Member Function Documentation
Following is the detailed documentation of the public methods declared under the StreamBuilder class.
StreamBuilder();
virtual ~StreamBuilder();
Set Access object. Set Access object.
void setAccess(com::anyconnect::access::Access::Ptr access)
Member | Datatype | Definition |
---|---|---|
access | com::anyconnect::access::Access::Ptr | Access object. |
Get Access object.
com::anyconnect::access::Access::Ptr getAccess() const
Return Value: Access object.
Set the timeout for receiving media data. Set the timeout that Stream library will wait for receiving media data before closing any ongoing stream.
void setReceiveTimeout(unsigned int msTime) {receiveTimeout = msTime;}
Member | Datatype | Definition |
---|---|---|
msTime | unsigned int | Time in milliseconds to wait for receiving media data before closing stream. |
Get the timeout for receiving media data. Get the timeout that Stream library will wait for media data before closing any ongoing stream.
unsigned int getReceiveTimeout() const {return receiveTimeout;}
Return Value: unsigned int - Time to wait in milliseconds.
Set the maximum network change time. Set the time that Connect will keep a connection open without an underlying path to get to the endpoint. (For example, if this value is greater than the time it takes to move from Wi-Fi to 4G, then the connection will not close.) The default value is 0, meaning that loss of network results in immediate close of connection.
void setMaxNetworkChangeTime(unsigned int msTime) {maxNetworkWaitTime = msTime;}
Member | Datatype | Definition |
---|---|---|
msTime | unsigned int | Time to wait for a new network path in milliseconds. |
Get the maximum network change time. Get the maximum time that Connect will keep a connection open without an underlying path to reach the endpoint.
unsigned int getMaxNetworkChangeTime() const {return maxNetworkWaitTime;}
Return Value: unsigned int - Time to wait in milliseconds.
Set the logging directory for Stream library. Set the Stream library's logging directory.
void setLogDirectory(const std::string &logDirectory) {this->logDirectory = logDirectory;}
Member | Datatype | Definition |
---|---|---|
logDirectory | const std::string & | log directory where Stream library will write the logs |
Get the Stream library's logging directory.
std::string getLogDirectory() const
Return Value: Stream library's logging directory.
Set the plugin library's directory for Stream library. Set the directory of plugin library for Stream library.
void setPluginLibraryDirectory(const std::string &pluginLibraryDirectory) {this->pluginLibraryDirectory = pluginLibraryDirectory;}
Member | Datatype | Definition |
---|---|---|
pluginLibraryDirectory | const std::string & | event library's directory where the event library is available to be used by Stream library. |
Get the event library's directory.
std::string getPluginLibraryDirectory() const
Return Value: Event library's directory.
Construct a Stream object using the builder.
Stream::Ptr build() throw (std::runtime_error);
Return Value: In success, returns Stream::Ptr containing Stream instance. In failure, returns null Stream::Ptr
Typedefs Documentation
Following is the detailed documentation of the typedefs declared under the StreamBuilder class.
/// Definition of a shared pointer to StreamBuilder.
typedef std::shared_ptr<StreamBuilder> Ptr;
Enum Class Documentation
Following is the description of the enum classes.
/// \brief Stream return states.
/// Defines Stream success and failure states.
enum class StreamRet {
OK, ///< Successful invocation.
NOT_STARTED, ///< Call start() before calling APIs.
INVALID_PARAMETERS, ///< Invalid parameters.
FAIL, ///< Generic failure.
};
/// Supported stream media types: audio, video and image.
enum class MediaType {
AUDIO,
VIDEO,
IMAGE
};
/// Supported video resolutions.
enum class VideoResolution {
WH_176x144,
WH_192x144,
WH_320x240,
WH_352x288,
WH_640x400,
WH_640x480,
WH_840x480,
WH_848x480,
WH_1280x720,
WH_1920x1080,
WH_3840x2160,
WH_7680x4320,
WH_15360x8640
};
/// Supported image formats.
enum class ImageFormat {
BMP,
GIF,
JPEG,
PNG,
RAW,
SVG,
TIFF
};
/// Supported video codecs.
enum class VideoCodec {
H263,
H264,
H264_SVC,
H265,
RAW
};
/// Supported recording trigger types.
enum class RecordingTriggers {
MOTION,
SOUND,
TIME
};
/// Supported video quality profiles.
enum class VideoQualityProfile {
HIGH_FRAME_RATE, // Optimized image quality
STANDARD_QUALITY, // Optimized frame rate and image quality
HIGH_IMAGE_QUALITY // Optimized frame rate
};
/// Supported audio codecs.
enum class AudioCodec {
AAC,
G711,
G722,
OPUS,
SIREN,
SPEEX
};
/// Supported audio sample rates.
enum class SampleRate {
Hz_8K,
Hz_12K,
Hz_16K,
Hz_20K,
Hz_32K,
Hz_48K
};
/// Defines input source states.
enum class InputSourceStatus {
SUCCESS,
BUSY,
NOT_SUPPORTED,
NOT_FOUND,
INVALID,
FAIL
};
/// Indicates stopped/recovering/restarted/restart-failed/retrying state of a stream session.
enum class StreamTransitionState {
STOPPED,
RECOVERING,
RESTARTED,
RESTART_FAILED,
RETRYING,
RUNNING
};
Global Typedefs Documentation
Following is the detailed documentation of the Typedefs which do not belong to any structur class
/// \brief End Point Universally Unique Identifier.
typedef com::anyconnect::access::types::Endpoint EndPointUUID;
/// \brief Recorded media definition.
typedef std::string RecordingURL;
/// \brief Format of the frame.
typedef std::string Format;
/// \brief Structure of the frame.
typedef std::string Structure;
/// \brief QoS values in json format.
typedef std::string QoSjson;
/// Handler function for stopping Stream API session.
typedef std::function<void()> stopHandler;
/// Handler function for stream request.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] status stream request status
typedef std::function<void(const EndPointUUID &fromEndPoint, const int &status)> onStreamRequestHandler;
/// Handler function for stream receive.
/// \param[in] toEndPoint - stream sink endpoint UUID
/// \param[in] mediaType - selected media type
/// \return True - to accept the requested stream
/// False - to reject the requested stream
typedef std::function<bool(const EndPointUUID &toEndPoint, MediaType mediaType)> onStreamReceiveHandler;
/// Handler function for stream start.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] connectionType stream's connection type
typedef std::function<bool(const EndPointUUID &fromEndPoint, const std::string& connectionType)> onStreamStartHandler;
/// Handler function for stream stop.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] status stream stop status
typedef std::function<void(const EndPointUUID &fromEndPoint, const int &status)> onStreamStopHandler;
/// Handler function for stream pause.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] mediaTypeList selected media types
/// \param[in] status stream pause status
typedef std::function<void(const EndPointUUID &fromEndPoint, const std::vector<MediaType> &mediaTypeList, const int &status)> onStreamPauseHandler;
/// Handler function for stream resume.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] mediaTypeList selected media types
/// \param[in] status stream resume status
typedef std::function<void(const EndPointUUID &fromEndPoint, const std::vector<MediaType> &mediaTypeList, const int &status)> onStreamResumeHandler;
/// Handler function for stream connectivity transition.
typedef std::function<void(const EndPointUUID &fromEndpoint, const StreamTransitionState streamTransitionState, const std::string &connectionType)> onStreamConnectivityChangeHandler;
/// Handler function to notify video resolution change.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] updatedVideoResolution updated video resolution.
typedef std::function<void(const EndPointUUID &fromEndpoint, VideoResolution &updatedVideoResolution)> onReceivedVideoResolutionChangeHandler;
/// Handler function to notify video specific data received.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] timestamp - time stamp of the video frame
/// \param[in] data - video specific data
typedef std::function<void(const EndPointUUID &fromEndpoint, uint32_t &ssrc, time_t timestamp, const std::string &data)> onReceivedVideoSpecificDataHandler;
/// Handler function for start recording.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] status requested recording status
typedef std::function<bool(const EndPointUUID &fromEndPoint, const int &status)> onStartRecordingHandler;
/// Handler function for stop recording.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] status recording status
typedef std::function<void(const EndPointUUID &fromEndPoint, const int &status)> onStopRecordingHandler;
/// Handler function for recording list.
/// \param[in] fromEndPoint stream source endpoint UUID
/// \param[in] recordingList List of recording URL
typedef std::function<void(const EndPointUUID &fromEndPoint, const std::map<MediaType, const std::vector<RecordingURL>> &recordingList)> onRecordingListHandler;
/// Handler function for receive frame.
/// \param[in] fromEndpoint - stream source endpoint UUID
/// \param[in] mediaType - media type of the frame
/// \param[in] framePtr - frame data
/// \param[in] size - size of the frame
/// \param[in] frameProperties - properties of the frame
/// \param[in] timestamp - time stamp of the frame
typedef std::function<void(const EndPointUUID &fromEndpoint, MediaType mediaType, void *framePtr, long size, FrameProperties frameProperties, time_t timestamp)> onReceiveFrameHandler;
/// Handler function for set input sources.
/// \param[in] inputSourceList List of input sources
/// \param[in] status List of input sources status
typedef std::function<void(const std::vector<std::string> &inputSourceList, const std::vector<InputSourceStatus> &status)> onSetInputSourcesHandler;
/// Handler function for RawData
/// \param[in] Buffer for Rawdata
typedef std::function<void(RingBuffer buffer)> onRawDataHandler;
Updated over 2 years ago