Fixed playback info reporting for not asynchronous playbacks#435
Fixed playback info reporting for not asynchronous playbacks#435
Conversation
|
Pull request must be merged with a description containing the required fields, Summary: 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. |
There was a problem hiding this comment.
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()andstopNotifyPlaybackInfoTimer()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();} |
There was a problem hiding this comment.
Missing newline before closing brace. The closing brace should be on its own line for consistency with other test methods.
| m_sut->stopNotifyPlaybackInfoTimer();} | |
| m_sut->stopNotifyPlaybackInfoTimer(); | |
| } |
| m_sut->stopPositionReportingAndCheckAudioUnderflowTimer(); | ||
| } | ||
|
|
||
| TEST_F(GstGenericPlayerPrivateTest, shouldStopActivePlaybackInfoTimerTimer) |
There was a problem hiding this comment.
The test name has a duplicated 'Timer' suffix ('PlaybackInfoTimerTimer'). It should be 'shouldStopActivePlaybackInfoTimer' to match the naming pattern of similar tests.
| m_sut->stopPositionReportingAndCheckAudioUnderflowTimer(); | ||
| } | ||
|
|
||
| TEST_F(GstGenericPlayerPrivateTest, shouldNotStopInactiveActivePlaybackInfoTimer) |
There was a problem hiding this comment.
The test name contains both 'Inactive' and 'Active' which is contradictory. It should be 'shouldNotStopInactivePlaybackInfoTimer' to match the pattern of 'shouldNotStopInactivePositionReportingTimer'.
| TEST_F(GstGenericPlayerPrivateTest, shouldNotStopInactiveActivePlaybackInfoTimer) | |
| TEST_F(GstGenericPlayerPrivateTest, shouldNotStopInactivePlaybackInfoTimer) |
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Test name contains a redundant "Timer" suffix. The name should be "shouldStopActivePlaybackInfoTimer" instead of "shouldStopActivePlaybackInfoTimerTimer".
| TEST_F(GstGenericPlayerPrivateTest, shouldStopActivePlaybackInfoTimerTimer) | |
| TEST_F(GstGenericPlayerPrivateTest, shouldStopActivePlaybackInfoTimer) |
|
Coverage statistics of your commit: |
There was a problem hiding this comment.
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}; |
There was a problem hiding this comment.
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.
|
Coverage statistics of your commit: |
1 similar comment
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
1 similar comment
|
Coverage statistics of your commit: |
|
tests/componenttests/server/tests/mediaPipeline/FlushTest.cpp:59:0: style: The function 'willFlush' is never used. [unusedFunction] |
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
1 similar comment
|
Coverage statistics of your commit: |
|
Coverage statistics of your commit: |
Summary: Fixed playback info reporting for not asynchronous playbacks
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: ENTDAI-2231