Skip to content

Comments

Fixed playback info reporting for not asynchronous playbacks#435

Merged
aczs merged 16 commits intomasterfrom
PostionReportingInAsyncFalseFix
Jan 14, 2026
Merged

Fixed playback info reporting for not asynchronous playbacks#435
aczs merged 16 commits intomasterfrom
PostionReportingInAsyncFalseFix

Conversation

@aczs
Copy link
Contributor

@aczs aczs commented Jan 14, 2026

Summary: Fixed playback info reporting for not asynchronous playbacks
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: ENTDAI-2231

Copilot AI review requested due to automatic review settings January 14, 2026 09:58
@github-actions
Copy link

Pull request must be merged with a description containing the required fields,

Summary:
Type: Feature/Fix/Cleanup
Test Plan:
Jira:

If there is no jira releated to this change, please put 'Jira: NO-JIRA'.

Description can be changed by editing the top comment on your pull request and making a new commit.

Copy link

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 separates the playback info reporting timer from the position reporting timer to fix playback info reporting for non-asynchronous playbacks. Previously, the playback info timer was created and managed together with the position reporting timer, but now they are managed independently with dedicated start/stop methods.

Changes:

  • Introduced new startNotifyPlaybackInfoTimer() and stopNotifyPlaybackInfoTimer() methods to manage the playback info timer separately
  • Modified state transition handling to start the playback info timer when entering PAUSED state and stop it when entering READY state
  • Updated tests to reflect the separation of the two timers

Reviewed changes

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

Show a summary per file
File Description
media/server/gstplayer/include/IGstGenericPlayerPrivate.h Added interface methods for starting/stopping the playback info timer
media/server/gstplayer/include/GstGenericPlayer.h Declared new timer control methods
media/server/gstplayer/source/GstGenericPlayer.cpp Implemented separate timer management with dedicated start/stop methods
media/server/gstplayer/source/tasks/generic/HandleBusMessage.cpp Updated state transition logic to control the playback info timer appropriately
media/server/gstplayer/source/tasks/generic/Stop.cpp Added call to stop playback info timer on stop
media/server/gstplayer/source/tasks/generic/Flush.cpp Removed unnecessary stopPositionReportingAndCheckAudioUnderflowTimer call
media/server/gstplayer/source/tasks/generic/RemoveSource.cpp Unchanged in diff but referenced by tests
tests/unittests/media/server/mocks/gstplayer/GstGenericPlayerPrivateMock.h Added mock methods for new timer control functions
tests/unittests/media/server/gstplayer/genericPlayer/GstGenericPlayerPrivateTest.cpp Added comprehensive tests for separate timer management
tests/unittests/media/server/gstplayer/genericPlayer/tasksTests/HandleBusMessageTest.cpp Updated expectations to reflect separated timer control
tests/unittests/media/server/gstplayer/genericPlayer/tasksTests/RemoveSourceTest.cpp Updated test expectations for timer control during source removal
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.h Added helper method declaration
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp Implemented helper method and updated flush expectations
Comments suppressed due to low confidence (1)

media/server/gstplayer/source/tasks/generic/HandleBusMessage.cpp:122

  • The playback info timer is not stopped when entering PLAYING state. Since it's started in PAUSED state and should report playback info only when paused, it should be stopped here to avoid unnecessary periodic notifications during playback. Add m_player.stopNotifyPlaybackInfoTimer(); before or after line 122.
            case GST_STATE_PLAYING:
            {
                m_context.flushOnPrerollController.stateReached(newState);
                m_player.executePostponedFlushes();
                // If async flush was requested before HandleBusMessage task creation (but it was not executed yet)
                // or if async flush was created after HandleBusMessage task creation (but before its execution)
                // we can't report playback state, because async flush causes state loss - reported state is probably invalid.
                if (m_isAsyncFlushOngoingDuringCreation || m_flushWatcher.isAsyncFlushOngoing())
                {
                    RIALTO_SERVER_LOG_WARN("Skip PLAYING notification - flush is ongoing");
                    break;
                }
                if (m_context.pendingPlaybackRate != kNoPendingPlaybackRate)
                {
                    m_player.setPendingPlaybackRate();
                }
                m_player.startPositionReportingAndCheckAudioUnderflowTimer();

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

m_sut->startNotifyPlaybackInfoTimer();
m_sut->stopNotifyPlaybackInfoTimer();}
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Missing newline before closing brace. The closing brace should be on its own line for consistency with other test methods.

Suggested change
m_sut->stopNotifyPlaybackInfoTimer();}
m_sut->stopNotifyPlaybackInfoTimer();
}

Copilot uses AI. Check for mistakes.
m_sut->stopPositionReportingAndCheckAudioUnderflowTimer();
}

TEST_F(GstGenericPlayerPrivateTest, shouldStopActivePlaybackInfoTimerTimer)
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The test name has a duplicated 'Timer' suffix ('PlaybackInfoTimerTimer'). It should be 'shouldStopActivePlaybackInfoTimer' to match the naming pattern of similar tests.

Copilot uses AI. Check for mistakes.
m_sut->stopPositionReportingAndCheckAudioUnderflowTimer();
}

TEST_F(GstGenericPlayerPrivateTest, shouldNotStopInactiveActivePlaybackInfoTimer)
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The test name contains both 'Inactive' and 'Active' which is contradictory. It should be 'shouldNotStopInactivePlaybackInfoTimer' to match the pattern of 'shouldNotStopInactivePositionReportingTimer'.

Suggested change
TEST_F(GstGenericPlayerPrivateTest, shouldNotStopInactiveActivePlaybackInfoTimer)
TEST_F(GstGenericPlayerPrivateTest, shouldNotStopInactivePlaybackInfoTimer)

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

Copilot AI review requested due to automatic review settings January 14, 2026 12:04
@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

Copy link

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

Copilot AI review requested due to automatic review settings January 14, 2026 13:10
Copy link

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 15 out of 15 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

m_sut->stopPositionReportingAndCheckAudioUnderflowTimer();
}

TEST_F(GstGenericPlayerPrivateTest, shouldStopActivePlaybackInfoTimerTimer)
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

Test name contains a redundant "Timer" suffix. The name should be "shouldStopActivePlaybackInfoTimer" instead of "shouldStopActivePlaybackInfoTimerTimer".

Suggested change
TEST_F(GstGenericPlayerPrivateTest, shouldStopActivePlaybackInfoTimerTimer)
TEST_F(GstGenericPlayerPrivateTest, shouldStopActivePlaybackInfoTimer)

Copilot uses AI. Check for mistakes.
Copilot AI review requested due to automatic review settings January 14, 2026 13:19
@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

Copy link

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 15 out of 15 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


void GstGenericPlayer::startNotifyPlaybackInfoTimer()
{
static constexpr std::chrono::milliseconds kPlaybackInfoTimerMs{32};
Copy link

Copilot AI Jan 14, 2026

Choose a reason for hiding this comment

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

The constant kPlaybackInfoTimerMs is defined locally inside startNotifyPlaybackInfoTimer(), while the similar constant kPositionReportTimerMs is defined at file scope (line 44). For consistency and maintainability, consider moving kPlaybackInfoTimerMs to file scope alongside kPositionReportTimerMs.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

1 similar comment
@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

Copilot AI review requested due to automatic review settings January 14, 2026 14:28
@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

1 similar comment
@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

@github-actions
Copy link

tests/componenttests/server/tests/mediaPipeline/FlushTest.cpp:59:0: style: The function 'willFlush' is never used. [unusedFunction]
void willFlush()
^
nofile:0:0: information: Active checkers: 161/592 (use --checkers-report= to see details) [checkersReport]

@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

1 similar comment
@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

@github-actions
Copy link

Coverage statistics of your commit:
Lines coverage stays unchanged and is: 85.2%
Functions coverage stays unchanged and is: 92.5%

@aczs aczs merged commit e918186 into master Jan 14, 2026
50 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants