| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
On Jul 17, 2005, at 4:44 PM, Elliotte Harold wrote:
Among others, if you try the above without initializing QuickTime via QTSession.open(): import quicktime.*; import quicktime.std.movies.*; public class TrivialQTCrash { public static void main (String[] arrrImAPirate) { try { new Movie(); // die die die } catch (QTException qte) { qte.printStackTrace(); } } } produces: [chrisg5:~/dev/experiments/trivialqtcrash] cadamson% java TrivialQTCrash Exception in thread "main" java.lang.ExceptionInInitializerError at quicktime.std.movies.Movie.allocate(Movie.java:394) at quicktime.std.movies.Movie.<init>(Movie.java:384) at quicktime.std.movies.Movie.<init>(Movie.java:372) at TrivialQTCrash.main(TrivialQTCrash.java:8) Caused by: quicktime.QTNullPointerException: QuickTime MUST be initialized:quicktime.qd.QDGraphics at quicktime.QTObject._ID(QTObject.java:75) at quicktime.qd.QDGraphics.isOffscreen(QDGraphics.java:482) at quicktime.qd.QDGraphics.<init>(QDGraphics.java:333) at quicktime.qd.QDGraphics.<init>(QDGraphics.java:427) at quicktime.qd.QDGraphics.<clinit>(QDGraphics.java:56) ... 4 more [chrisg5:~/dev/experiments/trivialqtcrash] cadamson% Generally speaking, the Movie constructor throws an exception if the native NewMovie function returns NIL. From the native docs:
The genericized QTException-throwing seen throughout QTJ represents a wrapping of the handling of return values (the classic "if err != noErr" you see in QT sample code) and lookup of error codes. If it seems weird that you have to catch QTException on pretty much any QTJ call, just imagine if you had to catch all the RuntimeExceptions in Java. My point being that in theory, almost any call can potentially error (e.g., illegal access, out of memory, stack-heap collision), and this is more visible in native QT than it is in Java. Maybe QTJ is more of a QT mindset than a Java mindset in this regard.. --Chris |
_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-java mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-java/email@hidden This email sent to email@hidden
| References: | |
| >Movie() throws Exception? (From: Elliotte Harold <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
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.