![]() Registered Member ![]()
|
Hello, I'm working on a plasmoid for the webcam (maybe somebody know it).
Recently, I switched to gst-python for webcam capture and apply some video effects using GStreamer. All the code for webcam managing is in this file. Based on this example, when the user clicks the play/stop button, I dinamically import and initialize the GStreamer library only once (lines 379-411), then create the pipeline (lines 413-471) and play it (line 525). All captured frames are processed by the readFrame() method (lines 545-555). I can start the webcam widget (without the plasmoid container) with:
And it works fine, but when I try to start the plasmoid using plasmoidviewer from the root directory, by click in the play/stop button, it crashes with the following message:
Wich is basically, a segfault after self.camerabin.set_state(self.gst.STATE_PLAYING) is called and before readFrame(), from many test I did before, I arrived to the conclusion that the problem occurs in the gobject threads and, I think that this problem is caused because the gobject threads are initialized inside the Plasma thread. I searched for source code in other plasmoids (C++ and Python) but it appears that nobody had working on this kind of hacks. Sorry for coming with this extensive question, but at this point I'm stucked, seriously, I haven't idea what to do. Is there a way in wich I can initialize the gobject threads before the Plasma threads? Or any other idea to fix this issue? |
![]() Administrator ![]()
|
I would recommend asking about this on plasma-devel@kde.org. However, I suspect that it is not possible to start the GObject threads before Plasma commences it start procedures. This would definitely be the case with Plasma Desktop itself.
I suspect you may be able to start the threads in another manner however.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
Thank, I will ask in the mailing list
![]()
For now, I'm using GStreamer with gst-launch. This is not the best solution, but at least works. I'm still interested in an answer for this question. |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient