Trouble in running CameraText.java

61 views
Skip to first unread message

Marco Mènchise

unread,
Feb 2, 2017, 6:13:58 AM2/2/17
to gstreamer-java
Hello, I'm using Netbeans to compile and run CameraTest.java under Linux and OsX.

I added gst1-java-core-0.9-161201.jar, jna.jar and SimpleVideoComponent.java.

Source compiles well.

I also used jna.library.path to link gstreamer: -Djna.library.path=/usr/lib/x86_64-linux-gnu/gstreamer-1.0 (osx path is a bit different).

When I try to run the example I get the following error and I can't figure out why.

Any hint? Thanks.


Exception in thread "AWT-EventQueue-0" java.lang.ArrayIndexOutOfBoundsException: 1
at com.sun.jna.Function.invoke(Function.java:334)
at com.sun.jna.Library$Handler.invoke(Library.java:244)
at org.freedesktop.gstreamer.lowlevel.GNative$Handler.invoke(GNative.java:195)
at com.sun.proxy.$Proxy16.gst_element_link_many(Unknown Source)
at org.freedesktop.gstreamer.Element.linkMany(Element.java:547)
at gst1.pkg0test.CameraTest$1.run(CameraTest.java:33)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:756)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:726)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
BUILD SUCCESSFUL (total time: 1 second)

Neil C Smith

unread,
Feb 2, 2017, 6:21:18 AM2/2/17
to gstream...@googlegroups.com
On 2 February 2017 at 11:13, Marco Mènchise <marco.m...@gmail.com> wrote:
> I also used jna.library.path to link gstreamer:
> -Djna.library.path=/usr/lib/x86_64-linux-gnu/gstreamer-1.0 (osx path is a
> bit different).

You don't need to set jna.library.path if GStreamer is in the system
path already.

> When I try to run the example I get the following error and I can't figure
> out why.

On both Linux and OSX?

Which JNA version?

Best wishes,

Neil



--
Neil C Smith
Artist & Technologist
www.neilcsmith.net

Praxis LIVE - hybrid visual IDE for creative coding - www.praxislive.org

Marco Menchise

unread,
Feb 2, 2017, 6:34:23 AM2/2/17
to gstream...@googlegroups.com
Hello Neil, yes you are right, I just tested on Linux without setting jna.library.path and I got same results. Yesterday I made some test on OSX and I had to set the jna.library.path because GStreamer was not in the system path.

I downloaded jna from GitHub. Release is 4.3.0.

Thanks,
Marco




--
You received this message because you are subscribed to a topic in the Google Groups "gstreamer-java" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gstreamer-java/NvTEAYucyl4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gstreamer-java+unsubscribe@googlegroups.com.
To post to this group, send email to gstreamer-java@googlegroups.com.
Visit this group at https://groups.google.com/group/gstreamer-java.
For more options, visit https://groups.google.com/d/optout.

Neil C Smith

unread,
Feb 2, 2017, 7:20:36 AM2/2/17
to gstream...@googlegroups.com
Hi,

On 2 February 2017 at 11:33, Marco Menchise <marco.m...@gmail.com> wrote:
> I downloaded jna from GitHub. Release is 4.3.0.

Please try with JNA 4.2.2. May be on GitHub or at
http://repo1.maven.org/maven2/net/java/dev/jna/jna/4.2.2/

I haven't tested with the new JNA 4.3.0 yet, and get a compile error,
which makes me suspect some breaking changes. Anyone else?

Neil C Smith

unread,
Feb 2, 2017, 8:36:26 AM2/2/17
to gstream...@googlegroups.com
On 2 February 2017 at 12:20, Neil C Smith <ne...@neilcsmith.net> wrote:
> On 2 February 2017 at 11:33, Marco Menchise <marco.m...@gmail.com> wrote:
>> I downloaded jna from GitHub. Release is 4.3.0.

OK, having fixed the build errors, all tests fail with the same
ArrayIndexOutOfBoundsException. So, JNA 4.3.0 should be treated as
not compatible currently, and you should use 4.2.2.. It looks like a
breaking change on their side, but I'll also check we're not doing
something against the spec.

Neil C Smith

unread,
Feb 4, 2017, 11:38:18 AM2/4/17
to gstream...@googlegroups.com
On 2 February 2017 at 13:36, Neil C Smith <ne...@neilcsmith.net> wrote:
> It looks like a
> breaking change on their side, but I'll also check we're not doing
> something against the spec.
>

For information - https://github.com/java-native-access/jna/issues/763
Reply all
Reply to author
Forward
0 new messages