Skip to content

Fix pipeline setup async requests executing at pipeline teardown#564

Merged
skywojciechowskim merged 4 commits into
release/v0.15.2from
feature/RDKEMW-21806
Jul 17, 2026
Merged

Fix pipeline setup async requests executing at pipeline teardown#564
skywojciechowskim merged 4 commits into
release/v0.15.2from
feature/RDKEMW-21806

Conversation

@smudri85

Copy link
Copy Markdown
Contributor

Summary: Fix pipeline setup async requests executing at pipeline teardown (#563).
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: RDKEMW-21806

Copilot AI review requested due to automatic review settings July 16, 2026 17:11
@github-actions

Copy link
Copy Markdown

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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes a teardown-time lifetime issue in the GStreamer generic player by ensuring objects captured by async worker-thread tasks remain valid until task completion, and by extending unit tests to reflect the new ownership semantics.

Changes:

  • Take/transfer ownership of GstElement/GstCaps used by queued tasks (gstObjectRef + gstCapsCopy) and release them in task destructors.
  • Update task-factory APIs and implementations to accept owned GstCaps* for UpdatePlaybackGroup.
  • Adjust unit tests/mocks to validate the new ref/unref behavior, including a null-caps case.

Reviewed changes

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

Show a summary per file
File Description
tests/unittests/media/server/mocks/gstplayer/GenericPlayerTaskFactoryMock.h Updates mock signature for createUpdatePlaybackGroup to match new ownership model.
tests/unittests/media/server/gstplayer/genericPlayer/tasksTests/GenericPlayerTaskFactoryTest.cpp Updates task-factory tests to expect unrefs performed by task destructors.
tests/unittests/media/server/gstplayer/genericPlayer/GstGenericPlayerTest.cpp Adds expectation for gstObjectRef when scheduling DeepElementAdded.
tests/unittests/media/server/gstplayer/genericPlayer/GstGenericPlayerPrivateTest.cpp Verifies gstObjectRef + gstCapsCopy behavior and adds null-caps coverage.
tests/unittests/media/server/gstplayer/genericPlayer/common/GenericTasksTestsBase.cpp Aligns common task tests with new destructor-based cleanup.
media/server/gstplayer/source/tasks/generic/UpdatePlaybackGroup.cpp Releases owned typefind/caps in destructor.
media/server/gstplayer/source/tasks/generic/GenericPlayerTaskFactory.cpp Updates factory method signature to accept owned GstCaps*.
media/server/gstplayer/source/tasks/generic/DeepElementAdded.cpp Releases owned element in destructor.
media/server/gstplayer/source/GstGenericPlayer.cpp Takes refs / copies before enqueuing tasks to prevent use-after-free at teardown.
media/server/gstplayer/include/tasks/IGenericPlayerTaskFactory.h Updates interface signature for createUpdatePlaybackGroup.
media/server/gstplayer/include/tasks/generic/UpdatePlaybackGroup.h Updates constructor/member types for owned GstCaps*.
media/server/gstplayer/include/tasks/generic/GenericPlayerTaskFactory.h Updates concrete factory declaration to match interface change.

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

Comment on lines +38 to +42
m_gstWrapper->gstObjectUnref(m_typefind);
if (m_caps)
{
m_gstWrapper->gstCapsUnref(m_caps);
}
{
RIALTO_SERVER_LOG_DEBUG("DeepElementAdded finished");
m_glibWrapper->gFree(m_elementName);
m_gstWrapper->gstObjectUnref(m_element);
Comment on lines 395 to 399
* @param[in] context : The GstGenericPlayer context
* @param[in] player : The GstGenericPlayer instance
* @param[in] typefind : The typefind element.
* @param[in] caps : The GstCaps of added element
* @param[in] caps : The GstCaps of added element.
*
Comment on lines 48 to +49
GstElement *m_typefind;
const GstCaps *m_caps;
GstCaps *m_caps;
@github-actions

Copy link
Copy Markdown

Coverage statistics of your commit:
Congratulations, your commit improved lines coverage from: 0.0% to 84.3%
Congratulations, your commit improved functions coverage from: 0.0% to 92.5%

@skywojciechowskim
skywojciechowskim merged commit 8151b84 into release/v0.15.2 Jul 17, 2026
32 of 34 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 17, 2026
@skywojciechowskim
skywojciechowskim deleted the feature/RDKEMW-21806 branch July 17, 2026 06:10
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.

3 participants