How to use Camerabin

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

How to use Camerabin

Ian Davidson
I am attempting to use  camerabin to take snapshots.

I see from a gst-inspect-1.0 of camerabin that a) the default mode is '(1): mode-image       - Still image capture' and b) there are two 'Element Actions' of 'start-capture' and 'stop-capture'.

I assume that stop-capture is only required if the capture mode is 'mode-video'.

What I don't know is how to initiate the start-capture.  I can see that the inspect tells me  that start-capture is
void user_function (GstElement* object);
but if I have declared an element called 'myBin' using
myBin  = gst_element_factory_make ("camerabin",  "cambin1");
how would I make it take a picture?

Ian

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

Re: How to use Camerabin

Josh Doe
On Wed, Jan 15, 2014 at 5:05 AM, Ian Davidson
<[hidden email]> wrote:

> I am attempting to use  camerabin to take snapshots.
>
> I see from a gst-inspect-1.0 of camerabin that a) the default mode is '(1):
> mode-image       - Still image capture' and b) there are two 'Element
> Actions' of 'start-capture' and 'stop-capture'.
>
> I assume that stop-capture is only required if the capture mode is
> 'mode-video'.
>
> What I don't know is how to initiate the start-capture.  I can see that the
> inspect tells me  that start-capture is
>
> void user_function (GstElement* object);
>
> but if I have declared an element called 'myBin' using
>
> myBin  = gst_element_factory_make ("camerabin",  "cambin1");
>
> how would I make it take a picture?

It's been a while, but I believe you would just then run:

g_signal_emit_by_name (myBin, "start-capture", 0);

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

Re: How to use Camerabin

Ian Davidson
Thanks Josh,

I can now take pictures - which is good.

I have found confirmation that stop-capture only applies to video, not
still images.

I notice that when I start camerabin, I get a preview window open up.  I
am now trying to stop the camera pipeline.  If I send an EOS on the
pipeline, it seems that the pipeline stops but the preview window stays
open.  My application has not completely finished until I manually close
the preview window.  If I set the camera pipeline state to NULL, the
preview window disappears - but something is still running, even if I
close the application.

Evidently, I am missing something.  Any ideas?

Ian


On 15/01/2014 12:15, Josh Doe wrote:

> On Wed, Jan 15, 2014 at 5:05 AM, Ian Davidson
> <[hidden email]> wrote:
>> I am attempting to use  camerabin to take snapshots.
>>
>> how would I make it take a picture?
> It's been a while, but I believe you would just then run:
>
> g_signal_emit_by_name (myBin, "start-capture", 0);
>
> -Josh
> _______________________________________________
> 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: How to use Camerabin

Thiago Santos
On 01/15/2014 12:53 PM, Ian Davidson wrote:

> Thanks Josh,
>
> I can now take pictures - which is good.
>
> I have found confirmation that stop-capture only applies to video, not
> still images.
>
> I notice that when I start camerabin, I get a preview window open up.  
> I am now trying to stop the camera pipeline.  If I send an EOS on the
> pipeline, it seems that the pipeline stops but the preview window
> stays open.  My application has not completely finished until I
> manually close the preview window.  If I set the camera pipeline state
> to NULL, the preview window disappears - but something is still
> running, even if I close the application.
>
> Evidently, I am missing something.  Any ideas?
To stop camerabin you should wait for it to become idle. There is an
'idle' property to inform that,
or you just need to track the 'image-done' and 'video-done' messages it
posts for each capture.
Other than that, it just works like a regular pipeline, set it to NULL
and unref and it is finished. No
need to send EOS to it.

Your problem seems to be related to something else. Do you have a
mainloop running? Is it quit
when you close the window? You can try running with gdb to check what
threads are still running
when you try to close your application.

--
BR,
Thiago

>
> Ian
>
>
> On 15/01/2014 12:15, Josh Doe wrote:
>> On Wed, Jan 15, 2014 at 5:05 AM, Ian Davidson
>> <[hidden email]> wrote:
>>> I am attempting to use  camerabin to take snapshots.
>>>
>>> how would I make it take a picture?
>> It's been a while, but I believe you would just then run:
>>
>> g_signal_emit_by_name (myBin, "start-capture", 0);
>>
>> -Josh
>> _______________________________________________
>> 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

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