-
Notifications
You must be signed in to change notification settings - Fork 0
Align C++ frame skipping probe logic with Python implementation #168
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| 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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR updates the GPU frame comparison probe logic in C++ to match the logic used in the Python implementation.
Changes include:
Closes #165