Skip to content

Feature/vplay 13092 migrate fragmentcollector hls header to std vector#1220

Merged
pstroffolino merged 9 commits intodev_sprint_25_2from
feature/VPLAY-13092_Migrate_fragmentcollector_hls_header_to_std_vector
Mar 24, 2026
Merged

Feature/vplay 13092 migrate fragmentcollector hls header to std vector#1220
pstroffolino merged 9 commits intodev_sprint_25_2from
feature/VPLAY-13092_Migrate_fragmentcollector_hls_header_to_std_vector

Conversation

@DomSyna
Copy link
Contributor

@DomSyna DomSyna commented Mar 23, 2026

Summary
Pure mechanical refactor of fragmentcollector_hls.h — no behaviour changes. Replaces AampGrowableBuffer member fields with std::vector<uint8_t>, eliminating a legacy manual-memory type from the HLS abstraction layer.

Changes

  • fragmentcollector_hls.h: replace AampGrowableBuffer members with std::vector<uint8_t>{}
  • Update all use-sites within fragmentcollector_hls.cpp to use the equivalent std::vector API (assign, data(), size(), clear())
  • No changes to logic, control flow, or public API

@DomSyna DomSyna marked this pull request as ready for review March 23, 2026 18:12
@DomSyna DomSyna requested a review from a team as a code owner March 23, 2026 18:12
Copilot AI review requested due to automatic review settings March 23, 2026 18:12
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates key in-memory HLS manifest/playlist buffers in the HLS fragment collector from the legacy AampGrowableBuffer wrapper to std::vector<uint8_t>, with corresponding updates to production code call sites and unit tests.

Changes:

  • Replace AampGrowableBuffer members (mainManifest, thumbnailManifest, and per-track playlist) with std::vector<uint8_t> in fragmentcollector_hls.h.
  • Update fragmentcollector_hls.cpp to use std::vector APIs and adjust cache/GetFile interactions accordingly.
  • Refactor HLS-related unit tests to build manifests/playlists as std::vector<uint8_t> and add parameterized coverage for Is4KStream and tag parsing.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
fragmentcollector_hls.h Switch HLS manifest/playlist buffer members to std::vector<uint8_t> and update helper function signature.
fragmentcollector_hls.cpp Update buffer handling, cache interactions, and GetFormatFromFragmentExtension() to operate on vectors.
test/utests/fakes/FakeFragmentCollector_HLS.cpp Align fake StreamAbstractionAAMP_HLS constructor initialization with the new member types.
test/utests/tests/fragmentcollector_hls/byteRangeTests.cpp Update format-detection test to pass a std::vector<uint8_t> buffer and modernize the test table iteration.
test/utests/tests/StreamAbstractionAAMP_HLS/FunctionalTests.cpp Refactor tests to use vector-backed manifests; add parameterized tests for Is4KStream and tag smoke parsing.

Comment on lines 4847 to 4849
TrackState::~TrackState()
{
playlist.Free();
// We could remove this. This is already done in MediaTrack destructor
int maxCachedFragmentsPerTrack = GETCONFIGVALUE(eAAMPConfig_MaxFragmentCached);
for (int j=0; j< maxCachedFragmentsPerTrack; j++)
{
aamp_utils::ClearAndRelease(mCachedFragment[j].fragment);
}
FlushIndex();
memset( mDrmInfo.iv, 0, sizeof(mDrmInfo.iv) );
}
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TrackState::~TrackState() became empty. Previously it explicitly zeroed mDrmInfo.iv; with the destructor now empty, the IV bytes can remain in freed memory until overwritten. Please restore secure clearing of sensitive DRM fields (e.g., explicitly zero mDrmInfo.iv, ideally using a clearing routine that won’t be optimized out).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

@DomSyna DomSyna Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If a bad actor can access the released memory to read the transient init vector data they can also read the data structure, which will be much easier to find. For it to be properly secure it would have to live in the TEE.

The Init vector is often in the clear, so not really that secret.

Copilot AI review requested due to automatic review settings March 24, 2026 14:17
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@pstroffolino pstroffolino merged commit 3b0e173 into dev_sprint_25_2 Mar 24, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants