Skip to content

Commit

Permalink
gst: disconnect from camera in stop method
Browse files Browse the repository at this point in the history
Otherwise a stopped source can not be restarted, because the camera is still
in use.

Fix #907
  • Loading branch information
EmmanuelP committed Aug 14, 2024
1 parent 14b67a2 commit 40f679e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions gst/gstaravis.c
Original file line number Diff line number Diff line change
Expand Up @@ -462,17 +462,21 @@ gst_aravis_stop( GstBaseSrc * src )
{
GError *error = NULL;
GstAravis* gst_aravis = GST_ARAVIS(src);
ArvCamera *camera;
ArvStream *stream;
GstCaps *all_caps;

GST_OBJECT_LOCK (gst_aravis);
arv_camera_stop_acquisition (gst_aravis->camera, &error);
camera = g_steal_pointer (&gst_aravis->camera);
stream = g_steal_pointer (&gst_aravis->stream);
all_caps = g_steal_pointer (&gst_aravis->all_caps);
GST_OBJECT_UNLOCK (gst_aravis);

if (stream != NULL)
g_object_unref (stream);
if (camera != NULL)
g_object_unref (camera);
if (all_caps != NULL)
gst_caps_unref (all_caps);

Expand Down

0 comments on commit 40f679e

Please sign in to comment.