steffen-foerster / sailfish-barcode

22 stars 36 forks source link

SailfishOS >= 2.1.3.5 displays "Screenshot catured" #37

Open steffen-foerster opened 6 years ago

steffen-foerster commented 6 years ago

This app uses the screenshot service to grab images from the camera's viewfinder. Since SailfishOS 2.1.3.5, each service call triggers a screenshot event that displays a "Screenshot catured" notification at the top of the screen.

I think only a redesign can solve this problem. Maybe this a starting point: http://omg-it.works/how-to-grab-video-frames-directly-from-qcamera/

steffen-foerster commented 6 years ago

Unfortunately, the approach described above does not work. In addition, the QVideoProbe does not accept a QCamera object as a source. At the moment I have no idea how to solve this problem.

Olf0 commented 6 years ago

It took me a while to understand this issue with CodeReader 0.7.13 on a Jolla 1 phone under SailfishOS 2.1.3.7: This is not a regular notification (i.e. no transient notification on-screen ("notification preview") and nothing in the events-view), but a special on-screen message displayed 1 to 3 times when scanning a QR- or Barcode.

While I have to admit, that this is a bit irritating (as no screenshot is taken), I perceive it as a rather minor nuisance. Apart from this, CodeReader 0.7.13 is working fine on my two Jolla 1 phones (and on Xperia X as well, according to the reports in issue 34).

steffen-foerster commented 6 years ago

The transient on-screen notifications also appear on my Jolla 1 (OS 2.1.3.7). I was able to deactivate the notifications by a repeated tap on the notifications. After a restart they were active again.

Olf0 commented 6 years ago

Sorry, I understood that meanwhile and edited my comment above accordingly. BTW, thanks for pointing out the "tap on message trick", which I was not aware of.

I also created https://together.jolla.com/question/175363/using-codereader-triggers-unnecessary-on-screen-message-screenshot-captured-under-sailfishos-213/ to address this issue more directly to Jolla employees, as I fear that your comment https://together.jolla.com/question/145151/codereader-0711-does-not-scan/?answer=175351#post-id-175351 will not be noticed by them.

steffen-foerster commented 6 years ago

Thanks for creating the separate question on TJC!

Olf0 commented 6 years ago

You're welcome. But seriously, I rather thank you for coding and maintaining CodeReader for so many years. Hence supporting your efforts this way (and in my own interest) is a logical consequence of that.

Olf0 commented 6 years ago

@steffen-foerster, may I suggest mailing to developer-care(bei)jolla.com and kindly asking to make the Qt-classes QCamera / QVideoProbe accessible and working for SailfishOS applications, referencing https://together.jolla.com/question/175363/using-codereader-triggers-on-screen-message-screenshot-captured-under-sailfishos-213/

Otherwise you (/ we) may never receive an answer (positive or negative) from the SailfishOS developers. I would appreciate, if you report (here or on TJC), when you received a reply.

kazord commented 6 years ago

Why are you trying to use system to capture screenshoot while Qt is able to capture from his buffer..., We used this on openfoodfact ubuntu app (qt/qml+zbar) : https://github.com/openfoodfacts/openfoodfacts-ubuntu/blob/develop/app/qrcodereader.cpp fast idea is : get the qwindows (qApp->allWindows()), grap QImage from it with QScreen::grabWindow, (option debug saving the Image), process it.

My SDK isn't ready yet but i will try to give you a pull request as soon as possible

monich commented 6 years ago

@kazord this is pretty much what I did on my fork https://github.com/monich/sailfish-barcode/commit/7615fe70 and it's already been released to the Jolla store.