summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cameras/uca-mock-camera.c2
-rw-r--r--src/cameras/uca-pco-camera.c2
-rw-r--r--src/uca-camera.c7
-rw-r--r--src/uca-camera.h14
4 files changed, 20 insertions, 5 deletions
diff --git a/src/cameras/uca-mock-camera.c b/src/cameras/uca-mock-camera.c
index 94645af..8dacf5d 100644
--- a/src/cameras/uca-mock-camera.c
+++ b/src/cameras/uca-mock-camera.c
@@ -78,7 +78,7 @@ static void uca_mock_camera_stop_recording(UcaCamera *camera, GError **error)
g_return_if_fail(UCA_IS_MOCK_CAMERA(camera));
}
-static void uca_mock_camera_grab(UcaCamera *camera, gchar *data, GError **error)
+static void uca_mock_camera_grab(UcaCamera *camera, gpointer data, GError **error)
{
g_return_if_fail(UCA_IS_MOCK_CAMERA(camera));
UcaMockCameraPrivate *priv = UCA_MOCK_CAMERA_GET_PRIVATE(camera);
diff --git a/src/cameras/uca-pco-camera.c b/src/cameras/uca-pco-camera.c
index 0f8ca14..80034e3 100644
--- a/src/cameras/uca-pco-camera.c
+++ b/src/cameras/uca-pco-camera.c
@@ -247,7 +247,7 @@ static void uca_pco_camera_stop_recording(UcaCamera *camera, GError **error)
pco_stop_recording(UCA_PCO_CAMERA_GET_PRIVATE(camera)->pco);
}
-static void uca_pco_camera_grab(UcaCamera *camera, gchar *data, GError **error)
+static void uca_pco_camera_grab(UcaCamera *camera, gpointer data, GError **error)
{
g_return_if_fail(UCA_IS_PCO_CAMERA(camera));
}
diff --git a/src/uca-camera.c b/src/uca-camera.c
index 00bda82..7079279 100644
--- a/src/uca-camera.c
+++ b/src/uca-camera.c
@@ -220,7 +220,12 @@ void uca_camera_stop_recording(UcaCamera *camera, GError **error)
g_signal_emit_by_name(G_OBJECT(camera), "recording-stopped");
}
-void uca_camera_grab(UcaCamera *camera, gchar *data, GError **error)
+void uca_camera_set_grab_func(UcaCamera *camera, UcaCameraGrabFunc func)
+{
+ /* TODO: implement */
+}
+
+void uca_camera_grab(UcaCamera *camera, gpointer data, GError **error)
{
g_return_if_fail(UCA_IS_CAMERA(camera));
diff --git a/src/uca-camera.h b/src/uca-camera.h
index 59a0670..b09e12b 100644
--- a/src/uca-camera.h
+++ b/src/uca-camera.h
@@ -37,6 +37,15 @@ typedef struct _UcaCamera UcaCamera;
typedef struct _UcaCameraClass UcaCameraClass;
typedef struct _UcaCameraPrivate UcaCameraPrivate;
+/**
+ * UcaCameraGrabFunc:
+ * @data: a pointer to the raw data
+ * @user_data: user data passed to the function
+ *
+ * A function receiving the data when streaming in asynchronous mode.
+ */
+typedef void (*UcaCameraGrabFunc) (gpointer data, gpointer user_data);
+
struct _UcaCamera {
/*< private >*/
GObject parent;
@@ -55,7 +64,7 @@ struct _UcaCameraClass {
void (*start_recording) (UcaCamera *camera, GError **error);
void (*stop_recording) (UcaCamera *camera, GError **error);
- void (*grab) (UcaCamera *camera, gchar *data, GError **error);
+ void (*grab) (UcaCamera *camera, gpointer data, GError **error);
void (*recording_started) (UcaCamera *camera);
void (*recording_stopped) (UcaCamera *camera);
@@ -63,7 +72,8 @@ struct _UcaCameraClass {
void uca_camera_start_recording(UcaCamera *camera, GError **error);
void uca_camera_stop_recording(UcaCamera *camera, GError **error);
-void uca_camera_grab(UcaCamera *camera, gchar *data, GError **error);
+void uca_camera_grab(UcaCamera *camera, gpointer data, GError **error);
+void uca_camera_set_grab_func(UcaCamera *camera, UcaCameraGrabFunc func);
GType uca_camera_get_type(void);