[vlc-devel] [vlc-commits] macosx: refactor main class object life management and main menu

David Fuhrmann david.fuhrmann at gmail.com
Tue Jul 21 22:31:46 CEST 2015


> Am 21.07.2015 um 20:13 schrieb Felix Paul Kühne <fkuehne at videolan.org>:
> 
> On 21 Jul 2015, at 18:47, David Fuhrmann <david.fuhrmann at gmail.com <mailto:david.fuhrmann at gmail.com>> wrote:
>> 
>>> 
>>> Am 21.07.2015 um 17:52 schrieb Felix Paul Kühne <git at videolan.org>:
>>> 
>>> vlc | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Tue Jul 21 17:50:49 2015 +0200| [f450457875207163ddb4f435e0bb5dc868e35ee8] | committer: Felix Paul Kühne
>>> 
>>> macosx: refactor main class object life management and main menu
>>> 
>>>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f450457875207163ddb4f435e0bb5dc868e35ee8
>>> ---
>>> 
>>> .../macosx/Resources/English.lproj/MainMenu.xib    |10096 +++-----------------
>>> .../package/macosx/vlc.xcodeproj/project.pbxproj   |    8 -
>>> modules/gui/macosx/ControlsBar.m                   |    4 +-
>>> modules/gui/macosx/CoreInteraction.h               |    2 +
>>> modules/gui/macosx/CoreInteraction.m               |   46 +-
>>> modules/gui/macosx/MainMenu.h                      |  456 +-
>>> modules/gui/macosx/MainMenu.m                      | 1338 +--
>>> modules/gui/macosx/MainWindow.m                    |    6 +-
>>> modules/gui/macosx/Makefile.am                     |    1 -
>>> modules/gui/macosx/VideoView.m                     |    6 +-
>>> modules/gui/macosx/controls.h                      |   70 -
>>> modules/gui/macosx/controls.m                      |  255 -
>>> modules/gui/macosx/intf.h                          |    4 -
>>> modules/gui/macosx/intf.m                          |   82 +-
>>> modules/gui/macosx/misc.m                          |    6 +-
>>> modules/gui/macosx/playlist.m                      |    1 -
>>> 16 files changed, 2175 insertions(+), 10206 deletions(-)
>>> 
>> 
>>> -        [NSBundle loadNibNamed:@"MainMenu" owner:NSApp];
>>> -        [NSBundle loadNibNamed:@"MainWindow" owner:[VLCMain sharedInstance]];
>>> -
>>> -        [[[VLCMain sharedInstance] mainWindow] makeKeyAndOrderFront:nil];
>>> -
>> 
>> Hi Felix,
>> 
>> This is wrong and reverts 9434662c9228278ccd18fd649e71fa809745a576. As explained in the commit log already, there should be no performance improvement if you move stuff to application:willFinishLaunching.
>> 
>> Additionally, initialization needs to be done in OpenIntf() (there might be still missing), not moved outside. Otherwise the vout might get created before init is complete.
> 
> Can you be more precise on what you think really needs to be initialized in OpenIntf()?

At least, all VLC callbacks should have been registered. The vout window provider can be triggered at any time after OpenIntf (even before application:WillfinishLaunching or similar), so important initialization need to happen earlier. So in fact, the main window needs to be there, if we want to have embedded video playback.

And we need to load the main window anyway right from the start - without it VLC is unusable. So I see no reason to artificially delay its loading...

> Note that loading the MainWindow xib currently loads VLCPlaylist, VLCMainWindow and VLCMainWindowControlsBar, which will not be the case anymore by the end of the week. Then, loading the xib will load the UI representation stored in the xib and that’s about it.

Well we need an existing parent view for the out window provider. So its not only about helper classes, but about the UI content itself. But you are absolutely right, the xib should contain the UI and not any other important objects like VLCPlaylist...

I would say, first make the init order right (see above points), and afterwards we can think about optimizations by lazy loading.

Best regards,
David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20150721/75f8769a/attachment.html>


More information about the vlc-devel mailing list