@@ -1775,7 +1775,7 @@ bool TrackState::FetchFragmentHelper(long &http_error, bool &decryption_error, b
1775
1775
std::string tempEffectiveUrl;
1776
1776
AAMPLOG_TRACE (" Calling Getfile . buffer %p avail %d" , &cachedFragment->fragment , (int )cachedFragment->fragment .avail );
1777
1777
bool fetched = aamp->GetFile (fragmentUrl, &cachedFragment->fragment ,
1778
- tempEffectiveUrl, &http_error, &downloadTime, range, type, false , (MediaType)(type), NULL , NULL , fragmentDurationSeconds);
1778
+ tempEffectiveUrl, &http_error, &downloadTime, range, type, false , (MediaType)(type), NULL , NULL , fragmentDurationSeconds,pCMCDMetrics );
1779
1779
// Workaround for 404 of subtitle fragments
1780
1780
// TODO: This needs to be handled at server side and this workaround has to be removed
1781
1781
if (!fetched && http_error == 404 && type == eTRACK_SUBTITLE)
@@ -4001,7 +4001,7 @@ AAMPStatusType StreamAbstractionAAMP_HLS::Init(TuneType tuneType)
4001
4001
std::string mainManifestOrigUrl = aamp->GetManifestUrl ();
4002
4002
double downloadTime;
4003
4003
aamp->SetCurlTimeout (aamp->mManifestTimeoutMs , eCURLINSTANCE_MANIFEST_PLAYLIST);
4004
- (void ) aamp->GetFile (aamp->GetManifestUrl (), &this ->mainManifest , aamp->GetManifestUrl (), &http_error, &mainManifestdownloadTime, NULL , eCURLINSTANCE_MANIFEST_PLAYLIST, true , eMEDIATYPE_MANIFEST);// CID:82578 - checked return
4004
+ (void ) aamp->GetFile (aamp->GetManifestUrl (), &this ->mainManifest , aamp->GetManifestUrl (), &http_error, &mainManifestdownloadTime, NULL , eCURLINSTANCE_MANIFEST_PLAYLIST, true , eMEDIATYPE_MANIFEST, NULL , NULL , 0 ,pCMCDMetrics );// CID:82578 - checked return
4005
4005
updateVideoEndMetrics = true ;
4006
4006
aamp->SetCurlTimeout (aamp->mPlaylistTimeoutMs , eCURLINSTANCE_MANIFEST_PLAYLIST);
4007
4007
if (this ->mainManifest .len )
@@ -5637,7 +5637,7 @@ StreamAbstractionAAMP_HLS::StreamAbstractionAAMP_HLS(AampLogManager *logObj, cla
5637
5637
rate(rate), maxIntervalBtwPlaylistUpdateMs(DEFAULT_INTERVAL_BETWEEN_PLAYLIST_UPDATES_MS), mainManifest(), allowsCache(false ), seekPosition(seekpos), mTrickPlayFPS(),
5638
5638
enableThrottle(false ), firstFragmentDecrypted(false ), mStartTimestampZero(false ), mNumberOfTracks(0 ), midSeekPtsOffset(0 ),
5639
5639
lastSelectedProfileIndex(0 ), segDLFailCount(0 ), segDrmDecryptFailCount(0 ), mMediaCount(0 ),mProfileCount(0 ),
5640
- mLangList(),mIframeAvailable(false ), thumbnailManifest(), indexedTileInfo(),
5640
+ mLangList(),mIframeAvailable(false ), thumbnailManifest(), indexedTileInfo(),pCMCDMetrics( NULL ),
5641
5641
mFirstPTS(0 )
5642
5642
{
5643
5643
#ifndef AVE_DRM
@@ -5659,6 +5659,10 @@ StreamAbstractionAAMP_HLS::StreamAbstractionAAMP_HLS(AampLogManager *logObj, cla
5659
5659
memset (&trackState[0 ], 0x00 , sizeof (trackState));
5660
5660
aamp->CurlInit (eCURLINSTANCE_VIDEO, DEFAULT_CURL_INSTANCE_COUNT,aamp->GetNetworkProxy ());
5661
5661
memset (streamInfo, 0 , sizeof (*streamInfo));
5662
+ if (ISCONFIGSET (eAAMPConfig_EnableCMCD))
5663
+ {
5664
+ pCMCDMetrics = new ManifestCMCDHeaders ();
5665
+ }
5662
5666
5663
5667
}
5664
5668
@@ -5687,8 +5691,8 @@ TrackState::TrackState(AampLogManager *logObj, TrackType type, StreamAbstraction
5687
5691
mPlaylistIndexed(), mDiscoCheckMutex(), mDiscoCheckComplete(), mTrackDrmMutex(), mPlaylistType(ePLAYLISTTYPE_UNDEFINED), mReachedEndListTag(false ),
5688
5692
mByteOffsetCalculation(false ),mSkipAbr(false ),
5689
5693
mCheckForInitialFragEnc(false ), mFirstEncInitFragmentInfo(NULL ), mDrmMethod(eDRM_KEY_METHOD_NONE)
5690
- ,mXStartTimeOFfset(0 ), mCulledSecondsAtStart(0.0 )
5691
- ,mProgramDateTime(0.0 )
5694
+ ,mXStartTimeOFfset(0 ), mCulledSecondsAtStart(0.0 )// , mCMCDNetworkMetrics{-1,-1,-1}
5695
+ ,mProgramDateTime(0.0 ),pCMCDMetrics( NULL )
5692
5696
,mDiscontinuityCheckingOn(false )
5693
5697
,mSkipSegmentOnError(true )
5694
5698
{
@@ -5705,6 +5709,15 @@ TrackState::TrackState(AampLogManager *logObj, TrackType type, StreamAbstraction
5705
5709
mCulledSecondsAtStart = aamp->culledSeconds ;
5706
5710
mProgramDateTime = aamp->mProgramDateTime ;
5707
5711
AAMPLOG_INFO (" Restore PDT (%f) " ,mProgramDateTime );
5712
+ if (ISCONFIGSET (eAAMPConfig_EnableCMCD))
5713
+ {
5714
+ if (type == eTRACK_VIDEO)
5715
+ pCMCDMetrics = new VideoCMCDHeaders ();
5716
+ else if (type == eTRACK_AUDIO)
5717
+ pCMCDMetrics = new AudioCMCDHeaders ();
5718
+ else if (type == eTRACK_SUBTITLE)
5719
+ pCMCDMetrics = new SubtitleCMCDHeaders ();
5720
+ }
5708
5721
}
5709
5722
5710
5723
@@ -5738,6 +5751,7 @@ TrackState::~TrackState()
5738
5751
pthread_cond_destroy (&mPlaylistIndexed );
5739
5752
pthread_mutex_destroy (&mPlaylistMutex );
5740
5753
pthread_mutex_destroy (&mTrackDrmMutex );
5754
+ delete pCMCDMetrics;
5741
5755
5742
5756
}
5743
5757
@@ -5806,6 +5820,7 @@ StreamAbstractionAAMP_HLS::~StreamAbstractionAAMP_HLS()
5806
5820
aamp_Free (&this ->mainManifest );
5807
5821
aamp->CurlTerm (eCURLINSTANCE_VIDEO, DEFAULT_CURL_INSTANCE_COUNT);
5808
5822
aamp->SyncEnd ();
5823
+ delete pCMCDMetrics;
5809
5824
}
5810
5825
5811
5826
/* *
0 commit comments