add a new trigger capture function (just triggers capture, no results)
added a new CAPTURE_COMPLETE event for wait_for_event. some deprecated stuff removed. git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@11958 67ed7778-7388-44ab-90cf-0a291f65f57c
This commit is contained in:
@@ -64,7 +64,8 @@ typedef enum {
|
||||
GP_OPERATION_CAPTURE_VIDEO = 1 << 1, /**< Capturing videos supported. */
|
||||
GP_OPERATION_CAPTURE_AUDIO = 1 << 2, /**< Capturing audio supported. */
|
||||
GP_OPERATION_CAPTURE_PREVIEW = 1 << 3, /**< Capturing image previews supported. */
|
||||
GP_OPERATION_CONFIG = 1 << 4 /**< Camera and Driver configuration supported. */
|
||||
GP_OPERATION_CONFIG = 1 << 4, /**< Camera and Driver configuration supported. */
|
||||
GP_OPERATION_TRIGGER_CAPTURE = 1 << 5, /**< Camera can trigger capture and wait for events. */
|
||||
} CameraOperation;
|
||||
|
||||
/**
|
||||
|
||||
@@ -105,7 +105,8 @@ typedef enum {
|
||||
GP_EVENT_UNKNOWN, /**< unknown and unhandled event */
|
||||
GP_EVENT_TIMEOUT, /**< timeout, no arguments */
|
||||
GP_EVENT_FILE_ADDED, /**< CameraFilePath* = file path on camfs */
|
||||
GP_EVENT_FOLDER_ADDED /**< CameraFilePath* = folder on camfs */
|
||||
GP_EVENT_FOLDER_ADDED, /**< CameraFilePath* = folder on camfs */
|
||||
GP_EVENT_CAPTURE_COMPLETE /**< last capture is complete */
|
||||
} CameraEventType;
|
||||
|
||||
/**
|
||||
@@ -173,6 +174,7 @@ typedef int (*CameraSetConfigFunc) (Camera *camera, CameraWidget *widget,
|
||||
GPContext *context);
|
||||
typedef int (*CameraCaptureFunc) (Camera *camera, CameraCaptureType type,
|
||||
CameraFilePath *path, GPContext *context);
|
||||
typedef int (*CameraTriggerCaptureFunc) (Camera *camera, GPContext *context);
|
||||
typedef int (*CameraCapturePreviewFunc) (Camera *camera, CameraFile *file,
|
||||
GPContext *context);
|
||||
typedef int (*CameraSummaryFunc) (Camera *camera, CameraText *text,
|
||||
@@ -227,6 +229,7 @@ typedef struct _CameraFunctions {
|
||||
|
||||
/* Capturing */
|
||||
CameraCaptureFunc capture; /**< \brief Remote control the camera to capture */
|
||||
CameraTriggerCaptureFunc trigger_capture;/**< \brief Remote control the camera to trigger capture */
|
||||
CameraCapturePreviewFunc capture_preview;/**< \brief Preview viewfinder content. */
|
||||
|
||||
/* Textual information */
|
||||
@@ -236,7 +239,6 @@ typedef struct _CameraFunctions {
|
||||
|
||||
/* Event Interface */
|
||||
CameraWaitForEvent wait_for_event; /**< \brief Wait for a specific event from the camera */
|
||||
|
||||
/* Reserved space to use in the future without changing the struct size */
|
||||
void *reserved1; /**< \brief reserved for future use */
|
||||
void *reserved2; /**< \brief reserved for future use */
|
||||
@@ -245,12 +247,9 @@ typedef struct _CameraFunctions {
|
||||
void *reserved5; /**< \brief reserved for future use */
|
||||
void *reserved6; /**< \brief reserved for future use */
|
||||
void *reserved7; /**< \brief reserved for future use */
|
||||
void *reserved8; /**< \brief reserved for future use */
|
||||
} CameraFunctions;
|
||||
|
||||
/* Those are DEPRECATED */
|
||||
typedef GPPort CameraPort;
|
||||
typedef GPPortInfo CameraPortInfo;
|
||||
|
||||
typedef struct _CameraPrivateLibrary CameraPrivateLibrary;
|
||||
typedef struct _CameraPrivateCore CameraPrivateCore;
|
||||
|
||||
@@ -327,6 +326,7 @@ 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_trigger_capture (Camera *camera, GPContext *context);
|
||||
int gp_camera_capture_preview (Camera *camera, CameraFile *file,
|
||||
GPContext *context);
|
||||
int gp_camera_wait_for_event (Camera *camera, int timeout,
|
||||
|
||||
@@ -1038,6 +1038,34 @@ gp_camera_capture (Camera *camera, CameraCaptureType type,
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggers capture of one or more images.
|
||||
*
|
||||
* @param camera a #Camera
|
||||
* @param context a #GPContext
|
||||
* @return a gphoto2 error code
|
||||
*
|
||||
* This functions just remotely causes the shutter release and returns
|
||||
* immediately. You will want to run #gp_camera_wait_event until a image
|
||||
* is added which can be downloaded using #gp_camera_file_get.
|
||||
**/
|
||||
int
|
||||
gp_camera_trigger_capture (Camera *camera, GPContext *context)
|
||||
{
|
||||
CHECK_NULL (camera);
|
||||
CHECK_INIT (camera, context);
|
||||
|
||||
if (!camera->functions->trigger_capture) {
|
||||
gp_context_error (context, _("This camera can not trigger capture."));
|
||||
CAMERA_UNUSED (camera, context);
|
||||
return (GP_ERROR_NOT_SUPPORTED);
|
||||
}
|
||||
CHECK_RESULT_OPEN_CLOSE (camera, camera->functions->trigger_capture (camera,
|
||||
context), context);
|
||||
CAMERA_UNUSED (camera, context);
|
||||
return (GP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Captures a preview that won't be stored on the camera but returned in
|
||||
* supplied file.
|
||||
|
||||
@@ -44,6 +44,7 @@ gp_camera_set_port_speed
|
||||
gp_camera_set_timeout_funcs
|
||||
gp_camera_start_timeout
|
||||
gp_camera_stop_timeout
|
||||
gp_camera_trigger_capture
|
||||
gp_camera_unref
|
||||
gp_camera_wait_for_event
|
||||
gp_camera_get_storageinfo
|
||||
|
||||
Reference in New Issue
Block a user