Data Structures | |
struct | AvIdentity |
Typedefs | |
typedef enum AvSecurityMode | AvSecurityMode |
typedef enum AvAuthType | AvAuthType |
typedef struct AvIdentity | AvIdentity |
Enumerations | |
enum | AVIOCtrlType { IOTYPE_INNER_SND_DATA_DELAY = 0xFF, IOTYPE_INNER_STATISTICAL_DATA = 0x01, IOTYPE_INNER_STATISTICAL_CLIENT_DATA = 0x02, IOTYPE_USER_DEFINED_START = 0x100 } |
enum | AvSecurityMode { AV_SECURITY_SIMPLE, AV_SECURITY_DTLS, AV_SECURITY_AUTO } |
enum | AvAuthType { AV_AUTH_PASSWORD, AV_AUTH_TOKEN, AV_AUTH_NEBULA } |
Functions | |
AVAPI_API_DEPRECATED int32_t | avGetAVApiVer (void) |
Get the version of AV module. | |
const char * | avGetAVApiVersionString (void) |
Get the version of AV module. | |
int32_t | avInitialize (int32_t nMaxChannelNum) |
Initialize AV module. | |
int32_t | avDeInitialize (void) |
Deinitialize AV module. | |
int32_t | avSendFrameData (int32_t nAVChannelID, const char *cabFrameData, int32_t nFrameDataSize, const void *cabFrameInfo, int32_t nFrameInfoSize) |
An AV server sends frame data to an AV client. | |
int32_t | avSendAudioData (int32_t nAVChannelID, const char *cabAudioData, int32_t nAudioDataSize, const void *cabFrameInfo, int32_t nFrameInfoSize) |
An AV server sends audio data to an AV client. | |
int32_t | avRecvFrameData2 (int32_t nAVChannelID, char *abFrameData, int32_t nFrameDataMaxSize, int32_t *pnActualFrameSize, int32_t *pnExpectedFrameSize, char *abFrameInfo, int32_t nFrameInfoMaxSize, int32_t *pnActualFrameInfoSize, uint32_t *pnFrameIdx) |
A new version AV client receives frame data from an AV server. | |
int32_t | avRecvAudioData (int32_t nAVChannelID, char *abAudioData, int32_t nAudioDataMaxSize, char *abFrameInfo, int32_t nFrameInfoMaxSize, uint32_t *pnFrameIdx) |
An AV client receives audio data from an AV server. | |
int32_t | avSendIOCtrl (int32_t nAVChannelID, uint32_t nIOCtrlType, const char *cabIOCtrlData, int32_t nIOCtrlDataSize) |
Send AV IO control. | |
int32_t | avRecvIOCtrl (int32_t nAVChannelID, uint32_t *pnIOCtrlType, char *abIOCtrlData, int32_t nIOCtrlMaxDataSize, uint32_t nTimeout) |
Receive AV IO control. | |
int32_t | avSendIOCtrlExit (int32_t nAVChannelID) |
Used by an AV server or an AV client to exit sending IO control process. | |
AVAPI_API_DEPRECATED void | AV_Set_Log_Path (char *path, int32_t nMaxSize) |
Set path of log file. | |
int32_t | AV_Set_Log_Attr (LogAttr logAttr) |
Set Attribute of log file. | |
int32_t | avSetAudioLostCondition (int32_t nAVChannelID, int32_t lostCondition) |
Set Audio Lost Condition. | |
This file describes common AV module APIs of server and client.
#define AV_ER_ALREADY_INITIALIZED -20031 |
AV module is already initialized. It is not necessary to re-initialize.
#define AV_ER_BUFPARA_MAXSIZE_INSUFF -20001 |
The buffer to receive is too small to store
#define AV_ER_CANNOT_FIND_CIPHER -22181 |
Cannot find any cipher suites for DTLS handshaking, please check if the parameter dtls_cipher_suites of avClientStartEx or avServStartEx is set as NULL
#define AV_ER_CLEANBUF_ALREADY_CALLED -20029 |
The AV channel of specified AV channel ID is already in reset buffer process
#define AV_ER_CLIENT_EXIT -20018 |
The AV client API process is terminated by avClientExit() or avClientStop()
#define AV_ER_CLIENT_NO_AVLOGIN -20008 |
An AV client does not call avClientStart() yet
#define AV_ER_CLIENT_NOT_SUPPORT -20020 |
By design, an AV client cannot send frame and audio data to an AV server
#define AV_ER_DASA_CLEAN_BUFFER -20032 |
Dynamic Adaptive Streaming over AVAPI notified program to clean buffer
#define AV_ER_DATA_NOREADY -20012 |
The data is not ready for receiving yet.
#define AV_ER_DTLS_AUTH_FAIL -20041 |
The server fail in authentication due to the passowrd/token auth function return value is smaller than 0
#define AV_ER_DTLS_WRONG_PWD -20040 |
The server fail in authentication due to incorrect password/token with DTLS security mode enabled
#define AV_ER_EXCEED_MAX_ALARM -20005 |
A warning error code to indicate that the sending queue of video frame of an AV server is almost full, probably caused by slow handling of an AV client or network issue. Please note that this is just a warning, the video frame is actually put in the queue.
#define AV_ER_EXCEED_MAX_CHANNEL -20002 |
The number of AV channels has reached maximum. The maximum number of AV channels is determined by the passed-in argument of avInitialize()
#define AV_ER_EXCEED_MAX_SIZE -20006 |
The frame to be sent exceeds the currently remaining video frame buffer. The maximum of video frame buffer is controlled by avServSetResendSize()
#define AV_ER_FAIL_CONNECT_TO_VSAAS -20043 |
Device can't connect to VSaaS Server by https
#define AV_ER_FAIL_CREATE_DTLS -20035 |
AV fails to create channel for DTLS connection.
#define AV_ER_FAIL_CREATE_THREAD -20004 |
AV fails to create threads. Please check if OS has ability to create threads for AV.
#define AV_ER_FAIL_INITIALIZE_DTLS -20034 |
AV fails to initialize DTLS module.
#define AV_ER_HTTP_ERROR -20048 |
An error occurred during the http connection
#define AV_ER_INCOMPLETE_FRAME -20013 |
Some parts of a frame are lost during receiving
#define AV_ER_INVALID_ARG -20000 |
The passed-in arguments for the function are incorrect
#define AV_ER_INVALID_SID -20010 |
The IOTC session of specified AV channel is not valid
#define AV_ER_IOTC_CHANNEL_IN_USED -20027 |
IOTC channel is used by other av channel
#define AV_ER_IOTC_DEINITIALIZED -20026 |
IOTC is deinitialized
#define AV_ER_IOTC_SESSION_CLOSED -20025 |
IOTC session has been closed
#define AV_ER_LOCAL_NOT_SUPPORT_DTLS -20049 |
The client fail because server require DTLS
#define AV_ER_LOSED_THIS_FRAME -20014 |
The whole frame is lost during receiving
#define AV_ER_MEM_INSUFF -20003 |
Insufficient memory for allocation
#define AV_ER_NO_CLOUD_RECORD_URL -20050 |
The cloud recording endpoint url not set
#define AV_ER_NO_NOTIFICATION_LIST -20047 |
No notification settings
#define AV_ER_NO_PERMISSION -20023 |
The UID is a lite UID
#define AV_ER_NoERROR 0 |
The function is performed successfully.
#define AV_ER_NOT_INITIALIZED -20019 |
AV module has not been initialized
#define AV_ER_NOT_SUPPORT -20033 |
Function is not support, need to using correct AV Server and AV Client
#define AV_ER_PARSE_JSON_FAIL -20044 |
This JSON format cannot be parsed
#define AV_ER_PUSH_NOTIFICATION_ALREADY_ENABLED -20046 |
Push notification already enabled
#define AV_ER_PUSH_NOTIFICATION_NOT_ENABLE -20045 |
Push notification does not enable
#define AV_ER_REMOTE_NOT_SUPPORT -20037 |
Function is not supported on remote side.
#define AV_ER_REMOTE_NOT_SUPPORT_DTLS -20039 |
The server fail because client not support DTLS
#define AV_ER_REMOTE_TIMEOUT_DISCONNECT -20016 |
This IOTC session is disconnected because remote site has no any response after a specified timeout expires.
#define AV_ER_REQUEST_ALREADY_CALLED -20036 |
The AV channel of specified AV channel ID is already in request process
#define AV_ER_SDK_NOT_SUPPORT_DTLS -21334 |
The SDK Version not support DTLS
#define AV_ER_SENDIOCTRL_ALREADY_CALLED -20021 |
The AV channel of specified AV channel ID is already in sending IO control process
#define AV_ER_SENDIOCTRL_EXIT -20022 |
The sending IO control process is terminated by avSendIOCtrlExit()
#define AV_ER_SERV_NO_RESPONSE -20007 |
The specified AV server has no response
#define AV_ER_SERVER_EXIT -20017 |
The AV server API process is terminated by avServExit() or avServStop()
#define AV_ER_SESSION_CLOSE_BY_REMOTE -20015 |
The remote site already closes the IOTC session. Please call IOTC_Session_Close() to release local IOTC session resource
#define AV_ER_SOCKET_QUEUE_FULL -20030 |
IOTC UDP/TCP socket send queue is full.
#define AV_ER_TIMEOUT -20011 |
The specified timeout has expired during some operation
#define AV_ER_TOKEN_EXCEED_MAX_SIZE -20038 |
The token to be sent exceeds MAX_TOKEN_LENGTH.
#define AV_ER_VSAAS_CONTRACT_NOT_FOUND -20107 |
VSaaS server return contract not found
#define AV_ER_VSAAS_INVALID_BINDING -20103 |
VSaaS server return invalid binding
#define AV_ER_VSAAS_INVALID_CONTRACT -20104 |
VSaaS server return invalid contract
#define AV_ER_VSAAS_INVALID_DEVICE -20102 |
VSaaS server return invalid device
#define AV_ER_VSAAS_INVALID_PARAMETER -20101 |
VSaaS server return invalid parameter
#define AV_ER_VSAAS_INVALID_START_TIME_FORMAT -20106 |
VSaaS server return invalid start time format
#define AV_ER_VSAAS_INVALID_START_TIME_RANGE -20105 |
VSaaS server return invalid start time range
#define AV_ER_VSAAS_PULLING_NOT_ENABLE -20042 |
Device don't enable VSaaS pulling
#define AV_ER_VSAAS_UNEXPECTED_ERROR -20100 |
VSaaS server return unexpected error code
#define AV_ER_WAIT_KEY_FRAME -20028 |
AV channel is waiting key frame
#define AV_ER_WRONG_ACCPWD_LENGTH -20024 |
The length of password is wrong
#define AV_ER_WRONG_VIEWACCorPWD -20009 |
The client fails in authentication due to incorrect view account or password
#define AV_MAX_AUDIO_DATA_SIZE 1280 |
The maximum size of audio data to be sent, in unit of byte.
#define AV_MAX_IOCTRL_DATA_SIZE 1024 |
The maximum size of AV IO Control data to be sent, in unit of byte.
#define AVAPI_API_DEPRECATED |
#define MAX_IDENTITY_DESCRIPTION_LENGTH 127 |
The maximum length of identity description, exclude the Null character '\0', in unit of byte.
#define MAX_IDENTITY_LENGTH 119 |
The maximum length of identity, exclude the Null character '\0', in unit of byte. If DTLS security mode is enabled, or auth type is set to AV_AUTH_TOKEN, the the max lenth of account or identity should not exceed this value.
#define MAX_PLAYBACK_FILENAME_LENGTH 128 |
The maximum length of timestamp, exclude the Null character character '\0', in unit of byte.
#define MAX_TIMESTAMP_LENGTH 16 |
The maximum length of timestamp, exclude the Null character character '\0', in unit of byte.
#define MAX_TOKEN_LENGTH 1024 |
The maximum length of token, exclude the Null character character '\0', in unit of byte.
#define NEW_MAXSIZE_VIEWACC 257 |
The maximum length of account, include the Null character '\0', in unit of byte. If security mode is AV_SECURITY_SIMPLE, or avClientStart/avClientStart2 is used, the the max lenth of account should not exceed this value.
#define NEW_MAXSIZE_VIEWPWD 257 |
The maximum length of password, include the Null character '\0', in unit of byte.
#define OLD_MAXSIZE_VIEWACC 16 |
#define OLD_MAXSIZE_VIEWPWD 16 |
typedef enum AvAuthType AvAuthType |
typedef struct AvIdentity AvIdentity |
typedef enum AvSecurityMode AvSecurityMode |
enum AvAuthType |
enum AVIOCtrlType |
The types for AV IO control. AV IO control are used for AV servers and AV clients to communicate control message with each other. The types contains system defined types and user defined ones. The range of system defined types is from 0x00 to 0xFF, while user defined ones is starting from 0x100.
IOTYPE_INNER_SND_DATA_DELAY |
Used by AV clients to tell AV servers to change the time interval of sending packets by avSendFrameData() when AV clients are too slow to handle frame data. |
IOTYPE_INNER_STATISTICAL_DATA |
Used by AV servers to tell AV clients statistical data. |
IOTYPE_INNER_STATISTICAL_CLIENT_DATA |
Used by AV clients to tell AV servers statistical data. |
IOTYPE_USER_DEFINED_START |
The starting enum value of user defined IO types. It is suggested to assign this to the first one of user defined types, like |
enum AvSecurityMode |
int32_t AV_Set_Log_Attr | ( | LogAttr | logAttr | ) |
Set Attribute of log file.
logAttr | [in] See LogAttr |
AVAPI_API_DEPRECATED void AV_Set_Log_Path | ( | char * | path, |
int32_t | nMaxSize | ||
) |
Set path of log file.
Set the absolute path of log file
path | [in] The path of log file, NULL = disable Log |
nMaxSize | [in] The maximum size of log file in Bytes, 0 = unlimit |
int32_t avDeInitialize | ( | void | ) |
Deinitialize AV module.
This function will deinitialize AV module.
AVAPI_API_DEPRECATED int32_t avGetAVApiVer | ( | void | ) |
Get the version of AV module.
This function returns the version of AV module.
const char* avGetAVApiVersionString | ( | void | ) |
Get the version of AV module.
This function returns the version of AV module.
int32_t avInitialize | ( | int32_t | nMaxChannelNum | ) |
Initialize AV module.
This function is used by AV servers or AV clients to initialize AV module and shall be called before any AV module related function is invoked.
nMaxChannelNum | [in] The max number of AV channels. If it is specified less than 1, AV will set max number of AV channels as 1. |
int32_t avRecvAudioData | ( | int32_t | nAVChannelID, |
char * | abAudioData, | ||
int32_t | nAudioDataMaxSize, | ||
char * | abFrameInfo, | ||
int32_t | nFrameInfoMaxSize, | ||
uint32_t * | pnFrameIdx | ||
) |
An AV client receives audio data from an AV server.
An AV client uses this function to receive audio data from AV server
nAVChannelID | [in] The channel ID of the AV channel to be received |
abAudioData | [out] The audio data to be received |
nAudioDataMaxSize | [in] The max size of the audio data |
abFrameInfo | [out] The audio frame information to be received |
nFrameInfoMaxSize | [in] The max size of the audio frame information |
pnFrameIdx | [out] The index of current receiving audio frame |
int32_t avRecvFrameData2 | ( | int32_t | nAVChannelID, |
char * | abFrameData, | ||
int32_t | nFrameDataMaxSize, | ||
int32_t * | pnActualFrameSize, | ||
int32_t * | pnExpectedFrameSize, | ||
char * | abFrameInfo, | ||
int32_t | nFrameInfoMaxSize, | ||
int32_t * | pnActualFrameInfoSize, | ||
uint32_t * | pnFrameIdx | ||
) |
A new version AV client receives frame data from an AV server.
An AV client uses this function to receive frame data from AV server
nAVChannelID | [in] The channel ID of the AV channel to be received |
abFrameData | [out] The frame data to be received |
nFrameDataMaxSize | [in] The max size of the frame data |
pnActualFrameSize | [in] The actual size of frame data to be received, maybe less than expected size |
pnExpectedFrameSize | [in] The size of frame data expect to be received that sent from av server |
abFrameInfo | [out] The video frame information to be received |
nFrameInfoMaxSize | [in] The max size of the video frame information |
pnActualFrameInfoSize | [in] The actual size of the video frame information to be received |
pnFrameIdx | [out] The index of current receiving video frame |
int32_t avRecvIOCtrl | ( | int32_t | nAVChannelID, |
uint32_t * | pnIOCtrlType, | ||
char * | abIOCtrlData, | ||
int32_t | nIOCtrlMaxDataSize, | ||
uint32_t | nTimeout | ||
) |
Receive AV IO control.
This function is used by AV servers or AV clients to receive a AV IO control.
nAVChannelID | [in] The channel ID of the AV channel to receive IO control |
pnIOCtrlType | [out] The type of received IO control |
abIOCtrlData | [out] The buffer of received IO control data |
nIOCtrlMaxDataSize | [in] The max length of buffer of received IO control data |
nTimeout | [in] The timeout for this function in unit of million-second, give 0 means return immediately |
int32_t avSendAudioData | ( | int32_t | nAVChannelID, |
const char * | cabAudioData, | ||
int32_t | nAudioDataSize, | ||
const void * | cabFrameInfo, | ||
int32_t | nFrameInfoSize | ||
) |
An AV server sends audio data to an AV client.
An AV server uses this function to send audio data to AV client
nAVChannelID | [in] The channel ID of the AV channel to be sent |
cabAudioData | [in] The audio data to be sent |
nAudioDataSize | [in] The size of the audio data |
cabFrameInfo | [in] The audio frame information to be sent |
nFrameInfoSize | [in] The size of the audio frame information |
int32_t avSendFrameData | ( | int32_t | nAVChannelID, |
const char * | cabFrameData, | ||
int32_t | nFrameDataSize, | ||
const void * | cabFrameInfo, | ||
int32_t | nFrameInfoSize | ||
) |
An AV server sends frame data to an AV client.
An AV server uses this function to send frame data to AV client
nAVChannelID | [in] The channel ID of the AV channel to be sent |
cabFrameData | [in] The frame data to be sent |
nFrameDataSize | [in] The size of the frame data |
cabFrameInfo | [in] The video frame information to be sent |
nFrameInfoSize | [in] The size of the video frame information |
int32_t avSendIOCtrl | ( | int32_t | nAVChannelID, |
uint32_t | nIOCtrlType, | ||
const char * | cabIOCtrlData, | ||
int32_t | nIOCtrlDataSize | ||
) |
Send AV IO control.
This function is used by AV servers or AV clients to send a AV IO control.
nAVChannelID | [in] The channel ID of the AV channel to send IO control |
nIOCtrlType | [in] The type of IO control |
cabIOCtrlData | [in] The buffer of IO control data |
nIOCtrlDataSize | [in] The length of IO control data |
int32_t avSendIOCtrlExit | ( | int32_t | nAVChannelID | ) |
Used by an AV server or an AV client to exit sending IO control process.
Since avSendIOCtrl() process is a block process and that means the caller has to wait for the acknowledgment from the receipt before avSendIOCtrl() returns. In some cases, caller may want to exit sending immediately by this function in another thread.
nAVChannelID | [in] The channel ID of the AV channel in sending IO control |
int32_t avSetAudioLostCondition | ( | int32_t | nAVChannelID, |
int32_t | lostCondition | ||
) |
Set Audio Lost Condition.
lostCondition | [in] maximum audio frame number different using in check audio lost |