IOTC Platform  Ver: 4.3.6.2-0-ge1f616e
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
VSaaS.h File Reference
#include "AVCommon.h"

Data Structures

struct  VSaaSContractInfo
 

Typedefs

typedef enum VSaaSType VSaaSType
 
typedef enum VSaaSContractType VSaaSContractType
 
typedef enum VSaaSPullStreamType VSaaSPullStreamType
 
typedef struct VSaaSContractInfo VSaaSContractInfo
 
typedef void(__stdcall * OnVSaaSConfigChangedCb )(const char *VSaaSconfig)
 
typedef void(__stdcall * OnVSaaSUpdateContractInfoCb )(const VSaaSContractInfo *ContractInfo)
 

Enumerations

enum  VSaaSType { VSAAS_AWS, VSAAS_ALI }
 
enum  VSaaSContractType { VSAAS_UNKNOWN_TYPE, VSAAS_FULLTIME, VSAAS_EVENT }
 
enum  VSaaSPullStreamType { VSAAS_EVENT_GENERAL = 999 }
 

Functions

int32_t avEnableVSaaS (const char *udid, const char *VSaaSconfig, OnVSaaSConfigChangedCb config_callback, OnVSaaSUpdateContractInfoCb contract_callback)
 After Enabling VSaaS event notification, device can send notification to server and ask server to pull streaming by AVAPI.
 
int32_t avServNotifyCloudRecordStream (TUTKJsonObject *attr_obj, uint32_t timeout_msec, uint32_t *abort_flag)
 Sending event notification to TUTK cloud and asking cloud to pull streaming.
 

Detailed Description

This file describes AV module APIs for VSaaS.

Typedef Documentation

typedef void(__stdcall * OnVSaaSConfigChangedCb)(const char *VSaaSconfig)

The prototype of VSaaS configuration callback function used for AV server. The configuration function must be set in avEnableVSaaS. This function will be called while receiving VSaaS configuration in json format from av client.

Parameters
VSaaSconfig[in] The VSaaS configuration that user need to keep it in the storage.
typedef void(__stdcall * OnVSaaSUpdateContractInfoCb)(const VSaaSContractInfo *ContractInfo)

The prototype of VSaaS contractinfo callback function used for AV server. The update contractinfo function must be set in avEnableVSaaS. This function will be called while receiving VSaaS pull stream message in json format from VSaaS server.

Parameters
ContractInfo[in] current VSaaS contractinfo.

The VSaaS contract information and the video format requested by VSaaS server

Parameters
cb[in] The check byte of this structure.
contract_type[out] The user's contract type of VSaaS.(event, fulltime)
event_recording_max_sec[out] The max length of event recording video in sec.
video_max_fps[out] The max fps of video.
recording_max_kbps[out] The max kbps fo recording.
video_max_high[out] The max height of video.
video_max_width[out] two max width of video.
typedef enum VSaaSType VSaaSType

Enumeration Type Documentation

Enumerator:
VSAAS_UNKNOWN_TYPE 
VSAAS_FULLTIME 
VSAAS_EVENT 
Enumerator:
VSAAS_EVENT_GENERAL 
enum VSaaSType
Enumerator:
VSAAS_AWS 
VSAAS_ALI 

Function Documentation

int32_t avEnableVSaaS ( const char *  udid,
const char *  VSaaSconfig,
OnVSaaSConfigChangedCb  config_callback,
OnVSaaSUpdateContractInfoCb  contract_callback 
)

After Enabling VSaaS event notification, device can send notification to server and ask server to pull streaming by AVAPI.

This function is used by device to enable VSaaS server pulling stream. This function must be called before avInitialize().

Parameters
udid[in] The udid of device.
VSaaSconfig[in] The information that can connect to VSaas server. You can get this from the registed OnVSaaSConfigChangedCb. This param can be NULL if you never get information by OnVSaaSConfigChangedCb before.
config_callback[in] This callback function will be called while receiving VSaaSconfig from av client.
contract_callback[in] This callback function will be called while receiving pullstream message from VSaaS server.
Returns
AV_ER_NoERROR if enable VSaaS pulling stream successfully.
Error code if return value < 0
Attention
VSaaSconfig can be NULL if you never get information by OnVSaaSConfigChangedCb before.
This function must be called before avInitialize().
int32_t avServNotifyCloudRecordStream ( TUTKJsonObject attr_obj,
uint32_t  timeout_msec,
uint32_t *  abort_flag 
)

Sending event notification to TUTK cloud and asking cloud to pull streaming.

This function is used by device to notify TUTK cloud of pulling stream by AVAPI. This function must be called after avEnableVSaaS() or avEnableVSaaSByNebula().

Parameters
attr_obj[in] the information of event which including event type and timestamp.
timeout_sec[in] timeout of this function.
abort_flag[in] set *abort_flag to 1 if you need to abort this function
Returns
AV_ER_NoERROR if notify TUTK cloud successfully.
Error code if return value < 0
See Also
avEnableVSaaS()