Skip to content

Conversation

@r83575
Copy link
Collaborator

@r83575 r83575 commented Nov 20, 2025

This PR updates the GPU frame comparison probe logic in C++ to match the logic used in the Python implementation.

Changes include:

  • Removed singleton usage
  • Cleaned up probe logic and ensured same frame filtering behavior as in Python

Closes #165

buffer_ptr: int = hash(info.get_buffer())
batch_id: int = 0
should_process: bool = frame_skipping_probe.frame_skipping_probe(buffer_ptr, batch_id)
detector: GPUFrameChangeDetector = u_data
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider declaring detector: GPUFrameChangeDetector directly in the function parameters instead of assigning it later.

stats: Dict[str, int] = {"total": 0, "skipped": 0, "processed": 0}

def jetson_frame_skip_probe(pad: Gst.Pad, info: Gst.PadProbeInfo, u_data: Optional[Any]) -> Gst.PadProbeReturn:
def jetson_frame_skip_probe(pad: Gst.Pad, info: Gst.PadProbeInfo, detector: GPUFrameChangeDetector) -> Gst.PadProbeReturn:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would not have the platform name in function name - we don't gain any information from "jetson" (it can also be a cpu-based implementation, for example). I'd use gpu_frame_skip_probe or smth similar.

Copy link
Collaborator

Choose a reason for hiding this comment

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

same as here

Could you please remove the jetson from function names, e.g. build_jetson_pipeline -> build_pipeline?

Also I think your branch is not up-to-date with main: runner is not used

@r83575 r83575 merged commit bf022cb into main Dec 4, 2025
1 check failed
@r83575 r83575 self-assigned this Dec 7, 2025
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.

Change frame comparison C++ implementation to be in sync with python one

4 participants