diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-10-18 12:44:40 +0200 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@gmail.com> | 2012-10-18 13:38:41 +0200 |
commit | 983005dfbc3b07093145c0b964063e334b928d48 (patch) | |
tree | bcda1ab9dec89a08099de31b5cc4b5756d522d4e /src/uca-camera.c | |
parent | e16087fbe25df8901e9221602570c074ae887450 (diff) | |
download | libuca-983005dfbc3b07093145c0b964063e334b928d48.tar.gz libuca-983005dfbc3b07093145c0b964063e334b928d48.tar.bz2 libuca-983005dfbc3b07093145c0b964063e334b928d48.tar.xz libuca-983005dfbc3b07093145c0b964063e334b928d48.zip |
Fix download of in-camera frames
Diffstat (limited to 'src/uca-camera.c')
-rw-r--r-- | src/uca-camera.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/uca-camera.c b/src/uca-camera.c index 9210a05..053dcca 100644 --- a/src/uca-camera.c +++ b/src/uca-camera.c @@ -543,6 +543,50 @@ uca_camera_start_readout (UcaCamera *camera, GError **error) } /** + * uca_camera_stop_readout: + * @camera: A #UcaCamera object + * @error: Location to store a #UcaCameraError error or %NULL + * + * Stop reading out frames. + * + * Since: 1.1 + */ +void +uca_camera_stop_readout (UcaCamera *camera, GError **error) +{ + UcaCameraClass *klass; + static GStaticMutex mutex = G_STATIC_MUTEX_INIT; + + g_return_if_fail (UCA_IS_CAMERA(camera)); + + klass = UCA_CAMERA_GET_CLASS(camera); + + g_return_if_fail (klass != NULL); + g_return_if_fail (klass->start_readout != NULL); + + g_static_mutex_lock (&mutex); + + if (camera->priv->is_recording) { + g_set_error (error, UCA_CAMERA_ERROR, UCA_CAMERA_ERROR_RECORDING, + "Camera is still recording"); + } + else { + GError *tmp_error = NULL; + + (*klass->stop_readout) (camera, &tmp_error); + + if (tmp_error == NULL) { + camera->priv->is_readout = FALSE; + g_object_notify (G_OBJECT (camera), "is-readout"); + } + else + g_propagate_error (error, tmp_error); + } + + g_static_mutex_unlock (&mutex); +} + +/** * uca_camera_set_grab_func: * @camera: A #UcaCamera object * @func: A #UcaCameraGrabFunc callback function |