[GOODIE] Mpeg3Plugin.so for Linux

Lex Spoon lex at cc.gatech.edu
Mon Nov 6 22:49:48 UTC 2000


> >it's at http://isgwww.cs.uni-magdeburg.de/~bert/squeak/mpeg/ . I don't
> >know why, but I don't see any video yet. The sound is fine, though. Any
> >idea?
> >
> >I have thrown out all the "#define MACINTOSH" . This should not be in the
> >sourcecode anyway. Also, some permissions were not right, the lineends
> >were mangled, file name case was incorrect, etc. I changed the Makefile so
> >it should build "out of the box".
> >
> 
> Great I ran a compare and will integrate your changes into the source 
> I've got. There are some other changes pending for Windows support. 
> But let me ask what is performance like?
> 

This seems to happen a lot with squeak projects; I'm not sure if it's similar
elsewhere.  People do a lot of work and then it gets dumped or reimplemented.
Anyway, I'll post what I've done -- and what I thought Bert and John
realized I was doing -- and everyone can do as they wish with it.

I've uploadod everything to the Squeak swiki:

	http://minnow.cc.gatech.edu/squeak/uploads/mpeg3plugin.so-ls
	http://minnow.cc.gatech.edu/squeak/uploads/mpegplayerjmm-ls.cs
	http://minnow.cc.gatech.edu/squeak/uploads/mpeg3plugin-ls.tgz

Rename mpeg3plugin.so-ls to Mpeg3Plugin.so before trying to use it. 

The first file should get Linux/x86 guys going okay with basic MPEG audio and
video.  However, the color will be messed up, due to an endianness
problem.  Bert says that it works to switch to color mode 1 instead of
14 in videoReadNextFrameInto:width:height:stream:.  I offered to make
this translation happen automatically within the plugin, but John and I
reached a stalemate on how it should be implemented, so it didn't
happened.  Until somebody does something about this, I guess
we'll all just have to live in hackery.


There are a number of cleanups in the above:

	1. The #define MACINTOSH's are centralized  so that you can decide
Macintosh-ness in just one location.  It should even happen
automatically, though I don't have a properly set up Mac to test this
on.

	2. Much of the code is switched from #ifndef MACINTOSH to #ifdef
USE_PTHREADS; this will probably help people with older Unices that
don't have pthreads yet.  (Though the threaded version is nice!  The
non-threaded version means that Squeak will completely block while it
decodes each frame, which will cause problems if there are other
animated morphs on the screen.)

	3. Sanity checks are added for the stream number; eg, if you try to
"playStream: 3" when there is no stream 3, you get a debugger window
instead of a segment fault.

	4. The Makefiles for libmpeg are improved.  (Recursive make is harmful,
and in this case it was completely gratuitous).

	5. Sound playing is tweaked so that SoundPlayer's background process
isn't restarted.  Not a big deal, if you think of playStream:, etc, as
stopgaps until a real MPEG player comes along.

To compile this, do "make" in the libmpeg directory, and
then do the following from the Squeak "build" directory:

	gcc -c -DUNIX -DHAVE_CONFIG_H /blahblah/Mpeg3Plugin.c -I. -I../src/generated -I ../src/unix

	gcc -shared Mpeg3Plugin.o /blahblah/Mpeg3Plugin/libmpeg3.a -o Mpeg3Plugin.so -lpthread



There are other things I'd like to do.  I'd like to fix the endianness problem,
update John's memory allocation fix to be more Unix-friendly, integrate
stuff into Ian's build mechanism, and unfork the core libmpeg. 
However, there's a lot of cooks in this kitchen now and we're bumping into
each other.  I'll get out of the way until thing settle down.


-Lex





More information about the Squeak-dev mailing list