-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgphoto2_doc.txt
3368 lines (2546 loc) · 95 KB
/
gphoto2_doc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
Help on package gphoto2:
NAME
gphoto2
PACKAGE CONTENTS
_abilities_list
_camera
_context
_file
_filesys
_list
_port_info_list
_port_log
_result
_version
_widget
abilities_list
camera
context
file
filesys
list
port_info_list
port_log
result
version
widget
CLASSES
builtins.Exception(builtins.BaseException)
GPhoto2Error
class GPhoto2Error(builtins.Exception)
| Exception raised by gphoto2 library errors
|
| Attributes:
| code (int): the gphoto2 error code
| string (str): corresponding error message
|
| Method resolution order:
| GPhoto2Error
| builtins.Exception
| builtins.BaseException
| builtins.object
|
| Methods defined here:
|
| __init__(self, code)
| Initialize self. See help(type(self)) for accurate signature.
|
| ----------------------------------------------------------------------
| Data descriptors defined here:
|
| __weakref__
| list of weak references to the object (if defined)
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.Exception:
|
| __new__(*args, **kwargs) from builtins.type
| Create and return a new object. See help(type) for accurate signature.
|
| ----------------------------------------------------------------------
| Methods inherited from builtins.BaseException:
|
| __delattr__(self, name, /)
| Implement delattr(self, name).
|
| __getattribute__(self, name, /)
| Return getattr(self, name).
|
| __reduce__(...)
| helper for pickle
|
| __repr__(self, /)
| Return repr(self).
|
| __setattr__(self, name, value, /)
| Implement setattr(self, name, value).
|
| __setstate__(...)
|
| __str__(self, /)
| Return str(self).
|
| with_traceback(...)
| Exception.with_traceback(tb) --
| set self.__traceback__ to tb and return self.
|
| ----------------------------------------------------------------------
| Data descriptors inherited from builtins.BaseException:
|
| __cause__
| exception cause
|
| __context__
| exception context
|
| __dict__
|
| __suppress_context__
|
| __traceback__
|
| args
FUNCTIONS
SWIG_PyInstanceMethod_New(...)
gp_abilities_list_append(...)
gp_abilities_list_append(CameraAbilitiesList list, CameraAbilities abilities) -> int
Append the abilities to the list.
Parameters
----------
* `list` :
CameraAbilitiesList
* `abilities` :
CameraAbilities
Returns
-------
a gphoto2 error code
This function is called by a camera library on camera_abilities() in
order to inform libgphoto2 about a supported camera model.
See also gphoto2.CameraAbilitiesList.append
gp_abilities_list_count(...)
gp_abilities_list_count(CameraAbilitiesList list) -> int
Count the entries in the supplied list.
Parameters
----------
* `list` :
a CameraAbilitiesList
Returns
-------
The number of entries or a gphoto2 error code
See also gphoto2.CameraAbilitiesList.count
gp_abilities_list_detect(...)
gp_abilities_list_detect(CameraAbilitiesList list, PortInfoList info_list, Context context) -> int
Parameters
----------
* `list` :
a CameraAbilitiesList
* `info_list` :
the GPPortInfoList of ports to use for detection
* `l` :
a CameraList that contains the autodetected cameras after the call
* `context` :
a GPContext
Tries to detect any camera connected to the computer using the supplied
list of supported cameras and the supplied info_list of ports.
Returns
-------
a gphoto2 error code
See also gphoto2.CameraAbilitiesList.detect
gp_abilities_list_get_abilities(...)
gp_abilities_list_get_abilities(CameraAbilitiesList list, int index) -> int
Retrieve the camera abilities of entry with supplied index number.
Parameters
----------
* `list` :
a CameraAbilitiesList
* `index` :
index
* `abilities` :
pointer to CameraAbilities for returned data.
Returns
-------
a gphoto2 error code
Retrieves the camera abilities of entry with supplied index number.
Typically, you would call gp_camera_set_abilities() afterwards in order
to prepare the initialization of a camera.
See also gphoto2.CameraAbilitiesList.get_abilities
gp_abilities_list_load(...)
gp_abilities_list_load(CameraAbilitiesList list, Context context) -> int
Scans the system for camera drivers.
Parameters
----------
* `list` :
a CameraAbilitiesList
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
All supported camera models will then be added to the list.
See also gphoto2.CameraAbilitiesList.load
gp_abilities_list_load_dir(...)
gp_abilities_list_load_dir(CameraAbilitiesList list, char const * dir, Context context) -> int
See also gphoto2.CameraAbilitiesList.load_dir
gp_abilities_list_lookup_model(...)
gp_abilities_list_lookup_model(CameraAbilitiesList list, char const * model) -> int
Search the list for an entry of given model name.
Parameters
----------
* `list` :
a CameraAbilitiesList
* `model` :
a camera model name
Returns
-------
Index of entry or gphoto2 error code
See also gphoto2.CameraAbilitiesList.lookup_model
gp_abilities_list_new(...)
gp_abilities_list_new() -> int
Allocate the memory for a new abilities list.
Function to allocate the memory for a new abilities list.
Parameters
----------
* `list` :
CameraAbilitiesList object to initialize
Returns
-------
gphoto2 error code
You would then call gp_abilities_list_load() in order to populate it.
See also gphoto2.CameraAbilitiesList.new
gp_abilities_list_reset(...)
gp_abilities_list_reset(CameraAbilitiesList list) -> int
Reset the list.
Parameters
----------
* `list` :
a CameraAbilitiesList
Returns
-------
a gphoto2 error code
See also gphoto2.CameraAbilitiesList.reset
gp_camera_autodetect(...)
gp_camera_autodetect(Context context) -> int
Autodetect all detectable camera
Parameters
----------
* `list` :
a CameraList that receives the autodetected cameras
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
This camera will autodetected all cameras that can be autodetected. This
will for instance detect all USB cameras.
CameraList *list; gp_list_new (&list); gp_camera_autodetect (list,
context); ... done! ...
See also gphoto2.Camera.autodetect
gp_camera_capture(...)
gp_camera_capture(Camera camera, CameraCaptureType type, Context context) -> int
Captures an image, movie, or sound clip depending on the given `type`.
Parameters
----------
* `camera` :
a Camera
* `type` :
a CameraCaptureType
* `path` :
a CameraFilePath
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
The resulting file will be stored on the camera. The location gets
stored in `path`. The file can then be downloaded using
gp_camera_file_get.
See also gphoto2.Camera.capture
gp_camera_capture_preview(...)
gp_camera_capture_preview(Camera camera, Context context) -> int
Captures a preview that won't be stored on the camera but returned in
supplied file.
Parameters
----------
* `camera` :
a Camera
* `file` :
a CameraFile
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
For example, you could use gp_capture_preview() for taking some sample
pictures before calling gp_capture().
See also gphoto2.Camera.capture_preview
gp_camera_exit(...)
gp_camera_exit(Camera camera, Context context) -> int
Close connection to camera.
Parameters
----------
* `camera` :
a Camera object
* `context` :
a GPContext object
Returns
-------
a gphoto2 error code.
Closes a connection to the camera and therefore gives other application
the possibility to access the camera, too.
It is recommended that you call this function when you currently don't
need the camera. The camera will get reinitialized by gp_camera_init()
automatically if you try to access the camera again.
See also gphoto2.Camera.exit
gp_camera_file_delete(...)
gp_camera_file_delete(Camera camera, char const * folder, char const * file, Context context) -> int
Deletes the file from `folder`.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `file` :
the name of a file
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.file_delete
gp_camera_file_get(...)
gp_camera_file_get(Camera camera, char const * folder, char const * file, CameraFileType type, Context context) -> int
Retrieves a file from the Camera.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `file` :
the name of a file
* `type` :
the CameraFileType
* `camera_file` :
a CameraFile
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.file_get
gp_camera_file_get_info(...)
gp_camera_file_get_info(Camera camera, char const * folder, char const * file, Context context) -> int
Retrieves information about a file.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `file` :
the name of the file
* `info` :
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.file_get_info
gp_camera_file_read(...)
gp_camera_file_read(Camera camera, char const * folder, char const * file, CameraFileType type, uint64_t offset, char * buf, Context context) -> int
Reads a file partially from the Camera.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `file` :
the name of a file
* `type` :
the CameraFileType
* `offset` :
the offset into the camera file
* `data` :
the buffer receiving the data
* `size` :
the size to be read and that was read. (Note: size should not exceed
32 bits)
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.file_read
gp_camera_file_set_info(...)
gp_camera_file_set_info(Camera camera, char const * folder, char const * file, CameraFileInfo info, Context context) -> int
Sets some file properties like name or permissions.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `file` :
the name of a file
* `info` :
the CameraFileInfo
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.file_set_info
gp_camera_folder_delete_all(...)
gp_camera_folder_delete_all(Camera camera, char const * folder, Context context) -> int
Deletes all files in a given `folder`.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.folder_delete_all
gp_camera_folder_list_files(...)
gp_camera_folder_list_files(Camera camera, char const * folder, Context context) -> int
Lists the files in supplied `folder`.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `list` :
a CameraList
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.folder_list_files
gp_camera_folder_list_folders(...)
gp_camera_folder_list_folders(Camera camera, char const * folder, Context context) -> int
Lists the folders in supplied `folder`.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `list` :
a CameraList
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.folder_list_folders
gp_camera_folder_make_dir(...)
gp_camera_folder_make_dir(Camera camera, char const * folder, char const * name, Context context) -> int
Creates a new directory called `name` in the given `folder`.
Parameters
----------
* `camera` :
a Camera
* `folder` :
the location where to create the new directory
* `name` :
the name of the directory to be created
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.folder_make_dir
gp_camera_folder_put_file(...)
gp_camera_folder_put_file(Camera camera, char const * folder, char const * filename, CameraFileType type, CameraFile file, Context context) -> int
Uploads a file into given `folder`.
Parameters
----------
* `camera` :
a Camera
* `folder` :
a folder
* `file` :
a CameraFile
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.folder_put_file
gp_camera_folder_remove_dir(...)
gp_camera_folder_remove_dir(Camera camera, char const * folder, char const * name, Context context) -> int
Removes an (empty) directory called `name` from the given `folder`.
Parameters
----------
* `camera` :
a Camera
* `folder` :
the folder from which to remove the directory
* `name` :
the name of the directory to be removed
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.folder_remove_dir
gp_camera_get_abilities(...)
gp_camera_get_abilities(Camera camera) -> int
Retrieve the `abilities` of the `camera`.
Parameters
----------
* `camera` :
a Camera
* `abilities` :
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.get_abilities
gp_camera_get_about(...)
gp_camera_get_about(Camera camera, Context context) -> int
Retrieves information about the camera driver.
Parameters
----------
* `camera` :
a Camera
* `about` :
a CameraText
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
Typically, this information contains name and address of the author,
acknowledgements, etc.
See also gphoto2.Camera.get_about
gp_camera_get_config(...)
gp_camera_get_config(Camera camera, Context context) -> int
Retrieve a configuration `window` for the `camera`.
Parameters
----------
* `camera` :
a Camera
* `window` :
a CameraWidget
* `context` :
a GPContext
Returns
-------
gphoto2 error code
This `window` can be used for construction of a configuration dialog.
See also gphoto2.Camera.get_config
gp_camera_get_manual(...)
gp_camera_get_manual(Camera camera, Context context) -> int
Retrieves the `manual` for given `camera`.
Parameters
----------
* `camera` :
a Camera
* `manual` :
a CameraText
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
This manual typically contains information about using the camera.
See also gphoto2.Camera.get_manual
gp_camera_get_port_info(...)
gp_camera_get_port_info(Camera camera) -> int
See also gphoto2.Camera.get_port_info
gp_camera_get_port_speed(...)
gp_camera_get_port_speed(Camera camera) -> int
Retrieve the current speed.
Parameters
----------
* `camera` :
a Camera
Returns
-------
The current speed or a gphoto2 error code
See also gphoto2.Camera.get_port_speed
gp_camera_get_single_config(...)
gp_camera_get_single_config(Camera camera, char const * name, Context context) -> int
Retrieve a single configuration `widget` for the `camera`.
Parameters
----------
* `camera` :
a Camera
* `name` :
the name of a configuration widget
* `widget` :
a CameraWidget
* `context` :
a GPContext
Returns
-------
gphoto2 error code
This `widget` will then contain the current and the possible values and
the type.
See also gphoto2.Camera.get_single_config
gp_camera_get_storageinfo(...)
gp_camera_get_storageinfo(Camera camera, Context context) -> int
Gets information on the camera attached storage.
Parameters
----------
* `camera` :
a Camera
* `sifs` :
Pointer to receive a pointer to/array of storage info items
* `nrofsifs` :
Pointer to receive number of array entries
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
Retrieves the storage information, like maximum and free space, for the
specified filesystem, if supported by the device. The storage
information is returned in an newly allocated array of
CameraStorageInformation objects, to which the pointer pointed to by
#sifs will be set.
The variable pointed to by #nrofsifs will be set to the number of
elements in that array.
It is the caller's responsibility to free the memory of the array.
See also gphoto2.Camera.get_storageinfo
gp_camera_get_summary(...)
gp_camera_get_summary(Camera camera, Context context) -> int
Retrieves a camera summary.
Parameters
----------
* `camera` :
a Camera
* `summary` :
a CameraText
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
This summary typically contains information like manufacturer, pictures
taken, or generally information that is not configurable.
See also gphoto2.Camera.get_summary
gp_camera_init(...)
gp_camera_init(Camera camera, Context context) -> int
Initiate a connection to the `camera`.
Parameters
----------
* `camera` :
a Camera
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
Before calling this function, the `camera` should be set up using
gp_camera_set_port_path() or gp_camera_set_port_name() and
gp_camera_set_abilities(). If that has been omitted, gphoto2 tries to
autodetect any cameras and chooses the first one if any cameras are
found. It is generally a good idea to call gp_camera_exit() after
transactions have been completed in order to give other applications the
chance to access the camera, too.
See also gphoto2.Camera.init
gp_camera_list_config(...)
gp_camera_list_config(Camera camera, Context context) -> int
See also gphoto2.Camera.list_config
gp_camera_new(...)
gp_camera_new() -> int
Allocates the memory for a Camera.
Parameters
----------
* `camera` :
the Camera object to initialize.
Returns
-------
a gphoto2 error code
See also gphoto2.Camera.new
gp_camera_set_abilities(...)
gp_camera_set_abilities(Camera camera, CameraAbilities abilities) -> int
Sets the camera abilities.
Parameters
----------
* `camera` :
a Camera
* `abilities` :
the CameraAbilities to be set
Returns
-------
a gphoto2 error code
You need to call this function before calling gp_camera_init the first
time unless you want gphoto2 to autodetect cameras and choose the first
detected one. By setting the `abilities`, you tell gphoto2 what model
the `camera` is and what camera driver should be used for accessing the
`camera`. You can get `abilities` by calling
gp_abilities_list_get_abilities.
See also gphoto2.Camera.set_abilities
gp_camera_set_config(...)
gp_camera_set_config(Camera camera, CameraWidget window, Context context) -> int
Sets the configuration.
Parameters
----------
* `camera` :
a Camera
* `window` :
a CameraWidget
* `context` :
a GPContext
Returns
-------
a gphoto2 error code
Typically, a `window` is retrieved using gp_camera_get_config and passed
to this function in order to adjust the settings on the camera.
See also gphoto2.Camera.set_config
gp_camera_set_port_info(...)
gp_camera_set_port_info(Camera camera, GPPortInfo info) -> int
See also gphoto2.Camera.set_port_info
gp_camera_set_port_speed(...)
gp_camera_set_port_speed(Camera camera, int speed) -> int
Set the camera speed.
Parameters
----------
* `camera` :
a Camera
* `speed` :
the speed
Returns
-------
a gphoto2 error code
This function is typically used prior first initialization using
gp_camera_init for debugging purposes. Normally, a camera driver will
try to figure out the current speed of the camera and set the speed to
the optimal one automatically. Note that this function only works with
serial ports. In other words, you have to set the camera's port to a
serial one (using #gp_camera_set_port_path or #gp_camera_set_port_name)
prior calling this function.
See also gphoto2.Camera.set_port_speed
gp_camera_set_single_config(...)
gp_camera_set_single_config(Camera camera, char const * name, CameraWidget widget, Context context) -> int
Set a single configuration `widget` for the `camera`.
Parameters
----------
* `camera` :
a Camera
* `name` :
the name of a configuration widget
* `widget` :
a CameraWidget
* `context` :
a GPContext
Returns
-------
gphoto2 error code
This `widget` contains the new value of the widget to set.
See also gphoto2.Camera.set_single_config
gp_camera_set_timeout_funcs(...)
gp_camera_set_timeout_funcs(Camera camera, CameraTimeoutStartFunc start_func, CameraTimeoutStopFunc stop_func, void * data)
Parameters
----------
* `camera` :
a Camera
* `start_func` :
* `stop_func` :
* `data` :
Returns
-------
a gphoto2 error code
If your frontend has something like idle loops, it is recommended you
use gp_camera_set_timeout_funcs in order to give the camera driver the
possibility to keep up the connection to the camera.
See also gphoto2.Camera.set_timeout_funcs
gp_camera_start_timeout(...)
gp_camera_start_timeout(Camera camera, unsigned int timeout, CameraTimeoutFunc func) -> int
Parameters
----------
* `camera` :
a Camera