Stopping Camerabin

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Stopping Camerabin

Ian Davidson
I am trying to use camerabin to take still pictures. All now goes well
until I try to stop.

I can send a state change to camerabin to set the state to NULL - but I
do not see anything telling me that the state change has worked.  
Consequently, the main loop is never exited, so the program hangs.

Should I be waiting for the main loop to see some message, so that it
can exit - or should I just set the state to NULL, then unref the
pipeline, remove the bus watch and unref the main loop?

Ian
_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stopping Camerabin

Thiago Santos
On 01/20/2014 10:34 AM, Ian Davidson wrote:

> I am trying to use camerabin to take still pictures. All now goes well
> until I try to stop.
>
> I can send a state change to camerabin to set the state to NULL - but
> I do not see anything telling me that the state change has worked.  
> Consequently, the main loop is never exited, so the program hangs.
>
> Should I be waiting for the main loop to see some message, so that it
> can exit - or should I just set the state to NULL, then unref the
> pipeline, remove the bus watch and unref the main loop?

Setting elements/pipelines to NULL is a sync operation. So after that
call returns it should be safe to quit the main loop and unref everything.

Additionally to make sure that all pictures were saved, check that the
idle property of camerabin is true, or make sure to wait for the
image-done messages posted on the bus for each picture you requested to
capture.

--
Thiago

>
> Ian
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: Stopping Camerabin

Ian Davidson
Thanks Thiago - I was looking in the wrong place, which was why I could
not see the problem.

I had forgotten to stop the GTK loop which was why my program did not stop.

Ian

>
> Setting elements/pipelines to NULL is a sync operation. So after that
> call returns it should be safe to quit the main loop and unref
> everything.
>
> Additionally to make sure that all pictures were saved, check that the
> idle property of camerabin is true, or make sure to wait for the
> image-done messages posted on the bus for each picture you requested
> to capture.
>
> --
> Thiago

_______________________________________________
gstreamer-devel mailing list
[hidden email]
http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel