[Mp4-tech] Problems compiling MPEG-J Reference
Stefan A. Goor
stefan.goor ucd.ie
Wed Aug 27 20:14:53 EDT 2003
Hi Wesley + Mp4ers,
Thanks for you help it was really useful and I'm really grateful, I finally
got the code all compiled and running.
I tried adding the quotes to the paths but there was a lot of paths to
changes them so just as a temporary solution I moved the files to a
directory with no spaces and it all worked fine.
HERE ARE SOME GUIDELINES THAT MIGHT HELP ANYONE ELSE HAVING DIFFICULTIES
COMPILING THE MPEGJ SOFTWARE:
When compiling the "IM1Core4\2DPlayer-CSELT\IM1-2D.dsw" project in Visual
Studio 6 you must have your JAVA_HOME referencing the JAVA JDK 1.1.8, other
versions such as 1.4.2 and 1.3.1 don't seem to be compatible and caused
problems during compilation. I believe this is due to changes in the JNI
(Java Native Interface). However to run the programs i.e. steps 4 and 5 of
the you must use a later version of Java that have Swing and Thread
Libraries included.
Also, if you want to run "samples\TwoVideoAudioMpegj\createSample.bat"
sample explained in the README.html in step 5.2, you will need to edit some
of the code because there is an error in the way the arrays are indexed,
that throws an ArrayOutOfBoundException.
The file that needs to edited is "ClassId" in method "createBuffer()". The
changes that are needed are shown below:
public void createBuffer()
{
if (className == null)
{
length = 0;
// aligned to 32 bits
buffer = new byte[4];
buffer[0] = 0x00;
buffer[1] = 0x00;
/**
* Change to Reference Code by Stefan A. Goor 27-08-2023
* An array out of bounds exception was being thrown here
* array length = 4, cannot index 4!!
*/
//buffer[3] = 0x00;
//buffer[4] = 0x00;
buffer[2] = 0x00;
buffer[3] = 0x00;
/**
* End of Change by Stefan A. Goor - 27-08-2023
*/
return;
}
.
.
.
Many thanks again Wesley for help,
Stefan
-----Original Message-----
From: Wesley De Neve [mailto:Wesley.DeNeve ugent.be]
Sent: 27 August 2023 17:14
To: Stefan A. Goor; M4IF
Subject: Re: [Mp4-tech] Problems compiling MPEG-J Reference
Hi Stefan, all,
Stefan A. Goor wrote:
> Hi Wesley,
> Thanks so much for your reply, I think it's pointed me in the right
> direction.
> You were right about the JNI header not being found and I think I
> know why it couldn't find it. If you look at the compiler messages
> (http://delboy.ucd.ie/M4IF_Technotes/VB6_MPEGJ_Rebuild_All_Messages.txt),
> there are a load of Command line warnings and I think these are due
> to the fact that my CLASSPATH and MPEGJ_HOME variable contain
> directories with spaces in them.
> The JNI.h file is in the Java SDK includes directory which on my
> computer is in the directory "C:\Program Files\Java
> Tools\j2sdk1.4.2\include\".
> The command line warnings complain about problems like:
> "Command line warning D4024 : unrecognized source file type
> 'Files\Java', object file assumed"
> but if you look at this it suggests that the compiler did use the full
> directory, but rather took it to be "C:\Program" and then found
> "Files\Java" because of the spaces.
> Now that I know the problem I'm sure I can resolve it by moving the
> files to a directory without spaces, however I am reluctant to do
> this because of the way I maintain my harddisk. So if anyone has any
> suggestions how to resolve the problems with the spaces, I'd be very
> grateful.
> Also I realise that this is now more a programming issue rathar than
> an M4IF topic but I thought I'd still post it because others trying
> to compile the MPEG-J software may encounter similar problems,
your problem may possibly be solved by putting the relevant paths to your
libraries and header files between "" in your project settings. I now
remember I had once a similar problem with another multimedia API...
Hope this helps,
Wesley
More information about the Mp4-tech
mailing list