Feature/vplay 12900 cached fragment to use vector#1141
Merged
pstroffolino merged 40 commits intodev_sprint_25_2from Mar 15, 2026
Merged
Feature/vplay 12900 cached fragment to use vector#1141pstroffolino merged 40 commits intodev_sprint_25_2from
pstroffolino merged 40 commits intodev_sprint_25_2from
Conversation
removed AAMP_NET_TRACE tests
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
jfagunde
reviewed
Mar 11, 2026
jfagunde
reviewed
Mar 11, 2026
jfagunde
approved these changes
Mar 11, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors cached fragment storage from AampGrowableBuffer to std::vector<uint8_t> and propagates the API changes through TS/ISO-BMFF processing, injection paths, and unit tests.
Changes:
- Replace
CachedFragment::fragmentwithstd::vector<uint8_t>and update copy/clear semantics. - Update
MediaProcessor/TSProcessor/TS fragment processing to accept vectors and add asendSegment(std::vector<...>&)bridge. - Update stream injection (
SendStreamTransfer, ID3 processing) and unit tests/mocks to use vectors.
Reviewed changes
Copilot reviewed 48 out of 49 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
tsprocessor.h |
Updates TSProcessor::getFirstPts signature to accept std::vector<uint8_t>. |
tsprocessor.cpp |
Adjusts TS PTS extraction to use vector-backed buffer. |
tsFragmentProcessor.hpp |
Switches fragment processing APIs from AampGrowableBuffer to std::vector<uint8_t>. |
tsFragmentProcessor.cpp |
Implements vector-based fragment validation/demux entry points. |
streamabstraction.cpp |
Converts cached fragment freeing/injection paths to vector + ClearAndRelease. |
priv_aamp.h |
Updates ProcessID3Metadata/SendStreamTransfer signatures and docs for vector usage. |
priv_aamp.cpp |
Moves vectors into sink transfer and clears buffers via ClearAndRelease. |
mp4demux/AampMp4Demuxer.h |
Updates getFirstPts override to vector signature. |
mediaprocessor.h |
Changes pure virtual getFirstPts to vector and adds sendSegment(std::vector<...>&) bridge overload. |
isobmff/isobmffprocessor.h |
Updates resetPTSOn*Switch and getFirstPts signatures to vector forms. |
isobmff/isobmffprocessor.cpp |
Adjusts PTS reset and stream sending paths to operate on vectors. |
isobmff/isobmffhelper.h |
Refactors helper APIs to accept std::vector<uint8_t>; adds InitAndParse helper. |
isobmff/isobmffhelper.cpp |
Implements vector-based parsing/restamping helpers with shared parse init. |
isobmff/isobmffbuffer.h |
Adds setBuffer(const std::vector<uint8_t>&) overload for read-only parsing use cases. |
isobmff/isobmffbuffer.cpp |
Implements const-vector setBuffer overload. |
fragmentcollector_mpd.cpp |
Uses std::vector<uint8_t> for init segment fetch + transfer for disabled tracks. |
fragmentcollector_hls.cpp |
Converts fragment fetch/caching to vector-backed buffers and replaces .Free() usage. |
StreamAbstractionAAMP.h |
Updates InjectFragmentChunkInternal/TrickModePtsRestamp signatures to vector refs. |
MetadataProcessor.cpp |
Updates metadata parsing paths to use vectors and vector-based IsoBmffBuffer::setBuffer. |
MediaStreamContext.h |
Replaces downloaded/temp fragment buffers with vectors; updates ctor/dtor accordingly. |
MediaStreamContext.cpp |
Converts fragment caching/injection to vector move/clear semantics. |
CachedFragment.h |
Replaces fragment with std::vector<uint8_t>; changes Copy API to const-ref. |
CachedFragment.cpp |
Implements vector-based copy/clear/swap and uses ClearAndRelease. |
AampUtils.h |
Adds aamp_utils::ClearAndRelease(std::vector<...>&) helper. |
AampTSBSessionManager.cpp |
Updates init-fragment cache retrieval to write into vectors. |
test/utests/tests/TrackInjectTests/TrackInjectTests.cpp |
Updates mock calls to SendStreamTransfer and IsoBmffBuffer::setBuffer for vectors. |
test/utests/tests/StreamAbstractionAAMP_MPD/LinearFOGTests.cpp |
Uses ClearAndRelease for vector-backed downloaded fragment cleanup. |
test/utests/tests/PrivAampTests/PrivAampTests.cpp |
Replaces NULL buffer usage with empty vector in disabled test. |
test/utests/tests/MediaTrackTests/MediaTrackTests.cpp |
Reworks matchers and buffer population to use std::vector<uint8_t>. |
test/utests/tests/MediaStreamContextTests/FragmentDownloadTests.cpp |
Updates fragment data setup and cleanup to vector + ClearAndRelease. |
test/utests/tests/IsoBmffHelperTests/IsoBmffHelperTests.cpp |
Converts helper tests from AampGrowableBuffer to std::vector<uint8_t>. |
test/utests/tests/IsoBmffConvertToKeyFrameTests/IsoBmffConvertToKeyFrameTests.cpp |
Updates conversion tests to use vectors and removes g_free expectation. |
test/utests/tests/CachedFragmentTests/CachedFragmentTestCases.cpp |
Updates CachedFragment::Copy tests to use const-ref API. |
test/utests/tests/CacheFragmentTests/CacheFragmentTests.cpp |
Updates temp fragment setup to use vector member. |
test/utests/mocks/MockPrivateInstanceAAMP.h |
Updates mocked SendStreamTransfer/ProcessID3Metadata signatures to vector-based APIs. |
test/utests/mocks/MockMediaProcessor.h |
Updates mock getFirstPts signature to vector. |
test/utests/mocks/MockIsoBmffHelper.h |
Updates helper mock APIs to accept vector buffers. |
test/utests/mocks/MockIsoBmffBuffer.h |
Adds const-vector setBuffer overload to match new IsoBmffBuffer API. |
test/utests/fakes/FakeTsProcessor.cpp |
Updates fake getFirstPts signature to vector. |
test/utests/fakes/FakePrivateInstanceAAMP.cpp |
Updates fake SendStreamTransfer and ProcessID3Metadata signatures and clearing behavior. |
test/utests/fakes/FakeMetadataProcessor.cpp |
Formatting-only alignment changes in fake metadata processors. |
test/utests/fakes/FakeIsoBmffProcessor.cpp |
Updates fake PTS reset APIs to vector signatures. |
test/utests/fakes/FakeIsoBmffHelper.cpp |
Updates fake helper APIs to accept vectors. |
test/utests/fakes/FakeIsoBmffBuffer.cpp |
Adds forwarding implementation for const-vector setBuffer. |
test/utests/drm/mocks/aampMocks.cpp |
Updates mocked ProcessID3Metadata signature to const std::vector<uint8_t>&. |
Comments suppressed due to low confidence (1)
tsFragmentProcessor.cpp:194
ValidateFragmentdereferencescurr_packet_ptr[...]in thewhilecondition before confirmingcurr_lenis large enough. Because&&evaluates left-to-right, this can read out-of-bounds (and crash) for empty/short fragments. Reorder the condition to checkcurr_lenfirst (and add an early length guard) before any byte access.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 48 out of 49 changed files in this pull request and generated 1 comment.
Comments suppressed due to low confidence (1)
tsFragmentProcessor.cpp:140
ProcessFragmentassumesfragmenthas at least one TS packet. If an empty (or too-small) fragment is ever passed in,ValidateFragmentwill dereferencecurr_packet_ptr[0]and can crash. Add a size guard (e.g., return false whenfragment.size() < ts_packet_size) before computing/dereferencing packet pointers.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Change CachedFragment to use std::vector instead of AampGrowableBuffer