27 #include "AampUtils.h"
38 tuneStartMonotonicBase(0), tuneStartBaseUTCMS(0), bandwidthBitsPerSecondVideo(0),
39 bandwidthBitsPerSecondAudio(0), drmErrorCode(0), enabled(false), xreTimeBuckets(), tuneEventList(),
50 bool siblingEvent =
false;
51 unsigned int tEndTime = NOW_STEADY_TS_MS;
55 std::string temlUrl = url;
56 end = temlUrl.find(
"?");
58 if (end != std::string::npos)
60 temlUrl = temlUrl.substr(0, end);
64 memset(outPtr,
'\0', 512);
66 snprintf(outPtr, 512,
"{\"s\":%lld,\"td\":%d,\"st\":\"%s\",\"u\":\"%s\",\"tf\":{\"i\":%d,\"er\":%d},\"r\":%d,\"v\":[",
tuneStartBaseUTCMS, td, streamType.c_str(), temlUrl.c_str(),
mTuneFailBucketType,
mTuneFailErrorCode, (success ? 1 : 0));
68 outStr.append(outPtr);
78 memset(eventPtr,
'\0', 256);
79 snprintf(eventPtr, 256,
"{\"i\":%d,\"b\":%d,\"d\":%d,\"o\":%d}", te.id, te.start, te.duration, te.result);
80 outStr.append(eventPtr);
96 memset(buckets, 0,
sizeof(buckets));
157 void ProfileEventAAMP::TuneEnd(
TuneEndMetrics &mTuneEndMetrics,std::string appName, std::string playerActiveMode,
int playerId,
bool playerPreBuffered,
unsigned int durationSeconds,
bool interfaceWifi,std::string failureReason)
165 char tuneTimeStrPrefix[64];
166 memset(tuneTimeStrPrefix,
'\0',
sizeof(tuneTimeStrPrefix));
169 if (mTuneEndMetrics.
success > 0)
177 if (!appName.empty())
179 snprintf(tuneTimeStrPrefix,
sizeof(tuneTimeStrPrefix),
"%s PLAYER[%d] APP: %s IP_AAMP_TUNETIME", playerActiveMode.c_str(),playerId,appName.c_str());
183 snprintf(tuneTimeStrPrefix,
sizeof(tuneTimeStrPrefix),
"%s PLAYER[%d] IP_AAMP_TUNETIME", playerActiveMode.c_str(),playerId);
186 AAMPLOG_WARN(
"%s:%d,%s,%lld,"
211 AAMP_TUNETIME_VERSION,
233 durationSeconds,interfaceWifi,
269 if(licenseNWTime == 0)
271 licenseNWTime = licenseTotal;
275 unsigned int networkTime = manifestTotal + profilesTotal + initFragmentTotal + fragmentTotal + licenseNWTime;
284 networkTime,playerLoadTime, failRetryBucketTime, prepareToPlayBucketTime,playBucketTime,licenseTotal,decoderStreamingBucketTime,
285 manifestTotal,profilesTotal,(initFragmentTotal + fragmentTotal),fragmentBucketTime, licenseNWTime,success,durationinSec*1000,isLive,
289 #ifndef CREATE_PIPE_SESSION_TO_XRE
290 AAMPLOG_WARN(
"AAMP=>XRE: %s", TuneTimeInfoStr);
367 AAMPLOG_INFO(
"Tune Fail: ProfilerBucketType: %d, tuneFailCode: %d", failBucketType, tuneFailCode);