Catching image from zbar when it recognised a bar code

Mailing List SVR lists at svrinformatica.it
Thu Apr 9 03:04:01 PDT 2015


Il 09/04/2015 10:12, Tobias Mueller ha scritto:
> Hi.
>
> I am using the zbar element and I would like to "catch" the image that
> made zbar decode a barcode.
> So I do not only want to get the decoded barcode, but also the image
> which caused zbar to generate a signal.
>
> The scenario is that an attacker could "inject", for a frame or two, a
> malicious image. And I want to show the user "see, this image apparently
> contained a barcode which decoded to this string".
>
> My pipeline is this:
> v4l2src ! tee name=t ! queue ! videoconvert ! zbar ! fakesink t. queue !
> videoconvert ! xvimagesink
>
> I tried to get my hands on the xvimagesink, i.e.
> imagesink.get_last_sample().get_buffer().extract_dup(), but that data
> doesn't seem to be anything useful for me.

zbar post the buffer timestamp on the bus, try to replace fakesink with 
appsink or use a buffer probe, keep the last few buffers inside you app 
and when you receive a bus message search for the matching timestamp,

Nicola

>
> Cheers,
>    Tobi
>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list