Skip to content

Changes to the way flushing is handled#1692

Draft
anshephe wants to merge 20 commits into
feature/VPLAY-12902from
feature/VPLAY-12902_flushing_state
Draft

Changes to the way flushing is handled#1692
anshephe wants to merge 20 commits into
feature/VPLAY-12902from
feature/VPLAY-12902_flushing_state

Conversation

@anshephe

@anshephe anshephe commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

No description provided.

anshephe added 20 commits July 6, 2026 10:22
(Trying to match non-direct rialto behaviour)
(which appears to be the case of what is happening in live trickplay)
Enabled applied_rate setting following Flush
All void methods in PrivateInstanceAAMPNotifiable now post their work
to the AAMP scheduler thread rather than calling PrivateInstanceAAMP
directly from the Rialto callback thread.

This eliminates the AB/BA deadlock where the AAMP main thread holds
mLock or mStreamLock waiting for a Rialto call to return while the
Rialto callback thread simultaneously tries to acquire the same lock
through NotifyFirstFrameReceived, NotifyEOSReached, NotifySpeedChanged,
etc.

The two return-value methods (GetState, GetProgressReportIntervalSeconds)
remain synchronous — GetState reads a std::atomic and the config read
in GetProgressReportIntervalSeconds does not contend with Rialto locks.

Test coverage: all 15 PrivateInstanceAAMPNotifiable tests pass.
Tests updated to expect ScheduleAsyncTask calls and execute tasks
inline to verify correct argument forwarding.
New tests added for NotifyBufferUnderflow (both monitor-enabled and
monitor-disabled paths) and SendMonitorAvEvent.
SEEKING and SEEK_DONE. ALso clearing the playing and eos flags
replicating a flush
Changed addSegment and haveData, as the simulator was behaving
as if the segment was ready to be processed on the call to
addSegment which isn't correct. It is released to Rialto on the
haveData call.
Reworked the needData notification, to consider request_ids before
a flush/setPosition to be stale and ignored. Also it seemed that
it was sending all sources the next needData for each haveData
response rather than limiting it to the specific source.

These changes need further examination
Flush() was reworked to use a pipeline-level setPosition() + SEEK_DONE
notification instead of per-source flush() + notifySourceFlushed(), but
11 tests (including 2 new ones added by this branch) still drove flush
completion via the now-dead notifySourceFlushed()/OnSourceFlushed() path,
so their EXPECT_CALL assertions on pipeline->flush()/setSourcePosition()
were never satisfied. Rewired all affected tests to call
PostPlaybackState(SEEK_DONE) and assert on setPosition()/setSourcePosition()
per the new implementation, correcting two assertions that encoded the old
(now incorrect) resetTime/rate semantics. Also added the state-machine
onStop/onReconfigure test cases that were missing per-state coverage for
the new individual overrides, and removed the now-unused PostSourceFlushed
test helper.

Files changed:
- test/utests/tests/AampRialtoPlayerTests/AampRialtoPlayerTestCases.cpp — rewired 11 tests to the SEEK_DONE flow; removed dead helper
- test/utests/tests/AampPlayerStateMachineTests/AampPlayerStateMachineTestCases.cpp — added 5 missing onStop/onReconfigure per-state tests
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.

1 participant