EdgeVisDecoderSDK::GOPDownloadService Class Reference

Detailed Description

The GOP Download Service handles the download of GOPs (Group of Pictures) from the edge archive of supported encoders.

This allows the footage to be downloaded at its original recorded quality.

The bandwidth at which the GOPs are downloaded can be set.

The GOP download service differs from the ArchiveExporter service in that it allows specific time periods to be downloaded without the need to download an entire file. Also, the downloaded GOP data does not need decrypted or extracted from the CSX container as this is performed at the Encoder.

The GOPDownloadService is both a service (can be used by only 1 application at a time) and a stream (data provider). This interface extends the Stream interface and includes all methods and properties from that interface. The StreamType returned by the Type property of Stream is always ST_GOPDownloadService.

Interface

Data callbacks are available via the IGOPDownloadListener

Availability

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

#include <GOPDownloadService.h>

Public Member Functions

DB_EDGEVIS_SDK void SetListener (IGOPDownloadListener *listener)
 Set the listener for the GOP download service. More...
 
DB_EDGEVIS_SDK OpResult DownloadGOPs (int64_t start_ts, int64_t end_ts, int32_t input, int32_t frame_height=0, int32_t frame_step=0, int32_t bitrate=0)
 Request GOP download from the encoder for the given time frame and input. More...
 
DB_EDGEVIS_SDK void AbortDownload ()
 Abort any in-progress GOP download.
 
DB_EDGEVIS_SDK int32_t GetBandwidth ()
 Get the measured bandwidth usage of the GOP download. More...
 
DB_EDGEVIS_SDK OpResult SetTargetBandwidth (int32_t bandwidth)
 Set the target bandwidth usage of the GOP download. More...
 
DB_EDGEVIS_SDK int32_t GetTargetBandwidth ()
 Get the target bandwidth for the GOP download. More...
 
DB_EDGEVIS_SDK OpResult SetTargetBandwidthPercentage (int32_t bandwidthPercentage)
 Sets the target GOP download bandwidth usage percentage. More...
 
DB_EDGEVIS_SDK int32_t GetTargetBandwidthPercentage ()
 Gets the target GOP download bandwidth usage percentage. More...
 
DB_EDGEVIS_SDK bool GetIsHighPriority () const
 Get if high priority is being used for GOP downloads. More...
 
DB_EDGEVIS_SDK bool SetIsHighPriority (const bool high_priority)
 Set whether to use high priority for GOP downloads. More...
 
virtual DB_EDGEVIS_SDK OpResult Start ()
 Starts the GOP download service. More...
 
virtual DB_EDGEVIS_SDK OpResult Stop ()
 Stops the GOP download service. More...
 
- Public Member Functions inherited from EdgeVisDecoderSDK::Stream
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...
 
- Public Member Functions inherited from EdgeVisDecoderSDK::Service
DB_EDGEVIS_SDK std::wstring ServiceName () const
 Gets the name of the Service. More...
 
void UpdateState (ServiceState state, std::wstring user)
 Updates the service's state. More...
 
DB_EDGEVIS_SDK bool Started () const
 Determines whether the service has been started or not. More...
 
DB_EDGEVIS_SDK int32_t KeepAliveInterval () const
 Retrieves the keep alive interval for the service. More...
 
DB_EDGEVIS_SDK int32_t IdleTimeoutInterval () const
 Retrieves the idle timeout interval for the service. More...
 
DB_EDGEVIS_SDK void SetIdleTimeoutInterval (int32_t idleTimeout)
 Sets the idle timeout interval for the service. More...
 
DB_EDGEVIS_SDK bool KeepAliveTaskRunning () const
 Determines if the Keep alive task is currently running. More...
 
DB_EDGEVIS_SDK bool IdleTimeoutRunning () const
 Determines if the idle timeout is currently running. More...
 
DB_EDGEVIS_SDK void RegisterListener (IServiceListener *listener)
 Registers the specified listener to be notified when the service state changes. More...
 
DB_EDGEVIS_SDK void UnregisterListener (IServiceListener *listener)
 Removes the specified listener from the set of listeners to be notified about service state changes. More...
 
DB_EDGEVIS_SDK int64_t GetServiceUptime () const
 Retrieve the number of milliseconds since the service was started. More...
 

Member Function Documentation

DB_EDGEVIS_SDK void EdgeVisDecoderSDK::GOPDownloadService::SetListener ( IGOPDownloadListener listener)

Set the listener for the GOP download service.

Class must implement the IGOPDownloadListener

DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::GOPDownloadService::DownloadGOPs ( int64_t  start_ts,
int64_t  end_ts,
int32_t  input,
int32_t  frame_height = 0,
int32_t  frame_step = 0,
int32_t  bitrate = 0 
)

Request GOP download from the encoder for the given time frame and input.

This method allows the GOPs on the encoder to be transcoded in real-time into the requested dimensions. Typical values for the frame_height would be 720, 576, 480, 360. The aspect ratio of the original footage is maintained, either 16:9 or 4:3. Transcoding of GOPs may be available for some encoder types. If transcoding is desired, all transcoding related parameters must be non-zero and within the valid ranges. The frame height is the frame height to use for the transcoded footage, the value must be in the range 160-1080 fps, or 0 if not transcoding. The frame rate is the frames/sec of the transcoded footage, the value must be in the range 1-30 fps, or 0 if not transcoding. The bitrate is bits/sec of the transcoded footage, the value must be in the range 2000-2000000 bits/sec, or 0 if not transcoding. Setting a value of 0 for the frame_height, frame_step and bitrate will preserve the quality of the original recorded footage.

Parameters
start_tsThe UTC timestamp in milliseconds for the start of the GOP download.
end_tsThe UTC timestamp in milliseconds for the end of the GOP download.
inputThe video input to download the GOPs for.
frame_heightThe frame height of the transcoded GOP. Use 0 (default parameter) for no transcode.
frame_stepThe frame step of the transcoded GOP. With a 30 fps source, step of 1 gives 30fps, step 2 gives 15 fps, etc. Use 0 (default parameter) for no transcode.
bitrateThe bitrate of the transcoded GOP in bits/sec. Use 0 (default parameter) for no transcode.
Returns
opResult Result of the start download request. This may return OR_NotSupported if transcode parameters are supplied and the Encoder does not support GOP transcoding. OR_InvalidParameter may also be returned if the transcode parameters are inconsistent - if one is non-zero they must all be non-zero.
DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::GOPDownloadService::GetBandwidth ( )

Get the measured bandwidth usage of the GOP download.

Returns
The measured bandwidth in bits per second.
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::GOPDownloadService::SetTargetBandwidth ( int32_t  bandwidth)

Set the target bandwidth usage of the GOP download.

Parameters
bandwidthThe measured bandwidth in bits per second. The maximum allowable value is limited by the current configured maximum stream bandwidth value, which can be set in EncoderProfile. The minimum allowable value is 5000.
Returns
opResult Result of the set target bandwidth request.
DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::GOPDownloadService::GetTargetBandwidth ( )

Get the target bandwidth for the GOP download.

Returns
The target bandwidth in bits per second.
DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::GOPDownloadService::SetTargetBandwidthPercentage ( int32_t  bandwidthPercentage)

Sets the target GOP download bandwidth usage percentage.

Parameters
bandwidthThe target GOP download bandwidth usage percentage.
Returns
An OpResult of the request

Sets the target bandwidth percentage for the GOP download. This is limited by the current configured maximum and minimum stream bandwidth values, which can be set in EncoderProfile.

DB_EDGEVIS_SDK int32_t EdgeVisDecoderSDK::GOPDownloadService::GetTargetBandwidthPercentage ( )

Gets the target GOP download bandwidth usage percentage.

Returns
The target GOP download bandwidth usage percentage.

Gets the target bandwidth percentage that a file download will use.

DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::GOPDownloadService::GetIsHighPriority ( ) const

Get if high priority is being used for GOP downloads.

Returns
True if high priority is set, false otherwise.
DB_EDGEVIS_SDK bool EdgeVisDecoderSDK::GOPDownloadService::SetIsHighPriority ( const bool  high_priority)

Set whether to use high priority for GOP downloads.

NOTE: if enabling high pirority GOP downloads please set the GOPDownloadService transport to TT_TCP before starting the service.

Returns
True if value was set correctly, false otherwise. Failing to set the transport to TT_TCP before setting high pirority will result in false.
virtual DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::GOPDownloadService::Start ( )
virtual

Starts the GOP download service.

This must be called before any other method. If the start is successful then the GOP download service will be locked by this user. When the user is finished using the service it must be stopped.

Returns
opResult Result of the start command.

Implements EdgeVisDecoderSDK::Service.

virtual DB_EDGEVIS_SDK OpResult EdgeVisDecoderSDK::GOPDownloadService::Stop ( )
virtual

Stops the GOP download service.

This will release the service for other users to access it.

Returns
opResult Result of the stop command.

Implements EdgeVisDecoderSDK::Service.


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