gphoto2-camera.h
Go to the documentation of this file.
#ifndef __GPHOTO2_CAMERA_H__
#define __GPHOTO2_CAMERA_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct _Camera Camera;
#ifdef __cplusplus
}
#endif /* __cplusplus */
#include <gphoto2/gphoto2-abilities-list.h>
#include <gphoto2/gphoto2-port.h>
#include <gphoto2/gphoto2-widget.h>
#include <gphoto2/gphoto2-filesys.h>
#include <gphoto2/gphoto2-result.h>
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
typedef struct {
char text [32 * 1024];
} CameraText;
typedef struct {
char name [128];
char folder [1024];
} CameraFilePath;
typedef enum {
GP_CAPTURE_IMAGE,
GP_CAPTURE_MOVIE,
GP_CAPTURE_SOUND
} CameraCaptureType;
typedef enum {
GP_EVENT_UNKNOWN,
GP_EVENT_TIMEOUT,
GP_EVENT_FILE_ADDED,
GP_EVENT_FOLDER_ADDED,
GP_EVENT_CAPTURE_COMPLETE
} CameraEventType;
typedef int (*CameraExitFunc) (Camera *camera, GPContext *context);
typedef int (*CameraGetConfigFunc) (Camera *camera, CameraWidget **widget,
GPContext *context);
typedef int (*CameraSetConfigFunc) (Camera *camera, CameraWidget *widget,
GPContext *context);
typedef int (*CameraCaptureFunc) (Camera *camera, CameraCaptureType type,
CameraFilePath *path, GPContext *context);
typedef int (*CameraCapturePreviewFunc) (Camera *camera, CameraFile *file,
GPContext *context);
typedef int (*CameraSummaryFunc) (Camera *camera, CameraText *text,
GPContext *context);
typedef int (*CameraManualFunc) (Camera *camera, CameraText *text,
GPContext *context);
typedef int (*CameraAboutFunc) (Camera *camera, CameraText *text,
GPContext *context);
typedef int (*CameraWaitForEvent) (Camera *camera, int timeout,
CameraEventType *eventtype, void **eventdata,
GPContext *context);
typedef int (*CameraPrePostFunc) (Camera *camera, GPContext *context);
typedef struct _CameraFunctions {
CameraPrePostFunc pre_func;
CameraPrePostFunc post_func;
CameraExitFunc exit;
/* Configuration */
CameraGetConfigFunc get_config;
CameraSetConfigFunc set_config;
/* Capturing */
CameraCaptureFunc capture;
CameraCapturePreviewFunc capture_preview;
/* Textual information */
CameraSummaryFunc summary;
CameraManualFunc manual;
CameraAboutFunc about;
/* Event Interface */
CameraWaitForEvent wait_for_event;
/* Reserved space to use in the future without changing the struct size */
void *reserved1;
void *reserved2;
void *reserved3;
void *reserved4;
void *reserved5;
void *reserved6;
void *reserved7;
} CameraFunctions;
/* Those are DEPRECATED */
typedef GPPort CameraPort;
typedef GPPortInfo CameraPortInfo;
typedef struct _CameraPrivateLibrary CameraPrivateLibrary;
typedef struct _CameraPrivateCore CameraPrivateCore;
struct _Camera {
GPPort *port;
CameraFilesystem *fs;
CameraFunctions *functions;
CameraPrivateLibrary *pl;
CameraPrivateCore *pc;
};
int gp_camera_new (Camera **camera);
int gp_camera_set_abilities (Camera *camera, CameraAbilities abilities);
int gp_camera_get_abilities (Camera *camera, CameraAbilities *abilities);
int gp_camera_set_port_info (Camera *camera, GPPortInfo info);
int gp_camera_get_port_info (Camera *camera, GPPortInfo *info);
int gp_camera_set_port_speed (Camera *camera, int speed);
int gp_camera_get_port_speed (Camera *camera);
int gp_camera_init (Camera *camera, GPContext *context);
int gp_camera_exit (Camera *camera, GPContext *context);
int gp_camera_ref (Camera *camera);
int gp_camera_unref (Camera *camera);
int gp_camera_free (Camera *camera);
int gp_camera_get_config (Camera *camera, CameraWidget **window,
GPContext *context);
int gp_camera_set_config (Camera *camera, CameraWidget *window,
GPContext *context);
int gp_camera_get_summary (Camera *camera, CameraText *summary,
GPContext *context);
int gp_camera_get_manual (Camera *camera, CameraText *manual,
GPContext *context);
int gp_camera_get_about (Camera *camera, CameraText *about,
GPContext *context);
int gp_camera_capture (Camera *camera, CameraCaptureType type,
CameraFilePath *path, GPContext *context);
int gp_camera_capture_preview (Camera *camera, CameraFile *file,
GPContext *context);
int gp_camera_wait_for_event (Camera *camera, int timeout,
CameraEventType *eventtype, void **eventdata,
GPContext *context);
int gp_camera_get_storageinfo (Camera *camera, CameraStorageInformation**,
int *, GPContext *context);
int gp_camera_folder_list_files (Camera *camera, const char *folder,
CameraList *list, GPContext *context);
int gp_camera_folder_list_folders (Camera *camera, const char *folder,
CameraList *list, GPContext *context);
int gp_camera_folder_delete_all (Camera *camera, const char *folder,
GPContext *context);
int gp_camera_folder_put_file (Camera *camera, const char *folder,
CameraFile *file, GPContext *context);
int gp_camera_folder_make_dir (Camera *camera, const char *folder,
const char *name, GPContext *context);
int gp_camera_folder_remove_dir (Camera *camera, const char *folder,
const char *name, GPContext *context);
int gp_camera_file_get_info (Camera *camera, const char *folder,
const char *file, CameraFileInfo *info,
GPContext *context);
int gp_camera_file_set_info (Camera *camera, const char *folder,
const char *file, CameraFileInfo info,
GPContext *context);
int gp_camera_file_get (Camera *camera, const char *folder,
const char *file, CameraFileType type,
CameraFile *camera_file, GPContext *context);
int gp_camera_file_delete (Camera *camera, const char *folder,
const char *file, GPContext *context);
typedef int (* CameraTimeoutFunc) (Camera *camera,
GPContext *context);
typedef unsigned int (* CameraTimeoutStartFunc) (Camera *camera,
unsigned int timeout,
CameraTimeoutFunc func,
void *data);
typedef void (* CameraTimeoutStopFunc) (Camera *camera,
unsigned int id, void *data);
void gp_camera_set_timeout_funcs (Camera *camera,
CameraTimeoutStartFunc start_func,
CameraTimeoutStopFunc stop_func,
void *data);
int gp_camera_start_timeout (Camera *camera, unsigned int timeout,
CameraTimeoutFunc func);
void gp_camera_stop_timeout (Camera *camera, unsigned int id);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GPHOTO2_CAMERA_H__ */
gp_camera_stop_timeout
void gp_camera_stop_timeout(Camera *camera, unsigned int id)
Definition: gphoto2-camera.c:1522
gp_camera_file_get_info
int gp_camera_file_get_info(Camera *camera, const char *folder, const char *file, CameraFileInfo *info, GPContext *context)
Definition: gphoto2-camera.c:1196
CameraCaptureType
CameraCaptureType
Type of the capture to do.
Definition: gphoto2-camera.h:90
CameraExitFunc
int(* CameraExitFunc)(Camera *camera, GPContext *context)
The camera exit function.
Definition: gphoto2-camera.h:138
_CameraList
Definition: gphoto2-list.c:77
gphoto2-port.h
_Camera::pc
CameraPrivateCore * pc
Definition: gphoto2-camera.h:268
gphoto2-widget.h
GP_EVENT_UNKNOWN
Definition: gphoto2-camera.h:105
gp_camera_get_about
int gp_camera_get_about(Camera *camera, CameraText *about, GPContext *context)
Definition: gphoto2-camera.c:948
CameraSetConfigFunc
int(* CameraSetConfigFunc)(Camera *camera, CameraWidget *widget, GPContext *context)
Set the configuration in the camera.
Definition: gphoto2-camera.h:173
gp_camera_get_summary
int gp_camera_get_summary(Camera *camera, CameraText *summary, GPContext *context)
Definition: gphoto2-camera.c:885
GP_EVENT_TIMEOUT
Definition: gphoto2-camera.h:106
gp_camera_init
int gp_camera_init(Camera *camera, GPContext *context)
Definition: gphoto2-camera.c:643
gp_camera_exit
int gp_camera_exit(Camera *camera, GPContext *context)
Definition: gphoto2-camera.c:270
gp_camera_start_timeout
int gp_camera_start_timeout(Camera *camera, unsigned int timeout, CameraTimeoutFunc func)
Definition: gphoto2-camera.c:1477
gp_camera_folder_put_file
int gp_camera_folder_put_file(Camera *camera, const char *folder, CameraFile *file, GPContext *context)
Definition: gphoto2-camera.c:1168
GP_EVENT_FILE_ADDED
Definition: gphoto2-camera.h:107
_CameraFunctions::reserved4
void * reserved4
reserved for future use
Definition: gphoto2-camera.h:245
_CameraFunctions::post_func
CameraPrePostFunc post_func
Function called after each camera operation.
Definition: gphoto2-camera.h:221
GP_EVENT_FOLDER_ADDED
Definition: gphoto2-camera.h:108
gp_camera_folder_list_files
int gp_camera_folder_list_files(Camera *camera, const char *folder, CameraList *list, GPContext *context)
Definition: gphoto2-camera.c:1084
gp_camera_file_delete
int gp_camera_file_delete(Camera *camera, const char *folder, const char *file, GPContext *context)
Definition: gphoto2-camera.c:1335
gp_camera_wait_for_event
int gp_camera_wait_for_event(Camera *camera, int timeout, CameraEventType *eventtype, void **eventdata, GPContext *context)
Definition: gphoto2-camera.c:1055
_Camera
Definition: gphoto2-camera.h:258
_CameraFunctions::reserved3
void * reserved3
reserved for future use
Definition: gphoto2-camera.h:244
_CameraWidget
Definition: gphoto2-widget.c:40
_CameraFunctions::capture_preview
CameraCapturePreviewFunc capture_preview
Preview viewfinder content.
Definition: gphoto2-camera.h:231
gp_camera_set_abilities
int gp_camera_set_abilities(Camera *camera, CameraAbilities abilities)
Sets the camera abilities.
Definition: gphoto2-camera.c:383
gp_camera_folder_list_folders
int gp_camera_folder_list_folders(Camera *camera, const char *folder, CameraList *list, GPContext *context)
Definition: gphoto2-camera.c:1113
_CameraPrivateCore
Definition: gphoto2-camera.c:225
CameraFile
File structure.
CameraFunctions
struct _CameraFunctions CameraFunctions
Various camera specific functions.
_CameraFunctions::reserved1
void * reserved1
reserved for future use
Definition: gphoto2-camera.h:242
gp_camera_folder_delete_all
int gp_camera_folder_delete_all(Camera *camera, const char *folder, GPContext *context)
Definition: gphoto2-camera.c:1141
gp_camera_file_get
int gp_camera_file_get(Camera *camera, const char *folder, const char *file, CameraFileType type, CameraFile *camera_file, GPContext *context)
Definition: gphoto2-camera.c:1295
GP_CAPTURE_SOUND
Capture audio.
Definition: gphoto2-camera.h:93
_CameraFunctions::about
CameraAboutFunc about
A little About text, including authors and credits.
Definition: gphoto2-camera.h:236
_CameraFunctions
Various camera specific functions.
Definition: gphoto2-camera.h:219
_GPPort
The GPhoto port structure.
Definition: gphoto2-port.h:151
gphoto2-result.h
gp_camera_file_set_info
int gp_camera_file_set_info(Camera *camera, const char *folder, const char *file, CameraFileInfo info, GPContext *context)
Definition: gphoto2-camera.c:1268
gp_camera_set_timeout_funcs
void gp_camera_set_timeout_funcs(Camera *camera, CameraTimeoutStartFunc start_func, CameraTimeoutStopFunc stop_func, void *data)
Definition: gphoto2-camera.c:1451
_CameraFunctions::reserved2
void * reserved2
reserved for future use
Definition: gphoto2-camera.h:243
gp_camera_folder_remove_dir
int gp_camera_folder_remove_dir(Camera *camera, const char *folder, const char *name, GPContext *context)
Definition: gphoto2-camera.c:1386
gp_camera_ref
int gp_camera_ref(Camera *camera)
Definition: gphoto2-camera.c:528
_CameraFunctions::reserved6
void * reserved6
reserved for future use
Definition: gphoto2-camera.h:247
gp_camera_get_manual
int gp_camera_get_manual(Camera *camera, CameraText *manual, GPContext *context)
Definition: gphoto2-camera.c:916
_CameraFileInfo
File information structure.
Definition: gphoto2-filesys.h:142
gphoto2-filesys.h
Filesystem related operations and declarations.
_CameraFunctions::get_config
CameraGetConfigFunc get_config
Called for requesting the configuration widgets.
Definition: gphoto2-camera.h:226
gp_camera_get_storageinfo
int gp_camera_get_storageinfo(Camera *camera, CameraStorageInformation **sifs, int *nrofsifs, GPContext *context)
Gets information on the camera attached storage.
Definition: gphoto2-camera.c:1421
gp_camera_get_config
int gp_camera_get_config(Camera *camera, CameraWidget **window, GPContext *context)
Definition: gphoto2-camera.c:820
CameraEventType
CameraEventType
Specify what event we received from the camera.
Definition: gphoto2-camera.h:104
GP_EVENT_CAPTURE_COMPLETE
Definition: gphoto2-camera.h:109
_CameraFunctions::capture
CameraCaptureFunc capture
Remote control the camera to capture.
Definition: gphoto2-camera.h:230
gp_camera_capture
int gp_camera_capture(Camera *camera, CameraCaptureType type, CameraFilePath *path, GPContext *context)
Definition: gphoto2-camera.c:981
_CameraFilesystem
The internal camera filesystem structure.
Definition: gphoto2-filesys.c:241
_Camera::pl
CameraPrivateLibrary * pl
Definition: gphoto2-camera.h:267
_CameraFunctions::reserved5
void * reserved5
reserved for future use
Definition: gphoto2-camera.h:246
gp_camera_set_config
int gp_camera_set_config(Camera *camera, CameraWidget *window, GPContext *context)
Definition: gphoto2-camera.c:853
gp_camera_new
int gp_camera_new(Camera **camera)
Definition: gphoto2-camera.c:322
gphoto2-abilities-list.h
List of supported camera models including their abilities.
_CameraFunctions::summary
CameraSummaryFunc summary
Give a summary about the current camera status, translated.
Definition: gphoto2-camera.h:234
gp_camera_capture_preview
int gp_camera_capture_preview(Camera *camera, CameraFile *file, GPContext *context)
Definition: gphoto2-camera.c:1014
gp_camera_get_port_speed
int gp_camera_get_port_speed(Camera *camera)
Definition: gphoto2-camera.c:512
gp_camera_folder_make_dir
int gp_camera_folder_make_dir(Camera *camera, const char *folder, const char *name, GPContext *context)
Definition: gphoto2-camera.c:1362
CameraFilePath
A structure created by the capture operation.
Definition: gphoto2-camera.h:79
_CameraFunctions::set_config
CameraSetConfigFunc set_config
Called after a configuration was changed.
Definition: gphoto2-camera.h:227
_CameraFunctions::wait_for_event
CameraWaitForEvent wait_for_event
Wait for a specific event from the camera.
Definition: gphoto2-camera.h:239
gp_camera_set_port_speed
int gp_camera_set_port_speed(Camera *camera, int speed)
Definition: gphoto2-camera.c:470
CameraText
CameraText structure used in various functions.
Definition: gphoto2-camera.h:68
gp_camera_get_abilities
int gp_camera_get_abilities(Camera *camera, CameraAbilities *abilities)
Definition: gphoto2-camera.c:412
_GPPortInfo
Information about the current port.
Definition: gphoto2-port-info-list.h:53
gp_camera_free
int gp_camera_free(Camera *camera)
Definition: gphoto2-camera.c:584
CameraFileType
CameraFileType
The type of view on the specified file.
Definition: gphoto2-file.h:66
CameraGetConfigFunc
int(* CameraGetConfigFunc)(Camera *camera, CameraWidget **widget, GPContext *context)
Get a configuration tree for the camera and its driver.
Definition: gphoto2-camera.h:158
_CameraStorageInformation
Storage information structue.
Definition: gphoto2-filesys.h:215
CameraPrePostFunc
int(* CameraPrePostFunc)(Camera *camera, GPContext *context)
Definition: gphoto2-camera.h:205
_CameraFunctions::pre_func
CameraPrePostFunc pre_func
Function called before each camera operation.
Definition: gphoto2-camera.h:220
CameraAbilities
Describes the properties of a specific camera.
Definition: gphoto2-abilities-list.h:119
_GPContext
Definition: gphoto2-context.c:35
GP_CAPTURE_MOVIE
Capture a movie.
Definition: gphoto2-camera.h:92
_CameraFunctions::reserved7
void * reserved7
reserved for future use
Definition: gphoto2-camera.h:248
GP_CAPTURE_IMAGE
Capture an image.
Definition: gphoto2-camera.h:91
gp_camera_unref
int gp_camera_unref(Camera *camera)
Definition: gphoto2-camera.c:549
_CameraFunctions::exit
CameraExitFunc exit
Function called on closing the camera.
Definition: gphoto2-camera.h:223
_CameraFunctions::manual
CameraManualFunc manual
Give a brief manual about any specific items a user has to know, translated.
Definition: gphoto2-camera.h:235