-
Notifications
You must be signed in to change notification settings - Fork 59
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
camera.wait_for_event works? #50
Comments
The Python version of gp_camera_wait_for_event returns event type and event data as in your line Returning instantly with loads of PS Don't try and use |
Thanks for answer. The question is, that "type" is always 0. |
If you want to try and decipher the camera.i file you also need to look at the |
"type" is an enum - SWIG provides no means to translate back from the integer value to a meaningful name. 0 is GP_EVENT_UNKNOWN. |
Thanks a lot again. But why can it be always UNKNOWN? Wrong library path, version mismatch, etc? |
"PTP Property d105 changed" doesn't fit any of the other types and isn't handled. gp_camera_wait_for_event is (currently) only looking for timeout, file added, folder added, and capture complete events. Anything else is unknown and unhandled. |
Yes, this is all the log, I get, when pressing shutter:
This is a log, I get from sample-tether.c:
Definitely more, but why? |
You appear to have only got as far as "gp_camera_wait_for_event: 0 PTP Property d116 changed". I'd expect more events to follow. |
I've added a simple event logging example in commit c0a3847. |
I checked again, it works. PS: I also checked direct ctypes approach, also works ;)
|
Giving the ctypesgen module the same name as the Python-gphoto2 package is going to cause some confusion! |
Agree, changed. |
Hi,
I'm testing the wait_for_event method now, the idea is to download the files.
The "type" is always 0, and the output looks like this:
gp_camera_wait_for_event: 0 PTP Property d105 changed
gp_camera_wait_for_event: 0 PTP Property d108 changed
gp_camera_wait_for_event: 0 PTP Property d106 changed
gp_camera_wait_for_event: 0 PTP Property d107 changed
Should it be different?
I'm checking the "sample-tether.c" code from a library (it works btw:), there are 2 additional parameters:
CameraEventType evttype;
CameraFilePath *path;
retval = gp_camera_wait_for_event (camera, 1000, &evttype, &evtdata, context);
I tried to do the same like this (maybe wrong ctypes usage):
intc = ctypes.c_int(0)
char_data = ctypes.c_char_p(0)
type, data = camera.wait_for_event(1000, ctypes.pointer(intc), ctypes.pointer(char_data), context)
But getting the error "TypeError: Camera_wait_for_event expected at most 2 arguments, got 4".
In the "camera.i" I see:
MEMBER_FUNCTION_THREAD(_Camera, Camera,
wait_for_event,
(int timeout, CameraEventType *eventtype, void **eventdata, GPContext *context),
gp_camera_wait_for_event, ($self, timeout, eventtype, eventdata, context))
So, it should support 4 arguments? Or something was changed?
Thanks
The text was updated successfully, but these errors were encountered: