Skip to content

VPLAY-12498 gstreamer test harness - robustness: Track Destructor Enhancement and Comprehensive Pipeline::Reset#922

Merged
pstroffolino merged 5 commits intodev_sprint_25_2from
feature/VPLAY-12498
Jan 28, 2026
Merged

VPLAY-12498 gstreamer test harness - robustness: Track Destructor Enhancement and Comprehensive Pipeline::Reset#922
pstroffolino merged 5 commits intodev_sprint_25_2from
feature/VPLAY-12498

Conversation

@pstroffolino
Copy link
Contributor

VPLAY-12498 gstreamer test harness - robustness: Track Destructor Enhancement and Comprehensive Pipeline::Reset

Reason for Change:

Fix #1 - Track Destructor Enhancement:

Now calls Flush() before deleting the queue
Ensures all TrackEvent objects are properly deleted
Prevents memory leaks when Track objects are destroyed

Fix #2 - Comprehensive Pipeline::Reset():

Clears the seek queue (original behavior)
Resets configured_stream_count to 0
Resets initial_seek_performed to false
Clears injected seconds counters for all media streams
Provides detailed debug logging
These fixes create multiple layers of protection:

Stop command (Fix #1) - Explicit cleanup when user stops playback
Track destructor (Fix #2) - Automatic cleanup when Track objects are destroyed
Pipeline::Reset() (Fix #3) - Comprehensive state reset that can be called by other methods like Flush()
Together, these should significantly improve stability when:

Stopping and playing different streams
Switching between DAI tests
Recovering from errors
Handling rapid state transitions
The code now has proper cleanup at multiple lifecycle points, reducing the chance of crashes from stale state or memory leaks

Reason for Change:
Cleans up global Mp4Demux instances - Prevents memory leaks from accumulated demuxers
Flushes track queues - Removes stale TrackEvent objects that could reference freed memory
Resets pipeline state - Sets to NULL before deletion
Recreates clean pipeline - Fresh instance without baggage
Resets context state - All counters and flags back to initial values
Resets track state - Clears needsData and injection flags
This should significantly improve stability when stopping and playing different streams. The fix addresses the root cause of the crashes: incomplete cleanup leaving dangling pointers and stale state.

Test Guidance: use gst test harness to play different streams and tests and confirm no crashes

Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
…ancement and Comprehensive Pipeline::Reset

Reason for Change:
Fix #1 - Track Destructor Enhancement:

Now calls Flush() before deleting the queue
Ensures all TrackEvent objects are properly deleted
Prevents memory leaks when Track objects are destroyed

Fix #2 - Comprehensive Pipeline::Reset():

Clears the seek queue (original behavior)
Resets configured_stream_count to 0
Resets initial_seek_performed to false
Clears injected seconds counters for all media streams
Provides detailed debug logging
These fixes create multiple layers of protection:

Stop command (Fix #1) - Explicit cleanup when user stops playback
Track destructor (Fix #2) - Automatic cleanup when Track objects are destroyed
Pipeline::Reset() (Fix #3) - Comprehensive state reset that can be called by other methods like Flush()
Together, these should significantly improve stability when:

Stopping and playing different streams
Switching between DAI tests
Recovering from errors
Handling rapid state transitions
The code now has proper cleanup at multiple lifecycle points, reducing the chance of crashes from stale state or memory leaks.

Signed-off-by: Philip Stroffolino <philip_stroffolino@cable.comcast.com>
@pstroffolino pstroffolino requested a review from a team as a code owner January 27, 2026 19:10
Copilot AI review requested due to automatic review settings January 27, 2026 19:10
Copy link
Contributor

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

Improves robustness of the GStreamer test harness by strengthening cleanup/reset behavior across stop/teardown paths and by making pipeline context inheritance compatible with PipelineContext* usage.

Changes:

  • Make MyPipelineContext publicly inherit PipelineContext so it can be passed safely as a PipelineContext*.
  • Ensure Track cleans up queued TrackEvent objects on destruction and add additional cleanup/reset steps on the stop command.
  • Expand Pipeline::Reset() to reset more internal state (seek queue + config state + injected counters).

Reviewed changes

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

File Description
test/gstTestHarness/gst-test.h Public inheritance for MyPipelineContext to enable correct upcasting to PipelineContext*.
test/gstTestHarness/gst-test.cpp Adds queue flushing in Track destructor and extends stop command cleanup/reset logic.
test/gstTestHarness/gst-port.cpp Enhances Pipeline::Reset() to fully reset seek/config state and injected counters.

pstroffolino and others added 2 commits January 27, 2026 20:53
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings January 28, 2026 01:57
@pstroffolino pstroffolino merged commit d10c0f2 into dev_sprint_25_2 Jan 28, 2026
7 of 8 checks passed
@pstroffolino pstroffolino deleted the feature/VPLAY-12498 branch January 28, 2026 02:01
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant