Skip to content
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

new camera_keep_device_on() function (less noise in debug log) #1011

Merged
merged 1 commit into from
Sep 16, 2024

Conversation

axxel
Copy link
Contributor

@axxel axxel commented Sep 12, 2024

Instead of calling ptp_canon_eos_keepdeviceon() in e.g. camera_wait_for_event() directly for every invocation (often twice), which can lead to dozens of those calls per second, this patch limits the number to 1 every 10 seconds.

The camera_prepare_capture + ptp_check_eos_events + keepdeviceon block in camera_lookup_by_property has been removed completely as this function is only called from within camera_wait_for_event() where those checks have been made just prior to the call to camera_lookup_by_property.

Furthermore: ptp_check_eos_events() will now only be called inside camera_wait_for_event if the queue of already transmitted events is drained first.

Instead of calling ptp_canon_eos_keepdeviceon() in e.g.
camera_wait_for_event() directly for every invocation (often twice),
which can lead to dozens of those calls per second, this patch limits the
number to 1 every 10 seconds.

The camera_prepare_capture + ptp_check_eos_events + keepdeviceon block in
camera_lookup_by_property has been removed completely as this function is
only called from within camera_wait_for_event() where those checks have
been made just prior to the call to camera_lookup_by_property.

Furthermore: ptp_check_eos_events() will now only be called inside
camera_wait_for_event if the queue of already transmitted events is
drained first.
@msmeissn msmeissn merged commit a26126a into gphoto:master Sep 16, 2024
4 of 5 checks passed
@axxel axxel deleted the camera-keep-device-on branch September 16, 2024 09:47
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.

2 participants