gBroutin / gstreamer-java

Automatically exported from code.google.com/p/gstreamer-java
0 stars 0 forks source link

g_object_get doesn't return a valid pointer #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
The method getPointer() was added to GObject, which allows to retrieve
arbitrary properties from a GObject. This works by calling the function
g_object_get through JNA:

PointerByReference refPtr = new PointerByReference();
gobj.g_object_get(this, property, refPtr, null);

However, the value pointer returned by refPtr.getValue() is always null.

Original issue reported on code.google.com by andres.c...@gmail.com on 25 May 2009 at 9:59

GoogleCodeExporter commented 8 years ago
is it still valid with jna 3.2?

Original comment by lfar...@gmail.com on 5 Nov 2009 at 6:01

GoogleCodeExporter commented 8 years ago
Yes, still valid :-(

I'll look for possible workarounds using jna 3.2

Original comment by andres.c...@gmail.com on 6 Nov 2009 at 11:28

GoogleCodeExporter commented 8 years ago
any progress?

Original comment by lfar...@gmail.com on 26 Apr 2010 at 12:38

GoogleCodeExporter commented 8 years ago
Not yet, but I'm resuming work on gstreamer-java. Hopefully I'll have updates 
on this
one soon.

Original comment by andres.c...@gmail.com on 26 Apr 2010 at 2:28

GoogleCodeExporter commented 8 years ago
Ok, it is solved. The getPointer method should be used only to get pointer to 
arrays,
so I renamed it to getArrayPointer:

https://jna.dev.java.net/servlets/ReadMsg?list=users&msgNo=3984

Original comment by andres.c...@gmail.com on 1 May 2010 at 10:45

GoogleCodeExporter commented 8 years ago
I used it to get the "last-buffer" off a video sink and it was working fine as 
long 
as I was calling it at an appropriate time. It was throwing an exception, 
however, 
when I'd think it should just return null if it can't find it.

Original comment by david.g.hoyt on 4 May 2010 at 5:30

GoogleCodeExporter commented 8 years ago
Thanks for the comment. I renamed getArrayPointer back to getPointer, and 
removed the
exception throwing, since a null pointer just means that the value of the 
property is
null.

Original comment by andres.c...@gmail.com on 5 May 2010 at 9:09