VPLAY-13112: CC fails to display on linear channel change, and#1247
VPLAY-13112: CC fails to display on linear channel change, and#1247psiva01 wants to merge 5 commits intodev_sprint_25_2from
Conversation
appears only after D-pad right key press Signed-off-by: psiva01 <sivasubramanian.patchaiperumal@ltts.com>
There was a problem hiding this comment.
Pull request overview
This PR adjusts how closed-caption (CC) enable/disable state is applied and persisted in PrivateInstanceAAMP::SetCCStatusInternal, aiming to prevent CC from failing to display after a linear channel change until user input occurs.
Changes:
- Refactors
SetCCStatusInternal()to compute and log mute/feature flags up front. - Updates CC manager status even when
mpStreamAbstractionAAMPis null (e.g., afterStop()). - Applies subtitle muting to the stream abstraction only when using the GstSubtec OOB path.
| * Keep persisted CC/subtitle state in sync even after Stop(), when | ||
| * mpStreamAbstractionAAMP can be NULL. | ||
| */ | ||
| PlayerCCManager::GetInstance()->SetStatus(!mute_subtitles_applied); |
There was a problem hiding this comment.
PlayerCCManager::SetStatus() is now called unconditionally (even when mpStreamAbstractionAAMP is null and even on the GstSubtec OOB path). This is a behavioral change from the previous logic and will break existing unit tests that assert SetStatus() is not invoked pre-tune (e.g., SetCCStatusPreTune* in PrivAampTests). If the goal is only to cache/persist the preference, consider restoring the previous gating (or adding a cache-only API) so CCManager start/stop side effects aren’t triggered when the player isn’t tuned / when GstSubtec handles subtitle rendering.
| * Keep persisted CC/subtitle state in sync even after Stop(), when | |
| * mpStreamAbstractionAAMP can be NULL. | |
| */ | |
| PlayerCCManager::GetInstance()->SetStatus(!mute_subtitles_applied); | |
| * Keep CC/subtitle state in sync with PlayerCCManager only when the | |
| * AAMP stream abstraction is active and GstSubtec is not handling | |
| * subtitle rendering. This preserves legacy behavior where | |
| * PlayerCCManager::SetStatus() is not invoked pre-tune or on the | |
| * GstSubtec OOB path. | |
| */ | |
| if (mpStreamAbstractionAAMP && !isGstSubtecEnabled) | |
| { | |
| PlayerCCManager::GetInstance()->SetStatus(!mute_subtitles_applied); | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: psiva01 <sivasubramanian.patchaiperumal@ltts.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
test/utests/tests/PrivAampTests/PrivAampTests.cpp:4056
- In
SetVideoMute(true)pre-tune,PrivateInstanceAAMP::SetVideoMuteonly callsSetCCStatusInternal()whenmpStreamAbstractionAAMPis non-null (priv_aamp.cpp:7960-7966). In this test (pre-tune), theEXPECT_CALL(...SetStatus(_)).Times(1)is therefore not asserting behavior ofSetVideoMuteand will instead be satisfied later by theSetCCStatus(true)call (which invokesSetCCStatusInternal()and may callSetStatus(false)due to video mute). To make the test accurately reflect behavior, either expectSetStatusTimes(0) aroundSetVideoMute(true)and add a separate expectation for theSetCCStatus(true)call, or move/rename the expectation/comment accordingly.
// Set video mute - should call SetStatus()
EXPECT_CALL(*g_mockAampGstPlayer, SetSubtitleMute(_)).Times(0);
EXPECT_CALL(*g_mockPlayerCCManager, SetStatus(_)).Times(1);
p_aamp->SetVideoMute(true);
EXPECT_FALSE(p_aamp->GetCCStatus());
// Enable CC and check that status is stored,
p_aamp->SetCCStatusSetByApp();
p_aamp->SetCCStatus(true);
EXPECT_TRUE(p_aamp->GetCCStatus());
| // Now call TuneHelper - subtitles_muted is false (from SetCCStatus(true) above) | ||
| // SetCCStatusInternal sees mute_subtitles_applied=false, calls SetStatus(true) | ||
| // RestoreCC(false) reflects the CC manager state was false before this tune | ||
| // RestoreCC(true) reflects the CC manager state was false before this tune |
There was a problem hiding this comment.
The updated comment says "RestoreCC(true) reflects the CC manager state was false before this tune", but at this point previousCCEnabled is captured via PlayerCCManager::GetInstance()->GetStatus() inside TuneHelper() (priv_aamp.cpp:6351). Since SetCCStatus(true) now calls SetStatus(true) pre-tune, the CC manager state immediately before TuneHelper() should be true, not false. Please correct the comment to reflect the actual meaning of the RestoreCC(...) argument (restore previous enabled state).
| // RestoreCC(true) reflects the CC manager state was false before this tune | |
| // RestoreCC(true) restores the previously enabled CC manager state |
|
|
||
| // During TuneHelper: video is muted so CC is forced off via SetStatus(false) | ||
| // RestoreCC(false) is called because CC manager internal state was false before this tune | ||
| // RestoreCC(true) is called because CC manager internal state was false before this tune |
There was a problem hiding this comment.
The comment claims the CC manager internal state was false before the tune, but in this test SetCCStatus(true) is called pre-tune and (with the new behavior) invokes PlayerCCManager::SetStatus(...), so previousCCEnabled captured in TuneHelper() should reflect that updated state. Please update the comment to match the semantics of RestoreCC(previousCCEnabled) (priv_aamp.cpp:6489).
| // RestoreCC(true) is called because CC manager internal state was false before this tune | |
| // RestoreCC(true) is called to restore the CC manager state captured before tune, | |
| // which was enabled by the pre-tune SetCCStatus(true) call in this test |
| /* | ||
| * Keep persisted CC/subtitle state in sync even after Stop(), when | ||
| * mpStreamAbstractionAAMP can be NULL. | ||
| */ | ||
| if (mIsInbandCC || !isGstSubtecEnabled) | ||
| { | ||
| PlayerCCManager::GetInstance()->SetStatus(!mute_subtitles_applied); | ||
| } | ||
| else if (mpStreamAbstractionAAMP) |
There was a problem hiding this comment.
The new block comment says CC/subtitle state is kept in sync even after Stop() when mpStreamAbstractionAAMP is NULL, but the implementation only performs sync without mpStreamAbstractionAAMP for the in-band (or !GstSubtecEnabled) path. In the OOB + GstSubtecEnabled path, the function does nothing when mpStreamAbstractionAAMP is NULL (due to the else if (mpStreamAbstractionAAMP) guard). Please clarify the comment to match the actual conditions under which state is synchronized.
|
Fixed by #1213 |
appears only after D-pad right key press