[vlc-commits] [Git][videolan/vlc][master] 4 commits: macosx: Add method to acquire and return the vout containing view from the...
Steve Lhomme (@robUx4)
gitlab at videolan.org
Sun Apr 13 06:02:37 UTC 2025
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
829c9164 by Claudio Cambra at 2025-04-13T05:46:54+00:00
macosx: Add method to acquire and return the vout containing view from the main video view controller
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
aea8412a by Claudio Cambra at 2025-04-13T05:46:54+00:00
macosx: Use the acquire/return video view methods in PIP implementation in VLCMainVideoViewController
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
73a096bb by Claudio Cambra at 2025-04-13T05:46:54+00:00
macosx: Present live playback in thumbnail button view of library window control bar
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
76165816 by Claudio Cambra at 2025-04-13T05:46:54+00:00
macosx: Add checks that acquired video view is valid
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
3 changed files:
- modules/gui/macosx/library/VLCLibraryWindow.m
- modules/gui/macosx/windows/video/VLCMainVideoViewController.h
- modules/gui/macosx/windows/video/VLCMainVideoViewController.m
Changes:
=====================================
modules/gui/macosx/library/VLCLibraryWindow.m
=====================================
@@ -73,6 +73,7 @@
#import "views/VLCBottomBarView.h"
#import "views/VLCCustomWindowButton.h"
#import "views/VLCDragDropView.h"
+#import "views/VLCImageView.h"
#import "views/VLCLoadingOverlayView.h"
#import "views/VLCNoResultsLabel.h"
#import "views/VLCRoundedCornerTextField.h"
@@ -101,6 +102,7 @@ const NSUserInterfaceItemIdentifier VLCLibraryWindowIdentifier = @"VLCLibraryWin
{
NSInteger _currentSelectedViewModeSegment;
VLCVideoWindowCommon *_temporaryAudioDecorativeWindow;
+ NSView *_acquiredVideoView;
}
@property NSTimer *searchInputTimer;
@@ -532,6 +534,10 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
return;
}
+ if (_acquiredVideoView) {
+ [self.videoViewController returnVideoView:_acquiredVideoView];
+ }
+
[self presentVideoView];
[self enableVideoTitleBarMode];
[self hideControlsBarImmediately];
@@ -556,6 +562,14 @@ static void addShadow(NSImageView *__unsafe_unretained imageView)
[self showControlsBarImmediately];
[self updateArtworkButtonEnabledState];
+ _acquiredVideoView = [self.videoViewController acquireVideoView];
+ if (_acquiredVideoView) {
+ [self.controlsBar.artworkImageView addSubview:_acquiredVideoView
+ positioned:NSWindowBelow
+ relativeTo:self.artworkButton];
+ [_acquiredVideoView applyConstraintsToFillSuperview];
+ }
+
self.splitViewController.mainVideoModeEnabled = NO;
if (self.presentLoadingOverlayOnVideoPlaybackHide) {
=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.h
=====================================
@@ -66,6 +66,8 @@ NS_ASSUME_NONNULL_BEGIN
- (void)showControls;
- (void)hideControls;
+- (nullable NSView *)acquireVideoView;
+- (void)returnVideoView:(NSView *)videoView;
- (IBAction)togglePlayQueue:(id)sender;
- (IBAction)returnToLibrary:(id)sender;
=====================================
modules/gui/macosx/windows/video/VLCMainVideoViewController.m
=====================================
@@ -520,7 +520,8 @@
self.retainedWindow = window;
_voutViewController = [PIPVoutViewController new];
- _voutViewController.view = self.voutContainingView;
+ _voutViewController.view = [self acquireVideoView];
+ NSAssert(_voutViewController.view != nil, @"Vout view should not be nil");
VLCPlayerController * const controller = notification.object;
_pipViewController.playing = controller.playerState == VLC_PLAYER_STATE_PLAYING;
@@ -565,6 +566,24 @@
[libraryWindow disableVideoPlaybackAppearance];
}
}
+
+- (nullable NSView *)acquireVideoView
+{
+ [self.voutContainingView removeFromSuperview];
+ return self.voutContainingView;
+}
+
+- (void)returnVideoView:(NSView *)videoView
+{
+ NSParameterAssert(videoView != nil);
+ [videoView removeFromSuperview];
+ [self.view addSubview:videoView
+ positioned:NSWindowBelow
+ relativeTo:self.mainControlsView];
+ [videoView applyConstraintsToFillSuperview];
+ [self applyAudioDecorativeViewForegroundCoverArtViewConstraints];
+}
+
#pragma mark - PIPViewControllerDelegate
- (BOOL)pipShouldClose:(PIPViewController *)pip
@@ -586,13 +605,8 @@
- (void)pipDidClose:(PIPViewController *)pip
{
- [self.voutContainingView removeFromSuperview];
- [self.view addSubview:self.voutContainingView
- positioned:NSWindowBelow
- relativeTo:self.mainControlsView];
- [self.voutContainingView applyConstraintsToFillSuperview];
+ [self returnVideoView:_voutViewController.view];
_voutViewController = nil;
- [self applyAudioDecorativeViewForegroundCoverArtViewConstraints];
}
- (void)pipActionPlay:(PIPViewController *)pip
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d0d9ba3e60398c33a303583d780c5038a76a5d8f...7616581625670b94381f78e6cf3021b5625551df
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/d0d9ba3e60398c33a303583d780c5038a76a5d8f...7616581625670b94381f78e6cf3021b5625551df
You're receiving this email because of your account on code.videolan.org.
VideoLAN code repository instance
More information about the vlc-commits
mailing list