gavgaurav / nativelibs4java

Automatically exported from code.google.com/p/nativelibs4java
0 stars 0 forks source link

BridJ.sizeOf(GUID.class) = 48, but should be 16. #64

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Olivier,

BridJ.sizeOf(GUID.class) returns 48, but GUID is 16 bytes integer actually.
Probably this leads to the wrong read/write of the classes that contains GUID 
as a field.

Regards, Andrei.

Original issue reported on code.google.com by andrei.s...@gmail.com on 7 Apr 2011 at 2:31

GoogleCodeExporter commented 9 years ago
Hi Andrei,

Thanks for your report, this is indeed a very serious issue.
Working on it straight away :-)

Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 7 Apr 2011 at 7:02

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r1857.

Original comment by olivier.chafik@gmail.com on 7 Apr 2011 at 7:16

GoogleCodeExporter commented 9 years ago
This is fixed by revision #1857.
I'll deploy an updated snapshot as soon as the sourceforge FTP is accessible 
again, in the meanwhile you can build BridJ from sources : 
http://code.google.com/p/bridj/wiki/Build

Thanks again !
Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 7 Apr 2011 at 7:39

GoogleCodeExporter commented 9 years ago
Deployed !

Original comment by olivier.chafik@gmail.com on 7 Apr 2011 at 7:43

GoogleCodeExporter commented 9 years ago
Thanks! I'll wait till you deploy a new version :)

Regards, Andrei.

Original comment by andrei.s...@gmail.com on 7 Apr 2011 at 7:44

GoogleCodeExporter commented 9 years ago
(just in case you missed the notifications : the snapshot was updated yesterday 
and a new "stable" release 0.4 came out today)

Original comment by olivier.chafik@gmail.com on 8 Apr 2011 at 1:51

GoogleCodeExporter commented 9 years ago
I received notification. Congratulations with 0.4!!!

Nevertheless I wasn't able to make windows avicap or pcap functionality 
workable :)

GUID functionality is necessary for AM_MEDIA_TYPE structure 
(http://msdn.microsoft.com/en-us/library/dd373477%28v=vs.85%29.aspx).

With the provided BridJX.java class this structure looks really simple 
(attached). So I am closer to the cam capture functionality based on DirectShow.

Some questions and feedback while you are here :)
- it seems jnaerator 0.9.7 User Interface can't generate BridJ classes (logs 
says it cant find org.bridj.* classes). Just copy AM_MEDIA_TYPE structure to 
the left panel,
jnaerate -> failure.  0.9.6 works correctly.
- how to manage pointers? is it necessary to release it explicitly?
- is it Callback.getPointer() a correct way to get callback method pointer that 
I need to pass?

Regards, Andrei.

Original comment by andrei.s...@gmail.com on 8 Apr 2011 at 2:45

Attachments:

GoogleCodeExporter commented 9 years ago
Hi Andrei,

You bear some responsability for this 0.4 release, your bug reports did help a 
lot so congratulations to you as well ;-)

Some quick answers (for the rest, let's follow on in issue #54) :
- thanks for the JNAerator bug :-)
- Pointers are automatically released when GC'd, but you might want to release 
them manually sometimes (for instance, a C++ destructor might perform actions, 
so you might want to release the C++ object's pointer to trigger these actions 
: either call BridJ.delete(cppObj) or pointerTo(cppObj).release()). Manual 
management might also help reduce the peak memory footprint of the application.
- Callback.getPointer() no longer exists (it's been renamed to toPointer() : 
http://nativelibs4java.sourceforge.net/bridj/api/development/org/bridj/Callback.
html), but I'd recommend the more generic Pointer.toPointer(NativeObject) which 
works on classes, structs and callbacks. 

Cheers
--
zOlive

Original comment by olivier.chafik@gmail.com on 10 Apr 2011 at 8:23