After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 726586 - OpenNI2 plugin doesn't initialize correctly
OpenNI2 plugin doesn't initialize correctly
Status: RESOLVED DUPLICATE of bug 732535
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2014-03-17 23:18 UTC by Andrew Wiley
Modified: 2016-12-31 10:09 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch that resolves the initialization issues (2.75 KB, patch)
2014-03-17 23:19 UTC, Andrew Wiley
needs-work Details | Review
revised patch (17.05 KB, patch)
2014-05-04 19:54 UTC, Andrew Wiley
none Details | Review

Description Andrew Wiley 2014-03-17 23:18:24 UTC
There are three issues with initialization in the OpenNI2 plugin:

- The OpenNI objects are never actually constructed, which leaves them in an invalid state. I assume it worked for the original author, but this breaks completely on my ARM machine and results in seemingly-impossible initialization errors.

- If the OpenNI device fails to initialize, the plugin correctly returns an empty list of capabilities, but it doesn't unlock the Gst object. This results in a deadlock that prevents the user from seeing any useful error messages.

- If the user doesn't specify a device URI, the plugin correctly uses openni::ANY_DEVICE to grab the first available device, but the case is needlessly disallowed in two code paths.

I've attached a patch that resolves these for review.
Comment 1 Andrew Wiley 2014-03-17 23:19:22 UTC
Created attachment 272211 [details] [review]
Patch that resolves the initialization issues
Comment 2 Miguel Casas 2014-04-08 07:22:25 UTC
Andrew, thanks for tackling this!
Pending slomo@ review, this all sounds reasonable to me.
Interesting the different OpenNI allocation behaviour in your platform.
Comment 3 Sebastian Dröge (slomo) 2014-04-08 08:11:41 UTC
Review of attachment 272211 [details] [review]:

Please attach this as "git format-patch" style patch

::: ext/openni2/gstopenni2src.cpp
@@ +185,3 @@
+  new((void*)&ni2src->colorVideoMode) openni::VideoMode();
+  new((void*)&ni2src->depthFrame) openni::VideoFrameRef();
+  new((void*)&ni2src->colorFrame) openni::VideoFrameRef();

Please store pointers in the struct and then use
ni2src->device = new openni::Device();
etc.

Also delete them in gst_openni2_src_finalize().
Comment 4 Andrew Wiley 2014-05-04 19:54:14 UTC
Created attachment 275847 [details] [review]
revised patch
Comment 5 Tim-Philipp Müller 2016-12-31 10:09:06 UTC
Thanks for the patch, and sorry it took so long to get to it.

Looks like this was fixed independently also in bug #732535 (the object init and unlock at least, not sure about the 'any device' bits).

*** This bug has been marked as a duplicate of bug 732535 ***