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: Calling QT from 1.4.1?



Where can I find information on how to access QuickTime from the current
Java 1.4.1 beta (assuming this is at all possible)? From what I recall from
earlier discussions on this list, the old JDirect method is no longer
supported. How do I "link" my Java-based against QT to make it work? Do I
need any new JNI libs somewhere?

I have been asking this question for weeks, and I had a steer from an Apple Engineer that suggests that the core of the problem isn't JNI or JDirect, but that CarbonLock where your app failed.

My impression is that Apple are need to migrate the tasking threads and callbacks for Quicktime. As these are currently Carbon based, and the engineers would need to work out how they are going to do it. There was a post about a month ago on the Java Dev list with a few pointers on this, and I'm copying it below.

Vickie

---------------------------------------------------------------------------------------------------------------
Last week, we announced that we will not recommend accessing Carbon from our Java 1.4.1 implementation. While this statement is still fundamentally true, the better way to state it is that there are significant challenges in accessing Carbon in Java 1.4.1. This is rooted in the fact that our Java implementation is now essentially a Cocoa framework. While Apple is continuing to improve the interoperability of the Carbon and Cocoa runtime environments, there are some documented issues you will need to deal with in doing native calls to Carbon or Cocoa in our Java 1.4.1 implementation.

Here's the technical documentation that covers some of the issues:
http://developer.apple.com/techpubs/macosx/Essentials/CarbonCocoaDoc/
index.html

The above documentation is geared towards pure Cocoa developers, so it may be difficult to glean all of the issues from it for the purposes of Java development. Lacking anything specific, it's a start for those of you who want a better understanding of the some of the underlying issues before we are able to provide more Java-specific documentation.

Developers should also note the unique issues that are involved with mixing Java AWT, Carbon, and Cocoa, among which are the following:

 All Carbon and Cocoa applications have a main event thread that is distinct from all Java threads.
 Run loops are not automatically serviced on Java threads. Carbon calls that make explicit or implicit use of a run loop will not work, as the run loop concerned (on the Java thread) is never run. Please refer to the aforementioned Cocoa/Carbon docs for the description of
the interaction of run loops.
 Java threads are fully pre-emptive native threads. Carbon threads
are co-operative threads. Please read this document (http://developer.apple.com/technotes/tn/tn2028.html) to understand the differences between these threading models and how they may be able to work together:

You should note that most of the above issues have always been true, whether our Java implementation is based on Carbon or Cocoa or whether we provide JDirect or not. It just highlights the point that doing native calls from Java can be a complex and tricky task.

Although there have been many requests for this, it is not as simple as providing a list of frameworks and saying they work or don't work. Working with Carbon-based libraries requires some knowledge of how all of the above things work together. We recommend you attempt to find Cocoa equivalents for the Carbon API you use today and that if you have difficulty doing so, we would like to hear about which frameworks you have issues with.

We intend to provide more documentation to cover specific issues of accessing Carbon and Cocoa between now and the final 1.4.1 release, so please be patient and stay tuned for more info. In the meantime let us
know how you intend on accessing Carbon from Java code.
_______________________________________________
quicktime-java mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/quicktime-java
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.