> Is it possible to prevent zbar from blocking main thread
The extension does not currently handle the GIL correctly (ie, at all).
Note that the Processor already runs in its own thread, which is running once you set the Processor active. The data_handler is called from that thread, so you may be able to get the effect you're looking for (…although it's still inviting trouble).
This bug is actually not hard to fix - are you interested in testing a new version if I fix it right now? In any case, you should definitely open a bug tracker…
Thanks for pointing this out!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BTW, regarding python UI responsiveness - is it possible to configure Processor to use lower resolution? By default it grabs maximum possible resolution and eats too much CPU. I can reduce video dimensions via command line but didn't figured out respective python method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
New function works as expected. Smaller video stream resolution combined with density configuration dropped CPU usage from 100% to mere 12-15%. Thank you!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hello excuse me.
why i use processor.request_size <this funtion.
then it told me : AttributeError: 'Zbar_Processor' object has no attribute ' request_size'
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello folks! Is it possible to prevent zbar from blocking main thread in the code below?
> Is it possible to prevent zbar from blocking main thread
The extension does not currently handle the GIL correctly (ie, at all).
Note that the Processor already runs in its own thread, which is running once you set the Processor active. The data_handler is called from that thread, so you may be able to get the effect you're looking for (…although it's still inviting trouble).
This bug is actually not hard to fix - are you interested in testing a new version if I fix it right now? In any case, you should definitely open a bug tracker…
Thanks for pointing this out!
I opened an issue #3177905.
BTW, regarding python UI responsiveness - is it possible to configure Processor to use lower resolution? By default it grabs maximum possible resolution and eats too much CPU. I can reduce video dimensions via command line but didn't figured out respective python method.
And yes, I'm willing to help in testing. I'm able to apply patches or pull from mercurial and compile the code.
> maximum possible resolution and eats too much CPU
You can also use the density configurations to avoid low frame rates without sacrificing as much resolution in the scan direction.
> I can reduce video dimensions via command line but didn't figured out respective python method.
I just pushed support for this interface to hg (rev 13a17b5b13f7). It would be great to hear back about this as well.
Thanks for your feedback!
New function works as expected. Smaller video stream resolution combined with density configuration dropped CPU usage from 100% to mere 12-15%. Thank you!
hello excuse me.
why i use processor.request_size <this funtion.
then it told me : AttributeError: 'Zbar_Processor' object has no attribute ' request_size'