Fix pipeline setup async requests executing at pipeline teardown#564
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
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/GstCapsused by queued tasks (gstObjectRef+gstCapsCopy) and release them in task destructors. - Update task-factory APIs and implementations to accept owned
GstCaps*forUpdatePlaybackGroup. - 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.
| 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); |
| * @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. | ||
| * |
| GstElement *m_typefind; | ||
| const GstCaps *m_caps; | ||
| GstCaps *m_caps; |
|
Coverage statistics of your commit: |
Summary: Fix pipeline setup async requests executing at pipeline teardown (#563).
Type: Fix
Test Plan: UT/CT, Fullstack
Jira: RDKEMW-21806