g3dlidarparse: Add PTS and duration timestamp management#915
Open
ZiningLi wants to merge 2 commits into
Open
Conversation
yunowo
approved these changes
Jun 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds GStreamer buffer timestamp (PTS and duration) management to the
g3dlidarparseelement. Previously, output buffers had undefined timestamps, which could cause synchronization issues with other streams and prevent proper playback timing in downstream elements.Changes:
next_ptsfield toGstG3DLidarParsestructure to track presentation timestamps across frames1/frame_ratefor each output frame1/frame_ratewhenframe_rate > 0next_ptson pipeline lifecycle events (init, stop, EOS, SEGMENT, FLUSH) to ensure correct timestamps after stream resetsTimestamp Behavior:
frame_rate > 0: Output buffers receive continuous timestamps (e.g., frame_rate=30 produces PTS: 0s, 0.033s, 0.066s... with duration=0.033s)frame_rate = 0: PTS is set to 0 and duration isGST_CLOCK_TIME_NONE(no rate control)stride > 1: Skipped frames do NOT consume timestamp space, ensuring output maintains the target frame rateThis enables proper synchronization in multi-stream pipelines (e.g., lidar + video) and allows downstream elements to perform time-based operations.
How Has This Been Tested?
GST_DEBUG=identity:5 gst-launch-1.0 -v multifilesrc loop=false location="/home/user/zn/prdlstreamer/dlstreamer/tests/unit_tests/tests_gstgva/test_files/%06d.pcd" start-index=1 caps=application/octet-stream ! g3dlidarparse stride=2 frame-rate=30 !
identity silent=false ! fakesink
Checklist: