20 #ifndef __AAMP_DEFINE_H__
21 #define __AAMP_DEFINE_H__
30 #ifdef UNIT_TEST_ENABLED
31 #define AAMP_CFG_PATH "aamp.cfg"
32 #define AAMP_JSON_PATH "aampcfg.json"
34 #define AAMP_CFG_PATH "/opt/aamp.cfg"
35 #define AAMP_JSON_PATH "/opt/aampcfg.json"
39 #define AAMP_VERSION "5.1"
40 #define AAMP_TUNETIME_VERSION 5
43 #define MACRO_TO_STRING(s) X_STR(s)
46 #if defined(REALTEKCE)
47 #define GST_VIDEOBUFFER_SIZE_BYTES_BASE 5242880
49 #define GST_VIDEOBUFFER_SIZE_BYTES_BASE 4194304
51 #define GST_AUDIOBUFFER_SIZE_BYTES_BASE 512000
52 #if defined(CONTENT_4K_SUPPORTED)
53 #define GST_VIDEOBUFFER_SIZE_BYTES (GST_VIDEOBUFFER_SIZE_BYTES_BASE*3)
54 #define GST_AUDIOBUFFER_SIZE_BYTES (GST_AUDIOBUFFER_SIZE_BYTES_BASE*3)
56 #define GST_VIDEOBUFFER_SIZE_BYTES (GST_VIDEOBUFFER_SIZE_BYTES_BASE)
57 #define GST_AUDIOBUFFER_SIZE_BYTES (GST_AUDIOBUFFER_SIZE_BYTES_BASE)
60 #define DEFAULT_ENCODED_CONTENT_BUFFER_SIZE (512*1024)
61 #define MAX_PTS_ERRORS_THRESHOLD 4
62 #define DEFAULT_WAIT_TIME_BEFORE_RETRY_HTTP_5XX_MS (1000)
63 #define MAX_PLAYLIST_CACHE_SIZE (3*1024)
65 #define DEFAULT_ABR_CACHE_LIFE 5000
66 #define DEFAULT_ABR_OUTLIER 5000000
67 #define DEFAULT_ABR_SKIP_DURATION 6
68 #define DEFAULT_ABR_NW_CONSISTENCY_CNT 2
69 #define DEFAULT_BUFFER_HEALTH_MONITOR_DELAY 10
70 #define DEFAULT_BUFFER_HEALTH_MONITOR_INTERVAL 5
71 #define DEFAULT_ABR_CACHE_LENGTH 3
72 #define DEFAULT_REPORT_PROGRESS_INTERVAL 1
73 #define DEFAULT_LICENSE_REQ_RETRY_WAIT_TIME 500
74 #define MIN_LICENSE_KEY_ACQUIRE_WAIT_TIME 500
75 #define DEFAULT_LICENSE_KEY_ACQUIRE_WAIT_TIME 5000
76 #define MAX_LICENSE_ACQ_WAIT_TIME 12000
77 #define DEFAULT_INIT_BITRATE 2500000
78 #define DEFAULT_BITRATE_OFFSET_FOR_DOWNLOAD 500000
79 #define DEFAULT_INIT_BITRATE_4K 13000000
80 #define AAMP_LIVE_OFFSET 15
81 #define AAMP_DEFAULT_PLAYBACK_OFFSET -99999
82 #define AAMP_CDVR_LIVE_OFFSET 30
83 #define MIN_DASH_DRM_SESSIONS 3
85 #define DEFAULT_CACHED_FRAGMENTS_PER_TRACK 3
87 #define DEFAULT_CACHED_FRAGMENTS_PER_TRACK 4
89 #define TRICKPLAY_VOD_PLAYBACK_FPS 4
90 #define TRICKPLAY_LINEAR_PLAYBACK_FPS 8
91 #define DEFAULT_DOWNLOAD_RETRY_COUNT (1)
92 #define DEFAULT_DISCONTINUITY_TIMEOUT 3000
93 #define CURL_FRAGMENT_DL_TIMEOUT 10L
94 #define DEFAULT_STALL_ERROR_CODE (7600)
95 #define DEFAULT_STALL_DETECTION_TIMEOUT (10000)
96 #define DEFAULT_MINIMUM_INIT_CACHE_SECONDS 0
97 #define DEFAULT_MAXIMUM_PLAYBACK_BUFFER_SECONDS 30
98 #define DEFAULT_TIMEOUT_FOR_SOURCE_SETUP (1000)
99 #define MAX_SEG_DRM_DECRYPT_FAIL_COUNT 10
100 #define MAX_SEG_INJECT_FAIL_COUNT 10
101 #define AAMP_USERAGENT_BASE_STRING "Mozilla/5.0 (Linux; x86_64 GNU/Linux) AppleWebKit/601.1 (KHTML, like Gecko) Version/8.0 Safari/601.1 WPE"
102 #define AAMP_USERAGENT_SUFFIX "AAMP/"+AAMP_VERSION
103 #define DEFAULT_AAMP_ABR_THRESHOLD_SIZE (6000)
104 #define DEFAULT_PREBUFFER_COUNT (2)
105 #define AAMP_LOW_BUFFER_BEFORE_RAMPDOWN 10
106 #define AAMP_HIGH_BUFFER_BEFORE_RAMPUP 15
107 #define MAX_DASH_DRM_SESSIONS 30
108 #define MAX_AD_SEG_DOWNLOAD_FAIL_COUNT 2
109 #define FRAGMENT_DOWNLOAD_WARNING_THRESHOLD 2000
110 #define BITRATE_ALLOWED_VARIATION_BAND 500000
111 #define MAX_DIFF_BETWEEN_PTS_POS_MS (3600*1000)
112 #define MAX_SEG_DOWNLOAD_FAIL_COUNT 10
113 #define MAX_DOWNLOAD_DELAY_LIMIT_MS 30000
114 #define MAX_ERROR_DESCRIPTION_LENGTH 128
115 #define MAX_ANOMALY_BUFF_SIZE 256
116 #define MAX_WAIT_TIMEOUT_MS 200
117 #define MAX_INIT_FRAGMENT_CACHE_PER_TRACK 5
118 #define MIN_SEG_DURTION_THREASHOLD (0.25)
119 #define MAX_CURL_SOCK_STORE 10
122 #define AAMP_RATE_TRICKPLAY_MAX 64
123 #define AAMP_NORMAL_PLAY_RATE 1
124 #define AAMP_SLOWMOTION_RATE 0.5
125 #define AAMP_RATE_PAUSE 0
126 #define AAMP_RATE_INVALID INT_MAX
129 #define AAMP_PAUSE_POSITION_POLL_PERIOD_MS (250)
130 #define AAMP_PAUSE_POSITION_INVALID_POSITION (-1)
132 #define STRLEN_LITERAL(STRING) (sizeof(STRING)-1)
133 #define STARTS_WITH_IGNORE_CASE(STRING, PREFIX) (0 == strncasecmp(STRING, PREFIX, STRLEN_LITERAL(PREFIX)))
135 #define MAX_GST_VIDEO_BUFFER_BYTES (GST_VIDEOBUFFER_SIZE_BYTES)
136 #define MAX_GST_AUDIO_BUFFER_BYTES (GST_AUDIOBUFFER_SIZE_BYTES)
138 #define DEFAULT_LATENCY_MONITOR_DELAY 9
139 #define DEFAULT_LATENCY_MONITOR_INTERVAL 6
140 #define DEFAULT_MIN_LOW_LATENCY 3
141 #define DEFAULT_MAX_LOW_LATENCY 9
142 #define DEFAULT_TARGET_LOW_LATENCY 6
143 #define DEFAULT_MIN_RATE_CORRECTION_SPEED 0.90f
144 #define DEFAULT_MAX_RATE_CORRECTION_SPEED 1.10f
145 #define AAMP_NORMAL_LL_PLAY_RATE 1.01f
146 #define DEFAULT_CACHED_FRAGMENT_CHUNKS_PER_TRACK 20
147 #define DEFAULT_ABR_CHUNK_CACHE_LENGTH 10
148 #define DEFAULT_AAMP_ABR_CHUNK_THRESHOLD_SIZE (DEFAULT_AAMP_ABR_THRESHOLD_SIZE)
149 #define DEFAULT_ABR_CHUNK_SPEEDCNT 10
150 #define DEFAULT_ABR_ELAPSED_MILLIS_FOR_ESTIMATE 100
151 #define DEFAULT_ABR_BYTES_TRANSFERRED_FOR_ESTIMATE (512 * 1024)
152 #define MAX_MDAT_NOT_FOUND_COUNT 500
153 #define DEFAULT_CONTENT_PROTECTION_DATA_UPDATE_TIMEOUT 5000
156 #define FOG_MAX_CONCURRENT_DOWNLOADS 4
158 #define AAMP_MAX_EVENT_PRIORITY (-70)
159 #define AAMP_TASK_ID_INVALID 0
162 #define MAX_LICENSE_REQUEST_ATTEMPTS 2
164 #define SECMANGER_DRM_FAILURE 200
165 #define SECMANGER_WM_FAILURE 300
168 #define SECMANGER_DRM_GEN_FAILURE 1
169 #define SECMANGER_SERVICE_TIMEOUT 3
170 #define SECMANGER_SERVICE_CON_FAILURE 4
171 #define SECMANGER_SERVICE_BUSY 5
172 #define SECMANGER_ACCTOKEN_EXPIRED 8
173 #define SECMANGER_ENTITLEMENT_FAILURE 102
176 #define SECMANGER_SPEED_SET_DELAY 500
179 #undef RENDER_FRAMES_IN_APP_CONTEXT
211 AAMP_OPERATOR_SETTING = 1,
212 AAMP_STREAM_SETTING = 2,
213 AAMP_APPLICATION_SETTING = 3,
214 AAMP_TUNE_SETTING = 4,
215 AAMP_DEV_CFG_SETTING = 5,
235 SECMANAGER_CLASS_RESULT_SUCCESS = 0,
236 SECMANAGER_CLASS_RESULT_API_FAIL = 100,
237 SECMANAGER_CLASS_RESULT_DRM_FAIL = 200,
238 SECMANAGER_CLASS_RESULT_WATERMARK_FAIL = 300,
239 SECMANAGER_CLASS_RESULT_SECCLIENT_FAIL = 400,
240 SECMANAGER_CLASS_RESULT_UNDEFINED = 9999
241 } SecManagerResultClassStatusCode;
244 SECMANAGER_SUCCESS = 0,
245 SECMANAGER_SUCCESS_WATERMARK_SESSION_ENGAGED = 100,
246 SECMANAGER_SUCCESS_WATERMARK_NOT_REQUIRED = 101
247 } SecManagerResultSuccessCode;
250 SECMANAGER_REASON_API_INVALID_SESSION_CONFIG = 1,
251 SECMANAGER_REASON_API_INVALID_ASPECT_DIMENSION = 2,
252 SECMANAGER_REASON_API_INVALID_KEY_SYSTEM_PARAM = 3,
253 SECMANAGER_REASON_API_INVALID_DRM_LICENSE_PARAM = 4,
254 SECMANAGER_REASON_API_INVALID_CONTENT_METADATA = 5,
255 SECMANAGER_REASON_API_INVALID_MEDIA_USAGE = 6,
256 SECMANAGER_REASON_API_INVALID_ACCESS_TOKEN = 7,
257 SECMANAGER_REASON_API_INVALID_ACCESS_ATTRIBUTE = 8,
258 SECMANAGER_REASON_API_INVALID_SESSION_ID = 9,
259 SECMANAGER_REASON_API_INVALID_APPLICATION_ID = 10,
260 SECMANAGER_REASON_API_INVALID_EVENT_ID = 11,
261 SECMANAGER_REASON_API_INVALID_CLIENT_ID = 12,
262 SECMANAGER_REASON_API_INVALID_PERCEPTION_ID = 13,
263 SECMANAGER_REASON_API_INVALID_WATERMARK_PARAMETER = 14,
264 SECMANAGER_REASON_API_INVALID_CONTENT_PARAMETER = 15,
265 SECMANAGER_REASON_API_UNDEFINED_ERROR = 9999
266 } SecManagerResultApiCode;
269 SECMANAGER_REASON_DRM_GENERAL_FAILURE = 1,
270 SECMANAGER_REASON_DRM_NO_PLAYBACK_SESSION = 2,
271 SECMANAGER_REASON_DRM_LICENSE_TIMEOUT = 3,
272 SECMANAGER_REASON_DRM_LICENSE_NETWORK_FAIL = 4,
273 SECMANAGER_REASON_DRM_LICENSE_BUSY = 5,
274 SECMANAGER_REASON_DRM_ACCESS_TOKEN_ERROR = 6,
275 SECMANAGER_REASON_DRM_ACCESS_TOKEN_IP_DIFF = 7,
276 SECMANAGER_REASON_DRM_ACCESS_TOKEN_EXPIRED = 8,
277 SECMANAGER_REASON_DRM_DEVICE_TOKEN_EXPIRED = 9,
278 SECMANAGER_REASON_DRM_MAC_TOKEN_MISSING = 10,
279 SECMANAGER_REASON_DRM_MAC_TOKEN_NO_PROV = 11,
280 SECMANAGER_REASON_DRM_MEMORY_ALLOCATION_ERROR = 12,
281 SECMANAGER_REASON_DRM_SECAPI_USAGE_FAILURE = 13,
282 SECMANAGER_REASON_DRM_PERMISSION_DENIED = 100,
283 SECMANAGER_REASON_DRM_RULE_ERROR = 101,
284 SECMANAGER_REASON_DRM_ENTITLEMENT_ERROR = 102,
285 SECMANAGER_REASON_DRM_AUTHENTICATION_FAIL = 103
286 } SecManagerResultDRMCode;