Eclipse building and debugging

556 views
Skip to first unread message

Dave Peterson

unread,
Feb 19, 2012, 4:34:38 PM2/19/12
to xuggler-users
Is there any documentation on how to build and debug with Eclipse IDE
(or any other IDE). I'm on OSX Lion. I normally use IntelliJ, but
have switched to Eclipse to try to build and debug this project. I
have installed Eclipse Java Indigo. Added the CDT plugin.

Things look decent in that I get the same test failure from ant run-
tests as I do from the command line (http://groups.google.com/group/
xuggler-users/browse_thread/thread/95bf0ffc0c7611f8).

However, I do see compile errors in the code.

For example, I can't figure out how to get Eclipse to accept the
namespaces:
using namespace VS_CPP_NAMESPACE;

I don't see where this class is coming from:
import com.xuggle.test_utils.NameAwareTestClassRunner;

Thanks
D

Dave Peterson

unread,
Feb 19, 2012, 5:21:23 PM2/19/12
to xuggler-users
downloaded an old xuggle-utils.jar from here:
http://www.java2s.com/Code/Jar/x/Downloadxuggleutils120688jar.htm

and at least the java compile errors have gone away. C/C++ is still a
nightmare.

Dave Peterson

unread,
Feb 20, 2012, 11:35:58 AM2/20/12
to xuggler-users
Still struggling to get eclipse to build the xuggler project.

Description Resource Path Location Type
Faceted project metadata file "/xuggle-xuggler-main/.settings/
org.eclipse.wst.common.project.facet.core.xml" could not be read.
xuggle-xuggler-main Unknown Faceted Project Problem

Looks like someone added in wst nature into .project 2 years ago (can
that be right?).
https://github.com/xuggle/xuggle-xuggler/blob/9beeb74b2908be3c4a142bb47fb43a9b18d86a4f/.project

but doesn't seem to have the corresponding setting file committed.
Only these natures are in the git:
file org.eclipse.cdt.core.prefs 12 days ago add my eclipse
settings; probably not a good idea [xuggle]
file org.eclipse.cdt.ui.prefs 2 years ago add eclipse settings for
code formatting standards [xuggle]
file org.eclipse.jdt.core.prefs 2 years ago add eclipse settings
for code formatting standards [xuggle]
file org.eclipse.jdt.ui.prefs 2 years ago add eclipse settings for
code formatting standards [xuggle]

Dave Peterson

unread,
Feb 20, 2012, 11:40:01 AM2/20/12
to xuggler-users
INSTALL file points to a bad link.

Welcome to Xuggler

See here for complete (and updated) install instructions:

http://www.xuggle.com/xuggler/downloads/build.jsp

Dave Peterson

unread,
Feb 20, 2012, 11:45:52 AM2/20/12
to xuggler-users
.classpath seems to not work properly for unit tests.

.classpath: <classpathentry kind="src" output="build/test" path="test/
src"/>


Changed this to the project default:

<classpathentry kind="src" path="test/src"/>

And at least unit tests can find the class now. However, next error
seems like it can't find the JNI link. Sigh.

SKIPPING BROKEN container testfile_bw_pattern.flv -> container-
testfile_bw_pattern-flv.mpg
SKIPPING BROKEN container testfile_videoonly_20sec.flv -> container-
testfile_videoonly_20sec-flv.mpg
SKIPPING BROKEN container subtitled_video.mkv -> container-
subtitled_video-mkv.avi
SKIPPING BROKEN container subtitled_video.mkv -> container-
subtitled_video-mkv.flv
SKIPPING BROKEN container subtitled_video.mkv -> container-
subtitled_video-mkv.mpg
SKIPPING BROKEN container testfile.flv -> container-testfile-flv.mpg
SKIPPING BROKEN container testfile_mpeg1video_mp2audio.mpg ->
container-testfile_mpeg1video_mp2audio-mpg.mov
SKIPPING BROKEN container testfile_mpeg1video_mp2audio.mpg ->
container-testfile_mpeg1video_mp2audio-mpg.flv
SKIPPING BROKEN reader testfile_bw_pattern.flv -> reader-
testfile_bw_pattern-flv.mpg
SKIPPING BROKEN reader testfile_videoonly_20sec.flv -> reader-
testfile_videoonly_20sec-flv.mpg
SKIPPING BROKEN reader subtitled_video.mkv -> reader-
subtitled_video-mkv.avi
SKIPPING BROKEN reader subtitled_video.mkv -> reader-
subtitled_video-mkv.flv
SKIPPING BROKEN reader subtitled_video.mkv -> reader-
subtitled_video-mkv.mpg
SKIPPING BROKEN reader testfile.flv -> reader-testfile-flv.mpg
SKIPPING BROKEN reader testfile_mpeg1video_mp2audio.mpg -> reader-
testfile_mpeg1video_mp2audio-mpg.mov
SKIPPING BROKEN reader testfile_mpeg1video_mp2audio.mpg -> reader-
testfile_mpeg1video_mp2audio-mpg.flv
Exception in thread "xuggler thread" java.lang.UnsatisfiedLinkError:
com.xuggle.xuggler.XugglerJNI.IContainer_make__SWIG_0()J
at com.xuggle.xuggler.XugglerJNI.IContainer_make__SWIG_0(Native
Method)
at com.xuggle.xuggler.IContainer.make(IContainer.java:853)
at com.xuggle.xuggler.InterruptingExhaustiveTest
$1.run(InterruptingExhaustiveTest.java:58)
at java.lang.Thread.run(Thread.java:680)
2012-02-20 11:43:24,961 [pool-1-thread-1] INFO
c.x.x.InterruptingExhaustiveTest - waiting for start

Art Clarke

unread,
Feb 20, 2012, 12:53:09 PM2/20/12
to xuggle...@googlegroups.com
Hi there Dave,

Read the FAQ on Eclipse and Xuggler.  You need to make sure the DYLD_LIBRARY_PATH environment variable is correctly set on Mac OSX (and the FAQ shows how).  As for the .classpath file -- I stupidly checked those in but they should probablyn't not be there.  Finally, turn off all C/C++ warnings in CDT/Eclipse.  It generates lots of noise and is error prone.  You ALWAYS must compile Xuggler from the command line -- expecting C++/C builds to work from eclipse will be a futile waste of time I'm afraid.

- Art


--
You received this message because you are subscribed to the Google Groups "xuggler-users" group.
To post to this group, send email to xuggle...@googlegroups.com.
To unsubscribe from this group, send email to xuggler-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/xuggler-users?hl=en.




--
http://www.xuggle.com/
xu‧ggle (zŭ' gl) v. To freely encode, decode, and experience audio and video.

Use Xuggle to get the power of FFmpeg in Java.

Dave Peterson

unread,
Feb 20, 2012, 1:35:17 PM2/20/12
to xuggler-users
yes I tried a dozen different ways to get this linked error to go away
including the one in the FAQs. Thanks for responding. I'll quadruple
check my work, but yes I agree it certainly looks like an environment
variable issue.

My latest thinking is that maybe the link error is due to the X3
environment variables all being defined pointing to release 3.4 which
is what I have officially installed. Whereas the git that I'm trying
to build probably depends upon newer versions. Is it possible that
this is the cause of the issue (i.e. not that the environment variable
is missing but rather it's pointing at a version that is older)? Or
is that not possible?

Dave Peterson

unread,
Feb 20, 2012, 1:53:50 PM2/20/12
to xuggler-users
$HOME/.MacOSX/environment.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>JAVA_HOME</key>
<string>/Library/Java/Home</string>
<key>DYLD_LIBRARY_PATH</key>
<string>/usr/local/xuggler/lib</string>
<key>XUGGLE_HOME</key>
<string>/usr/local/xuggler</string>
</dict>
</plist>

Release 3.4 is in /usr/local/xuggler. Launching eclipse from finder /
opt/eclipse/Eclipse.app. java.lang.UnsatisfiedLinkError when trying
to run unit tests.

Next thing I tried is to define the variables from the command line
and then run eclipse from the command line where the variables should
just transition in.

export XUGGLE_HOME=/usr/local/xuggler
export DYLD_LIBRARY_PATH=$XUGGLE_HOME/lib:$DYLD_LIBRARY_PATH
export PATH=$XUGGLE_HOME/bin:$PATH
alias start-eclipse='open /opt/eclipse/Eclipse.app'

start-eclipse

Just to confirm correct esports, typing from command line: export
returns this:
declare -x XUGGLE_HOME="/usr/local/xuggler"
declare -x PATH="/usr/local/xuggler/bin:/opt/local/bin:/opt/local/
sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/
davidpeterson/bin:SOLR_HOME/example"
declare -x CC="clang"
declare -x CXX="clang++"
declare -x DYLD_LIBRARY_PATH="/usr/local/xuggler/lib"

Sigh.

Hugo Flambo

unread,
Feb 20, 2012, 2:16:41 PM2/20/12
to xuggle...@googlegroups.com
Define those env variables inside the
IDE as well.. I believe that eclipse don't see them for some reason.. Or maybe you need to start eclipse with -clean arg..

I believe if you create those vars by yorself inside the IDE it works.

Cheers

On 20.02.2012, at 19:53, Dave Peterson <dcp...@gmail.com> wrote:

> $HOME/.MacOSX/environment.plist
> <?xml version="1.0" encoding="UTF-8"?>

> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.IDE0//EN"

Dave Peterson

unread,
Feb 20, 2012, 2:52:22 PM2/20/12
to xuggler-users
Okay got the unit tests to run. I'll explain how after I run a few
more things to narrow down what is required. In the meantime,
changing this (as I described above):
---
.classpath seems to not work properly for unit tests.

.classpath: <classpathentry kind="src" output="build/test"
path="test/
src"/>

Changed this to the project default:

<classpathentry kind="src" path="test/src"/>
-----

Causes tests fail until I link the fixtures directory to a new place
corresponding to the new class output location:
pwd
/Users/davidpeterson/projects/xuggle/xuggle-xuggler
$ ln -s test/fixtures fixtures

Tests now run up to the libx264.120.dylib plugin seg faulting and
dying. Looks like during the MediaToolExhaustiveTest.processFile.

Also, looks like some of the earlier tests did not pass. I'll dig in
further.

Dave Peterson

unread,
Feb 20, 2012, 2:58:06 PM2/20/12
to xuggler-users
okay as theorized, there is some incompatibility in trying to run the
unit tests from the latest git against the XUGGLE_HOME files which are
based upon the 3.4 install that I did a couple of weeks ago. I got
around this by creating a eclipse.sh and pointing XUGGLE_HOME to my
git working project area:
cat eclipse.sh
#!/bin/sh

#export XUGGLE_HOME=/usr/local/xuggler
export XUGGLE_HOME=$HOME/projects/xuggle/xuggle-xuggler/dist/stage/usr/
local/xuggler
export DYLD_LIBRARY_PATH=$XUGGLE_HOME/lib
export PATH=$XUGGLE_HOME/bin:$PATH

logger "`dirname \"$0\"`/eclipse"

exec "`dirname \"$0\"`/eclipse" $@

Dave Peterson

unread,
Feb 20, 2012, 3:14:48 PM2/20/12
to xuggler-users
man this is the bleeding edge of something....

Test failures:

MediaToolTest
assertEquals(OUTPUT_FILE_SIZE, outputFile.length(), 200);
junit.framework.AssertionFailedError: expected:<3985885.0> but
was:<3986260.0>
at junit.framework.Assert.fail(Assert.java:47)
at junit.framework.Assert.failNotEquals(Assert.java:277)
at junit.framework.Assert.assertEquals(Assert.java:116)
at junit.framework.Assert.assertEquals(Assert.java:123)
at
com.xuggle.mediatool.MediaToolTest.testEventCounts(MediaToolTest.java:
160)

MultiThreadedWritingExhausingTest
java.lang.InterruptedException
at java.util.concurrent.locks.AbstractQueuedSynchronizer
$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2015)
at
java.util.concurrent.ThreadPoolExecutor.awaitTermination(ThreadPoolExecutor.java:
1253)
at java.util.concurrent.Executors
$DelegatedExecutorService.awaitTermination(Executors.java:597)

hmm.. strange.
ConverterTest.testConversion
java.lang.RuntimeException: could not open url: fixtures/
testfile_videoonly_20sec.flv
at com.xuggle.xuggler.Converter.setupStreams(Converter.java:643)
at com.xuggle.xuggler.Converter.run(Converter.java:1203)
at com.xuggle.xuggler.ConverterTest.testConversion(ConverterTest.java:
208)

Okay put an IError around the retval for testConversion to see if that
provides clues:
retval = mIContainer.open(inputURL, IContainer.Type.READ, iFmt, false,
true,
parameters, rejectParameters);
if (retval < 0) {
IError iError = IError.make(retval);
throw new RuntimeException(iError + " could not open url: " +
inputURL);
}
java.lang.RuntimeException: Interrupted system call could not open
url: fixtures/testfile_videoonly_20sec.flv
at com.xuggle.xuggler.Converter.setupStreams(Converter.java:644)
at com.xuggle.xuggler.Converter.run(Converter.java:1205)
at com.xuggle.xuggler.ConverterTest.testConversion(ConverterTest.java:
208)







Reply all
Reply to author
Forward
0 new messages