FakeCamera | Henkaku plugin which fakes camera calls on PlayStation TV
kandi X-RAY | FakeCamera Summary
kandi X-RAY | FakeCamera Summary
Henkaku plugin that fakes invalid camera calls in order to avoid some crashes for some titles on PlayStation TV. Of course, those titles have been blocked by Sony and you must previously unlock them in order to launch them. Use an application like AntiBlackList (from Rinnegatamante) to do it: Once titles are unlocked, they could crash due unexpected SceCamera API answers (because they were never conceived to run on a device without camera). This is where this plugin could intervene to "simulate" expected answers and, therefore, avoid some crashes.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of FakeCamera
FakeCamera Key Features
FakeCamera Examples and Code Snippets
Community Discussions
Trending Discussions on FakeCamera
QUESTION
I want to build a Qt interface to control a camera acquisition.
What I want: Before going into the hardware communication, I am testing a GUI which control a "fake camera", a continuous loop which, if started, gives a random image every 100 ms. The image acquisition is running in a separate thread so that the user could interact with the GUI. The user can start and stop the acquisition via a button.
How I want to do it:
My first attempt was to simply istanziate a QThread
and call the run()
method which would then contain an infinite loop with single image acquisitions interleaved by a QThread.sleep(0.1)
. I noticed that after stopping and restarting the thread, the program was starting to lag and crashed after some time.
By reading some posts around and the main Qt webpage, I then learned that the preferable way to do what I want is to:
subclass a
QObject
to create a worker. Instantiate this worker object and aQThread
. Move the worker to the new thread.
Moreover, following the idea in this post, I added a QTimer
object to iterate indefinitely the worker inside the thread, and I implement an active
flag that just makes the thread run without doing anything if it's set to False
.
This solution seemed to work at the beginning. I can start, stop and restart the acquisition as many times as I want.
Problems:
1) The CPU is always taking quite some resources (about 30% in my case, according to windows task menager) when the camera is not acquiring.
2) Sometimes, after acquisition is started, the memory start to be filled, like if every new image is allocated in new memory (while it is suppose to be overwritten I guess), till the program becomes irresponsive and then crashes. The following image is what I see in task menager when this happens: Red arrows correspond to the time the acquisition start.
Where am I doing wrong? Is it the right way to procede?
The code
...ANSWER
Answered 2018-Nov-14 at 07:08QThread.sleep()
only accepts whole arguments, when passing a floating it will round it and in your case 0.1 that will be rounded to 0 so there is no pause, so the signal will be continuously issued but the painting takes a while so the data it will be stored in a queue for it increases the memory. On the other hand if a QTimer
is going to call a task continuously it is better to live in the thread of the object that handles the task so that it is enough that the QTimer
is the son of FakeCamera. Another improvement is the use of the decorator @QtCore.pyqtSlot()
since the connection is given in C++ making it more efficient. And finally I have improved the design since FakeCamera
should not interact directly with the GUI because if you want to use it with another GUI you will have to modify a lot of code, instead it is better to create slots.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install FakeCamera
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page