This allows us to only copy the actually required data from the source
frame into the greyscale target image. Without this patch, my desktop
machine with a camera providing YUV420 frames takes about ~25ms to
decode a single frame 1920x1080 frame using a 25% capture rect.
With the patch applied, the performance goes up drastically, and we
now only take about 17ms to decode a single frame.
The same should be done for NV12 frames, but I didn't have a device
at hand to test the code there yet.
Automatically add qzxing_qml if qzxing_multimedia tag is used
Refactorings to wrap QML dependant code in QZXING_QML scopes
update README.md to reflect the above changes
changes triggered from #26
captureRect is accessible and modifyable via QML, so that
it can take arbitrary values, what can make QZXingFilter to crash
the application.
This issue was experienced when running code similar to QZXingLive
example on an android device, where captureRect is bound based on
VideoOutput's contentRect and sourceRect, when QML Engine is
calculating layout for the pages it sets temp values to width/height
of elements (including VideoOutput) what causes captureRect to be
set to invalid values for the QZXingFilter's perspective, such
as negative values for x and y.
Signed-off-by: Nick Diego Yamane <nick.diego@gmail.com>
QZXingFilterRunnable runs QFuture to perform
decoder::decodeImage() and stores it in a
class var of its owner (QZXingFilter), but
when QZXingFilter is destructed it was not canceling
that QFuture, making possible to the QFuture to try to
access filter->decoder->decodeImage() after filter's
are already destructed (dangling pointer).
Issue detected when using QZXingFilter QML Element in
an Page pushed in a StackView. When the page containing the
QZXingFilter is poped from the StackView, (by default) the
filter is unloaded/destructed, what makes the app crash
without this patch.
Signed-off-by: Nick Diego Yamane <nick.diego@gmail.com>
This simplifies the code for QZXingFilter (revert it to what it was before)
Also added a global include file, to include all QZXing user classes.
Reverts 5627d2fbb5, eb6bdb41e9, 1bae498386 & 213c4d684b
great improvements of QZXing and QZXingLive performance provided by @milianw from KDAB!
QZXingFilter becomes integral part of QZXing library source code.
closes#5
This again leads to a noticeable performance improvement of the
QZXingFilter example, as we get rid of one full copy of the image
data by converting directly into greyscale, instead of first
converting to RGB and then converting to greyscale.
Do not call detaching QByteArray::data, use constData instead.
Also hoist some constants out of the inner conversion loops and make
more variables const.