-
Notifications
You must be signed in to change notification settings - Fork 9
Feature/vpaamp 237 unify cache fragment resolve symbols #1426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pstroffolino
merged 7 commits into
dev_sprint_25_2
from
feature/VPAAMP-237_Unify_Cache_Fragment_Resolve_Symbols
May 18, 2026
Merged
Changes from 3 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
aec7f5a
VPAAMP-237 Unify Cache Fragments Resolve Symbols
DomSyna c58f138
VPAAMP-237 Unify Cache Fragments Resolve Symbols
DomSyna 88cb051
VPAAMP-237 Unify Cache Fragments Resolve Symbols
DomSyna caa83d9
VPAAMP-237 Unify Cache Fragments Resolve Symbols
DomSyna 3d14d36
VPAAMP-237 Unify Cache Fragments Resolve Symbols
DomSyna e6dfdea
Merge branch 'dev_sprint_25_2' into feature/VPAAMP-237_Unify_Cache_Fr…
DomSyna 5f06788
Merge branch 'dev_sprint_25_2' into feature/VPAAMP-237_Unify_Cache_Fr…
pstroffolino File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| /* | ||
| * If not stated otherwise in this file or this component's license file the | ||
|
Check failure on line 2 in StreamAbstractionAAMP.h
|
||
| * following copyright and licenses apply: | ||
| * | ||
| * Copyright 2018 RDK Management | ||
|
|
@@ -32,6 +32,7 @@ | |
| #include <map> | ||
| #include <iterator> | ||
| #include <vector> | ||
| #include <array> | ||
| #include <condition_variable> | ||
|
|
||
| #include <glib.h> | ||
|
|
@@ -181,11 +182,11 @@ | |
| uint32_t GetManifestUpdateCounter(); | ||
|
|
||
| /** | ||
| * @fn AbortWaitForCachedFragmentChunk | ||
| * @fn AbortWaitForCachedFragmentInjected | ||
| * | ||
| * @return void | ||
| */ | ||
| void AbortWaitForCachedFragmentChunk(); | ||
| void AbortWaitForCachedFragmentInjected(); | ||
|
|
||
| /** | ||
| * @fn WaitForManifestUpdate | ||
|
|
@@ -346,13 +347,6 @@ | |
| */ | ||
| void UpdateInjectedDuration(double surplusDuration); | ||
|
|
||
| /** | ||
| * @brief Get total fragment chunk injected duration | ||
| * | ||
| * @return Total duration in seconds | ||
| */ | ||
| double GetTotalInjectedChunkDuration() { return totalInjectedChunksDuration; }; | ||
|
|
||
| /** | ||
| * @fn RunInjectLoop | ||
| * | ||
|
|
@@ -369,11 +363,11 @@ | |
| void UpdateTSAfterFetchStats(CachedFragment* cachedFragment, bool isInitSegment); | ||
|
|
||
| /** | ||
| * @fn UpdateTSAfterChunkFetch | ||
| * @fn UpdateTSAfterFetch | ||
| * | ||
| * @return void | ||
| */ | ||
| void UpdateTSAfterChunkFetch(); | ||
| void UpdateTSAfterFetch(); | ||
|
|
||
| /** | ||
| * @fn WaitForFreeFragmentAvailable | ||
|
|
@@ -383,10 +377,10 @@ | |
| bool WaitForFreeFragmentAvailable( int timeoutMs = -1); | ||
|
|
||
| /** | ||
| * @fn WaitForCachedFragmentChunkInjected | ||
| * @retval true if fragment chunk injected , false on abort. | ||
| * @fn WaitForCachedFragmentInjected | ||
| * @retval true if fragment injected, false on abort. | ||
| */ | ||
| bool WaitForCachedFragmentChunkInjected(int timeoutMs = -1); | ||
| bool WaitForCachedFragmentInjected(int timeoutMs = -1); | ||
|
|
||
| /** | ||
| * @fn AbortWaitForCachedAndFreeFragment | ||
|
|
@@ -439,11 +433,11 @@ | |
| virtual double GetBufferedDuration (void) = 0; | ||
|
|
||
| /** | ||
| * @fn GetFetchChunkBuffer | ||
| * @fn GetFetchBuffer | ||
| * @param[in] initialize true to initialize the fragment chunk | ||
| * @retval Pointer to fragment chunk buffer. | ||
| */ | ||
| CachedFragment *GetFetchChunkBuffer(bool initialize); | ||
| CachedFragment *GetFetchBuffer(bool initialize); | ||
|
|
||
| /** | ||
| * @brief Check if the fragment cache buffer is full | ||
|
|
@@ -478,14 +472,14 @@ | |
| * | ||
| * @return Total duration in seconds | ||
| */ | ||
| double GetTotalFetchedDuration() { return totalFetchedDuration; }; | ||
| double GetTotalFetchedDuration(); | ||
|
|
||
| /** | ||
| * @brief Get total duration of fetched fragments | ||
| * @brief Get total duration of injected fragment chunks (LLD chunk mode) | ||
| * | ||
| * @return Total duration in seconds | ||
| */ | ||
| double GetTotalInjectedChunksDuration() { return totalInjectedChunksDuration; }; | ||
| double GetTotalInjectedChunksDuration() { return totalInjectedChunksDuration; } | ||
|
|
||
| /** | ||
| * @brief Check if discontinuity is being processed | ||
|
|
@@ -576,12 +570,6 @@ | |
| */ | ||
| void FlushFragments(); | ||
|
|
||
| /** | ||
| * @fn FlushFragmentChunks | ||
| * | ||
| * @return void | ||
| */ | ||
| void FlushFragmentChunks(); | ||
| /** | ||
| * @brief API to wait thread until the fragment cached after audio reconfiguration | ||
| */ | ||
|
|
@@ -613,18 +601,18 @@ | |
| bool SignalIfEOSReached(); | ||
|
|
||
| /** | ||
| * @brief GetCachedFragmentChunksSize - Getter for fragment chunks cache size | ||
| * @brief GetCachedFragmentSize - Getter for fragment cache active window size | ||
| * | ||
| * @return size_t | ||
| */ | ||
| std::size_t GetCachedFragmentChunksSize() { return mCachedFragmentChunksSize; } | ||
| std::size_t GetCachedFragmentSize() { return mCachedFragmentSize; } | ||
|
|
||
| /** | ||
| * @brief SetCachedFragmentChunksSize - Setter for fragment chunks cache size | ||
| * @brief SetCachedFragmentSize - Setter for fragment cache active window size | ||
| * | ||
| * @param[in] size Size for fragment chunks cache | ||
| * @param[in] size Active window size (must be > 0 and <= DEFAULT_LLD_CACHED_FRAGMENTS_PER_TRACK) | ||
| */ | ||
| void SetCachedFragmentChunksSize(size_t size); | ||
| void SetCachedFragmentSize(size_t size); | ||
|
|
||
| void SourceFormat(StreamOutputFormat fmt) { mSourceFormat = fmt; } | ||
|
|
||
|
|
@@ -674,14 +662,14 @@ | |
| * | ||
| * @return void | ||
| */ | ||
| void UpdateTSAfterChunkInject(); | ||
| void UpdateTSAfterInject(); | ||
|
|
||
| /** | ||
| * @fn WaitForCachedFragmentChunkAvailable | ||
| * @fn WaitForCachedFragmentAvailable | ||
| * | ||
| * @return TRUE if fragment chunk available, FALSE if aborted/fragment chunk not available. | ||
| * @return TRUE if fragment available, FALSE if aborted or not available. | ||
| */ | ||
| bool WaitForCachedFragmentChunkAvailable(); | ||
| bool WaitForCachedFragmentAvailable(); | ||
|
|
||
| /** | ||
| * @brief Get the context of media track. To be implemented by subclasses | ||
|
|
@@ -786,7 +774,7 @@ | |
| public: | ||
| bool eosReached; /**< set to true when a vod asset has been played to completion */ | ||
| bool enabled; /**< set to true if track is enabled */ | ||
| int numberOfFragmentChunksCached; /**< Number of fragments cached in this track*/ | ||
| int numberOfFragmentsCached; /**< Number of fragments cached in this track*/ | ||
|
DomSyna marked this conversation as resolved.
Outdated
|
||
| const char* name; /**< Track name used for debugging*/ | ||
| double fragmentDurationSeconds; /**< duration in seconds for current fragment-of-interest */ | ||
| int segDLFailCount; /**< Segment download fail count*/ | ||
|
|
@@ -796,8 +784,8 @@ | |
| std::unique_ptr<SubtitleParser> mSubtitleParser; /**< Parser for subtitle data*/ | ||
| bool refreshSubtitles; /**< Switch subtitle track in the FetchLoop */ | ||
| bool refreshAudio; /** Switch audio track in the FetcherLoop */ | ||
| int maxCachedFragmentChunksPerTrack; | ||
| std::condition_variable fragmentChunkFetched;/**< Signaled after a fragment Chunk is fetched*/ | ||
| int maxLLDCachedFragmentsPerTrack; | ||
| std::condition_variable fragmentFetched;/**< Signaled after a fragment is fetched*/ | ||
|
DomSyna marked this conversation as resolved.
Outdated
|
||
| int noMDATCount; /**< MDAT Chunk Not Found count continuously while chunk buffer processing*/ | ||
| double m_totalDurationForPtsRestamping; | ||
| std::shared_ptr<MediaProcessor> playContext; /**< state for s/w demuxer / pts/pcr restamper module */ | ||
|
|
@@ -808,7 +796,7 @@ | |
| protected: | ||
| PrivateInstanceAAMP* aamp; /**< Pointer to the PrivateInstanceAAMP*/ | ||
| std::shared_ptr<IsoBmffHelper> mIsoBmffHelper; /**< Helper class for ISO BMFF parsing */ | ||
| CachedFragment mCachedFragmentChunks[DEFAULT_CACHED_FRAGMENT_CHUNKS_PER_TRACK]; | ||
| std::array<CachedFragment, DEFAULT_LLD_CACHED_FRAGMENTS_PER_TRACK> mCachedFragment{}; /**< Per-track ring buffer; static capacity sized for live LLD chunks. The active window is `mCachedFragmentSize`, which never exceeds the array size. */ | ||
|
DomSyna marked this conversation as resolved.
Outdated
|
||
| std::vector<uint8_t> unparsedBufferChunk{}; /**< Unparsed buffer chunk for ISOBMFF chunk processing */ | ||
| std::vector<uint8_t> parsedBufferChunk{}; /**< Parsed buffer chunk for ISOBMFF chunk processing */ | ||
| bool abort; /**< Abort all operations if flag is set*/ | ||
|
|
@@ -819,8 +807,8 @@ | |
| bool loadNewAudio; /**< Flag to indicate new audio loading started on seamless audio switch */ | ||
| std::mutex subtitleMutex; | ||
| bool loadNewSubtitle; | ||
| int fragmentChunkIdxToInject; /**< Write position */ | ||
| int fragmentChunkIdxToFetch; /**< Read position */ | ||
| int fragmentIdxToInject; /**< Write position */ | ||
| int fragmentIdxToFetch; /**< Read position */ | ||
|
|
||
| StreamOutputFormat mSourceFormat {StreamOutputFormat::FORMAT_INVALID}; | ||
| std::shared_ptr<aamp::AampTimeBasedBufferManager> mTimeBasedBufferManager; /**< Time based buffer for managing fragment download and playback */ | ||
|
|
@@ -836,7 +824,7 @@ | |
|
|
||
| std::mutex injectorStartMutex; /**< Mutex to protect injector start */ | ||
| std::thread fragmentInjectorThreadID; /**< Fragment injector thread id*/ | ||
| std::condition_variable fragmentChunkInjected; /**< Signaled after a fragment is injected*/ | ||
| std::condition_variable fragmentInjected; /**< Signaled after a fragment is injected*/ | ||
| std::thread bufferMonitorThreadID; /**< Buffer Monitor thread id */ | ||
| std::thread subtitleClockThreadID; /**< subtitle clock synchronisation thread id */ | ||
| int totalFragmentsDownloaded; /**< Total fragments downloaded since start by track*/ | ||
|
|
@@ -865,7 +853,7 @@ | |
| double lastInjectedDuration; /**< Last injected fragment end position */ | ||
| std::condition_variable subtitleFragmentCached; | ||
| std::atomic_bool mIsLocalTSBInjection; | ||
| size_t mCachedFragmentChunksSize; /**< Size of fragment chunks cache */ | ||
| size_t mCachedFragmentSize; /**< Active window size of the fragment ring buffer */ | ||
|
DomSyna marked this conversation as resolved.
Outdated
|
||
| AampTime mLastFragmentPts; /**< pts of the previous fragment, used in trick modes */ | ||
| AampTime mRestampedPts; /**< Restamped Pts of the segment, used in trick modes */ | ||
| AampTime mRestampedDuration; /**< Restamped segment duration, used in trick modes */ | ||
|
|
@@ -1815,11 +1803,11 @@ | |
| } | ||
|
|
||
| /** | ||
| * @fn UnblockWaitForCachedFragmentChunk | ||
| * @fn UnblockWaitForCachedFragmentInjected | ||
| * | ||
| * @return void | ||
| */ | ||
| void UnblockWaitForCachedFragmentChunk(); | ||
| void UnblockWaitForCachedFragmentInjected(); | ||
|
|
||
| /** | ||
| * @brief Get available thumbnail bitrates. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.