Code: Select all
libvlc_media_player_set_nsobject(vlcPlayer, (void*)videoWidget->winId()); // videoWidget is QFrame *
Code: Select all
QMacCocoaViewContainer container(0);
// Many Cocoa objects create temporary autorelease objects,
// so create a pool to catch them.
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
// Create the NSView, set it on the QCocoaViewContainer.
NSView *view = [[NSView alloc] init];
container.setCocoaView(view); // here it crashes saying EXC_BAD_ACCESS
// Release our reference, since our super class takes ownership and we
// don't need it anymore.
[view release];
// Clean up our pool as we no longer need it.
[pool release];
container.show();
....
libvlc_media_player_set_nsobject(vlcPlayer, (void*)container->cocoaView());