This is a very very tricky situation, as Quicktime and QTKit have some special threading guidelines you will need to follow.
http://developer.apple.com/library/mac/#technotes/tn2125/_index.html http://developer.apple.com/library/mac/#technotes/tn2138/_index.html It is 100% ok to call performSelectorOnMainThread to init a movie from say, a QCPlugin, in a QCRenderer, being rendered (and alloc/initted) from say, a CVDisplaylink. You need to ensure you call EnterMoviesOnThread / ExitMoviesOnThread n QTKit, and Attach / Detatch on the movie in specific. You need to balance these calls appropriately when moving a movie between threads, and ensure you follow very very strictly the guidelines on what is, and what is not allowed on background threads for movie controller access. Basically, few few things like decoding (and encoding) to a visual context (using QTVisualContextCopyFrameForTime and friends) is allowed on the background thread when using QTkit. Something as trivial as setting a rate to 1.0 via a QTKit call will use the movie controller, and need the main thread, and you will need to ensure you run those calls from the main thread. On Oct 24, 2011, at 9:45 AM, Nisar Ahmed wrote: > It works now, I initially missed to dispose off the movie which might be the > reason for such behavior. Thanks > > On Mon, Oct 24, 2011 at 6:34 PM, Nisar Ahmed <nisar....@gmail.com> wrote: > Thanks Achim, > > I don't think I can use performSelectorOnMainThread since I am initializing > movie inside a QCPlugin which is rendered by QCRenderer on a secondary thread > from another application. > > So I decided to use NewMovieFromProperties method to initialize my movie and > it actually worked, but after rendering few seconds the > ImageAvailableCallback stops calling, although I can hear audio which means > Movie toolbox is playing the movie. I have tested it on different movies and > on main thread as well but doesn't seem to work properly. > > Thanks > Nisar > > > On Mon, Oct 24, 2011 at 6:25 PM, Achim Breidenbach <ac...@boinx.com> wrote: > Hello Nisar, > > I am not sure why QTMovie whats to be initialized on the main thread, but did > you try to put your init code in a certain method and call it with > "performSelectorOnMainThread"? > > Btw: If you create a movie on the main thread, you should use > "detachFromCurrentThread" and "attachToCurrentThread" to "move" the movie > from the main thread to the secondary thread. > > Achim Breidenbach > Boinx Software > > On 24.10.2011, at 12:45, Nisar Ahmed wrote: > >> Dear List, >> >> I have developed a plugin that handles interlaced movies properly. The >> plugin works great with QCRenderer main thread but throws exception on >> secondary thread >> >> Terminating app due to uncaught exception 'QTMovieInitializedOnWrongThread', >> reason: 'QTMovie_QuickTime class must be initialized on the main thread.' >> >> I have also tried calling [QTMovie enterQTKITOnThread]/[QTMovie >> exitQTKitOnThread] and EnterMoviesOnThread(0)/ExitMoviesOnThread() pair but >> didn't help. >> >> I have build both the plugin and application in 32bit mode. >> >> Please help >> >> Thanks >> Nisar >> _______________________________________________ >> Do not post admin requests to the list. They will be ignored. >> Quartzcomposer-dev mailing list (Quartzcomposer-dev@lists.apple.com) >> Help/Unsubscribe/Update your Subscription: >> http://lists.apple.com/mailman/options/quartzcomposer-dev/achim%40boinx.com >> >> This email sent to ac...@boinx.com > > > > _______________________________________________ > Do not post admin requests to the list. They will be ignored. > Quartzcomposer-dev mailing list (Quartzcomposer-dev@lists.apple.com) > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/quartzcomposer-dev/doktorp%40mac.com > > This email sent to dokt...@mac.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list (Quartzcomposer-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com