Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Help with Java and QuickTime



The love of QTJava. Well there's as always lots of ways to do stuff
using QTJava. I get a java.awt.Images from QT is like this:

/// mp = MoviePlayer
QTImageProducer qtProducer = new QTImageProducer(mp, imageSize);
Image javaImage = Toolkit.getDefaultToolkit().createImage(qtProducer);
BufferedImage bi = new BufferedImage(r.getWidth(), r.getHeight(),
BufferedImage.TYPE_3BYTE_BGR);

This works with any image format or video. Now the image u are getting
from your SequenceGrabber maybe having hassle. Try going the getGWorld
route, it's a little harder but it ways seems to work out in the end.
Also u could try passing the QTImageProducer the SequenceGrabber (prob
wont work mind).

Tops

aNt


> Hi All
>
> I am having problems with QuickTime and Java.
>
> I am using JBuilder 9
>
> In my app I am calling ion a Web-Cam and need to Grab a Frame
>
> I have it all working other than I am getting this error.
>
> This is my Code to grab the frame
> private void grabFrame() {
> if (videoEnabled) {
> QTImageProducer producer = null;
> Pict pict = null;
> ImagePresenter ip = null;
> try {
> mGrabber.pause(StdQTConstants.seqGrabPause);
> pict = mGrabber.grabPict(new QDRect(kWidth, kHeight), 0,
> StdQTConstants.grabPictIgnoreClip);
> ip = ImagePresenter.fromPict(pict);
> QDRect rect = ip.getDisplayBounds();
> Dimension d = new Dimension(rect.getWidth(),
rect.getHeight());
> producer = new QTImageProducer(ip, d);
> //producer = new QTImageProducer(mDrawable, new
> Dimension(kWidth, kHeight));
> image = Toolkit.getDefaultToolkit().createImage(producer);
> }
> catch (Exception ee) {
> printStackTrace(ee);
> }
> finally {
> shutDown();
> }
>
> }
> }
> At this line
> pict = mGrabber.grabPict(new QDRect(kWidth, kHeight), 0,
> StdQTConstants.grabPictIgnoreClip);
> Is where I am getting this error
> quicktime.QTRuntimeException[QTJava:6.0.0g1]-
> 9402=cantDoThatInCurrentMode,QT.vers:6308000
> at quicktime.app.time.TaskThread.run(TaskThread.java:297)
> at java.lang.Thread.run(Thread.java:491)
> *** malloc[494]: error for object 0xf0486ec0: Non-page-aligned,
> non-allocated pointer being freed
> *** malloc[494]: error for object 0x5fed248: Non-aligned pointer being
> freed
>
>
> Can anyone help me with this
>
> Thanks
>
> Craig Laird
> _______________________________________________
> java-dev mailing list | email@hidden
> Help/Unsubscribe/Archives:
> http://www.lists.apple.com/mailman/listinfo/java-dev
> Be sure to read the FAQ http://developer.apple.com/java/faq/ before
> posting
> Do not post admin requests to the list. They will be ignored.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.