[vlc-devel] [PATCH] 64-bit support for mozilla plugin on Mac OS X

Pierre d'Herbemont pdherbemont at gmail.com
Mon May 17 10:23:15 CEST 2010

On May 11, 2010, at 1:31 AM, David Menestrina wrote:

> On Mon, May 10, 2010 at 4:02 PM, Pierre d'Herbemont
> <pdherbemont at gmail.com> wrote:
>>>  1) Cocoa documentation says that NSView is not threadsafe, yet this
>>>     code uses NSView in the vout thread for entering fullscreen mode.
>> It's easy to dispatch a selector on main thread using -performSelectorOnMainThread:withObject:,
>> why don't you use it?
> I did have a version that used that method, but it didn't seem to
> solve my issues, and it made the code more complicated.  It is
> probably the right thing to do, but I'd like to understand better
> which things need to be done in the main thread.  For example, if I
> alloc/init an object in the main thread, must I also release it in the
> main thread? Or can that be done from a secondary thread?  (I noticed
> that with waitUntilDone=YES, releasing in the main thread seemed to
> hang when done from dealloc in a secondary thread.)
> Also, is it OK to invoke something on the main thread with
> waitUntilDone=YES within the Display function of a vout display?

Yes, but you'll see frame being dropped. I think the display function is fine this way. Not the view creation though.

>>>  3) I have read that Cocoa requires an NSAutoreleasePool to exist for
>>>     any thread that makes Cocoa calls.  The vout thread does not have one,
>>>     and therefore the plugin will leak memory.
>> It's easy to create one when one is needed. Just wrap your Code like this:
>> NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
>> // Code
>> [pool drain];
> Is this something that's efficient to do every time I make a Cocoa
> call?



More information about the vlc-devel mailing list