RDK Documentation (Open Sourced RDK Components)
AampConfig.cpp
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2018 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21  * @file AampConfig.cpp
22  * @brief Configuration related Functionality for AAMP
23  */
24 
25 #include "AampConfig.h"
26 #include "_base64.h"
27 #include "base16.h"
28 #include "AampJsonObject.h" // For JSON parsing
29 #include "AampUtils.h"
30 #include "aampgstplayer.h"
31 #include "AampRfc.h"
32 #include <time.h>
33 //////////////// CAUTION !!!! STOP !!! Read this before you proceed !!!!!!! /////////////
34 /// 1. This Class handles Configuration Parameters of AAMP Player , only Config related functionality to be added
35 /// 2. Simple Steps to add a new configuration
36 /// a) Identify new configuration takes what value ( bool / int / long / string )
37 /// b) Add the new configuration string in README.txt with appropriate comment
38 /// c) Add a enum value for new config in AAMPConfigSettings. It should be inserted
39 /// at right place based on data type
40 /// d) Add the config string added in README and its equivalent enum value at the
41 /// end of ConfigLookUpTable
42 /// e) Go to AampConfig constructor and assign default value . Again the array to
43 /// store is based on the datatype of config
44 /// f) Thats it !! You added a new configuration . Use Set and Get function to
45 /// store and read value using enum config
46 /// g) IF any conversion required only (from config to usage, ex: sec to millisec ),
47 /// add specific Get function for each config
48 /// Not recommened . Better to have the conversion ( enum to string , sec to millisec etc ) where its consumed .
49 ///////////////////////////////// Happy Configuration ////////////////////////////////////
50 
51 template void AampConfig::SetConfigValue<long>(ConfigPriority owner, AAMPConfigSettings cfg , const long &value);
52 template void AampConfig::SetConfigValue<double>(ConfigPriority owner, AAMPConfigSettings cfg , const double &value);
53 template void AampConfig::SetConfigValue<int>(ConfigPriority owner, AAMPConfigSettings cfg , const int &value);
54 template void AampConfig::SetConfigValue<bool>(ConfigPriority owner, AAMPConfigSettings cfg , const bool &value);
55 
56 static ConfigPriority customOwner;
57 /**
58  * @brief AAMP Config Owners enum-string mapping table
59  */
60 
62 {
63  {"def",AAMP_DEFAULT_SETTING},
64  {"oper",AAMP_OPERATOR_SETTING},
65  {"stream",AAMP_STREAM_SETTING},
66  {"app",AAMP_APPLICATION_SETTING},
67  {"tune",AAMP_TUNE_SETTING},
68  {"cfg",AAMP_DEV_CFG_SETTING},
69  {"customcfg",AAMP_CUSTOM_DEV_CFG_SETTING},
70  {"unknown",AAMP_MAX_SETTING}
71 };
72 
73 /**
74  * @brief AAMP Config Command lookup table
75  */
76 
77 ///// No order is required to add to this table ,
78 ///// Better to add always at the end than inserting in the middle to avoid git merge conflicts
79 ///// Format -> configuration name, configuration enum (defined in AampConfig.h) , minValue(-1 if none) , maxValue(-1 if none)
81 {
82  {"mapMPD",eAAMPConfig_MapMPD,false,-1,-1},
83  {"mapM3U8",eAAMPConfig_MapM3U8,false,-1,-1},
84  {"fragmp4LicensePrefetch",eAAMPConfig_Fragmp4PrefetchLicense,false,-1,-1},
85  {"enableVideoEndEvent",eAAMPConfig_EnableVideoEndEvent,true,-1,-1},
86  {"fog",eAAMPConfig_Fog,false,-1,-1},
87  {"harvestCountLimit",eAAMPConfig_HarvestCountLimit,false,{.iMinValue=-1},{.iMaxValue=-1}},
88  {"harvestConfig",eAAMPConfig_HarvestConfig,false,{.iMinValue=-1},{.iMaxValue=-1}},
89  {"harvestPath",eAAMPConfig_HarvestPath,false,-1,-1},
90  {"forceEC3",eAAMPConfig_ForceEC3,false,-1,-1}, // Complete
91  {"disableEC3",eAAMPConfig_DisableEC3,true,-1,-1}, // Complete
92  {"disableATMOS",eAAMPConfig_DisableATMOS,true,-1,-1}, // Complete
93  {"disableAC4",eAAMPConfig_DisableAC4,true,-1,-1},
94  {"stereoOnly",eAAMPConfig_StereoOnly,true,-1,-1}, // Complete
95  {"disableAC3",eAAMPConfig_DisableAC3,true,-1,-1},
96  {"descriptiveTrackName",eAAMPConfig_DescriptiveTrackName,false,-1,-1},
97  {"offset",eAAMPConfig_PlaybackOffset,false,{.dMinValue = -1},{.dMaxValue = -1}},
98  {"cdvrLiveOffset",eAAMPConfig_CDVRLiveOffset,true,{.dMinValue = 0},{.dMaxValue=50}},
99  {"liveOffset",eAAMPConfig_LiveOffset,true,{.dMinValue = 0},{.dMaxValue=50}}, //liveOffset by user
100  {"liveOffset4K",eAAMPConfig_LiveOffset4K,true,{.dMinValue = 0},{.dMaxValue=50}}, //liveOffset for 4K by user
101  {"disablePlaylistIndexEvent",eAAMPConfig_DisablePlaylistIndexEvent,false,-1,-1}, // Complete
102  {"enableSubscribedTags",eAAMPConfig_EnableSubscribedTags,false,-1,-1}, // Complete
103  {"networkTimeout",eAAMPConfig_NetworkTimeout,true,{.dMinValue = -1},{.dMaxValue=-1}},
104  {"manifestTimeout",eAAMPConfig_ManifestTimeout,true,{.dMinValue = -1},{.dMaxValue=-1}},
105  {"playlistTimeout",eAAMPConfig_PlaylistTimeout,true,{.dMinValue = -1},{.dMaxValue=-1}},
106  {"dashIgnoreBaseUrlIfSlash",eAAMPConfig_DASHIgnoreBaseURLIfSlash,false,-1,-1}, // Complete
107  {"licenseAnonymousRequest",eAAMPConfig_AnonymousLicenseRequest,false,-1,-1}, // Complete
108  {"useLinearSimulator",eAAMPConfig_EnableLinearSimulator,false,-1,-1},
109  {"info",eAAMPConfig_InfoLogging,true,-1,-1},
110  {"failover",eAAMPConfig_FailoverLogging,false,-1,-1},
111  {"curlHeader",eAAMPConfig_CurlHeader,false,-1,-1},
112  {"curlLicense",eAAMPConfig_CurlLicenseLogging,false,-1,-1},
113  {"logMetadata",eAAMPConfig_MetadataLogging,false,-1,-1},
114  {"customHeader",eAAMPConfig_CustomHeader,false,-1,-1},
115  {"uriParameter",eAAMPConfig_URIParameter,false,-1,-1},
116  {"gst",eAAMPConfig_GSTLogging,false,-1,-1},
117  {"progress",eAAMPConfig_ProgressLogging,false,-1,-1},
118  {"debug",eAAMPConfig_DebugLogging,false,-1,-1},
119  {"trace",eAAMPConfig_TraceLogging,false,-1,-1},
120  {"warn",eAAMPConfig_WarnLogging,false,-1,-1},
121  {"curl",eAAMPConfig_CurlLogging,false,-1,-1},
122  {"stream",eAAMPConfig_StreamLogging,false,-1,-1},
123  {"initialBitrate",eAAMPConfig_DefaultBitrate,false,{.lMinValue=-1},{.lMaxValue=-1}},
124  {"initialBitrate4K",eAAMPConfig_DefaultBitrate4K,false,{.lMinValue=-1},{.lMaxValue=-1}},
125  {"defaultBitrate",eAAMPConfig_DefaultBitrate,true,{.lMinValue=-1},{.lMaxValue=-1}},
126  {"defaultBitrate4K",eAAMPConfig_DefaultBitrate4K,true,{.lMinValue=-1},{.lMaxValue=-1}},
127  {"abr",eAAMPConfig_EnableABR,false,-1,-1},
128  {"abrCacheLife",eAAMPConfig_ABRCacheLife,false,{.iMinValue=-1},{.iMaxValue=-1}},
129  {"abrCacheLength",eAAMPConfig_ABRCacheLength,false,{.iMinValue=-1},{.iMaxValue=-1}},
130  {"timeShiftBufferLength",eAAMPConfig_TimeShiftBufferLength,false,{.iMinValue=-1},{.iMaxValue=-1}},
131  {"useNewABR",eAAMPConfig_ABRBufferCheckEnabled,false,-1,-1},
132  {"useNewAdBreaker",eAAMPConfig_NewDiscontinuity,false,-1,-1},
133  {"reportVideoPTS",eAAMPConfig_ReportVideoPTS,false,-1,-1},
134  {"decoderUnavailableStrict",eAAMPConfig_DecoderUnavailableStrict,false,-1,-1},
135  {"descriptiveAudioTrack",eAAMPConfig_DescriptiveAudioTrack,false,-1,-1},
136  {"langCodePreference",eAAMPConfig_LanguageCodePreference,false,{.iMinValue=0},{.iMaxValue=3}},
137  {"appSrcForProgressivePlayback",eAAMPConfig_UseAppSrcForProgressivePlayback,false,-1,-1},
138  {"abrCacheOutlier",eAAMPConfig_ABRCacheOutlier,false,{.iMinValue=-1},{.iMaxValue=-1}},
139  {"abrSkipDuration",eAAMPConfig_ABRSkipDuration,false,{.iMinValue=-1},{.iMaxValue=-1}},
140  {"abrNwConsistency",eAAMPConfig_ABRNWConsistency,false,{.iMinValue=-1},{.iMaxValue=-1}},
141  {"minABRBufferRampdown",eAAMPConfig_MinABRNWBufferRampDown,false,{.iMinValue=-1},{.iMaxValue=-1}},
142  {"preservePipeline",eAAMPConfig_PreservePipeline,false,-1,-1},
143  {"demuxHlsAudioTrack",eAAMPConfig_DemuxAudioHLSTrack,false,-1,-1},
144  {"demuxHlsVideoTrack",eAAMPConfig_DemuxVideoHLSTrack,false,-1,-1},
145  {"demuxHlsVideoTrackTrickMode",eAAMPConfig_DemuxHLSVideoTsTrackTM,false,-1,-1},
146  {"demuxAudioBeforeVideo",eAAMPConfig_DemuxAudioBeforeVideo,false,-1,-1},
147  {"throttle",eAAMPConfig_Throttle,false,-1,-1},
148  {"bufferHealthMonitorDelay",eAAMPConfig_BufferHealthMonitorDelay,false,{.iMinValue=-1},{.iMaxValue=-1}},
149  {"bufferHealthMonitorInterval",eAAMPConfig_BufferHealthMonitorInterval,false,{.iMinValue=-1},{.iMaxValue=-1}},
150  {"preferredDrm",eAAMPConfig_PreferredDRM,true,{.iMinValue=0},{.iMaxValue=eDRM_MAX_DRMSystems}},
151  {"playreadyOutputProtection",eAAMPConfig_EnablePROutputProtection,false,-1,-1},
152  {"tuneEventConfig",eAAMPConfig_TuneEventConfig,false,{.iMinValue=eTUNED_EVENT_ON_PLAYLIST_INDEXED},{.iMaxValue=eTUNED_EVENT_ON_GST_PLAYING}},
153  {"parallelPlaylistDownload",eAAMPConfig_PlaylistParallelFetch,false,-1,-1},
154  {"dashParallelFragDownload",eAAMPConfig_DashParallelFragDownload,false,-1,-1},
155  {"parallelPlaylistRefresh",eAAMPConfig_PlaylistParallelRefresh ,false,-1,-1},
156  {"bulkTimedMetadata",eAAMPConfig_BulkTimedMetaReport,false,-1,-1},
157  {"useRetuneForUnpairedDiscontinuity",eAAMPConfig_RetuneForUnpairDiscontinuity,false,-1,-1},
158  {"useRetuneForGstInternalError",eAAMPConfig_RetuneForGSTError,false,-1,-1},
159  {"useWesterosSink",eAAMPConfig_UseWesterosSink,true,-1,-1},
160  {"setLicenseCaching",eAAMPConfig_SetLicenseCaching,false,-1,-1},
161  {"propagateUriParameters",eAAMPConfig_PropogateURIParam,false,-1,-1},
162  {"preFetchIframePlaylist",eAAMPConfig_PrefetchIFramePlaylistDL,false,-1,-1},
163  {"hlsAVTrackSyncUsingPDT",eAAMPConfig_HLSAVTrackSyncUsingStartTime,false,-1,-1},
164  {"mpdDiscontinuityHandling",eAAMPConfig_MPDDiscontinuityHandling,false,-1,-1},
165  {"mpdDiscontinuityHandlingCdvr",eAAMPConfig_MPDDiscontinuityHandlingCdvr,false,-1,-1},
166  {"vodTrickPlayFps",eAAMPConfig_VODTrickPlayFPS,false,{.iMinValue=-1},{.iMaxValue=-1}},
167  {"linearTrickPlayFps",eAAMPConfig_LinearTrickPlayFPS,false,{.iMinValue=-1},{.iMaxValue=-1}},
168  {"progressReportingInterval",eAAMPConfig_ReportProgressInterval,false,{.dMinValue=0},{.dMaxValue=-1}},
169  {"forceHttp",eAAMPConfig_ForceHttp,false,-1,-1},
170  {"internalRetune",eAAMPConfig_InternalReTune,false,-1,-1},
171  {"gstBufferAndPlay",eAAMPConfig_GStreamerBufferingBeforePlay,false,-1,-1},
172  {"retuneOnBufferingTimeout",eAAMPConfig_ReTuneOnBufferingTimeout,false,-1,-1},
173  {"iframeDefaultBitrate",eAAMPConfig_IFrameDefaultBitrate,false,{.lMinValue=-1},{.lMaxValue=-1}},
174  {"iframeDefaultBitrate4K",eAAMPConfig_IFrameDefaultBitrate4K,false,{.lMinValue=-1},{.lMaxValue=-1}},
175  {"audioOnlyPlayback",eAAMPConfig_AudioOnlyPlayback,false,-1,-1},
176  {"licenseRetryWaitTime",eAAMPConfig_LicenseRetryWaitTime,false,{.iMinValue=-1},{.iMaxValue=-1}},
177  {"licenseKeyAcquireWaitTime",eAAMPConfig_LicenseKeyAcquireWaitTime,false,{.iMinValue=MIN_LICENSE_KEY_ACQUIRE_WAIT_TIME},{.iMaxValue=MAX_LICENSE_ACQ_WAIT_TIME}},
178  {"downloadBuffer",eAAMPConfig_MaxFragmentCached,false,{.iMinValue=-1},{.iMaxValue=-1}},
179  {"ptsErrorThreshold",eAAMPConfig_PTSErrorThreshold,false,{.iMinValue=0},{.iMaxValue=MAX_PTS_ERRORS_THRESHOLD}},
180  {"enableVideoRectangle",eAAMPConfig_EnableRectPropertyCfg,false,-1,-1},
181  {"maxPlaylistCacheSize",eAAMPConfig_MaxPlaylistCacheSize,false,{.iMinValue=0},{.iMaxValue=15360}}, // Range for PlaylistCache size - upto 15 MB max
182  {"dashMaxDrmSessions",eAAMPConfig_MaxDASHDRMSessions,false,{.iMinValue=1},{.iMaxValue=MAX_DASH_DRM_SESSIONS}},
183  {"userAgent",eAAMPConfig_UserAgent,false,-1,-1},
184  {"waitTimeBeforeRetryHttp5xx",eAAMPConfig_Http5XXRetryWaitInterval,false,{.iMinValue=-1},{.iMaxValue=-1}},
185  {"preplayBuffercount",eAAMPConfig_PrePlayBufferCount,false,{.iMinValue=-1},{.iMaxValue=-1}},
186  {"sslVerifyPeer",eAAMPConfig_SslVerifyPeer,false,-1,-1},
187  {"downloadStallTimeout",eAAMPConfig_CurlStallTimeout,false,{.lMinValue=0},{.lMaxValue=50}},
188  {"downloadStartTimeout",eAAMPConfig_CurlDownloadStartTimeout,false,{.lMinValue=0},{.lMaxValue=50}},
189  {"downloadLowBWTimeout",eAAMPConfig_CurlDownloadLowBWTimeout,false,{.lMinValue=0},{.lMaxValue=50}},
190  {"discontinuityTimeout",eAAMPConfig_DiscontinuityTimeout,false,{.lMinValue=0},{.lMaxValue=50}},
191  {"client-dai",eAAMPConfig_EnableClientDai,true,-1,-1}, // not changing this name , this is already in use for RFC
192  {"cdnAdsOnly",eAAMPConfig_PlayAdFromCDN,false,-1,-1},
193  {"thresholdSizeABR",eAAMPConfig_ABRThresholdSize,false,{.iMinValue=-1},{.iMaxValue=-1}},
194  {"preferredSubtitleLanguage",eAAMPConfig_SubTitleLanguage,false,-1,-1},
195  {"reportBufferEvent",eAAMPConfig_ReportBufferEvent,false,-1,-1},
196  {"gstPositionQueryEnable",eAAMPConfig_EnableGstPositionQuery,false,-1,-1},
197  {"useMatchingBaseUrl",eAAMPConfig_MatchBaseUrl,false,-1,-1},
198  {"useAverageBandwidth",eAAMPConfig_AvgBWForABR,false,-1,-1},
199  {"preCachePlaylistTime",eAAMPConfig_PreCachePlaylistTime,false,{.iMinValue=-1},{.iMaxValue=-1}},
200  {"fragmentRetryLimit",eAAMPConfig_RampDownLimit,false,{.iMinValue=-1},{.iMaxValue=-1}},
201  {"segmentInjectFailThreshold",eAAMPConfig_SegmentInjectThreshold,false,{.iMinValue=0},{.iMaxValue=MAX_SEG_INJECT_FAIL_COUNT}},
202  {"drmDecryptFailThreshold",eAAMPConfig_DRMDecryptThreshold,false,{.iMinValue=0},{.iMaxValue=MAX_SEG_DRM_DECRYPT_FAIL_COUNT}},
203  {"minBitrate",eAAMPConfig_MinBitrate,true,{.lMinValue=0},{.lMaxValue=-1}},
204  {"maxBitrate",eAAMPConfig_MaxBitrate,true,{.lMinValue=0},{.lMaxValue=-1}},
205  {"initFragmentRetryCount",eAAMPConfig_InitFragmentRetryCount,false,{.iMinValue=0},{.iMaxValue=-1}},
206  {"nativeCCRendering",eAAMPConfig_NativeCCRendering,false,-1,-1},
207  {"subtecSubtitle",eAAMPConfig_Subtec_subtitle,false,-1,-1},
208  {"webVttNative",eAAMPConfig_WebVTTNative,false,-1,-1},
209  {"ceaFormat",eAAMPConfig_CEAPreferred,false,{.iMinValue=-1},{.iMaxValue=-1}},
210  {"asyncTune",eAAMPConfig_AsyncTune,true,-1,-1},
211  {"initRampdownLimit",eAAMPConfig_InitRampDownLimit,false,{.iMinValue=-1},{.iMaxValue=-1}},
212  {"enableSeekableRange",eAAMPConfig_EnableSeekRange,false,-1,-1},
213  {"maxTimeoutForSourceSetup",eAAMPConfig_SourceSetupTimeout,false,{.iMinValue=-1},{.iMaxValue=-1}},
214  {"seekMidFragment",eAAMPConfig_MidFragmentSeek,false,-1,-1},
215  {"wifiCurlHeader",eAAMPConfig_WifiCurlHeader,false,-1,-1},
216  {"persistBitrateOverSeek",eAAMPConfig_PersistentBitRateOverSeek,true,-1,-1},
217  {"log",eAAMPConfig_LogLevel,false,-1,-1},
218  {"maxABRBufferRampup",eAAMPConfig_MaxABRNWBufferRampUp,false,{.iMinValue=-1},{.iMaxValue=-1}},
219  {"networkProxy",eAAMPConfig_NetworkProxy,false,-1,-1},
220  {"licenseProxy",eAAMPConfig_LicenseProxy,false,-1,-1},
221  {"authToken",eAAMPConfig_AuthToken,false,-1,-1},
222  {"enableAccessAttributes",eAAMPConfig_EnableAccessAttributes,false,-1,-1},
223  {"ckLicenseServerUrl",eAAMPConfig_CKLicenseServerUrl,false,-1,-1},
224  {"licenseServerUrl",eAAMPConfig_LicenseServerUrl,false,-1,-1},
225  {"prLicenseServerUrl",eAAMPConfig_PRLicenseServerUrl,false,-1,-1},
226  {"wvLicenseServerUrl",eAAMPConfig_WVLicenseServerUrl,false,-1,-1},
227  {"stallErrorCode",eAAMPConfig_StallErrorCode,false,{.iMinValue=-1},{.iMaxValue=-1}},
228  {"stallTimeout",eAAMPConfig_StallTimeoutMS,false,{.iMinValue=-1},{.iMaxValue=-1}},
229  {"initialBuffer",eAAMPConfig_InitialBuffer,false,{.iMinValue=-1},{.iMaxValue=-1}},
230  {"playbackBuffer",eAAMPConfig_PlaybackBuffer,false,{.iMinValue=-1},{.iMaxValue=-1}},
231  {"downloadDelay",eAAMPConfig_DownloadDelay,false,{.iMinValue=0},{.iMaxValue=MAX_DOWNLOAD_DELAY_LIMIT_MS}},
232  {"livePauseBehavior",eAAMPConfig_LivePauseBehavior,false,{.iMinValue=ePAUSED_BEHAVIOR_AUTOPLAY_IMMEDIATE},{.iMaxValue=ePAUSED_BEHAVIOR_MAX}},
233  {"disableUnderflow",eAAMPConfig_DisableUnderflow,false,-1,-1},
234  {"limitResolution",eAAMPConfig_LimitResolution,false,-1,-1},
235  {"useAbsoluteTimeline",eAAMPConfig_UseAbsoluteTimeline,false,-1,-1},
236  {"id3",eAAMPConfig_ID3Logging,false,-1,-1},
237  {"SkyStoreDE",eAAMPConfig_WideVineKIDWorkaround,false,-1,-1},
238  {"repairIframes",eAAMPConfig_RepairIframes,false,-1,-1},
239  {"customHeaderLicense",eAAMPConfig_CustomHeaderLicense,false,-1,-1},
240  {"preferredAudioRendition",eAAMPConfig_PreferredAudioRendition,false,-1,-1},
241  {"preferredAudioCodec",eAAMPConfig_PreferredAudioCodec,false,-1,-1},
242  {"preferredAudioLanguage",eAAMPConfig_PreferredAudioLanguage,false,-1,-1},
243  {"preferredAudioLabel",eAAMPConfig_PreferredAudioLabel,false,-1,-1},
244  {"preferredAudioType",eAAMPConfig_PreferredAudioType,false,-1,-1},
245  {"preferredTextRendition",eAAMPConfig_PreferredTextRendition,false,-1,-1},
246  {"preferredTextLanguage",eAAMPConfig_PreferredTextLanguage,false,-1,-1},
247  {"preferredTextLabel",eAAMPConfig_PreferredTextLabel,false,-1,-1},
248  {"preferredTextType",eAAMPConfig_PreferredTextType,false,-1,-1},
249  {"gstVideoBufBytes", eAAMPConfig_GstVideoBufBytes,false,-1,-1},
250  {"gstAudioBufBytes", eAAMPConfig_GstAudioBufBytes,false,-1,-1},
251  {"seiTimeCode",eAAMPConfig_SEITimeCode,false,-1,-1},
252  {"disable4K" , eAAMPConfig_Disable4K, false,-1, -1},
253  {"sharedSSL",eAAMPConfig_EnableSharedSSLSession, true,-1,-1},
254  {"tsbInterruptHandling", eAAMPConfig_InterruptHandling,true, -1, -1},
255  {"enableLowLatencyDash",eAAMPConfig_EnableLowLatencyDash,true,-1,-1},
256  {"disableLowLatencyABR",eAAMPConfig_DisableLowLatencyABR,false,-1,-1},
257  {"enableLowLatencyCorrection",eAAMPConfig_EnableLowLatencyCorrection,false,-1,-1},
258  {"latencyMonitorDelay",eAAMPConfig_LatencyMonitorDelay,false,-1,-1},
259  {"latencyMonitorInterval",eAAMPConfig_LatencyMonitorInterval,false,-1,-1},
260  {"downloadBufferChunks",eAAMPConfig_MaxFragmentChunkCached,false,-1,-1},
261  {"abrChunkThresholdSize",eAAMPConfig_ABRChunkThresholdSize,false,-1,-1},
262  {"lowLatencyMinValue",eAAMPConfig_LLMinLatency,false,-1,-1},
263  {"lowLatencyTargetValue",eAAMPConfig_LLTargetLatency,false,-1,-1},
264  {"lowLatencyMaxValue",eAAMPConfig_LLMaxLatency,false,-1,-1},
265  {"enableLowLatencyOffsetMin",eAAMPConfig_EnableLowLatencyOffsetMin,false,-1,-1},
266  {"fragmentDownloadFailThreshold",eAAMPConfig_FragmentDownloadFailThreshold,false,{.iMinValue=1},{.iMaxValue=MAX_SEG_DOWNLOAD_FAIL_COUNT}},
267  {"syncAudioFragments",eAAMPConfig_SyncAudioFragments,false,-1,-1},
268  {"enableEosSmallFragment", eAAMPConfig_EnableIgnoreEosSmallFragment, false,-1, -1},
269  {"useSecManager",eAAMPConfig_UseSecManager, true,-1,-1},
270  {"enablePTO", eAAMPConfig_EnablePTO,false, -1, -1},
271  {"maxInitFragCachePerTrack",eAAMPConfig_MaxInitFragCachePerTrack,true,{.iMinValue=1},{.iMaxValue=5}},
272  {"supportTLS",eAAMPConfig_TLSVersion,true,{.lMinValue=CURL_SSLVERSION_DEFAULT},{.lMaxValue=CURL_SSLVERSION_TLSv1_3}},
273  {"fogMaxConcurrentDownloads",eAAMPConfig_FogMaxConcurrentDownloads, false,-1, -1},
274  {"enableFogConfig", eAAMPConfig_EnableAampConfigToFog, false, -1, -1},
275  {"xreSupportedTune",eAAMPConfig_XRESupportedTune,false,-1,-1},
276  {"allowPageHeaders",eAAMPConfig_AllowPageHeaders,false,-1,-1},
277  {"customLicenseData",eAAMPConfig_CustomLicenseData,false,-1,-1},
278  {"suppressDecode",eAAMPConfig_SuppressDecode,false,-1,-1},
279  {"persistHighNetworkBandwidth",eAAMPConfig_PersistHighNetworkBandwidth,false,-1,-1},
280  {"persistLowNetworkBandwidth",eAAMPConfig_PersistLowNetworkBandwidth,false,-1,-1},
281  {"gstSubtecEnabled",eAAMPConfig_GstSubtecEnabled,false,-1,-1},
282  {"changeTrackWithoutRetune", eAAMPConfig_ChangeTrackWithoutRetune, false,-1,-1},
283  {"contentProtectionDataUpdateTimeout",eAAMPConfig_ContentProtectionDataUpdateTimeout,false,{.iMinValue = 0},{.iMaxValue=-1}},
284  {"curlStore", eAAMPConfig_EnableCurlStore, true, -1, -1},
285  {"maxCurlStore", eAAMPConfig_MaxCurlSockStore,false, {.iMinValue=1},{.iMaxValue=10}},
286  {"configRuntimeDRM", eAAMPConfig_RuntimeDRMConfig,false,-1,-1},
287  {"enablePublishingMuxedAudio",eAAMPConfig_EnablePublishingMuxedAudio,false,-1,-1},
288  {"enableCMCD", eAAMPConfig_EnableCMCD, true, -1, -1},
289  {"SlowMotion", eAAMPConfig_EnableSlowMotion, true, -1, -1},
290  {"enableSCTE35PresentationTime", eAAMPConfig_EnableSCTE35PresentationTime, false, -1, -1},
291  {"jsinfo",eAAMPConfig_JsInfoLogging,false, -1, -1},
292  {"ignoreAppLiveOffset", eAAMPConfig_IgnoreAppLiveOffset, false, -1, -1},
293  {"SchemeIdUriDaiStream",eAAMPConfig_SchemeIdUriDaiStream,true,-1,-1},
294  {"SchemeIdUriVssStream",eAAMPConfig_SchemeIdUriVssStream,true,-1,-1},
295  {"LRHAcceptValue",eAAMPConfig_LRHAcceptValue,true,-1,-1},
296  {"LRHContentType",eAAMPConfig_LRHContentType,true,-1,-1}
297 };
298 
299 /////////////////// Public Functions /////////////////////////////////////
300 /**
301  * @brief AampConfig Constructor function . Default values defined
302  *
303  * @return None
304  */
305 AampConfig::AampConfig():mAampLookupTable(),mChannelOverrideMap(),logging(),mAampDevCmdTable(),vCustom(),vCustomIt(),customFound(false),mLogObj(NULL)
306 {
307  for(int i=0; i<sizeof(ConfigLookUpTable) / sizeof(AampConfigLookupEntry); ++i)
308  {
309  mAampLookupTable[ConfigLookUpTable[i].cmdString] = ConfigLookUpTable[i];
310  }
311  mLogObj = &logging;
312 }
313 
314 /**
315  * @brief AampConfig Copy Constructor function
316  */
318 {
319  // set the pointer to instance logger object , not the one from copyinstance
320  for(int i=0; i<sizeof(ConfigLookUpTable) / sizeof(AampConfigLookupEntry); ++i)
321  {
322  mAampLookupTable[ConfigLookUpTable[i].cmdString] = ConfigLookUpTable[i];
323  }
324  logging = rhs.logging;
325  mChannelOverrideMap = rhs.mChannelOverrideMap;
326  mAampDevCmdTable = rhs.mAampDevCmdTable;
327  vCustom = rhs.vCustom;
328  customFound = rhs.customFound;
329  mLogObj = &logging;
330  memcpy(bAampCfgValue , rhs.bAampCfgValue , sizeof(bAampCfgValue));
331  memcpy(iAampCfgValue , rhs.iAampCfgValue , sizeof(iAampCfgValue));
332  memcpy(lAampCfgValue , rhs.lAampCfgValue , sizeof(lAampCfgValue));
333  memcpy(dAampCfgValue , rhs.dAampCfgValue , sizeof(dAampCfgValue));
334 
335  for(int index=0;index < (eAAMPConfig_StringMaxValue-eAAMPConfig_StringStartValue) ; index++)
336  {
337  sAampCfgValue[index].owner = rhs.sAampCfgValue[index].owner;
338  sAampCfgValue[index].lastowner = rhs.sAampCfgValue[index].lastowner;
339  sAampCfgValue[index].value = rhs.sAampCfgValue[index].value;
340  sAampCfgValue[index].lastvalue = rhs.sAampCfgValue[index].lastvalue;
341  }
342  return *this;
343 }
344 
345 
346 void AampConfig::Initialize()
347 {
348  // Player Default Configuration
349  ///////////////// Following for Boolean setting ////////////////////////////
350  bAampCfgValue[eAAMPConfig_EnableABR].value = true;
351  bAampCfgValue[eAAMPConfig_Fog].value = true;
356  bAampCfgValue[eAAMPConfig_Throttle].value = false;
359  bAampCfgValue[eAAMPConfig_ForceEC3].value = false;
360  bAampCfgValue[eAAMPConfig_StereoOnly].value = false;
362  bAampCfgValue[eAAMPConfig_DisableEC3].value = false;
364 #if defined(BRCM) || defined(RPI) || defined(AAMP_SIMULATOR_BUILD)
366 #else
367  bAampCfgValue[eAAMPConfig_DisableAC4].value = false;
368 #endif
369  bAampCfgValue[eAAMPConfig_DisableAC3].value = false;
377  bAampCfgValue[eAAMPConfig_ForceHttp].value = false;
393  bAampCfgValue[eAAMPConfig_InfoLogging].value = false;
398  bAampCfgValue[eAAMPConfig_GSTLogging].value = false;
400  bAampCfgValue[eAAMPConfig_CurlLogging].value = false;
404  bAampCfgValue[eAAMPConfig_ID3Logging].value = false;
405  bAampCfgValue[eAAMPConfig_CurlHeader].value = false;
408  //bAampCfgValue[eAAMPConfig_XREEventReporting].value = true;
409 #ifdef INTELCE
411 #else
413 #endif
416 #if defined(REALTEKCE) || defined(AMLOGIC) || defined(FLEX2_RDK) // Temporary till westerossink disable is rollbacked
418 #else
420 #endif
423 #ifdef IARM_MGR
424  bAampCfgValue[eAAMPConfig_WifiCurlHeader].value = true;
425 #else
426  bAampCfgValue[eAAMPConfig_WifiCurlHeader].value = false;
427 #endif
428 
435  bAampCfgValue[eAAMPConfig_Fragmp4PrefetchLicense].value = true;
441  bAampCfgValue[eAAMPConfig_AvgBWForABR].value = false;
445  bAampCfgValue[eAAMPConfig_AsyncTune].value = false;
447 #ifdef GST_SUBTEC_ENABLED
449 #else
451 #endif
456 #ifdef REALTEKCE
458 #else
460 #endif
463 #ifdef CONTENT_4K_SUPPORTED
464  bAampCfgValue[eAAMPConfig_Disable4K].value = false;
465 #else
466  bAampCfgValue[eAAMPConfig_Disable4K].value = true;
467 #endif
476 #ifdef USE_SECMANAGER
477  // LLAMA-5520 workaround, QS005 branch only
479 #else
481 #endif
482  bAampCfgValue[eAAMPConfig_PersistHighNetworkBandwidth].value = false;
492 
493  ///////////////// Following for Integer Data type configs ////////////////////////////
494  iAampCfgValue[eAAMPConfig_HarvestCountLimit-eAAMPConfig_IntStartValue].value = 0;
495  iAampCfgValue[eAAMPConfig_ABRCacheLife-eAAMPConfig_IntStartValue].value = DEFAULT_ABR_CACHE_LIFE;
496 
497  iAampCfgValue[eAAMPConfig_ABRCacheLength-eAAMPConfig_IntStartValue].value = DEFAULT_ABR_CACHE_LENGTH;
498  iAampCfgValue[eAAMPConfig_ABRCacheOutlier-eAAMPConfig_IntStartValue].value = DEFAULT_ABR_OUTLIER;
499  iAampCfgValue[eAAMPConfig_TimeShiftBufferLength-eAAMPConfig_IntStartValue].value = 0;
500 
501  iAampCfgValue[eAAMPConfig_ABRSkipDuration-eAAMPConfig_IntStartValue].value = DEFAULT_ABR_SKIP_DURATION;
503  iAampCfgValue[eAAMPConfig_BufferHealthMonitorDelay-eAAMPConfig_IntStartValue].value = DEFAULT_BUFFER_HEALTH_MONITOR_DELAY;
504  iAampCfgValue[eAAMPConfig_BufferHealthMonitorInterval-eAAMPConfig_IntStartValue].value = DEFAULT_BUFFER_HEALTH_MONITOR_INTERVAL;
507  iAampCfgValue[eAAMPConfig_HarvestConfig-eAAMPConfig_IntStartValue].value = 0;
508  iAampCfgValue[eAAMPConfig_PreferredDRM-eAAMPConfig_IntStartValue].value = eDRM_PlayReady;
509  iAampCfgValue[eAAMPConfig_CEAPreferred-eAAMPConfig_IntStartValue].value = -1;
510  iAampCfgValue[eAAMPConfig_TuneEventConfig-eAAMPConfig_IntStartValue].value = eTUNED_EVENT_ON_GST_PLAYING;
512  iAampCfgValue[eAAMPConfig_MaxDASHDRMSessions-eAAMPConfig_IntStartValue].value = MIN_DASH_DRM_SESSIONS;
513  iAampCfgValue[eAAMPConfig_InitRampDownLimit-eAAMPConfig_IntStartValue].value = 0;
515 
516  iAampCfgValue[eAAMPConfig_VODTrickPlayFPS-eAAMPConfig_IntStartValue].value = TRICKPLAY_VOD_PLAYBACK_FPS;
518  iAampCfgValue[eAAMPConfig_RampDownLimit-eAAMPConfig_IntStartValue].value = -1;
520  iAampCfgValue[eAAMPConfig_StallErrorCode-eAAMPConfig_IntStartValue].value = DEFAULT_STALL_ERROR_CODE;
521  iAampCfgValue[eAAMPConfig_StallTimeoutMS-eAAMPConfig_IntStartValue].value = DEFAULT_STALL_DETECTION_TIMEOUT;
522  iAampCfgValue[eAAMPConfig_PreCachePlaylistTime-eAAMPConfig_IntStartValue].value = 0;
523  iAampCfgValue[eAAMPConfig_LanguageCodePreference-eAAMPConfig_IntStartValue].value = 0;
524  iAampCfgValue[eAAMPConfig_InitialBuffer-eAAMPConfig_IntStartValue].value = DEFAULT_MINIMUM_INIT_CACHE_SECONDS;
525  iAampCfgValue[eAAMPConfig_PlaybackBuffer-eAAMPConfig_IntStartValue].value = DEFAULT_MAXIMUM_PLAYBACK_BUFFER_SECONDS;
530  iAampCfgValue[eAAMPConfig_PrePlayBufferCount-eAAMPConfig_IntStartValue].value = DEFAULT_PREBUFFER_COUNT;
533  iAampCfgValue[eAAMPConfig_DownloadDelay-eAAMPConfig_IntStartValue].value = 0;
535  iAampCfgValue[eAAMPConfig_GstVideoBufBytes-eAAMPConfig_IntStartValue].value = MAX_GST_VIDEO_BUFFER_BYTES;
536  iAampCfgValue[eAAMPConfig_GstAudioBufBytes-eAAMPConfig_IntStartValue].value = MAX_GST_AUDIO_BUFFER_BYTES;
540  iAampCfgValue[eAAMPConfig_LLMinLatency-eAAMPConfig_IntStartValue].value = DEFAULT_MIN_LOW_LATENCY;
541  iAampCfgValue[eAAMPConfig_LLTargetLatency-eAAMPConfig_IntStartValue].value = DEFAULT_TARGET_LOW_LATENCY;
542  iAampCfgValue[eAAMPConfig_LLMaxLatency-eAAMPConfig_IntStartValue].value = DEFAULT_MAX_LOW_LATENCY;
548  iAampCfgValue[eAAMPConfig_MaxCurlSockStore-eAAMPConfig_IntStartValue].value = MAX_CURL_SOCK_STORE;
549 
550  ///////////////// Following for long data types /////////////////////////////
552  lAampCfgValue[eAAMPConfig_MaxBitrate-eAAMPConfig_LongStartValue].value = LONG_MAX;
553  lAampCfgValue[eAAMPConfig_CurlStallTimeout-eAAMPConfig_LongStartValue].value = 0;
554  lAampCfgValue[eAAMPConfig_CurlDownloadStartTimeout-eAAMPConfig_LongStartValue].value = 0;
555  lAampCfgValue[eAAMPConfig_CurlDownloadLowBWTimeout-eAAMPConfig_LongStartValue].value = 0;
556  lAampCfgValue[eAAMPConfig_MinBitrate-eAAMPConfig_LongStartValue].value = 0;
557  iAampCfgValue[eAAMPConfig_PTSErrorThreshold-eAAMPConfig_IntStartValue].value = MAX_PTS_ERRORS_THRESHOLD;
559  lAampCfgValue[eAAMPConfig_DefaultBitrate-eAAMPConfig_LongStartValue].value = DEFAULT_INIT_BITRATE;
560  lAampCfgValue[eAAMPConfig_DefaultBitrate4K-eAAMPConfig_LongStartValue].value = DEFAULT_INIT_BITRATE_4K;
561  lAampCfgValue[eAAMPConfig_IFrameDefaultBitrate-eAAMPConfig_LongStartValue].value = 0;
562  lAampCfgValue[eAAMPConfig_IFrameDefaultBitrate4K-eAAMPConfig_LongStartValue].value = 0;
563  lAampCfgValue[eAAMPConfig_TLSVersion-eAAMPConfig_LongStartValue].value = CURL_SSLVERSION_TLSv1_2;
564 
565  ///////////////// Following for double data types /////////////////////////////
566  dAampCfgValue[eAAMPConfig_NetworkTimeout-eAAMPConfig_DoubleStartValue].value = CURL_FRAGMENT_DL_TIMEOUT;
567  dAampCfgValue[eAAMPConfig_ManifestTimeout-eAAMPConfig_DoubleStartValue].value = CURL_FRAGMENT_DL_TIMEOUT;
568  dAampCfgValue[eAAMPConfig_PlaylistTimeout-eAAMPConfig_DoubleStartValue].value = 0;
569  dAampCfgValue[eAAMPConfig_PlaybackOffset-eAAMPConfig_DoubleStartValue].value = AAMP_DEFAULT_PLAYBACK_OFFSET;
571  dAampCfgValue[eAAMPConfig_LiveOffset-eAAMPConfig_DoubleStartValue].value = AAMP_LIVE_OFFSET;
572  dAampCfgValue[eAAMPConfig_LiveOffset4K-eAAMPConfig_DoubleStartValue].value = AAMP_LIVE_OFFSET;
573  dAampCfgValue[eAAMPConfig_CDVRLiveOffset-eAAMPConfig_DoubleStartValue].value = AAMP_CDVR_LIVE_OFFSET;
574 
575  ///////////////// Following for String type config ////////////////////////////
576  sAampCfgValue[eAAMPConfig_MapMPD-eAAMPConfig_StringStartValue].value = "";
577  sAampCfgValue[eAAMPConfig_MapM3U8-eAAMPConfig_StringStartValue].value = "";
578  sAampCfgValue[eAAMPConfig_HarvestPath-eAAMPConfig_StringStartValue].value = "";
579  sAampCfgValue[eAAMPConfig_LicenseServerUrl-eAAMPConfig_StringStartValue].value = "";
580  sAampCfgValue[eAAMPConfig_CKLicenseServerUrl-eAAMPConfig_StringStartValue].value = "";
581  sAampCfgValue[eAAMPConfig_PRLicenseServerUrl-eAAMPConfig_StringStartValue].value = "";
582  //sAampCfgValue[eAAMPConfig_RedirectUrl-eAAMPConfig_StringStartValue].value = "";
583  sAampCfgValue[eAAMPConfig_WVLicenseServerUrl-eAAMPConfig_StringStartValue].value = "";
584  sAampCfgValue[eAAMPConfig_UserAgent-eAAMPConfig_StringStartValue].value = "";
585  sAampCfgValue[eAAMPConfig_SubTitleLanguage-eAAMPConfig_StringStartValue].value = "en,eng";
586  sAampCfgValue[eAAMPConfig_CustomHeader-eAAMPConfig_StringStartValue].value = "";
587  sAampCfgValue[eAAMPConfig_URIParameter-eAAMPConfig_StringStartValue].value = "";
588  sAampCfgValue[eAAMPConfig_NetworkProxy-eAAMPConfig_StringStartValue].value = "";
589  sAampCfgValue[eAAMPConfig_LicenseProxy-eAAMPConfig_StringStartValue].value = "";
590  sAampCfgValue[eAAMPConfig_AuthToken-eAAMPConfig_StringStartValue].value = "";
591  sAampCfgValue[eAAMPConfig_LogLevel-eAAMPConfig_StringStartValue].value = "";
592  sAampCfgValue[eAAMPConfig_CustomHeaderLicense-eAAMPConfig_StringStartValue].value = "";
593  sAampCfgValue[eAAMPConfig_PreferredAudioRendition-eAAMPConfig_StringStartValue].value = "";
594  sAampCfgValue[eAAMPConfig_PreferredAudioCodec-eAAMPConfig_StringStartValue].value = "";
595  sAampCfgValue[eAAMPConfig_PreferredAudioLanguage-eAAMPConfig_StringStartValue].value = "en,eng";
596  sAampCfgValue[eAAMPConfig_PreferredAudioLabel-eAAMPConfig_StringStartValue].value = "";
597  sAampCfgValue[eAAMPConfig_PreferredAudioType-eAAMPConfig_StringStartValue].value = "";
598  sAampCfgValue[eAAMPConfig_PreferredTextRendition-eAAMPConfig_StringStartValue].value = "";
599  sAampCfgValue[eAAMPConfig_PreferredTextLanguage-eAAMPConfig_StringStartValue].value = "";
600  sAampCfgValue[eAAMPConfig_PreferredTextLabel-eAAMPConfig_StringStartValue].value = "";
601  sAampCfgValue[eAAMPConfig_PreferredTextType-eAAMPConfig_StringStartValue].value = "";
602  sAampCfgValue[eAAMPConfig_CustomLicenseData-eAAMPConfig_StringStartValue].value = "";
603  sAampCfgValue[eAAMPConfig_SchemeIdUriDaiStream-eAAMPConfig_StringStartValue].value = "urn:comcast:dai:2018";
604  sAampCfgValue[eAAMPConfig_SchemeIdUriVssStream-eAAMPConfig_StringStartValue].value = "urn:comcast:x1:lin:ck";
605  sAampCfgValue[eAAMPConfig_LRHAcceptValue-eAAMPConfig_StringStartValue].value = "";
606  sAampCfgValue[eAAMPConfig_LRHContentType-eAAMPConfig_StringStartValue].value = "";
607 }
608 
610 {
611 #if defined(BRCM) || defined(RPI) || defined(AAMP_SIMULATOR_BUILD)
613 #else
615  {
617  logprintf("AC4 not supported. DisableAC4 Audio");
618  }
619  else
620  {
621  bAampCfgValue[eAAMPConfig_DisableAC4].value = false;
622  }
623 #endif
624 
626  {
627  bAampCfgValue[eAAMPConfig_DisableAC3].value = false;
628  logprintf("AC3 not supported. DisableAC3 Audio");
629  }
630 }
631 
632 
633 #if 0
634 LangCodePreference AampConfig::GetLanguageCodePreference()
635 {
636  return (LangCodePreference)iAampCfgValue[eAAMPConfig_LanguageCodePreference-eAAMPConfig_IntStartValue].value;
637 }
638 #endif
639 
640 
641 std::string AampConfig::GetUserAgentString()
642 {
643  return std::string(sAampCfgValue[eAAMPConfig_UserAgent-eAAMPConfig_StringStartValue].value + " " + AAMP_USERAGENT_SUFFIX);
644 }
645 
646 /**
647  * @brief Gets the boolean configuration value
648  */
650 {
651  bool ret= false;
652  if(cfg < eAAMPConfig_BoolMaxValue)
653  {
654  ret = bAampCfgValue[cfg].value;
655  }
656  return ret;
657 }
658 
659 /**
660  * @brief GetConfigValue - Gets configuration for integer data type
661  *
662  * @return true - if valid return
663  */
665 {
666  bool ret= false;
667  if(cfg > eAAMPConfig_IntStartValue && cfg < eAAMPConfig_IntMaxValue)
668  {
669  value = iAampCfgValue[cfg-eAAMPConfig_IntStartValue].value;
670  ret = true;
671  }
672  return ret;
673 }
674 
675 /**
676  * @brief GetConfigOwner - Gets configuration Owner
677  *
678  * @return ConfigPriority - owner of the config
679  */
681 {
683 
684  if(cfg < eAAMPConfig_BoolMaxValue)
685  {
686  ret = bAampCfgValue[cfg].owner;
687  }
688  else if(cfg > eAAMPConfig_IntStartValue && cfg < eAAMPConfig_IntMaxValue)
689  {
690  ret = iAampCfgValue[cfg-eAAMPConfig_IntStartValue].owner;
691  }
692  else if(cfg > eAAMPConfig_LongStartValue && cfg < eAAMPConfig_LongMaxValue)
693  {
694  ret = lAampCfgValue[cfg-eAAMPConfig_LongStartValue].owner;
695  }
696  else if(cfg > eAAMPConfig_DoubleStartValue && cfg < eAAMPConfig_DoubleMaxValue)
697  {
698  ret = dAampCfgValue[cfg-eAAMPConfig_DoubleStartValue].owner;
699  }
700  else if(cfg > eAAMPConfig_StringStartValue && cfg < eAAMPConfig_StringMaxValue)
701  {
702  ret = sAampCfgValue[cfg-eAAMPConfig_StringStartValue].owner;
703  }
704  else
705  {
706  AAMPLOG_ERR("Cfg Index Not in range : %d",cfg);
707  }
708  return ret;
709 }
710 
711 /**
712  * @brief GetConfigValue - Gets configuration for long data type
713  *
714  * @return true - if valid return
715  */
717 {
718  bool ret= false;
719  if(cfg > eAAMPConfig_LongStartValue && cfg < eAAMPConfig_LongMaxValue)
720  {
721  value = lAampCfgValue[cfg-eAAMPConfig_LongStartValue].value;
722  ret=true;
723  }
724  return ret;
725 }
726 
727 /**
728  * @brief GetConfigValue - Gets configuration for double data type
729  *
730  * @return true - if valid return
731  */
733 {
734  bool ret= false;
735  if(cfg > eAAMPConfig_DoubleStartValue && cfg < eAAMPConfig_DoubleMaxValue)
736  {
737  value = dAampCfgValue[cfg-eAAMPConfig_DoubleStartValue].value;
738  ret=true;
739  }
740  return ret;
741 }
742 
743 /**
744  * @brief GetConfigValue - Gets configuration for string data type
745  *
746  * @return true - if valid return
747  */
748 bool AampConfig::GetConfigValue(AAMPConfigSettings cfg, std::string &value)
749 {
750  bool ret=false;
751  if(cfg > eAAMPConfig_StringStartValue && cfg < eAAMPConfig_StringMaxValue)
752  {
753  value = sAampCfgValue[cfg-eAAMPConfig_StringStartValue].value;
754  ret = true;
755  }
756  return ret;
757 }
758 
759 /**
760  * @brief GetChannelOverride - Gets channel override url for channel Name
761  *
762  * @return true - if valid return
763  */
764 const char * AampConfig::GetChannelOverride(const std::string manifestUrl)
765 {
766  if(mChannelOverrideMap.size() && manifestUrl.size())
767  {
768  for (ChannelMapIter it = mChannelOverrideMap.begin(); it != mChannelOverrideMap.end(); ++it)
769  {
770  ConfigChannelInfo &pChannelInfo = *it;
771  if (manifestUrl.find(pChannelInfo.name) != std::string::npos)
772  {
773  return pChannelInfo.uri.c_str();
774  }
775  }
776  }
777  return NULL;
778 }
779 
780 /**
781  * @brief GetChannelLicenseOverride - Gets channel License override url for channel Url
782  *
783  * @return true - if valid return
784  */
785 const char * AampConfig::GetChannelLicenseOverride(const std::string manifestUrl)
786 {
787  if(mChannelOverrideMap.size() && manifestUrl.size())
788  {
789  for (ChannelMapIter it = mChannelOverrideMap.begin(); it != mChannelOverrideMap.end(); ++it)
790  {
791  ConfigChannelInfo &pChannelInfo = *it;
792  if (manifestUrl.find(pChannelInfo.uri) != std::string::npos)
793  {
794  if(!pChannelInfo.licenseUri.empty())
795  {
796  return pChannelInfo.licenseUri.c_str();
797  }
798  }
799  }
800  }
801  return NULL;
802 }
803 
804 /**
805  * @brief ToggleConfigValue - Toggle Boolean configuration
806  *
807  * @return void
808  */
810 {
811  if(cfg < eAAMPConfig_BoolMaxValue)
812  {
813 
814  bool value = !bAampCfgValue[cfg].value;
815  SetValue<ConfigBool , bool> (bAampCfgValue[cfg], owner,value,GetConfigName(cfg));
816  }
817  else
818  {
819  AAMPLOG_ERR("Index beyond range : %d Max:%d ",cfg,eAAMPConfig_BoolMaxValue);
820  }
821 }
822 
823 
824 /**
825  * @brief SetConfigValue - Set function to set bool/int/long data type configuration
826  *
827  * @return void
828  */
829 template<typename T>
831 {
832  if(cfg < eAAMPConfig_BoolMaxValue)
833  {
834  SetValue<ConfigBool , bool> (bAampCfgValue[cfg], owner,(bool)value,GetConfigName(cfg));
835  }
836  else if(cfg > eAAMPConfig_IntStartValue && cfg < eAAMPConfig_IntMaxValue)
837  {
838  int valueInt = (int)value;
839  if(ValidateRange(GetConfigName(cfg),valueInt))
840  {
841  SetValue<ConfigInt , int>(iAampCfgValue[cfg-eAAMPConfig_IntStartValue], owner,(int)value,GetConfigName(cfg));
842  }
843  }
844  else if(cfg > eAAMPConfig_LongStartValue && cfg < eAAMPConfig_LongMaxValue)
845  {
846  long valueLong = (long)value;
847  if(ValidateRange(GetConfigName(cfg),valueLong))
848  {
849  SetValue<ConfigLong , long>(lAampCfgValue[cfg-eAAMPConfig_LongStartValue], owner,(long)value,GetConfigName(cfg));
850  }
851  }
852  else if(cfg > eAAMPConfig_DoubleStartValue && cfg < eAAMPConfig_DoubleMaxValue)
853  {
854  double valueDouble = (double)value;
855  if(ValidateRange(GetConfigName(cfg),valueDouble))
856  {
857  SetValue<ConfigDouble , double>(dAampCfgValue[cfg-eAAMPConfig_DoubleStartValue], owner,(double)value,GetConfigName(cfg));
858  }
859  }
860  else
861  {
862  AAMPLOG_ERR("Cfg Index Not in range : %d ",cfg);
863  }
864 }
865 
866 /**
867  * @brief SetConfigValue - Set function to set string data type configuration
868  *
869  * @return void
870  */
871 template <>
872 void AampConfig::SetConfigValue(ConfigPriority owner, AAMPConfigSettings cfg , const std::string &value)
873 {
874  if(cfg > eAAMPConfig_StringStartValue && cfg < eAAMPConfig_StringMaxValue)
875  {
876  SetValue<ConfigString , std::string>(sAampCfgValue[cfg-eAAMPConfig_StringStartValue], owner,value,GetConfigName(cfg));
877  }
878  else
879  {
880  AAMPLOG_ERR("Index Not in range : %d [%d-%d] ",cfg,eAAMPConfig_StringStartValue,eAAMPConfig_StringMaxValue);
881  }
882 }
883 
884 /**
885  * @brief ProcessConfigJson - Function to parse and process json configuration string
886  *
887  * @return bool - true on success
888  */
889 bool AampConfig::ProcessConfigJson(const char *jsonbuffer, ConfigPriority owner )
890 {
891  bool retval = false;
892  if(jsonbuffer)
893  {
894  cJSON *cfgdata = cJSON_Parse(jsonbuffer);
895  retval = ProcessConfigJson(cfgdata, owner);
896  cJSON_Delete(cfgdata);
897  }
898  return retval;
899 }
900 
901 /**
902  * @brief ProcessConfigJson - Function to parse and process json configuration string
903  *
904  * @return bool - true on success
905  */
906 bool AampConfig::ProcessConfigJson(const cJSON *cfgdata, ConfigPriority owner )
907 {
908  bool retval = false;
909 
910  if(cfgdata != NULL)
911  {
912  cJSON *custom = cJSON_GetObjectItem(cfgdata, "Custom");
913  if((custom != NULL) && (owner == AAMP_DEV_CFG_SETTING))
914  {
915  CustomArrayRead( custom,owner );
916  customFound = true;
917  }
918 
919  for(cJSON *searchObj = cfgdata->child; NULL != searchObj; searchObj=searchObj->next)
920  {
921  auto it = mAampLookupTable.find(searchObj->string);
922  if ( it != mAampLookupTable.end())
923  {
924  AampConfigLookupEntry cfg = it->second;
925  AAMPConfigSettings cfgEnum = cfg.cfgEntryValue;
926  std::string keyname = it->first;
927  // Found that keyname in json string
928  if(cfgEnum < eAAMPConfig_BoolMaxValue )
929  {
930  if(cJSON_IsTrue(searchObj))
931  {
932  SetConfigValue<bool>(owner,cfgEnum,true);
933  AAMPLOG_WARN("Parsed value for property %s - true",keyname.c_str());
934  }
935  else
936  {
937  SetConfigValue<bool>(owner,cfgEnum,false);
938  AAMPLOG_WARN("Parsed value for property %s - false",keyname.c_str());
939  }
940  }
941  else if(cfgEnum > eAAMPConfig_IntStartValue && cfgEnum < eAAMPConfig_IntMaxValue && cJSON_IsNumber(searchObj))
942  {
943  // For those parameters in Integer Settings
944  int conv = (int)searchObj->valueint;
945  AAMPLOG_WARN("Parsed value for property %s - %d",keyname.c_str(),conv);
946  if(ValidateRange(keyname,conv))
947  {
948  SetConfigValue<int>(owner,cfgEnum,conv);
949  }
950  else
951  {
952  AAMPLOG_ERR("Set failed .Input beyond the configured range");
953  }
954  }
955  else if(cfgEnum > eAAMPConfig_LongStartValue && cfgEnum < eAAMPConfig_LongMaxValue && cJSON_IsNumber(searchObj))
956  {
957  // For those parameters in long Settings
958  long conv = (long)searchObj->valueint;
959  AAMPLOG_WARN("Parsed value for property %s - %ld",keyname.c_str(),conv);
960  if(ValidateRange(keyname,conv))
961  {
962  SetConfigValue<long>(owner,cfgEnum,conv);
963  }
964  else
965  {
966  AAMPLOG_ERR("Set failed .Input beyond the configured range");
967  }
968  }
969  else if(cfgEnum > eAAMPConfig_DoubleStartValue && cfgEnum < eAAMPConfig_DoubleMaxValue && cJSON_IsNumber(searchObj))
970  {
971  // For those parameters in double settings
972  double conv= (double)searchObj->valuedouble;
973  AAMPLOG_WARN("Parsed value for property %s - %f",keyname.c_str(),conv);
974  if(ValidateRange(keyname,conv))
975  {
976  SetConfigValue<double>(owner,cfgEnum,conv);
977  }
978  else
979  {
980  AAMPLOG_ERR("Set failed .Input beyond the configured range");
981  }
982  }
983  else if(cfgEnum > eAAMPConfig_StringStartValue && cfgEnum < eAAMPConfig_StringMaxValue && cJSON_IsString(searchObj))
984  {
985  // For those parameters in string Settings
986  std::string conv = std::string(searchObj->valuestring);
987  AAMPLOG_WARN("Parsed value for property %s - %s",keyname.c_str(),conv.c_str());
988  SetConfigValue<std::string>(owner,cfgEnum,conv);
989  }
990  }
991  }
992  // checked all the config string in json
993  // next check is channel override array is present
994  cJSON *chMap = cJSON_GetObjectItem(cfgdata,"chmap");
995  if(chMap)
996  {
997  if(cJSON_IsArray(chMap))
998  {
999  for (int i = 0 ; i < cJSON_GetArraySize(chMap) ; i++)
1000  {
1001  cJSON * subitem = cJSON_GetArrayItem(chMap, i);
1002  char *name = (char *)cJSON_GetObjectItem(subitem, "name")->valuestring;
1003  char *url = (char *)cJSON_GetObjectItem(subitem, "url")->valuestring;
1004  char *licenseUrl= (char *)cJSON_GetObjectItem(subitem, "licenseServerUrl")->valuestring;
1005  if(name && url )
1006  {
1007  ConfigChannelInfo channelInfo;
1008  channelInfo.uri = url;
1009  channelInfo.name = name;
1010  channelInfo.licenseUri = licenseUrl;
1011  mChannelOverrideMap.push_back(channelInfo);
1012  }
1013  }
1014  }
1015  else
1016  {
1017  AAMPLOG_ERR("JSON Channel Override format is wrong");
1018  }
1019  }
1020  cJSON *drmConfig = cJSON_GetObjectItem(cfgdata,"drmConfig");
1021  if(drmConfig)
1022  {
1023  AAMPLOG_WARN("Parsed value for property DrmConfig");
1024  cJSON *subitem = drmConfig->child;
1025  DRMSystems drmType = eDRM_PlayReady;
1026  while( subitem )
1027  {
1028  std::string conv = std::string(subitem->valuestring);
1029  if(strcasecmp("com.microsoft.playready",subitem->string)==0)
1030  {
1031  AAMPLOG_WARN("Playready License Server URL config param received - %s", conv.c_str());
1032  SetConfigValue<std::string>(owner,eAAMPConfig_PRLicenseServerUrl,conv);
1033  drmType = eDRM_PlayReady;
1034  }
1035  if(strcasecmp("com.widevine.alpha",subitem->string)==0)
1036  {
1037  AAMPLOG_WARN("Widevine License Server URL config param received - %s", conv.c_str());
1038  SetConfigValue<std::string>(owner,eAAMPConfig_WVLicenseServerUrl,conv);
1039  drmType = eDRM_WideVine;
1040  }
1041  if(strcasecmp("org.w3.clearkey",subitem->string)==0)
1042  {
1043  AAMPLOG_WARN("ClearKey License Server URL config param received - %s", conv.c_str());
1044  SetConfigValue<std::string>(owner,eAAMPConfig_CKLicenseServerUrl,conv);
1045  drmType = eDRM_ClearKey;
1046  }
1047  if(strcasecmp("preferredKeysystem",subitem->string)==0)
1048  {
1049  AAMPLOG_WARN("Preferred key system received - %s", conv.c_str());
1050  SetConfigValue<int>(owner,eAAMPConfig_PreferredDRM,(int)drmType);
1051  }
1052  if(strcasecmp("customData",subitem->string)==0)
1053  {
1054  AAMPLOG_WARN("customData received - %s", conv.c_str());
1055  SetConfigValue<std::string>(owner,eAAMPConfig_CustomLicenseData,conv);
1056  }
1057  subitem = subitem->next;
1058  }
1059  }
1060  retval = true;
1061  }
1062 
1063  return retval;
1064 }
1065 
1066 /**
1067  * @brief CustomArrayRead - Function to Read Custom JSON Array
1068  * @return void
1069  */
1070 void AampConfig::CustomArrayRead( cJSON *customArray,ConfigPriority owner )
1071 {
1072  std::string keyname;
1073  customJson customValues;
1074  cJSON *customVal=NULL;
1075  cJSON *searchVal=NULL;
1076  customOwner = owner;
1077  if(owner == AAMP_DEV_CFG_SETTING)
1078  {
1079  customOwner = AAMP_CUSTOM_DEV_CFG_SETTING;
1080  }
1081 
1082  int length = cJSON_GetArraySize(customArray);
1083  if(customArray != NULL)
1084  {
1085  for(int i = 0; i < length ; i++)
1086  {
1087  customVal = cJSON_GetArrayItem(customArray,i);
1088  if((searchVal = cJSON_GetObjectItem(customVal,"url")) != NULL)
1089  {
1090  keyname = "url";
1091  }
1092  else if((searchVal = cJSON_GetObjectItem(customVal,"playerId")) != NULL)
1093  {
1094  keyname = "playerId";
1095  }
1096  else if((searchVal = cJSON_GetObjectItem(customVal,"appName")) != NULL)
1097  {
1098  keyname = "appName";
1099  }
1100  customValues.config = keyname;
1101  if(searchVal && searchVal->valuestring != NULL)
1102  {
1103  customValues.configValue = searchVal->valuestring;
1104  vCustom.push_back(customValues);
1105  }
1106  else
1107  {
1108  AAMPLOG_ERR("Invalid format for %s",keyname.c_str());
1109  continue;
1110  }
1111  for (auto it = mAampLookupTable.begin(); it != mAampLookupTable.end(); ++it)
1112  {
1113  keyname = it->first;
1114  searchVal = cJSON_GetObjectItem(customVal,keyname.c_str());
1115  if(searchVal)
1116  {
1117  customValues.config = keyname;
1118  if(searchVal->valuestring != NULL)
1119  {
1120  customValues.configValue = searchVal->valuestring;
1121  vCustom.push_back(customValues);
1122  }
1123  else
1124  {
1125  AAMPLOG_ERR("Invalid format for %s ",keyname.c_str());
1126  continue;
1127  }
1128  }
1129  }
1130  }
1131  for(int i = 0; i < vCustom.size(); i++)
1132  {
1133  AAMPLOG_WARN("Custom Values listed %s %s",vCustom[i].config.c_str(),vCustom[i].configValue.c_str());
1134  }
1135  }
1136 }
1137 
1138 /**
1139  * @brief CustomSearch - Function to apply custom search
1140  *
1141  */
1142 bool AampConfig::CustomSearch( std::string url, int playerId , std::string appname)
1143 {
1144  if(customFound == false)
1145  {
1146  return false;
1147  }
1148  bool found = false;
1149  AAMPLOG_INFO("url %s playerid %d appname %s ",url.c_str(),playerId,appname.c_str());
1150  std::string url_custom = url;
1151  std::string playerId_custom = std::to_string(playerId);
1152  std::string appName_custom = appname;
1153  std::string keyname;
1154  std::string urlName = "url";
1155  std::string player = "playerId";
1156  std::string appName = "appName";
1157  size_t foundurl;
1158  int index = 0;
1159  do{
1160  auto it = std::find_if( vCustom.begin(), vCustom.end(),[](const customJson & item) { return item.config == "url"; });
1161  if (it != vCustom.end())
1162  {
1163  int distance = std::distance(vCustom.begin(),it);
1164  foundurl = url_custom.find(vCustom[distance].configValue);
1165  if( foundurl != std::string::npos)
1166  {
1167  index = distance;
1168  AAMPLOG_INFO("FOUND URL %s", vCustom[index].configValue.c_str());
1169  found = true;
1170  break;
1171  }
1172  }
1173  auto it1 = std::find_if( vCustom.begin(), vCustom.end(),[](const customJson & item) { return item.config == "playerId"; });
1174  if (it1 != vCustom.end())
1175  {
1176  int distance = std::distance(vCustom.begin(),it1);
1177  foundurl = playerId_custom.find(vCustom[distance].configValue);
1178  if( foundurl != std::string::npos)
1179  {
1180  index = distance;
1181  AAMPLOG_INFO("FOUND PLAYERID %s", vCustom[index].configValue.c_str());
1182  found = true;
1183  break;
1184  }
1185  }
1186  auto it2 = std::find_if( vCustom.begin(), vCustom.end(),[](const customJson & item) { return item.config == "appName"; });
1187  if (it2 != vCustom.end())
1188  {
1189  int distance = std::distance(vCustom.begin(),it2);
1190  foundurl = appName_custom.find(vCustom[distance].configValue);
1191  if( foundurl != std::string::npos)
1192  {
1193  index = distance;
1194  AAMPLOG_INFO("FOUND AAPNAME %s",vCustom[index].configValue.c_str());
1195  found = true;
1196  break;
1197  }
1198  }
1199  //Not applicable values
1200  }while (0);
1201 
1202  if (found == true)
1203  {
1204  for( int i = index+1; i < vCustom.size(); i++ )
1205  {
1206  if(vCustom[i].config == urlName){
1207  break;}
1208  else if(vCustom[i].config == player){
1209  break;}
1210  else if(vCustom[i].config == appName){
1211  break;}
1212  else
1213  {
1214  for (auto it = mAampLookupTable.begin(); it != mAampLookupTable.end(); ++it)
1215  {
1216  AampConfigLookupEntry cfg = it->second;
1217  AAMPConfigSettings cfgEnum = cfg.cfgEntryValue;
1218  keyname = it->first;
1219  if(strcmp(vCustom[i].config.c_str(),keyname.c_str()) == 0)
1220  {
1221  if(cfgEnum < eAAMPConfig_BoolMaxValue )
1222  {
1223  if(strcmp(vCustom[i].configValue.c_str(),"true") == 0)
1224  {
1225  SetConfigValue<bool>(customOwner,cfgEnum,true);
1226  }
1227  else
1228  {
1229  SetConfigValue<bool>(customOwner,cfgEnum,false);
1230  }
1231  }
1232  else if(cfgEnum > eAAMPConfig_IntStartValue && cfgEnum < eAAMPConfig_IntMaxValue)
1233  {
1234  int conv = atoi(vCustom[i].configValue.c_str());
1235  if(ValidateRange(keyname,conv))
1236  {
1237  SetConfigValue<int>(customOwner,cfgEnum,conv);
1238  }
1239  else
1240  {
1241  AAMPLOG_ERR("Set failed .Input beyond the configured range");
1242  }
1243  }
1244  else if(cfgEnum > eAAMPConfig_LongStartValue && cfgEnum < eAAMPConfig_LongMaxValue)
1245  {
1246  long conv = atol(vCustom[i].configValue.c_str());
1247  if(ValidateRange(keyname,conv))
1248  {
1249  SetConfigValue<long>(customOwner,cfgEnum,conv);
1250  }
1251  else
1252  {
1253  AAMPLOG_ERR("Set failed .Input beyond the configured range");
1254  }
1255  }
1256  else if(cfgEnum > eAAMPConfig_DoubleStartValue && cfgEnum < eAAMPConfig_DoubleMaxValue)
1257  {
1258  double conv= (double)atof(vCustom[i].configValue.c_str());
1259  if(ValidateRange(keyname,conv))
1260  {
1261  SetConfigValue<double>(customOwner,cfgEnum,conv);
1262  }
1263  else
1264  {
1265  AAMPLOG_ERR("Set failed .Input beyond the configured range");
1266  }
1267  }
1268  else if(cfgEnum > eAAMPConfig_StringStartValue && cfgEnum < eAAMPConfig_StringMaxValue)
1269  {
1270  SetConfigValue<std::string>(customOwner,cfgEnum,std::string(vCustom[i].configValue.c_str()));
1271  }
1272  }
1273  }
1274  }
1275  }
1276 
1278  }
1279  return found;
1280 }
1281 
1282 /**
1283  * @brief GetAampConfigJSONStr - Function to Complete Config as JSON str
1284  *
1285  * @return true
1286  */
1287 bool AampConfig::GetAampConfigJSONStr(std::string &str)
1288 {
1289  AampJsonObject jsondata;
1290 
1291  // All Bool values
1292  for(int i=0;i<eAAMPConfig_BoolMaxValue;i++)
1293  {
1294  jsondata.add(GetConfigName((AAMPConfigSettings)i),bAampCfgValue[i].value);
1295  }
1296 
1297  // All integer values
1298  for(int i=eAAMPConfig_IntStartValue+1;i<eAAMPConfig_IntMaxValue;i++)
1299  {
1300  jsondata.add(GetConfigName((AAMPConfigSettings)i),iAampCfgValue[i-eAAMPConfig_IntStartValue].value);
1301  }
1302 
1303  // All long values
1304  for(int i=eAAMPConfig_LongStartValue+1;i<eAAMPConfig_LongMaxValue;i++)
1305  {
1306  jsondata.add(GetConfigName((AAMPConfigSettings)i),lAampCfgValue[i-eAAMPConfig_LongStartValue].value);
1307  }
1308 
1309  // All double values
1310  for(int i=eAAMPConfig_DoubleStartValue+1;i<eAAMPConfig_DoubleMaxValue;i++)
1311  {
1312  jsondata.add(GetConfigName((AAMPConfigSettings)i),dAampCfgValue[i-eAAMPConfig_DoubleStartValue].value);
1313  }
1314 
1315  // All String values
1316  for(int i=eAAMPConfig_StringStartValue+1;i<eAAMPConfig_StringMaxValue;i++)
1317  {
1318  jsondata.add(GetConfigName((AAMPConfigSettings)i),sAampCfgValue[i-eAAMPConfig_StringStartValue].value);
1319  }
1320 
1321  str = jsondata.print_UnFormatted();
1322  return true;
1323 }
1324 
1325 /**
1326  * @brief GetDeveloperConfigData - Function to parse and process configuration text
1327  *
1328  * @return true if parse successfully
1329  */
1330 bool AampConfig::GetDeveloperConfigData(std::string &key,std::string &value)
1331 {
1332  bool retval = false;
1333  DevCmdsIter iter = mAampDevCmdTable.find(key);
1334  if(iter != mAampDevCmdTable.end())
1335  {
1336  value = iter->second;
1337  retval = true;
1338  }
1339  return retval;
1340 }
1341 
1342 /**
1343  * @brief ProcessConfigText - Function to parse and process configuration text
1344  *
1345  * @return true if config process success
1346  */
1347 bool AampConfig::ProcessConfigText(std::string &cfg, ConfigPriority owner )
1348 {
1349  bool retval=true;
1350  do{
1351  if (!cfg.empty() && cfg.at(0) != '#')
1352  { // ignore comments
1353 
1354  if(cfg[0] == '#')
1355  break;
1356  if(cfg[0] == '*')
1357  {
1358  // Add to channel map
1359  std::size_t pos = cfg.find_first_of(' ');
1360  if (pos != std::string::npos)
1361  {
1362  //Populate channel map from aamp.cfg
1363  // new wildcard matching for overrides - allows *HBO to remap any url including "HBO"
1364  ConfigChannelInfo channelInfo;
1365  std::stringstream iss(cfg.substr(1));
1366  std::string token;
1367  while (getline(iss, token, ' '))
1368  {
1369  if (token.compare(0,4,"http") == 0)
1370  channelInfo.uri = token;
1371  else if ((token.compare(0,5,"live:") == 0) || (token.compare(0,3,"mr:") == 0) || (token.compare(0,5,"tune:") == 0))
1372  {
1373  AAMPLOG_INFO("Overriden OTA Url!!");
1374  channelInfo.uri = token;
1375  }
1376  else if(token.compare(0,4,"file") == 0)
1377  {
1378  AAMPLOG_INFO("Overriden Progressive URL!!");
1379  channelInfo.uri = token;
1380  }
1381  else if (token.compare(0,17,"licenseServerUrl=") == 0)
1382  {
1383  channelInfo.licenseUri = token.substr(17);
1384  }
1385  else
1386  channelInfo.name = token;
1387  }
1388  mChannelOverrideMap.push_back(channelInfo);
1389  }
1390 
1391  }
1392  else
1393  {
1394  //trim whitespace from the end of the string
1395  cfg.erase(std::find_if(cfg.rbegin(), cfg.rend(), [](unsigned char ch) {return !std::isspace(ch);}).base(), cfg.end());
1396  // Process commands
1397  bool toggle = false;
1398  int position = 0;
1399  std::string key,value;
1400  std::size_t delimiterPos = cfg.find("=");
1401  if(delimiterPos != std::string::npos)
1402  {
1403  key = cfg.substr(0, delimiterPos);
1404  key.erase(std::remove_if(key.begin(), key.end(), ::isspace), key.end());
1405  value = cfg.substr(delimiterPos + 1);
1406  position = value.find_first_not_of(' ');
1407  value = value.substr(position);
1408  }
1409  else
1410  {
1411  key = cfg.substr(0);
1412  toggle = true;
1413  }
1414 
1415  LookUpIter iter = mAampLookupTable.find(key);
1416  if(iter != mAampLookupTable.end())
1417  {
1418  AampConfigLookupEntry cfg = iter->second;
1419  AAMPConfigSettings cfgEnum = cfg.cfgEntryValue;
1420  AAMPLOG_WARN("Parsed value for dev cfg property %s - %s",key.c_str(),value.c_str());
1421  // For those parameters in Boolean Settings
1422  if(cfgEnum < eAAMPConfig_BoolMaxValue )
1423  {
1424  bool param=false;
1425  int conv = 0;
1426  if(!toggle)
1427  {
1428  if(isdigit(value[0]))
1429  { // for backward compatability 0/1
1430  if(ReadNumericHelper(value,conv))
1431  SetConfigValue<bool>(owner,cfgEnum,(bool)(conv != 0));
1432  }
1433  else
1434  {
1435  // look for true or false
1436  if(strcasecmp(value.c_str(),"true")==0)
1437  SetConfigValue<bool>(owner,cfgEnum,(bool)true);
1438  else if(strcasecmp(value.c_str(),"false")==0)
1439  SetConfigValue<bool>(owner,cfgEnum,(bool)false);
1440  else
1441  AAMPLOG_ERR("Wrong input provided for Cfg:%s Value:%s",iter->first.c_str(),value.c_str());
1442  }
1443  }
1444  else
1445  {
1446  // for toggle
1447  ToggleConfigValue(owner,cfgEnum);
1448  }
1449  }
1450  else if(cfgEnum > eAAMPConfig_IntStartValue && cfgEnum < eAAMPConfig_IntMaxValue)
1451  {
1452  // For those parameters in Integer Settings
1453  int conv = 0;
1454  if(isdigit(value[0]) && ReadNumericHelper(value,conv))
1455  {
1456  if(ValidateRange(key,conv))
1457  {
1458  SetConfigValue<int>(owner,cfgEnum,(int)conv);
1459  }
1460  else
1461  {
1462  AAMPLOG_ERR("Set failed .Input beyond the configured range");
1463  }
1464  }
1465  }
1466  else if(cfgEnum > eAAMPConfig_LongStartValue && cfgEnum < eAAMPConfig_LongMaxValue)
1467  {
1468  // For those parameters in long Settings
1469  long conv = 0;
1470  if(isdigit(value[0]) && ReadNumericHelper(value,conv))
1471  {
1472  if(ValidateRange(key,conv))
1473  {
1474  SetConfigValue<long>(owner,cfgEnum,(long)conv);
1475  }
1476  else
1477  {
1478  AAMPLOG_ERR("Set failed .Input beyond the configured range");
1479  }
1480  }
1481  }
1482  else if(cfgEnum > eAAMPConfig_DoubleStartValue && cfgEnum < eAAMPConfig_DoubleMaxValue)
1483  {
1484  // For those parameters in double settings
1485  double conv=0.0;
1486  if(isdigit(value[0]) && ReadNumericHelper(value,conv))
1487  {
1488  if(ValidateRange(key,conv))
1489  {
1490  SetConfigValue<double>(owner,cfgEnum,(double)conv);
1491  }
1492  else
1493  {
1494  AAMPLOG_ERR("Set failed .Input beyond the configured range");
1495  }
1496  }
1497  }
1498  else if(cfgEnum > eAAMPConfig_StringStartValue && cfgEnum < eAAMPConfig_StringMaxValue)
1499  {
1500  // For those parameters in string Settings
1501  if(value.size())
1502  SetConfigValue<std::string>(owner,cfgEnum,value);
1503  }
1504 
1505  }
1506  else
1507  {
1508  mAampDevCmdTable[key]=value;
1509  AAMPLOG_WARN("Unknown command(%s) added to DeveloperTable",key.c_str());
1510  }
1511  }
1512  }
1513  }while(0);
1514  return retval;
1515 }
1516 
1517 /**
1518  * @brief ReadAampCfgJsonFile - Function to parse and process configuration file in json format
1519  *
1520  * @return true if read successfully
1521  */
1522 
1524 {
1525  bool retVal=false;
1526 #ifdef AAMP_SIMULATOR_BUILD
1527  std::string cfgPath(getenv("HOME"));
1528 #else
1529  std::string cfgPath = "";
1530 #endif
1531 
1532 #ifdef AAMP_SIMULATOR_BUILD
1533  cfgPath += "/aampcfg.json";
1534 #else
1535 
1536 #ifdef AAMP_CPC // Comcast builds
1537  // AAMP_ENABLE_OPT_OVERRIDE is only added for PROD builds.
1538  const char *env_aamp_enable_opt = getenv("AAMP_ENABLE_OPT_OVERRIDE");
1539 #else
1540  const char *env_aamp_enable_opt = "true";
1541 #endif
1542 
1543  if(env_aamp_enable_opt)
1544  {
1545  cfgPath = AAMP_JSON_PATH;
1546  }
1547 #endif
1548 
1549  if (!cfgPath.empty())
1550  {
1551  std::ifstream f(cfgPath, std::ifstream::in | std::ifstream::binary);
1552  if (f.good())
1553  {
1554  AAMPLOG_WARN("opened aampcfg.json");
1555  std::filebuf* pbuf = f.rdbuf();
1556  std::size_t size = pbuf->pubseekoff (0,f.end,f.in);
1557  pbuf->pubseekpos (0,f.in);
1558  char* jsonbuffer=new char[size];
1559  pbuf->sgetn (jsonbuffer,size);
1560  f.close();
1561  ProcessConfigJson( jsonbuffer, AAMP_DEV_CFG_SETTING);
1562  SAFE_DELETE_ARRAY(jsonbuffer);
1563  DoCustomSetting(AAMP_DEV_CFG_SETTING);
1564  retVal = true;
1565  }
1566  }
1567  return retVal;
1568 }
1569 
1570 /**
1571  * @brief ReadAampCfgTxtFile - Function to parse and process configuration file in text format
1572  *
1573  */
1575 {
1576  bool retVal = false;
1577 #ifdef AAMP_SIMULATOR_BUILD
1578  std::string cfgPath(getenv("HOME"));
1579 #else
1580  std::string cfgPath = "";
1581 #endif
1582 
1583 #ifdef AAMP_SIMULATOR_BUILD
1584  cfgPath += "/aamp.cfg";
1585 #else
1586 
1587 #ifdef AAMP_CPC // Comcast builds
1588  // AAMP_ENABLE_OPT_OVERRIDE is only added for PROD builds.
1589  const char *env_aamp_enable_opt = getenv("AAMP_ENABLE_OPT_OVERRIDE");
1590 #else
1591  const char *env_aamp_enable_opt = "true";
1592 #endif
1593 
1594  if(env_aamp_enable_opt)
1595  {
1596  cfgPath = AAMP_CFG_PATH;
1597  }
1598 #endif
1599 
1600  if (!cfgPath.empty())
1601  {
1602  std::ifstream f(cfgPath, std::ifstream::in | std::ifstream::binary);
1603  if (f.good())
1604  {
1605  AAMPLOG_WARN("opened aamp.cfg");
1606  std::string buf;
1607  while (f.good())
1608  {
1609  std::getline(f, buf);
1610  ProcessConfigText(buf, AAMP_DEV_CFG_SETTING);
1611  }
1612  f.close();
1613  DoCustomSetting(AAMP_DEV_CFG_SETTING);
1614  retVal = true;
1615  }
1616  }
1617  return retVal;
1618 }
1619 
1620 /**
1621  * @fn ReadBase64TR181Param reads Tr181 parameter at Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AAMP_CFG.b64Config
1622  * @return void
1623  */
1624 void AampConfig::ReadBase64TR181Param()
1625 {
1626 #ifdef IARM_MGR
1627  size_t iConfigLen = 0;
1628  char * cloudConf = GetTR181AAMPConfig("Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.Feature.AAMP_CFG.b64Config", iConfigLen);
1629  if(cloudConf && (iConfigLen > 0))
1630  {
1631  bool bCharCompliant = true;
1632  for (int i = 0; i < iConfigLen; i++)
1633  {
1634  if (!( cloudConf[i] == 0xD || cloudConf[i] == 0xA) && // ignore LF and CR chars
1635  ((cloudConf[i] < 0x20) || (cloudConf[i] > 0x7E)))
1636  {
1637  bCharCompliant = false;
1638  AAMPLOG_ERR("Non Compliant char[0x%X] found, Ignoring whole config ",cloudConf[i]);
1639  break;
1640  }
1641  }
1642 
1643  if (bCharCompliant)
1644  {
1645  std::string strCfg(cloudConf,iConfigLen);
1646  if(!ProcessConfigJson(strCfg.c_str(),AAMP_OPERATOR_SETTING))
1647  {
1648  // Input received is not json format, parse as text
1649  std::istringstream iSteam(strCfg);
1650  std::string line;
1651  while (std::getline(iSteam, line))
1652  {
1653  if (line.length() > 0)
1654  {
1655  AAMPLOG_INFO("aamp-cmd:[%s]\n", line.c_str());
1656  ProcessConfigText(line,AAMP_OPERATOR_SETTING);
1657  }
1658  }
1659  }
1660  }
1661  free(cloudConf); // allocated by base64_Decode in GetTR181AAMPConfig
1662  }
1663 #endif
1664 }
1665 
1666 /**
1667  * @fn ReadAllTR181Params reads All Tr181 parameters at Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.aamp.<param-name>
1668  * @return void
1669  */
1670 void AampConfig::ReadAllTR181Params()
1671 {
1672 
1673 #ifdef AAMP_RFC_ENABLED
1674 
1675  // To find the execution time of ReadAllTR181Params
1676  long long begin = NOW_STEADY_TS_MS;
1677 
1678  ConfigPriority owner = AAMP_OPERATOR_SETTING;
1679  const std::string strAAMPTr181BasePath = "Device.DeviceInfo.X_RDKCENTRAL-COM_RFC.aamp.";
1680 
1681  for( int icount =0; icount < sizeof( ConfigLookUpTable)/ sizeof(AampConfigLookupEntry) ; icount++ )
1682  {
1683  if(true == ConfigLookUpTable[icount].bSupportOperatorSetting )
1684  {
1685  std::string strParamName = ConfigLookUpTable[icount].cmdString ;
1686  AAMPConfigSettings cfgEnum = ConfigLookUpTable[icount].cfgEntryValue;
1687  std::string value = RFCSettings::getRFCValue(strAAMPTr181BasePath+strParamName);
1688  if( !value.empty() )
1689  {
1690  if(cfgEnum < eAAMPConfig_BoolMaxValue)
1691  {
1692  int conv = 0;
1693  if(isdigit(value[0]))
1694  { // for backward compatability 0/1
1695  if(ReadNumericHelper(value,conv))
1696  SetConfigValue<bool>(owner,cfgEnum,(bool)(conv != 0));
1697  }
1698  else
1699  {
1700  // look for true or false
1701  if(strcasecmp(value.c_str(),"true")==0)
1702  {
1703  SetConfigValue<bool>(owner,cfgEnum,(bool)true);
1704  }
1705  else if(strcasecmp(value.c_str(),"false")==0)
1706  {
1707  SetConfigValue<bool>(owner,cfgEnum,(bool)false);
1708  }
1709  else
1710  {
1711  AAMPLOG_ERR("ReadAllTR181Params: Wrong input provided for param:%s Value:%s",strParamName.c_str(),value.c_str());
1712  }
1713  }
1714  }
1715  else if(cfgEnum > eAAMPConfig_IntStartValue && cfgEnum < eAAMPConfig_IntMaxValue)
1716  {
1717  // For those parameters in Integer Settings
1718  int conv = 0;
1719  if(isdigit(value[0]) && ReadNumericHelper(value,conv))
1720  {
1721  if(ValidateRange(strParamName,conv))
1722  {
1723  SetConfigValue<int>(owner,cfgEnum,(int)conv);
1724  }
1725  else
1726  {
1727  AAMPLOG_ERR("ReadAllTR181Params: Out of range input provided for param:%s Value:%s",strParamName.c_str(),value.c_str());
1728  }
1729  }
1730  }
1731  else if(cfgEnum > eAAMPConfig_LongStartValue && cfgEnum < eAAMPConfig_LongMaxValue)
1732  {
1733  // For those parameters in long Settings
1734  long conv = 0;
1735  if(isdigit(value[0]) && ReadNumericHelper(value,conv))
1736  {
1737  if(ValidateRange(strParamName,conv))
1738  {
1739  SetConfigValue<long>(owner,cfgEnum,(long)conv);
1740  }
1741  else
1742  {
1743  AAMPLOG_ERR("ReadAllTR181Params: Out of range input provided for param:%s Value:%s",strParamName.c_str(),value.c_str());
1744  }
1745  }
1746  }
1747  else if(cfgEnum > eAAMPConfig_DoubleStartValue && cfgEnum < eAAMPConfig_DoubleMaxValue)
1748  {
1749  // For those parameters in double settings
1750  double conv=0.0;
1751  if(isdigit(value[0]) && ReadNumericHelper(value,conv))
1752  {
1753  if(ValidateRange(strParamName,conv))
1754  {
1755  SetConfigValue<double>(owner,cfgEnum,(double)conv);
1756  }
1757  else
1758  {
1759  AAMPLOG_ERR("ReadAllTR181Params: Out of range input provided for param:%s Value:%s",strParamName.c_str(),value.c_str());
1760  }
1761  }
1762  }
1763  else if (cfgEnum > eAAMPConfig_StringStartValue && cfgEnum < eAAMPConfig_StringMaxValue)
1764  {
1765  // For those parameters in string Settings
1766  if(value.size())
1767  {
1768  SetConfigValue<std::string>(owner,cfgEnum,value);
1769  }
1770  }
1771  }
1772  else
1773  { // normal case - no need to log by default
1774  AAMPLOG_TRACE("ReadAllTR181Params: Got empty value for param:%s",strParamName.c_str());
1775  }
1776  }
1777  }
1778 
1779  AAMPLOG_WARN("ReadAllTR181Params took %lld ms to execute", (NOW_STEADY_TS_MS - begin));
1780 #endif
1781 
1782 }
1783 
1784 
1785 /**
1786  * @brief ReadOperatorConfiguration - Reads Operator configuration from RFC and env variables
1787  *
1788  */
1790 {
1791  // Not all parameters are supported as individual tr181 parameter hence keeping base64 version.
1792  ReadBase64TR181Param();
1793 
1794  // new way of reading RFC for each seperate parameter it will override any parameter set before ReadBase64TR181Param
1795  // read all individual config parameters,
1796  ReadAllTR181Params();
1797 
1798  ///////////// Read environment variables set specific to Operator ///////////////////
1799  const char *env_aamp_force_aac = getenv("AAMP_FORCE_AAC");
1800  if(env_aamp_force_aac)
1801  {
1802  AAMPLOG_INFO("AAMP_FORCE_AAC present: Changing preference to AAC over ATMOS & DD+");
1803  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_DisableAC4,true);
1804  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_DisableEC3,true);
1805  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_DisableAC3,true);
1806  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_DisableATMOS,true);
1807  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_ForceEC3,false);
1808  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_StereoOnly,true);
1809  }
1810 
1811  const char *env_aamp_min_init_cache = getenv("AAMP_MIN_INIT_CACHE");
1812  if(env_aamp_min_init_cache)
1813  {
1814  int minInitCache = 0;
1815  if(sscanf(env_aamp_min_init_cache,"%d",&minInitCache) && minInitCache >= 0)
1816  {
1817  AAMPLOG_INFO("AAMP_MIN_INIT_CACHE present: Changing min initial cache to %d seconds",minInitCache);
1818  SetConfigValue<int>(AAMP_OPERATOR_SETTING,eAAMPConfig_InitialBuffer,minInitCache);
1819  }
1820  }
1821 
1822 
1823  const char *env_enable_cdai = getenv("CLIENT_SIDE_DAI");
1824  if(env_enable_cdai)
1825  {
1826  AAMPLOG_INFO("CLIENT_SIDE_DAI present: Enabling CLIENT_SIDE_DAI.");
1827  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_EnableClientDai,true);
1828  }
1829 
1830  const char *env_enable_westoros_sink = getenv("AAMP_ENABLE_WESTEROS_SINK");
1831  if(env_enable_westoros_sink)
1832  {
1833 
1834  int iValue = atoi(env_enable_westoros_sink);
1835  bool bValue = (strcasecmp(env_enable_westoros_sink,"true") == 0);
1836 
1837  AAMPLOG_INFO("AAMP_ENABLE_WESTEROS_SINK present, Value = %d", (bValue ? bValue : (iValue ? iValue : 0)));
1838 
1839  if(iValue || bValue)
1840  {
1841  AAMPLOG_INFO("AAMP_ENABLE_WESTEROS_SINK present: Enabling westeros-sink.");
1842  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_UseWesterosSink,true);
1843  }
1844 
1845  }
1846 
1847  const char *env_enable_lld = getenv("LOW_LATENCY_DASH");
1848  if(env_enable_lld)
1849  {
1850  AAMPLOG_INFO("LOW_LATENCY_DASH present: Enabling LOW_LATENCY_DASH");
1851  SetConfigValue<bool>(AAMP_OPERATOR_SETTING,eAAMPConfig_EnableLowLatencyDash,true);
1852  }
1853 }
1854 
1855 /**
1856  * @brief ConfigureLogSettings - This function configures log settings for LogManager instance
1857  *
1858  */
1860 {
1861  std::string logString;
1862  logString = sAampCfgValue[eAAMPConfig_LogLevel-eAAMPConfig_StringStartValue].value;
1863 
1864  if(bAampCfgValue[eAAMPConfig_TraceLogging].value || logString.compare("trace") == 0)
1865  {
1866  // backward compatability
1868  logging.trace = true;
1869  }
1870  else if(bAampCfgValue[eAAMPConfig_DebugLogging].value || logString.compare("debug") == 0)
1871  {
1872  // backward compatability . Trace ande debug does same job.
1873  logging.info = false;
1875  logging.debug = true;
1876  }
1877  else if((bAampCfgValue[eAAMPConfig_InfoLogging].value || logString.compare("info") == 0))
1878  {
1879  // backward compatability
1881  logging.info = true;
1882  }
1883  else if((bAampCfgValue[eAAMPConfig_WarnLogging].value || logString.compare("warn") == 0))
1884  {
1886  }
1887  else if(logString.compare("error") == 0)
1888  {
1890  }
1891 
1892 
1893  // This is pending to handle the ownership rights , whether App can set following config
1903 
1904 }
1905 
1906 /**
1907  * @brief ShowOperatorSetConfiguration - List all operator configured settings
1908  */
1910 {
1911  ////////////////// AAMP Config (Operator Set) //////////
1912  ShowConfiguration(AAMP_OPERATOR_SETTING);
1913 }
1914 
1915 /**
1916  * @brief ShowAppSetConfiguration - List all Application configured settings
1917  */
1919 {
1920  ////////////////// AAMP Config (Application Set) //////////
1921  ShowConfiguration(AAMP_APPLICATION_SETTING);
1922 }
1923 
1924 /**
1925  * @brief ShowStreamSetConfiguration - List all stream configured settings
1926  */
1928 {
1929  ////////////////// AAMP Config (Stream Set) //////////
1930  ShowConfiguration(AAMP_STREAM_SETTING);
1931 
1932 }
1933 
1934 /**
1935  * @brief ShowDefaultAampConfiguration - List all AAMP Default settings
1936  *
1937  */
1939 {
1940  ///////////////// AAMP Default Configuration /////////
1942 }
1943 
1944 /**
1945  * @brief ShowDevCfgConfiguration - List all developer configured settings
1946  */
1948 {
1949  ////////////////// AAMP Cfg Override Configuration //////////
1950  ShowConfiguration(AAMP_DEV_CFG_SETTING);
1951 }
1952 
1953 /**
1954  * @brief ShowAAMPConfiguration - Show all settings for every owner
1955  *
1956  */
1958 {
1959  ////////////////// AAMP Configuration //////////
1960  ShowConfiguration(AAMP_MAX_SETTING);
1961 
1962 }
1963 
1964 //////////////// Special Functions which involve conversion of configuration ///////////
1965 /////////Only add new functions if required only , else use default Get call and covert
1966 /////////at usage
1967 #if 0
1968 /**
1969  * @brief GetPreferredDRM - Get Preferred DRM type
1970  *
1971  * @return DRMSystems - type of drm
1972  */
1973 DRMSystems AampConfig::GetPreferredDRM()
1974 {
1975  DRMSystems prefSys;
1976  std::string keySystem = sAampCfgValue[eAAMPConfig_PreferredDRM-eAAMPConfig_StringStartValue].value;
1977  std::transform(keySystem.begin(), keySystem.end(), keySystem.begin(), ::tolower);
1978  if(keySystem.find("widevine") != std::string::npos)
1979  prefSys = eDRM_WideVine;
1980  else if(keySystem.find("clearkey") != std::string::npos)
1981  prefSys = eDRM_ClearKey;
1982  else
1983  prefSys = eDRM_PlayReady; // default is playready
1984  return prefSys;
1985 }
1986 #endif
1987 
1988 ///////////////////////////////// Private Functions ///////////////////////////////////////////
1989 
1990 /**
1991  * @brief DoCustomSetting - Function to do override , to avoid complexity with multiple configs
1992  */
1994 {
1996  {
1997  // If Stereo Only flag is set , it will override all other sub setting with audio
1998  SetConfigValue<bool>(owner,eAAMPConfig_DisableEC3,true);
1999  SetConfigValue<bool>(owner,eAAMPConfig_DisableATMOS,true);
2000  SetConfigValue<bool>(owner,eAAMPConfig_ForceEC3,false);
2001  SetConfigValue<bool>(owner,eAAMPConfig_DisableAC4,true);
2002  SetConfigValue<bool>(owner,eAAMPConfig_DisableAC3,true);
2003  }
2005  {
2006  // if EC3 is disabled , no need to enable forceEC3
2007  SetConfigValue<bool>(owner,eAAMPConfig_ForceEC3,false);
2008  }
2010  {
2011  SetConfigValue<bool>(AAMP_APPLICATION_SETTING,eAAMPConfig_NewDiscontinuity,true);
2012  SetConfigValue<bool>(AAMP_APPLICATION_SETTING,eAAMPConfig_HLSAVTrackSyncUsingStartTime,true);
2013 
2014  }
2016  {
2018  {
2019  SetConfigValue<bool>(AAMP_APPLICATION_SETTING,eAAMPConfig_EnableRectPropertyCfg,true);
2020  }
2021  }
2023  {
2024  SetConfigValue<bool>(AAMP_APPLICATION_SETTING,eAAMPConfig_HLSAVTrackSyncUsingStartTime,true);
2025  }
2026  if(GetConfigOwner(eAAMPConfig_AuthToken) == AAMP_APPLICATION_SETTING)
2027  {
2028  ConfigPriority tempowner;
2029  std::string tempvalue;
2030  std::string sessionToken;
2031  tempowner = sAampCfgValue[eAAMPConfig_AuthToken-eAAMPConfig_StringStartValue].lastowner;
2032  tempvalue = sAampCfgValue[eAAMPConfig_AuthToken-eAAMPConfig_StringStartValue].lastvalue;
2033 
2034  GetConfigValue(eAAMPConfig_AuthToken,sessionToken);
2035  SetConfigValue<std::string>(AAMP_TUNE_SETTING,eAAMPConfig_AuthToken,sessionToken);
2036 
2037  sAampCfgValue[eAAMPConfig_AuthToken-eAAMPConfig_StringStartValue].lastowner = tempowner;
2038  sAampCfgValue[eAAMPConfig_AuthToken-eAAMPConfig_StringStartValue].lastvalue = tempvalue;
2039 
2040  }
2041  if(IsConfigSet(eAAMPConfig_IgnoreAppLiveOffset) && (GetConfigOwner(eAAMPConfig_LiveOffset) == AAMP_APPLICATION_SETTING))
2042  {
2043  ConfigPriority tempowner;
2044  double tempvalue,Appoffset;
2046  tempowner = dAampCfgValue[eAAMPConfig_LiveOffset-eAAMPConfig_DoubleStartValue].lastowner;
2047  tempvalue = dAampCfgValue[eAAMPConfig_LiveOffset-eAAMPConfig_DoubleStartValue].lastvalue;
2048  dAampCfgValue[eAAMPConfig_LiveOffset-eAAMPConfig_DoubleStartValue].owner = tempowner;
2049  dAampCfgValue[eAAMPConfig_LiveOffset-eAAMPConfig_DoubleStartValue].value = tempvalue;
2050  AAMPLOG_INFO("\n IgnoreAppLiveOffset Enabled,LiveOffset changed from %lf to %lf ",Appoffset,tempvalue);
2051 
2052 
2053  }
2054 
2056 }
2057 
2058 /**
2059  * @brief SetValue - Function to store the configuration and ownership based on priority set
2060  */
2061 template<class J,class K>
2062 void AampConfig::SetValue(J &setting, ConfigPriority newowner, const K &value, std::string cfgName)
2063 {
2064  if(setting.owner <= newowner )
2065  {
2066  // n number of times same configuration can be overwritten.
2067  // to store to last value ,owner has to be different
2068  if(setting.owner != newowner)
2069  {
2070  setting.lastvalue = setting.value;
2071  setting.lastowner = setting.owner;
2072  }
2073  setting.value = value;
2074  setting.owner = newowner;
2075  AAMPLOG_WARN("%s New Owner[%d]",cfgName.c_str(),newowner);
2076  }
2077  else
2078  {
2079  AAMPLOG_WARN("%s Owner[%d] not allowed to Set ,current Owner[%d]",cfgName.c_str(),newowner,setting.owner);
2080  }
2081 }
2082 
2083 /**
2084  * @brief GetConfigName - Function to get configuration name for enum from lookup table
2085  *
2086  */
2088 {
2089  std::string keyname;
2090  for (auto it = mAampLookupTable.begin(); it != mAampLookupTable.end(); ++it)
2091  {
2092  AampConfigLookupEntry cfgitem = it->second;
2093  AAMPConfigSettings cfgEnum = cfgitem.cfgEntryValue;
2094  if (cfgEnum == cfg)
2095  {
2096  keyname = it->first;
2097  break;
2098  }
2099  }
2100  return keyname;
2101 }
2102 
2103 
2104 template<typename T>
2105 bool AampConfig::ValidateRange(std::string key, T& value)
2106 {
2107  bool retval = true;
2108 
2109  LookUpIter iter = mAampLookupTable.find(key);
2110  if(iter != mAampLookupTable.end())
2111  {
2112  // check the type and find the min and max values
2113  AampConfigLookupEntry item = iter->second;
2114  if (std::is_same<T, int>::value)
2115  {
2116  if(item.Min.iMinValue != -1 && value < item.Min.iMinValue)
2117  retval = false;
2118  if(item.Max.iMaxValue != -1 && value > item.Max.iMaxValue)
2119  retval = false;
2120  }
2121  else if (std::is_same<T, long>::value)
2122  {
2123  if(item.Min.lMinValue != -1 && value < item.Min.lMinValue)
2124  retval = false;
2125  if(item.Max.lMaxValue != -1 && value > item.Max.lMaxValue)
2126  retval = false;
2127  }
2128  else if (std::is_same<T, double>::value)
2129  {
2130  if(item.Min.dMinValue != -1 && value < item.Min.dMinValue)
2131  retval = false;
2132  if(item.Max.dMaxValue != -1 && value > item.Max.dMaxValue)
2133  retval = false;
2134  }
2135  }
2136  else
2137  {
2138  retval = false;
2139  }
2140  return retval;
2141 }
2142 
2143 /**
2144  * @brief RestoreConfiguration - Function is restore last configuration value from current ownership
2145  *
2146  */
2148 {
2149  // All Bool values
2150  for(int i=0;i<eAAMPConfig_BoolMaxValue;i++)
2151  {
2152  if(bAampCfgValue[i].owner == owner && bAampCfgValue[i].owner != bAampCfgValue[i].lastowner)
2153  {
2154  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s]->[%-5s][%s]->[%s]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[bAampCfgValue[i].owner].ownerName,
2155  OwnerLookUpTable[bAampCfgValue[i].lastowner].ownerName,bAampCfgValue[i].value?"true":"false",bAampCfgValue[i].lastvalue?"true":"false");
2156  bAampCfgValue[i].owner = bAampCfgValue[i].lastowner;
2157  bAampCfgValue[i].value = bAampCfgValue[i].lastvalue;
2158 
2159  }
2160  }
2161 
2162  // All integer values
2163  for(int i=eAAMPConfig_IntStartValue+1;i<eAAMPConfig_IntMaxValue;i++)
2164  {
2165  // for int array
2166  if(iAampCfgValue[i-eAAMPConfig_IntStartValue].owner == owner && iAampCfgValue[i-eAAMPConfig_IntStartValue].owner != iAampCfgValue[i-eAAMPConfig_IntStartValue].lastowner)
2167  {
2168  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s]->[%-5s][%d]->[%d]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[iAampCfgValue[i-eAAMPConfig_IntStartValue].owner].ownerName,
2169  OwnerLookUpTable[iAampCfgValue[i-eAAMPConfig_IntStartValue].lastowner].ownerName,iAampCfgValue[i-eAAMPConfig_IntStartValue].value,iAampCfgValue[i-eAAMPConfig_IntStartValue].lastvalue);
2170  iAampCfgValue[i-eAAMPConfig_IntStartValue].owner = iAampCfgValue[i-eAAMPConfig_IntStartValue].lastowner;
2171  iAampCfgValue[i-eAAMPConfig_IntStartValue].value = iAampCfgValue[i-eAAMPConfig_IntStartValue].lastvalue;
2172 
2173  }
2174  }
2175 
2176  // All long values
2177  for(int i=eAAMPConfig_LongStartValue+1;i<eAAMPConfig_LongMaxValue;i++)
2178  {
2179  // for long array
2180  if(lAampCfgValue[i-eAAMPConfig_LongStartValue].owner == owner && lAampCfgValue[i-eAAMPConfig_LongStartValue].owner != lAampCfgValue[i-eAAMPConfig_LongStartValue].lastowner)
2181  {
2182  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s]->[%-5s][%ld]->[%ld]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[lAampCfgValue[i-eAAMPConfig_LongStartValue].owner].ownerName,
2183  OwnerLookUpTable[lAampCfgValue[i-eAAMPConfig_LongStartValue].lastowner].ownerName,lAampCfgValue[i-eAAMPConfig_LongStartValue].value,lAampCfgValue[i-eAAMPConfig_LongStartValue].lastvalue);
2184  lAampCfgValue[i-eAAMPConfig_LongStartValue].owner = lAampCfgValue[i-eAAMPConfig_LongStartValue].lastowner;
2185  lAampCfgValue[i-eAAMPConfig_LongStartValue].value = lAampCfgValue[i-eAAMPConfig_LongStartValue].lastvalue;
2186  }
2187  }
2188 
2189  // All double values
2190  for(int i=eAAMPConfig_DoubleStartValue+1;i<eAAMPConfig_DoubleMaxValue;i++)
2191  {
2192  // for double array
2193  if(dAampCfgValue[i-eAAMPConfig_DoubleStartValue].owner == owner && dAampCfgValue[i-eAAMPConfig_DoubleStartValue].owner != dAampCfgValue[i-eAAMPConfig_DoubleStartValue].lastowner)
2194  {
2195  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s]->[%-5s][%f]->[%f]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[dAampCfgValue[i-eAAMPConfig_DoubleStartValue].owner].ownerName,
2196  OwnerLookUpTable[dAampCfgValue[i-eAAMPConfig_DoubleStartValue].lastowner].ownerName,dAampCfgValue[i-eAAMPConfig_DoubleStartValue].value,dAampCfgValue[i-eAAMPConfig_DoubleStartValue].lastvalue);
2197  dAampCfgValue[i-eAAMPConfig_DoubleStartValue].owner = dAampCfgValue[i-eAAMPConfig_DoubleStartValue].lastowner;
2198  dAampCfgValue[i-eAAMPConfig_DoubleStartValue].value = dAampCfgValue[i-eAAMPConfig_DoubleStartValue].lastvalue;
2199  }
2200  }
2201 
2202 
2203  // All String values
2204  for(int i=eAAMPConfig_StringStartValue+1;i<eAAMPConfig_StringMaxValue;i++)
2205  {
2206  // for string array
2207  if(sAampCfgValue[i-eAAMPConfig_StringStartValue].owner == owner && sAampCfgValue[i-eAAMPConfig_StringStartValue].owner != sAampCfgValue[i-eAAMPConfig_StringStartValue].lastowner)
2208  {
2209  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s]->[%-5s][%s]->[%s]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[sAampCfgValue[i-eAAMPConfig_StringStartValue].owner].ownerName,
2210  OwnerLookUpTable[sAampCfgValue[i-eAAMPConfig_StringStartValue].lastowner].ownerName,sAampCfgValue[i-eAAMPConfig_StringStartValue].value.c_str(),sAampCfgValue[i-eAAMPConfig_StringStartValue].lastvalue.c_str());
2211  sAampCfgValue[i-eAAMPConfig_StringStartValue].owner = sAampCfgValue[i-eAAMPConfig_StringStartValue].lastowner;
2212  sAampCfgValue[i-eAAMPConfig_StringStartValue].value = sAampCfgValue[i-eAAMPConfig_StringStartValue].lastvalue;
2213  }
2214  }
2215 
2216  if(owner == AAMP_CUSTOM_DEV_CFG_SETTING)
2217  {
2219  }
2220 }
2221 
2222 /**
2223  * @brief ShowConfiguration - Function to list configration values based on the owner
2224  */
2226 {
2227  // All Bool values
2228  for(int i=0;i<eAAMPConfig_BoolMaxValue;i++)
2229  {
2230  if(bAampCfgValue[i].owner == owner || owner == AAMP_MAX_SETTING)
2231  {
2232  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s][%s]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[bAampCfgValue[i].owner].ownerName,bAampCfgValue[i].value?"true":"false");
2233  }
2234  }
2235 
2236  // All integer values
2237  for(int i=eAAMPConfig_IntStartValue+1;i<eAAMPConfig_IntMaxValue;i++)
2238  {
2239  // for int array
2240  if(iAampCfgValue[i-eAAMPConfig_IntStartValue].owner == owner || owner == AAMP_MAX_SETTING)
2241  {
2242  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s][%d]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[iAampCfgValue[i-eAAMPConfig_IntStartValue].owner].ownerName,iAampCfgValue[i-eAAMPConfig_IntStartValue].value);
2243  }
2244  }
2245 
2246  // All long values
2247  for(int i=eAAMPConfig_LongStartValue+1;i<eAAMPConfig_LongMaxValue;i++)
2248  {
2249  // for long array
2250  if(lAampCfgValue[i-eAAMPConfig_LongStartValue].owner == owner || owner == AAMP_MAX_SETTING)
2251  {
2252  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s][%ld]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[lAampCfgValue[i-eAAMPConfig_LongStartValue].owner].ownerName,lAampCfgValue[i-eAAMPConfig_LongStartValue].value);
2253  }
2254  }
2255 
2256  // All double values
2257  for(int i=eAAMPConfig_DoubleStartValue+1;i<eAAMPConfig_DoubleMaxValue;i++)
2258  {
2259  // for double array
2260  if(dAampCfgValue[i-eAAMPConfig_DoubleStartValue].owner == owner || owner == AAMP_MAX_SETTING)
2261  {
2262  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s][%f]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[dAampCfgValue[i-eAAMPConfig_DoubleStartValue].owner].ownerName,dAampCfgValue[i-eAAMPConfig_DoubleStartValue].value);
2263  }
2264  }
2265 
2266 
2267 
2268  // All String values
2269  for(int i=eAAMPConfig_StringStartValue+1;i<eAAMPConfig_StringMaxValue;i++)
2270  {
2271  // for string array
2272  if(sAampCfgValue[i-eAAMPConfig_StringStartValue].owner == owner || owner == AAMP_MAX_SETTING)
2273  {
2274  AAMPLOG_WARN("Cfg [%-3d][%-20s][%-5s][%s]",i,GetConfigName((AAMPConfigSettings)i).c_str(),OwnerLookUpTable[sAampCfgValue[i-eAAMPConfig_StringStartValue].owner].ownerName,sAampCfgValue[i-eAAMPConfig_StringStartValue].value.c_str());
2275  }
2276  }
2277 
2278  if(mChannelOverrideMap.size() && (owner == AAMP_DEV_CFG_SETTING || owner == AAMP_MAX_SETTING))
2279  {
2280  ChannelMapIter iter;
2281  for (iter = mChannelOverrideMap.begin(); iter != mChannelOverrideMap.end(); ++iter)
2282  {
2283  AAMPLOG_INFO("Cfg Channel[%s]-> [%s]",iter->name.c_str(),iter->uri.c_str());
2284  AAMPLOG_INFO("Cfg Channel[%s]-> License Uri: [%s]",iter->name.c_str(),iter->licenseUri.c_str());
2285  }
2286  }
2287 
2288 }
2289 
2290 /**
2291  * @brief ReadNumericHelper - Parse helper function
2292  */
2293 template<typename T>
2294 bool AampConfig::ReadNumericHelper(std::string valStr, T& value)
2295 {
2296  bool ret=false;
2297  if (valStr.size())
2298  {
2299  ret = true;
2300  if (std::is_same<T, int>::value)
2301  value = std::stoi(valStr);
2302  else if (std::is_same<T, long>::value)
2303  value = std::stol(valStr);
2304  else if (std::is_same<T, float>::value)
2305  value = std::stof(valStr);
2306  else if (std::is_same<T, double>::value)
2307  value = std::stod(valStr);
2308  else
2309  {
2310  AAMPLOG_ERR("ERROR Invalid Input ");
2311  ret = false;
2312  }
2313 
2314  }
2315  return ret;
2316 }
2317 
2318 #ifdef IARM_MGR
2319 
2320 /**
2321  * @brief GetTR181AAMPConfig
2322  *
2323  * @return config value
2324  */
2325 char * AampConfig::GetTR181AAMPConfig(const char * paramName, size_t & iConfigLen)
2326 {
2327  char * strConfig = NULL;
2328  IARM_Result_t result;
2329  HOSTIF_MsgData_t param;
2330  memset(&param,0,sizeof(param));
2331  snprintf(param.paramName,TR69HOSTIFMGR_MAX_PARAM_LEN,"%s",paramName);
2332  param.reqType = HOSTIF_GET;
2333 
2335  (void *)&param, sizeof(param));
2336  if(result == IARM_RESULT_SUCCESS)
2337  {
2338  if(fcNoFault == param.faultCode)
2339  {
2340  if(param.paramtype == hostIf_StringType && param.paramLen > 0 )
2341  {
2342  std::string strforLog(param.paramValue,param.paramLen);
2343 
2344  iConfigLen = param.paramLen;
2345  const char *src = (const char*)(param.paramValue);
2346  strConfig = (char * ) base64_Decode(src,&iConfigLen);
2347 
2348  AAMPLOG_INFO("GetTR181AAMPConfig: Got:%s En-Len:%d Dec-len:%d",strforLog.c_str(),param.paramLen,iConfigLen);
2349  }
2350  else
2351  {
2352  AAMPLOG_ERR("GetTR181AAMPConfig: Not a string param type=%d or Invalid len:%d ",param.paramtype, param.paramLen);
2353  }
2354  }
2355  }
2356  else
2357  {
2358  AAMPLOG_ERR("GetTR181AAMPConfig: Failed to retrieve value result=%d",result);
2359  }
2360  return strConfig;
2361 }
2362 #endif
2363 
2364 #ifdef UNIT_TEST_ENABLED
2365 
2366 int main()
2367 {
2368  AampConfig var1,var2;
2369  var1.ReadAampCfgTxtFile();
2370 
2371  var1.ShowAAMPConfiguration();
2372  for(int i=0;i<eAAMPConfig_BoolMaxValue;i++)
2373  {
2374  var1.SetConfigValue(AAMP_DEV_CFG_SETTING,(AAMPConfigSettings)i,false);
2375  }
2376  var1.ShowDevCfgConfiguration();
2377  for(int i=0;i<eAAMPConfig_BoolMaxValue;i++)
2378  {
2379  var1.SetConfigValue(AAMP_DEV_CFG_SETTING,(AAMPConfigSettings)i,true);
2380  }
2382  for(int i=0;i<eAAMPConfig_BoolMaxValue;i++)
2383  {
2384  var1.SetConfigValue(AAMP_OPERATOR_SETTING,(AAMPConfigSettings)i,false);
2385  }
2386  var1.ShowAppSetConfiguration();
2387 
2388  /*
2389  var1.SetConfigValue(AAMP_OPERATOR_SETTING, eAAMPConfig_EnableABR, false);
2390  var1.SetConfigValue(AAMP_DEV_CFG_SETTING, eAAMPConfig_EnableABR, true);
2391  var1.SetConfigValue(AAMP_OPERATOR_SETTING, eAAMPConfig_EnableABR, false);
2392  printf("Var 1 value : %d\n",var1.IsConfigSet(eAAMPConfig_EnableABR));
2393  printf("Var 2 value : %d\n",var2.IsConfigSet(eAAMPConfig_EnableABR));
2394  var2 = var1;
2395  printf("Var 2 value : %d\n",var2.IsConfigSet(eAAMPConfig_EnableABR));
2396  */
2397  var1.SetConfigValue<std::string>(AAMP_DEV_CFG_SETTING,eAAMPConfig_LicenseServerUrl,(std::string)"Testing");
2398  printf("Before Client DAI : %d \n",var1.IsConfigSet(eAAMPConfig_EnableClientDai));
2399  var1.ToggleConfigValue(AAMP_DEV_CFG_SETTING,eAAMPConfig_EnableClientDai);
2400  printf("After Client DAI : %d \n",var1.IsConfigSet(eAAMPConfig_EnableClientDai));
2401  std::string test1;
2403  printf("Var1 LicenseServer Url:%s\n",test1.c_str());
2404 
2405  var2.ReadAampCfgTxtFile();
2406  var2.SetConfigValue<std::string>(AAMP_OPERATOR_SETTING,eAAMPConfig_LicenseServerUrl,"Testing URL");
2407  var2.SetConfigValue(AAMP_APPLICATION_SETTING,eAAMPConfig_DisableATMOS,true);
2408  var2.ShowAAMPConfiguration();
2409  std::string ovrride;
2410  if(var2.GetChannelOverride("HBOCM",ovrride))
2411  {
2412  printf("Ch override for HBO: %s \n",ovrride.c_str());
2413  }
2414  return 0;
2415 }
2416 #endif
2417 
2418 
2419 
2420 //TODO
2421 // Time conversion of networktimeout , manifesttimeout ,
2422 // Handling info/debug/trace logging
2423 // channel mapping
2424 // playlist Cache size calc
2425 // MaxDRM session min n max checl
2426 // langcodepref - convert to enum
2427 
2428 
2429 
2430 
2431 
eAAMPConfig_LLMaxLatency
@ eAAMPConfig_LLMaxLatency
Definition: AampConfig.h:259
eAAMPConfig_CurlDownloadStartTimeout
@ eAAMPConfig_CurlDownloadStartTimeout
Definition: AampConfig.h:273
eTUNED_EVENT_ON_GST_PLAYING
@ eTUNED_EVENT_ON_GST_PLAYING
Definition: AampDefine.h:188
eAAMPConfig_PreferredTextLabel
@ eAAMPConfig_PreferredTextLabel
Definition: AampConfig.h:318
DEFAULT_AAMP_ABR_CHUNK_THRESHOLD_SIZE
#define DEFAULT_AAMP_ABR_CHUNK_THRESHOLD_SIZE
Definition: AampDefine.h:148
AampRfc.h
Aamp RFC header files.
eAAMPConfig_PlaylistTimeout
@ eAAMPConfig_PlaylistTimeout
Definition: AampConfig.h:285
_HostIf_MsgData_t::reqType
HostIf_ReqType_t reqType
Definition: hostIf_tr69ReqHandler.h:178
DEFAULT_CACHED_FRAGMENT_CHUNKS_PER_TRACK
#define DEFAULT_CACHED_FRAGMENT_CHUNKS_PER_TRACK
Definition: AampDefine.h:146
AampLogManager::trace
bool trace
Definition: AampLogManager.h:156
eAAMPConfig_CurlLicenseLogging
@ eAAMPConfig_CurlLicenseLogging
Definition: AampConfig.h:144
eAAMPConfig_Fog
@ eAAMPConfig_Fog
Definition: AampConfig.h:98
eDRM_WideVine
@ eDRM_WideVine
Definition: AampDrmSystems.h:36
eAAMPConfig_InterruptHandling
@ eAAMPConfig_InterruptHandling
Definition: AampConfig.h:183
DEFAULT_LICENSE_KEY_ACQUIRE_WAIT_TIME
#define DEFAULT_LICENSE_KEY_ACQUIRE_WAIT_TIME
Definition: AampDefine.h:75
eAAMPConfig_MaxFragmentCached
@ eAAMPConfig_MaxFragmentCached
Definition: AampConfig.h:220
DEFAULT_ABR_OUTLIER
#define DEFAULT_ABR_OUTLIER
Definition: AampDefine.h:66
eAAMPConfig_NewDiscontinuity
@ eAAMPConfig_NewDiscontinuity
Definition: AampConfig.h:165
AampConfig::logging
AampLogManager logging
Definition: AampConfig.h:462
eAAMPConfig_LiveOffset4K
@ eAAMPConfig_LiveOffset4K
Definition: AampConfig.h:289
eAAMPConfig_LicenseRetryWaitTime
@ eAAMPConfig_LicenseRetryWaitTime
Definition: AampConfig.h:227
eAAMPConfig_HLSAVTrackSyncUsingStartTime
@ eAAMPConfig_HLSAVTrackSyncUsingStartTime
Definition: AampConfig.h:117
eAAMPConfig_PreservePipeline
@ eAAMPConfig_PreservePipeline
Definition: AampConfig.h:100
eAAMPConfig_MapM3U8
@ eAAMPConfig_MapM3U8
Definition: AampConfig.h:295
eDRM_PlayReady
@ eDRM_PlayReady
Definition: AampDrmSystems.h:37
eAAMPConfig_StereoOnly
@ eAAMPConfig_StereoOnly
Definition: AampConfig.h:110
eAAMPConfig_AudioOnlyPlayback
@ eAAMPConfig_AudioOnlyPlayback
Definition: AampConfig.h:122
DEFAULT_STALL_DETECTION_TIMEOUT
#define DEFAULT_STALL_DETECTION_TIMEOUT
Definition: AampDefine.h:95
eAAMPConfig_SubTitleLanguage
@ eAAMPConfig_SubTitleLanguage
Definition: AampConfig.h:302
AampConfig::iAampCfgValue
ConfigInt iAampCfgValue[eAAMPConfig_IntMaxValue-eAAMPConfig_IntStartValue]
Definition: AampConfig.h:746
MAX_SEG_DOWNLOAD_FAIL_COUNT
#define MAX_SEG_DOWNLOAD_FAIL_COUNT
Definition: AampDefine.h:112
AampConfig::SetConfigValue
void SetConfigValue(ConfigPriority owner, AAMPConfigSettings cfg, const T &value)
SetConfigValue - Set function to set bool/int/long data type configuration.
Definition: AampConfig.cpp:830
AampConfig::SetValue
void SetValue(J &setting, ConfigPriority newowner, const K &value, std::string cfgName)
SetValue - Function to store the configuration and ownership based on priority set.
Definition: AampConfig.cpp:2062
eAAMPConfig_PreferredTextType
@ eAAMPConfig_PreferredTextType
Definition: AampConfig.h:319
eAAMPConfig_WVLicenseServerUrl
@ eAAMPConfig_WVLicenseServerUrl
Definition: AampConfig.h:300
eAAMPConfig_HarvestCountLimit
@ eAAMPConfig_HarvestCountLimit
Definition: AampConfig.h:211
AAMP_LIVE_OFFSET
#define AAMP_LIVE_OFFSET
Definition: AampDefine.h:80
eAAMPConfig_CurlDownloadLowBWTimeout
@ eAAMPConfig_CurlDownloadLowBWTimeout
Definition: AampConfig.h:274
eAAMPConfig_DecoderUnavailableStrict
@ eAAMPConfig_DecoderUnavailableStrict
Definition: AampConfig.h:132
eAAMPConfig_WarnLogging
@ eAAMPConfig_WarnLogging
Definition: AampConfig.h:139
eDRM_ClearKey
@ eDRM_ClearKey
Definition: AampDrmSystems.h:41
eAAMPConfig_PlaybackOffset
@ eAAMPConfig_PlaybackOffset
Definition: AampConfig.h:287
DEFAULT_DOWNLOAD_RETRY_COUNT
#define DEFAULT_DOWNLOAD_RETRY_COUNT
Definition: AampDefine.h:91
eAAMPConfig_EnableSCTE35PresentationTime
@ eAAMPConfig_EnableSCTE35PresentationTime
Definition: AampConfig.h:205
eAAMPConfig_EnableVideoEndEvent
@ eAAMPConfig_EnableVideoEndEvent
Definition: AampConfig.h:129
AAMP_HIGH_BUFFER_BEFORE_RAMPUP
#define AAMP_HIGH_BUFFER_BEFORE_RAMPUP
Definition: AampDefine.h:106
eAAMPConfig_MaxDASHDRMSessions
@ eAAMPConfig_MaxDASHDRMSessions
Definition: AampConfig.h:231
AampConfig::GetAampConfigJSONStr
bool GetAampConfigJSONStr(std::string &str)
GetAampConfigJSONStr - Function to Complete Config as JSON str.
Definition: AampConfig.cpp:1287
logprintf
void logprintf(const char *format,...)
Print logs to console / log fil.
Definition: aamplogging.cpp:432
DEFAULT_REPORT_PROGRESS_INTERVAL
#define DEFAULT_REPORT_PROGRESS_INTERVAL
Definition: AampDefine.h:72
eAAMPConfig_ForceHttp
@ eAAMPConfig_ForceHttp
Definition: AampConfig.h:120
eAAMPConfig_WebVTTNative
@ eAAMPConfig_WebVTTNative
Definition: AampConfig.h:172
MAX_SEG_DRM_DECRYPT_FAIL_COUNT
#define MAX_SEG_DRM_DECRYPT_FAIL_COUNT
Definition: AampDefine.h:99
eAAMPConfig_LRHContentType
@ eAAMPConfig_LRHContentType
Definition: AampConfig.h:324
DEFAULT_AAMP_ABR_THRESHOLD_SIZE
#define DEFAULT_AAMP_ABR_THRESHOLD_SIZE
Definition: AampDefine.h:103
eAAMPConfig_SEITimeCode
@ eAAMPConfig_SEITimeCode
Definition: AampConfig.h:180
eAAMPConfig_EnableLowLatencyDash
@ eAAMPConfig_EnableLowLatencyDash
Definition: AampConfig.h:184
eAAMPConfig_LicenseServerUrl
@ eAAMPConfig_LicenseServerUrl
Definition: AampConfig.h:297
eAAMPConfig_EnableCMCD
@ eAAMPConfig_EnableCMCD
Definition: AampConfig.h:203
eAAMPConfig_ABRNWConsistency
@ eAAMPConfig_ABRNWConsistency
Definition: AampConfig.h:218
CURL_FRAGMENT_DL_TIMEOUT
#define CURL_FRAGMENT_DL_TIMEOUT
Definition: AampDefine.h:93
AampConfigLookupEntry
AAMP Config lookup table structure.
Definition: AampConfig.h:361
eAAMPConfig_ReportProgressInterval
@ eAAMPConfig_ReportProgressInterval
Definition: AampConfig.h:286
AampLogManager::stream
bool stream
Definition: AampLogManager.h:161
IARM_Bus_Call
IARM_Result_t IARM_Bus_Call(const char *ownerName, const char *methodName, void *arg, size_t argLen)
This API is used to Invoke RPC method by its application name and method name.
Definition: iarm_bus.c:57
eAAMPConfig_PreferredTextLanguage
@ eAAMPConfig_PreferredTextLanguage
Definition: AampConfig.h:317
DEFAULT_LATENCY_MONITOR_DELAY
#define DEFAULT_LATENCY_MONITOR_DELAY
Definition: AampDefine.h:138
eAAMPConfig_LatencyMonitorDelay
@ eAAMPConfig_LatencyMonitorDelay
Definition: AampConfig.h:253
AampLogManager::failover
bool failover
Definition: AampLogManager.h:160
eAAMPConfig_GSTLogging
@ eAAMPConfig_GSTLogging
Definition: AampConfig.h:141
eAAMPConfig_EnableLowLatencyCorrection
@ eAAMPConfig_EnableLowLatencyCorrection
Definition: AampConfig.h:186
MAX_INIT_FRAGMENT_CACHE_PER_TRACK
#define MAX_INIT_FRAGMENT_CACHE_PER_TRACK
Definition: AampDefine.h:117
eAAMPConfig_EnableCurlStore
@ eAAMPConfig_EnableCurlStore
Definition: AampConfig.h:200
eAAMPConfig_BulkTimedMetaReport
@ eAAMPConfig_BulkTimedMetaReport
Definition: AampConfig.h:168
eAAMPConfig_NativeCCRendering
@ eAAMPConfig_NativeCCRendering
Definition: AampConfig.h:170
AAMP_DEFAULT_SETTING
@ AAMP_DEFAULT_SETTING
Definition: AampDefine.h:210
eAAMPConfig_EnableSharedSSLSession
@ eAAMPConfig_EnableSharedSSLSession
Definition: AampConfig.h:182
eAAMPConfig_MaxABRNWBufferRampUp
@ eAAMPConfig_MaxABRNWBufferRampUp
Definition: AampConfig.h:240
eAAMPConfig_AuthToken
@ eAAMPConfig_AuthToken
Definition: AampConfig.h:308
eAAMPConfig_ReportVideoPTS
@ eAAMPConfig_ReportVideoPTS
Definition: AampConfig.h:131
AampConfig::GetChannelOverride
const char * GetChannelOverride(const std::string chName)
GetChannelOverride - Gets channel override url for channel Name.
Definition: AampConfig.cpp:764
eAAMPConfig_MinABRNWBufferRampDown
@ eAAMPConfig_MinABRNWBufferRampDown
Definition: AampConfig.h:239
_HostIf_MsgData_t
Definition: hostIf_tr69ReqHandler.h:170
eAAMPConfig_InitRampDownLimit
@ eAAMPConfig_InitRampDownLimit
Definition: AampConfig.h:235
eAAMPConfig_PrefetchIFramePlaylistDL
@ eAAMPConfig_PrefetchIFramePlaylistDL
Definition: AampConfig.h:99
DEFAULT_MINIMUM_INIT_CACHE_SECONDS
#define DEFAULT_MINIMUM_INIT_CACHE_SECONDS
Definition: AampDefine.h:96
AampConfig::lAampCfgValue
ConfigLong lAampCfgValue[eAAMPConfig_LongMaxValue-eAAMPConfig_LongStartValue]
Definition: AampConfig.h:747
eAAMPConfig_EnableSeekRange
@ eAAMPConfig_EnableSeekRange
Definition: AampConfig.h:159
AampConfig::operator=
AampConfig & operator=(const AampConfig &)
AampConfig Copy Constructor function.
Definition: AampConfig.cpp:317
eAAMPConfig_DashParallelFragDownload
@ eAAMPConfig_DashParallelFragDownload
Definition: AampConfig.h:160
MAX_LICENSE_ACQ_WAIT_TIME
#define MAX_LICENSE_ACQ_WAIT_TIME
Definition: AampDefine.h:76
eAAMPConfig_ChangeTrackWithoutRetune
@ eAAMPConfig_ChangeTrackWithoutRetune
Definition: AampConfig.h:199
eAAMPConfig_SyncAudioFragments
@ eAAMPConfig_SyncAudioFragments
Definition: AampConfig.h:188
eAAMPConfig_GstAudioBufBytes
@ eAAMPConfig_GstAudioBufBytes
Definition: AampConfig.h:252
eAAMPConfig_EnablePROutputProtection
@ eAAMPConfig_EnablePROutputProtection
Definition: AampConfig.h:124
eAAMPConfig_EnableLowLatencyOffsetMin
@ eAAMPConfig_EnableLowLatencyOffsetMin
Definition: AampConfig.h:187
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
eAAMPConfig_CurlStallTimeout
@ eAAMPConfig_CurlStallTimeout
Definition: AampConfig.h:272
eAAMPConfig_MinBitrate
@ eAAMPConfig_MinBitrate
Definition: AampConfig.h:276
eAAMPConfig_GstVideoBufBytes
@ eAAMPConfig_GstVideoBufBytes
Definition: AampConfig.h:251
eAAMPConfig_ABRCacheOutlier
@ eAAMPConfig_ABRCacheOutlier
Definition: AampConfig.h:216
eAAMPConfig_IFrameDefaultBitrate4K
@ eAAMPConfig_IFrameDefaultBitrate4K
Definition: AampConfig.h:271
AampOwnerLookupEntry
AAMP Config ownership enum string mapping table.
Definition: AampConfig.h:385
eAAMPConfig_MPDDiscontinuityHandling
@ eAAMPConfig_MPDDiscontinuityHandling
Definition: AampConfig.h:118
eAAMPConfig_FragmentDownloadFailThreshold
@ eAAMPConfig_FragmentDownloadFailThreshold
Definition: AampConfig.h:260
eAAMPConfig_DemuxAudioHLSTrack
@ eAAMPConfig_DemuxAudioHLSTrack
Definition: AampConfig.h:101
eAAMPConfig_NetworkTimeout
@ eAAMPConfig_NetworkTimeout
Definition: AampConfig.h:283
AampConfig
AAMP Config Class defn.
Definition: AampConfig.h:457
AampConfig::GetConfigValue
bool GetConfigValue(AAMPConfigSettings cfg, std::string &value)
GetConfigValue - Gets configuration for string data type.
Definition: AampConfig.cpp:748
AampLogManager::id3
bool id3
Definition: AampLogManager.h:165
eAAMPConfig_LogLevel
@ eAAMPConfig_LogLevel
Definition: AampConfig.h:309
eAAMPConfig_DemuxVideoHLSTrack
@ eAAMPConfig_DemuxVideoHLSTrack
Definition: AampConfig.h:102
AampLogManager::debug
bool debug
Definition: AampLogManager.h:155
eAAMPConfig_DebugLogging
@ eAAMPConfig_DebugLogging
Definition: AampConfig.h:137
eAAMPConfig_ManifestTimeout
@ eAAMPConfig_ManifestTimeout
Definition: AampConfig.h:284
eAAMPConfig_URIParameter
@ eAAMPConfig_URIParameter
Definition: AampConfig.h:305
DEFAULT_TIMEOUT_FOR_SOURCE_SETUP
#define DEFAULT_TIMEOUT_FOR_SOURCE_SETUP
Definition: AampDefine.h:98
eAAMPConfig_Disable4K
@ eAAMPConfig_Disable4K
Definition: AampConfig.h:181
DEFAULT_WAIT_TIME_BEFORE_RETRY_HTTP_5XX_MS
#define DEFAULT_WAIT_TIME_BEFORE_RETRY_HTTP_5XX_MS
Definition: AampDefine.h:62
AampConfig::ProcessConfigJson
bool ProcessConfigJson(const char *cfg, ConfigPriority owner)
ProcessConfigJson - Function to parse and process json configuration string.
Definition: AampConfig.cpp:889
eAAMPConfig_RampDownLimit
@ eAAMPConfig_RampDownLimit
Definition: AampConfig.h:234
eAAMPConfig_MetadataLogging
@ eAAMPConfig_MetadataLogging
Definition: AampConfig.h:145
AampConfig::GetDeveloperConfigData
bool GetDeveloperConfigData(std::string &key, std::string &value)
GetDeveloperConfigData - Function to parse and process configuration text.
Definition: AampConfig.cpp:1330
AampConfig::ReadOperatorConfiguration
void ReadOperatorConfiguration()
ReadOperatorConfiguration - Reads Operator configuration from RFC and env variables.
Definition: AampConfig.cpp:1789
AampConfig::ReadAampCfgJsonFile
bool ReadAampCfgJsonFile()
ReadAampCfgJsonFile - Function to parse and process configuration file in json format.
Definition: AampConfig.cpp:1523
DEFAULT_LICENSE_REQ_RETRY_WAIT_TIME
#define DEFAULT_LICENSE_REQ_RETRY_WAIT_TIME
Definition: AampDefine.h:73
AAMP_USERAGENT_SUFFIX
#define AAMP_USERAGENT_SUFFIX
Definition: AampDefine.h:102
eAAMPConfig_NetworkProxy
@ eAAMPConfig_NetworkProxy
Definition: AampConfig.h:306
eAAMPConfig_ABRCacheLength
@ eAAMPConfig_ABRCacheLength
Definition: AampConfig.h:214
eAAMPConfig_PreferredTextRendition
@ eAAMPConfig_PreferredTextRendition
Definition: AampConfig.h:316
eAAMPConfig_DescriptiveTrackName
@ eAAMPConfig_DescriptiveTrackName
Definition: AampConfig.h:111
MAX_SEG_INJECT_FAIL_COUNT
#define MAX_SEG_INJECT_FAIL_COUNT
Definition: AampDefine.h:100
AAMPGstPlayer::IsCodecSupported
static bool IsCodecSupported(const std::string &codecName)
Definition: aampgstplayer.cpp:4370
DEFAULT_STALL_ERROR_CODE
#define DEFAULT_STALL_ERROR_CODE
Definition: AampDefine.h:94
eAAMPConfig_PlaylistParallelFetch
@ eAAMPConfig_PlaylistParallelFetch
Definition: AampConfig.h:166
eAAMPConfig_LimitResolution
@ eAAMPConfig_LimitResolution
Definition: AampConfig.h:175
eAAMPConfig_EnableGstPositionQuery
@ eAAMPConfig_EnableGstPositionQuery
Definition: AampConfig.h:150
customJson
Holds information of a custom JSON array.
Definition: AampConfig.h:348
eAAMPConfig_DRMDecryptThreshold
@ eAAMPConfig_DRMDecryptThreshold
Definition: AampConfig.h:236
DEFAULT_INIT_BITRATE
#define DEFAULT_INIT_BITRATE
Definition: AampDefine.h:77
eAAMPConfig_DisableLowLatencyABR
@ eAAMPConfig_DisableLowLatencyABR
Definition: AampConfig.h:185
AampLogManager::info
bool info
Definition: AampLogManager.h:154
eAAMPConfig_AnonymousLicenseRequest
@ eAAMPConfig_AnonymousLicenseRequest
Definition: AampConfig.h:116
AampConfig::dAampCfgValue
ConfigDouble dAampCfgValue[eAAMPConfig_DoubleMaxValue-eAAMPConfig_DoubleStartValue]
Definition: AampConfig.h:748
DEFAULT_MIN_LOW_LATENCY
#define DEFAULT_MIN_LOW_LATENCY
Definition: AampDefine.h:140
eAAMPConfig_CustomLicenseData
@ eAAMPConfig_CustomLicenseData
Definition: AampConfig.h:320
AAMP_CUSTOM_DEV_CFG_SETTING
@ AAMP_CUSTOM_DEV_CFG_SETTING
Definition: AampDefine.h:216
eAAMPConfig_ABRThresholdSize
@ eAAMPConfig_ABRThresholdSize
Definition: AampConfig.h:219
MIN_LICENSE_KEY_ACQUIRE_WAIT_TIME
#define MIN_LICENSE_KEY_ACQUIRE_WAIT_TIME
Definition: AampDefine.h:74
eAAMPConfig_EnableRectPropertyCfg
@ eAAMPConfig_EnableRectPropertyCfg
Definition: AampConfig.h:130
eAAMPConfig_MapMPD
@ eAAMPConfig_MapMPD
Definition: AampConfig.h:294
eAAMPConfig_DisableEC3
@ eAAMPConfig_DisableEC3
Definition: AampConfig.h:107
eAAMPConfig_LRHAcceptValue
@ eAAMPConfig_LRHAcceptValue
Definition: AampConfig.h:323
AampConfig::ShowDefaultAampConfiguration
void ShowDefaultAampConfiguration()
ShowDefaultAampConfiguration - List all AAMP Default settings.
Definition: AampConfig.cpp:1938
eAAMPConfig_DisableUnderflow
@ eAAMPConfig_DisableUnderflow
Definition: AampConfig.h:174
eAAMPConfig_LatencyMonitorInterval
@ eAAMPConfig_LatencyMonitorInterval
Definition: AampConfig.h:254
AampLogManager::progress
bool progress
Definition: AampLogManager.h:159
eAAMPConfig_DescriptiveAudioTrack
@ eAAMPConfig_DescriptiveAudioTrack
Definition: AampConfig.h:134
eAAMPConfig_EnablePublishingMuxedAudio
@ eAAMPConfig_EnablePublishingMuxedAudio
Definition: AampConfig.h:202
AampJsonObject.h
File to handle Json format.
eAAMPConfig_LiveOffset
@ eAAMPConfig_LiveOffset
Definition: AampConfig.h:288
AampConfig::ProcessConfigText
bool ProcessConfigText(std::string &cfg, ConfigPriority owner)
ProcessConfigText - Function to parse and process configuration text.
Definition: AampConfig.cpp:1347
eAAMPConfig_CKLicenseServerUrl
@ eAAMPConfig_CKLicenseServerUrl
Definition: AampConfig.h:298
AAMP_DEFAULT_PLAYBACK_OFFSET
#define AAMP_DEFAULT_PLAYBACK_OFFSET
Definition: AampDefine.h:81
eAAMPConfig_RuntimeDRMConfig
@ eAAMPConfig_RuntimeDRMConfig
Definition: AampConfig.h:201
eAAMPConfig_PreferredAudioType
@ eAAMPConfig_PreferredAudioType
Definition: AampConfig.h:315
AampConfig::ShowStreamSetConfiguration
void ShowStreamSetConfiguration()
ShowStreamSetConfiguration - List all stream configured settings.
Definition: AampConfig.cpp:1927
eAAMPConfig_MaxFragmentChunkCached
@ eAAMPConfig_MaxFragmentChunkCached
Definition: AampConfig.h:255
eAAMPConfig_GStreamerBufferingBeforePlay
@ eAAMPConfig_GStreamerBufferingBeforePlay
Definition: AampConfig.h:123
eAAMPConfig_LanguageCodePreference
@ eAAMPConfig_LanguageCodePreference
Definition: AampConfig.h:233
DEFAULT_MAXIMUM_PLAYBACK_BUFFER_SECONDS
#define DEFAULT_MAXIMUM_PLAYBACK_BUFFER_SECONDS
Definition: AampDefine.h:97
eAAMPConfig_UseWesterosSink
@ eAAMPConfig_UseWesterosSink
Definition: AampConfig.h:153
eAAMPConfig_GstSubtecEnabled
@ eAAMPConfig_GstSubtecEnabled
Definition: AampConfig.h:194
DEFAULT_ABR_SKIP_DURATION
#define DEFAULT_ABR_SKIP_DURATION
Definition: AampDefine.h:67
ConfigPriority
ConfigPriority
AAMP Config Ownership values.
Definition: AampDefine.h:208
eAAMPConfig_CurlLogging
@ eAAMPConfig_CurlLogging
Definition: AampConfig.h:143
eAAMPConfig_XRESupportedTune
@ eAAMPConfig_XRESupportedTune
Definition: AampConfig.h:193
eAAMPConfig_SuppressDecode
@ eAAMPConfig_SuppressDecode
Definition: AampConfig.h:196
aampgstplayer.h
Gstreamer based player for AAMP.
eAAMPConfig_AvgBWForABR
@ eAAMPConfig_AvgBWForABR
Definition: AampConfig.h:169
eAAMPConfig_DisableAC3
@ eAAMPConfig_DisableAC3
Definition: AampConfig.h:112
TRICKPLAY_LINEAR_PLAYBACK_FPS
#define TRICKPLAY_LINEAR_PLAYBACK_FPS
Definition: AampDefine.h:90
AampConfig::DoCustomSetting
void DoCustomSetting(ConfigPriority owner)
DoCustomSetting - Function to do override , to avoid complexity with multiple configs.
Definition: AampConfig.cpp:1993
eAAMPConfig_DisablePlaylistIndexEvent
@ eAAMPConfig_DisablePlaylistIndexEvent
Definition: AampConfig.h:113
_HostIf_MsgData_t::paramName
char paramName[(4 *1024)]
Definition: hostIf_tr69ReqHandler.h:171
DEFAULT_INIT_BITRATE_4K
#define DEFAULT_INIT_BITRATE_4K
Definition: AampDefine.h:79
_base64.h
base64 source Encoder/Decoder
eAAMPConfig_RetuneForGSTError
@ eAAMPConfig_RetuneForGSTError
Definition: AampConfig.h:156
eAAMPConfig_JsInfoLogging
@ eAAMPConfig_JsInfoLogging
Definition: AampConfig.h:206
eAAMPConfig_PreferredAudioLabel
@ eAAMPConfig_PreferredAudioLabel
Definition: AampConfig.h:314
AampConfig::GetChannelLicenseOverride
const char * GetChannelLicenseOverride(const std::string chName)
GetChannelLicenseOverride - Gets channel License override url for channel Url.
Definition: AampConfig.cpp:785
eAAMPConfig_LicenseKeyAcquireWaitTime
@ eAAMPConfig_LicenseKeyAcquireWaitTime
Definition: AampConfig.h:228
eAAMPConfig_ABRSkipDuration
@ eAAMPConfig_ABRSkipDuration
Definition: AampConfig.h:217
eAAMPConfig_DASHIgnoreBaseURLIfSlash
@ eAAMPConfig_DASHIgnoreBaseURLIfSlash
Definition: AampConfig.h:115
eAAMPConfig_HarvestConfig
@ eAAMPConfig_HarvestConfig
Definition: AampConfig.h:212
AampConfig::ToggleConfigValue
void ToggleConfigValue(ConfigPriority owner, AAMPConfigSettings cfg)
ToggleConfigValue - Toggle Boolean configuration.
Definition: AampConfig.cpp:809
eAAMPConfig_ABRCacheLife
@ eAAMPConfig_ABRCacheLife
Definition: AampConfig.h:213
eLOGLEVEL_WARN
@ eLOGLEVEL_WARN
Definition: AampLogManager.h:101
eAAMPConfig_LicenseProxy
@ eAAMPConfig_LicenseProxy
Definition: AampConfig.h:307
eDRM_MAX_DRMSystems
@ eDRM_MAX_DRMSystems
Definition: AampDrmSystems.h:42
AampConfig::GetConfigName
std::string GetConfigName(AAMPConfigSettings cfg)
GetConfigName - Function to get configuration name for enum from lookup table.
Definition: AampConfig.cpp:2087
eAAMPConfig_DiscontinuityTimeout
@ eAAMPConfig_DiscontinuityTimeout
Definition: AampConfig.h:275
TRICKPLAY_VOD_PLAYBACK_FPS
#define TRICKPLAY_VOD_PLAYBACK_FPS
Definition: AampDefine.h:89
eAAMPConfig_MaxCurlSockStore
@ eAAMPConfig_MaxCurlSockStore
Definition: AampConfig.h:264
eAAMPConfig_PlayAdFromCDN
@ eAAMPConfig_PlayAdFromCDN
Definition: AampConfig.h:128
AampLogManager::curlHeader
bool curlHeader
Definition: AampLogManager.h:162
AampConfig.h
Configurations for AAMP.
AampConfig::GetConfigOwner
ConfigPriority GetConfigOwner(AAMPConfigSettings cfg)
GetConfigOwner - Gets configuration Owner.
Definition: AampConfig.cpp:680
eAAMPConfig_LinearTrickPlayFPS
@ eAAMPConfig_LinearTrickPlayFPS
Definition: AampConfig.h:226
eAAMPConfig_DisableATMOS
@ eAAMPConfig_DisableATMOS
Definition: AampConfig.h:108
AampConfig::ReadNumericHelper
bool ReadNumericHelper(std::string valStr, T &value)
ReadNumericHelper - Parse helper function.
Definition: AampConfig.cpp:2294
eAAMPConfig_PreferredAudioRendition
@ eAAMPConfig_PreferredAudioRendition
Definition: AampConfig.h:311
eAAMPConfig_TuneEventConfig
@ eAAMPConfig_TuneEventConfig
Definition: AampConfig.h:224
eAAMPConfig_SslVerifyPeer
@ eAAMPConfig_SslVerifyPeer
Definition: AampConfig.h:126
eAAMPConfig_SegmentInjectThreshold
@ eAAMPConfig_SegmentInjectThreshold
Definition: AampConfig.h:237
eAAMPConfig_ReTuneOnBufferingTimeout
@ eAAMPConfig_ReTuneOnBufferingTimeout
Definition: AampConfig.h:125
AampConfig::ReadDeviceCapability
void ReadDeviceCapability()
Definition: AampConfig.cpp:609
eAAMPConfig_ABRBufferCheckEnabled
@ eAAMPConfig_ABRBufferCheckEnabled
Definition: AampConfig.h:164
eAAMPConfig_EnablePTO
@ eAAMPConfig_EnablePTO
Definition: AampConfig.h:191
eAAMPConfig_PreferredAudioLanguage
@ eAAMPConfig_PreferredAudioLanguage
Definition: AampConfig.h:313
eAAMPConfig_LLMinLatency
@ eAAMPConfig_LLMinLatency
Definition: AampConfig.h:257
AampLogManager::logMetadata
bool logMetadata
Definition: AampLogManager.h:164
AAMPLOG_TRACE
#define AAMPLOG_TRACE(FORMAT,...)
AAMP logging defines, this can be enabled through setLogLevel() as per the need.
Definition: AampLogManager.h:83
eAAMPConfig_UseSecManager
@ eAAMPConfig_UseSecManager
Definition: AampConfig.h:190
eAAMPConfig_SchemeIdUriDaiStream
@ eAAMPConfig_SchemeIdUriDaiStream
Definition: AampConfig.h:321
AampConfig::RestoreConfiguration
void RestoreConfiguration(ConfigPriority owner, AampLogManager *mLogObj)
RestoreConfiguration - Function is restore last configuration value from current ownership.
Definition: AampConfig.cpp:2147
eAAMPConfig_ForceEC3
@ eAAMPConfig_ForceEC3
Definition: AampConfig.h:106
eAAMPConfig_PropogateURIParam
@ eAAMPConfig_PropogateURIParam
Definition: AampConfig.h:152
AampConfig::ShowOperatorSetConfiguration
void ShowOperatorSetConfiguration()
ShowOperatorSetConfiguration - List all operator configured settings.
Definition: AampConfig.cpp:1909
AampLogManager::curl
bool curl
Definition: AampLogManager.h:158
AampJsonObject::print_UnFormatted
std::string print_UnFormatted()
Print the constructed JSON to a string.
Definition: AampJsonObject.cpp:380
AampConfig::CustomSearch
bool CustomSearch(std::string url, int playerId, std::string appname)
CustomSearch - Function to apply custom search.
Definition: AampConfig.cpp:1142
IARM_BUS_TR69HOSTIFMGR_NAME
#define IARM_BUS_TR69HOSTIFMGR_NAME
Definition: hostIf_tr69ReqHandler.h:85
eAAMPConfig_LivePauseBehavior
@ eAAMPConfig_LivePauseBehavior
Definition: AampConfig.h:250
DEFAULT_LATENCY_MONITOR_INTERVAL
#define DEFAULT_LATENCY_MONITOR_INTERVAL
Definition: AampDefine.h:139
DEFAULT_ABR_NW_CONSISTENCY_CNT
#define DEFAULT_ABR_NW_CONSISTENCY_CNT
Definition: AampDefine.h:68
eAAMPConfig_DemuxAudioBeforeVideo
@ eAAMPConfig_DemuxAudioBeforeVideo
Definition: AampConfig.h:104
eAAMPConfig_AsyncTune
@ eAAMPConfig_AsyncTune
Definition: AampConfig.h:173
eAAMPConfig_PersistLowNetworkBandwidth
@ eAAMPConfig_PersistLowNetworkBandwidth
Definition: AampConfig.h:198
eAAMPConfig_TraceLogging
@ eAAMPConfig_TraceLogging
Definition: AampConfig.h:138
AampJsonObject::add
bool add(const std::string &name, const std::string &value, const ENCODING encoding=ENCODING_STRING)
Add a string value.
Definition: AampJsonObject.cpp:69
AampConfig::GetTR181AAMPConfig
char * GetTR181AAMPConfig(const char *paramName, size_t &iConfigLen)
AampConfig::AampConfig
AampConfig()
AampConfig Constructor function . Default values defined.
Definition: AampConfig.cpp:305
eAAMPConfig_UserAgent
@ eAAMPConfig_UserAgent
Definition: AampConfig.h:301
eAAMPConfig_MaxPlaylistCacheSize
@ eAAMPConfig_MaxPlaylistCacheSize
Definition: AampConfig.h:230
eAAMPConfig_DefaultBitrate
@ eAAMPConfig_DefaultBitrate
Definition: AampConfig.h:268
eAAMPConfig_CEAPreferred
@ eAAMPConfig_CEAPreferred
Definition: AampConfig.h:243
eAAMPConfig_EnableClientDai
@ eAAMPConfig_EnableClientDai
Definition: AampConfig.h:127
eAAMPConfig_ID3Logging
@ eAAMPConfig_ID3Logging
Definition: AampConfig.h:148
eAAMPConfig_CurlHeader
@ eAAMPConfig_CurlHeader
Definition: AampConfig.h:146
AampConfig::ShowDevCfgConfiguration
void ShowDevCfgConfiguration()
ShowDevCfgConfiguration - List all developer configured settings.
Definition: AampConfig.cpp:1947
eAAMPConfig_LLTargetLatency
@ eAAMPConfig_LLTargetLatency
Definition: AampConfig.h:258
eAAMPConfig_EnableAampConfigToFog
@ eAAMPConfig_EnableAampConfigToFog
Definition: AampConfig.h:192
eAAMPConfig_Http5XXRetryWaitInterval
@ eAAMPConfig_Http5XXRetryWaitInterval
Definition: AampConfig.h:232
eAAMPConfig_Subtec_subtitle
@ eAAMPConfig_Subtec_subtitle
Definition: AampConfig.h:171
eAAMPConfig_EnableIgnoreEosSmallFragment
@ eAAMPConfig_EnableIgnoreEosSmallFragment
Definition: AampConfig.h:189
eAAMPConfig_EnableAccessAttributes
@ eAAMPConfig_EnableAccessAttributes
Definition: AampConfig.h:177
DEFAULT_DISCONTINUITY_TIMEOUT
#define DEFAULT_DISCONTINUITY_TIMEOUT
Definition: AampDefine.h:92
AAMP_LOW_BUFFER_BEFORE_RAMPDOWN
#define AAMP_LOW_BUFFER_BEFORE_RAMPDOWN
Definition: AampDefine.h:105
AampLogManager::gst
bool gst
Definition: AampLogManager.h:157
eAAMPConfig_ProgressLogging
@ eAAMPConfig_ProgressLogging
Definition: AampConfig.h:142
DEFAULT_TARGET_LOW_LATENCY
#define DEFAULT_TARGET_LOW_LATENCY
Definition: AampDefine.h:142
eLOGLEVEL_ERROR
@ eLOGLEVEL_ERROR
Definition: AampLogManager.h:102
eAAMPConfig_DisableAC4
@ eAAMPConfig_DisableAC4
Definition: AampConfig.h:109
AampConfig::ShowAppSetConfiguration
void ShowAppSetConfiguration()
ShowAppSetConfiguration - List all Application configured settings.
Definition: AampConfig.cpp:1918
eAAMPConfig_EnableSubscribedTags
@ eAAMPConfig_EnableSubscribedTags
Definition: AampConfig.h:114
eAAMPConfig_PlaylistParallelRefresh
@ eAAMPConfig_PlaylistParallelRefresh
Definition: AampConfig.h:167
eAAMPConfig_VODTrickPlayFPS
@ eAAMPConfig_VODTrickPlayFPS
Definition: AampConfig.h:225
eAAMPConfig_Throttle
@ eAAMPConfig_Throttle
Definition: AampConfig.h:103
eTUNED_EVENT_ON_PLAYLIST_INDEXED
@ eTUNED_EVENT_ON_PLAYLIST_INDEXED
Definition: AampDefine.h:186
eAAMPConfig_RetuneForUnpairDiscontinuity
@ eAAMPConfig_RetuneForUnpairDiscontinuity
Definition: AampConfig.h:155
eAAMPConfig_BufferHealthMonitorInterval
@ eAAMPConfig_BufferHealthMonitorInterval
Definition: AampConfig.h:222
eAAMPConfig_StreamLogging
@ eAAMPConfig_StreamLogging
Definition: AampConfig.h:147
eAAMPConfig_BoolMaxValue
@ eAAMPConfig_BoolMaxValue
Definition: AampConfig.h:208
eAAMPConfig_DefaultBitrate4K
@ eAAMPConfig_DefaultBitrate4K
Definition: AampConfig.h:269
MAX_PLAYLIST_CACHE_SIZE
#define MAX_PLAYLIST_CACHE_SIZE
Definition: AampDefine.h:63
eAAMPConfig_PrePlayBufferCount
@ eAAMPConfig_PrePlayBufferCount
Definition: AampConfig.h:241
eAAMPConfig_ABRChunkThresholdSize
@ eAAMPConfig_ABRChunkThresholdSize
Definition: AampConfig.h:256
eAAMPConfig_MaxBitrate
@ eAAMPConfig_MaxBitrate
Definition: AampConfig.h:277
AampConfig::IsConfigSet
bool IsConfigSet(AAMPConfigSettings cfg)
Gets the boolean configuration value.
Definition: AampConfig.cpp:649
eAAMPConfig_SetLicenseCaching
@ eAAMPConfig_SetLicenseCaching
Definition: AampConfig.h:162
eAAMPConfig_CDVRLiveOffset
@ eAAMPConfig_CDVRLiveOffset
Definition: AampConfig.h:290
DRMSystems
DRMSystems
DRM system types.
Definition: AampDrmSystems.h:33
eAAMPConfig_InternalReTune
@ eAAMPConfig_InternalReTune
Definition: AampConfig.h:121
DEFAULT_CACHED_FRAGMENTS_PER_TRACK
#define DEFAULT_CACHED_FRAGMENTS_PER_TRACK
Definition: AampDefine.h:87
eAAMPConfig_CustomHeaderLicense
@ eAAMPConfig_CustomHeaderLicense
Definition: AampConfig.h:310
eAAMPConfig_SchemeIdUriVssStream
@ eAAMPConfig_SchemeIdUriVssStream
Definition: AampConfig.h:322
eAAMPConfig_MPDDiscontinuityHandlingCdvr
@ eAAMPConfig_MPDDiscontinuityHandlingCdvr
Definition: AampConfig.h:119
AampConfig::bAampCfgValue
ConfigBool bAampCfgValue[eAAMPConfig_BoolMaxValue]
Definition: AampConfig.h:745
OwnerLookUpTable
static AampOwnerLookupEntry OwnerLookUpTable[]
AAMP Config Owners enum-string mapping table.
Definition: AampConfig.cpp:61
eAAMPConfig_BufferHealthMonitorDelay
@ eAAMPConfig_BufferHealthMonitorDelay
Definition: AampConfig.h:221
eAAMPConfig_FogMaxConcurrentDownloads
@ eAAMPConfig_FogMaxConcurrentDownloads
Definition: AampConfig.h:262
eAAMPConfig_IFrameDefaultBitrate
@ eAAMPConfig_IFrameDefaultBitrate
Definition: AampConfig.h:270
IARM_BUS_TR69HOSTIFMGR_API_GetParams
#define IARM_BUS_TR69HOSTIFMGR_API_GetParams
Definition: hostIf_tr69ReqHandler.h:94
eAAMPConfig_MaxInitFragCachePerTrack
@ eAAMPConfig_MaxInitFragCachePerTrack
Definition: AampConfig.h:261
base16.h
optimized way way base16 Encode/Decode operation
eAAMPConfig_EnableABR
@ eAAMPConfig_EnableABR
Definition: AampConfig.h:97
eAAMPConfig_SourceSetupTimeout
@ eAAMPConfig_SourceSetupTimeout
Definition: AampConfig.h:248
AampConfig::sAampCfgValue
ConfigString sAampCfgValue[eAAMPConfig_StringMaxValue-eAAMPConfig_StringStartValue]
Definition: AampConfig.h:749
eAAMPConfig_PersistentBitRateOverSeek
@ eAAMPConfig_PersistentBitRateOverSeek
Definition: AampConfig.h:161
DEFAULT_CONTENT_PROTECTION_DATA_UPDATE_TIMEOUT
#define DEFAULT_CONTENT_PROTECTION_DATA_UPDATE_TIMEOUT
Definition: AampDefine.h:153
eAAMPConfig_TimeShiftBufferLength
@ eAAMPConfig_TimeShiftBufferLength
Definition: AampConfig.h:215
eAAMPConfig_MatchBaseUrl
@ eAAMPConfig_MatchBaseUrl
Definition: AampConfig.h:157
eAAMPConfig_PreCachePlaylistTime
@ eAAMPConfig_PreCachePlaylistTime
Definition: AampConfig.h:242
eAAMPConfig_DemuxHLSVideoTsTrackTM
@ eAAMPConfig_DemuxHLSVideoTsTrackTM
Definition: AampConfig.h:105
MAX_CURL_SOCK_STORE
#define MAX_CURL_SOCK_STORE
Definition: AampDefine.h:119
AampConfig::ConfigureLogSettings
void ConfigureLogSettings()
ConfigureLogSettings - This function configures log settings for LogManager instance.
Definition: AampConfig.cpp:1859
eAAMPConfig_InfoLogging
@ eAAMPConfig_InfoLogging
Definition: AampConfig.h:136
eLOGLEVEL_TRACE
@ eLOGLEVEL_TRACE
Definition: AampLogManager.h:99
eAAMPConfig_WideVineKIDWorkaround
@ eAAMPConfig_WideVineKIDWorkaround
Definition: AampConfig.h:178
eAAMPConfig_EnableLinearSimulator
@ eAAMPConfig_EnableLinearSimulator
Definition: AampConfig.h:154
DEFAULT_MAX_LOW_LATENCY
#define DEFAULT_MAX_LOW_LATENCY
Definition: AampDefine.h:141
AampConfig::ReadAampCfgTxtFile
bool ReadAampCfgTxtFile()
ReadAampCfgTxtFile - Function to parse and process configuration file in text format.
Definition: AampConfig.cpp:1574
LangCodePreference
LangCodePreference
Language Code Preference types.
Definition: main_aamp.h:165
AampConfig::CustomArrayRead
void CustomArrayRead(cJSON *customArray, ConfigPriority owner)
CustomArrayRead - Function to Read Custom JSON Array.
Definition: AampConfig.cpp:1070
eAAMPConfig_FailoverLogging
@ eAAMPConfig_FailoverLogging
Definition: AampConfig.h:140
eAAMPConfig_ReportBufferEvent
@ eAAMPConfig_ReportBufferEvent
Definition: AampConfig.h:135
eAAMPConfig_AllowPageHeaders
@ eAAMPConfig_AllowPageHeaders
Definition: AampConfig.h:195
AAMP_CDVR_LIVE_OFFSET
#define AAMP_CDVR_LIVE_OFFSET
Definition: AampDefine.h:82
eAAMPConfig_UseAbsoluteTimeline
@ eAAMPConfig_UseAbsoluteTimeline
Definition: AampConfig.h:176
eAAMPConfig_EnableSlowMotion
@ eAAMPConfig_EnableSlowMotion
Definition: AampConfig.h:204
eAAMPConfig_InitFragmentRetryCount
@ eAAMPConfig_InitFragmentRetryCount
Definition: AampConfig.h:238
AampConfig::ShowConfiguration
void ShowConfiguration(ConfigPriority owner)
ShowConfiguration - Function to list configration values based on the owner.
Definition: AampConfig.cpp:2225
ePAUSED_BEHAVIOR_AUTOPLAY_IMMEDIATE
@ ePAUSED_BEHAVIOR_AUTOPLAY_IMMEDIATE
Definition: AampDefine.h:197
DEFAULT_ABR_CACHE_LIFE
#define DEFAULT_ABR_CACHE_LIFE
Definition: AampDefine.h:65
AAMPConfigSettings
AAMPConfigSettings
AAMP Config Settings.
Definition: AampConfig.h:95
eLOGLEVEL_INFO
@ eLOGLEVEL_INFO
Definition: AampLogManager.h:100
eAAMPConfig_PTSErrorThreshold
@ eAAMPConfig_PTSErrorThreshold
Definition: AampConfig.h:229
FOG_MAX_CONCURRENT_DOWNLOADS
#define FOG_MAX_CONCURRENT_DOWNLOADS
Definition: AampDefine.h:156
AampLogManager::curlLicense
bool curlLicense
Definition: AampLogManager.h:163
base64_Decode
unsigned char * base64_Decode(const char *src, size_t *len, size_t srcLen)
decode base64 encoded data to binary equivalent
Definition: _base64.cpp:91
eAAMPConfig_ContentProtectionDataUpdateTimeout
@ eAAMPConfig_ContentProtectionDataUpdateTimeout
Definition: AampConfig.h:263
eAAMPConfig_CustomHeader
@ eAAMPConfig_CustomHeader
Definition: AampConfig.h:304
eAAMPConfig_PRLicenseServerUrl
@ eAAMPConfig_PRLicenseServerUrl
Definition: AampConfig.h:299
eAAMPConfig_MidFragmentSeek
@ eAAMPConfig_MidFragmentSeek
Definition: AampConfig.h:151
eAAMPConfig_UseAppSrcForProgressivePlayback
@ eAAMPConfig_UseAppSrcForProgressivePlayback
Definition: AampConfig.h:133
eAAMPConfig_HarvestPath
@ eAAMPConfig_HarvestPath
Definition: AampConfig.h:296
eAAMPConfig_PreferredAudioCodec
@ eAAMPConfig_PreferredAudioCodec
Definition: AampConfig.h:312
AampJsonObject
Utility class to construct a JSON string.
Definition: AampJsonObject.h:37
eAAMPConfig_RepairIframes
@ eAAMPConfig_RepairIframes
Definition: AampConfig.h:179
ConfigLookUpTable
static AampConfigLookupEntry ConfigLookUpTable[]
AAMP Config Command lookup table.
Definition: AampConfig.cpp:80
AampLogManager::setLogLevel
void setLogLevel(AAMP_LogLevel newLevel)
Set the log level for print mechanism.
Definition: aamplogging.cpp:58
DEFAULT_ABR_CACHE_LENGTH
#define DEFAULT_ABR_CACHE_LENGTH
Definition: AampDefine.h:71
ConfigChannelInfo
Holds information of a channel.
Definition: AampConfig.h:333
eAAMPConfig_PreferredDRM
@ eAAMPConfig_PreferredDRM
Definition: AampConfig.h:223
AampConfig::ShowAAMPConfiguration
void ShowAAMPConfiguration()
ShowAAMPConfiguration - Show all settings for every owner.
Definition: AampConfig.cpp:1957