VPAAMP-371 Replatce SyncBegin and Sync end with modern cpp RAII imple…#1504
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR modernizes PrivateInstanceAAMP’s “GStreamer operation” locking by replacing the manual SyncBegin()/SyncEnd() pair with an RAII-style SyncLock() that returns a std::unique_lock<std::recursive_mutex>, reducing the risk of mismatched lock/unlock calls across the player and collectors.
Changes:
- Replace
SyncBegin()/SyncEnd()with[[nodiscard]] SyncLock()inPrivateInstanceAAMP(header + implementation). - Update call sites across player/collectors/DRM and unit-test fakes/mocks to use scoped RAII locking.
- Adjust unit tests to validate the new API entry point (
SyncLock()).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
priv_aamp.h |
Removes SyncBegin/SyncEnd declarations and introduces [[nodiscard]] SyncLock() with updated Doxygen. |
priv_aamp.cpp |
Implements SyncLock() and updates multiple internal critical sections to use RAII locking. |
aampgstplayer.cpp |
Updates AAMPGstPlayer::Pause() to use SyncLock() instead of manual begin/end. |
fragmentcollector_mpd.cpp |
Updates MPD collector destructor cleanup to use scoped SyncLock(). |
fragmentcollector_hls.cpp |
Updates HLS collector destructor cleanup to use scoped SyncLock(). |
drm/DrmInterface.cpp |
Updates curl termination path to use scoped SyncLock(). |
test/utests/fakes/FakePrivateInstanceAAMP.cpp |
Removes fake SyncBegin/SyncEnd stubs and adds fake SyncLock() implementation. |
test/utests/drm/mocks/aampMocks.cpp |
Removes mock SyncBegin/SyncEnd stubs and adds mock SyncLock() implementation. |
test/utests/tests/PrivAampTests/PrivAampTests.cpp |
Updates unit test to call SyncLock() instead of SyncBegin/SyncEnd. |
dnfaulkner
reviewed
May 22, 2026
dnfaulkner
reviewed
May 22, 2026
jfagunde
reviewed
May 22, 2026
dnfaulkner
reviewed
May 22, 2026
jfagunde
approved these changes
May 22, 2026
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.
SyncBegin()/SyncEnd() were thin wrappers around mLock.lock()/mLock.unlock()] that required callers to manually match every acquire with a release.