[2361] in java-interest

home help back first fref pref prev next nref lref last post

MPEG question

daemon@ATHENA.MIT.EDU (Robert Lougher)
Fri Sep 29 19:55:26 1995

From: "Robert Lougher" <rob@comp.lancs.ac.uk>
Date: Fri, 29 Sep 1995 22:23:06 +0100
To: java-interest@java.sun.com
Cc: rob@comp.lancs.ac.uk

First of all, I must echo what other people have said about the effort the
Java team is putting into answering questions.  I'd rather not increase their
workload so if anybody else could answer my queries...

I'm trying to add MPEG to Java.  I've got a hacked version of Berkeley's
mpeg player which I've used in the past to write an MPEG widget for tcl/tk.
In Java, I'm using two native methods, one which opens up a stream and
another which given a stream retrieves the next frame.  This is trivial -
the difficulty is displaying the frames inside Java.

Initially I thought about using the ImageConsumer, Producer interfaces.  The
ImageProducer interface supports the notion of "dynamic" images such as live
video feeds.  However, after playing about with writing a MPEG producer
I found that the Image class removes itself from the list of consumers
after the first frame, ignoring the status.  I could write an ImageConsumer
but I'd still need an Image to display the frame...

I'm currently using a MemoryImageSource on an array which is filled by the
C code.  To display each frame I have to create a new image from the
MemoryImageSource.  Although this works, the performance is not very high.
(Due to the overhead of creating the Image and the asynchronous image
updates?) 

There obviously is a better way to do this (I'm probably being very stupid
about something here).  Ideally I'd like to draw the frame directly on the
screen using X (i.e. XPutImage).  However, I don't know anything about
getting the details from Java to do this.  Has anybody done anything like
this?  Has anybody already implemented MPEG?

Thanks for your help,

Robert Lougher.

---------------------------------------------------------------------
POST:  Dr. Robert Lougher            | email: rob@comp.lancs.ac.uk
       Department of Computing       | tel. : +44 1524 65201 x3808
       University of Lancaster       | fax. : +44 1524 593608
       Lancaster, LA1 4YR, UK.       |
-
Note to Sun employees: this is an EXTERNAL mailing list!
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post