Amazon Kinesis Webrtc C SDK
FileCache.h
Go to the documentation of this file.
1 /*******************************************
2 Signaling internal include file
3 *******************************************/
4 #ifndef __KINESIS_VIDEO_WEBRTC_FILE_CACHE__
5 #define __KINESIS_VIDEO_WEBRTC_FILE_CACHE__
6 
7 #pragma once
8 
9 #ifdef __cplusplus
10 extern "C" {
11 #endif
12 
13 /* If SignalingFileCacheEntry layout is changed, change the version in cache file name so we wont read from older
14  * cache file. */
15 #define DEFAULT_CACHE_FILE_PATH (PCHAR) "./.SignalingCache_v0"
16 #define MAX_SIGNALING_CACHE_ENTRY_TIMESTAMP_STR_LEN 10
17 /* Max length for a serialized signaling cache entry. 8 accounts for 6 commas and 1 newline
18  * char and null terminator */
19 #define MAX_SERIALIZED_SIGNALING_CACHE_ENTRY_LEN \
20  MAX_CHANNEL_NAME_LEN + MAX_ARN_LEN + MAX_REGION_NAME_LEN + MAX_SIGNALING_ENDPOINT_URI_LEN * 2 + MAX_SIGNALING_CACHE_ENTRY_TIMESTAMP_STR_LEN + 8
21 #define MAX_SIGNALING_CACHE_ENTRY_COUNT 32
22 #define SIGNALING_FILE_CACHE_ROLE_TYPE_MASTER_STR "Master"
23 #define SIGNALING_FILE_CACHE_ROLE_TYPE_VIEWER_STR "Viewer"
24 
25 typedef struct {
28  CHAR storageEnabled[2];
29  CHAR channelName[MAX_CHANNEL_NAME_LEN + 1];
30  CHAR channelArn[MAX_ARN_LEN + 1];
31  CHAR region[MAX_REGION_NAME_LEN + 1];
32  CHAR httpsEndpoint[MAX_SIGNALING_ENDPOINT_URI_LEN + 1];
33  CHAR wssEndpoint[MAX_SIGNALING_ENDPOINT_URI_LEN + 1];
34  CHAR storageStreamArn[MAX_ARN_LEN + 1];
35  CHAR webrtcEndpoint[MAX_SIGNALING_ENDPOINT_URI_LEN + 1];
37 
38 STATUS deserializeSignalingCacheEntries(PCHAR, UINT64, PSignalingFileCacheEntry, PUINT32, PCHAR);
41 
42 #ifdef __cplusplus
43 }
44 #endif
45 #endif /* __KINESIS_VIDEO_WEBRTC_FILE_CACHE__ */
STATUS deserializeSignalingCacheEntries(PCHAR, UINT64, PSignalingFileCacheEntry, PUINT32, PCHAR)
Definition: FileCache.c:27
STATUS signalingCacheLoadFromFile(PCHAR, PCHAR, SIGNALING_CHANNEL_ROLE_TYPE, PSignalingFileCacheEntry, PBOOL, PCHAR)
Definition: FileCache.c:127
struct SignalingFileCacheEntry * PSignalingFileCacheEntry
STATUS signalingCacheSaveToFile(PSignalingFileCacheEntry, PCHAR)
Definition: FileCache.c:176
#define MAX_SIGNALING_ENDPOINT_URI_LEN
Definition: Include.h:461
#define MAX_CHANNEL_NAME_LEN
Definition: Include.h:439
SIGNALING_CHANNEL_ROLE_TYPE
Channel role type.
Definition: Include.h:927
Definition: FileCache.h:25
UINT64 creationTsEpochSeconds
Definition: FileCache.h:27
SIGNALING_CHANNEL_ROLE_TYPE role
Definition: FileCache.h:26