From df2362a864aee32f9a73b68507961ce73923d80c Mon Sep 17 00:00:00 2001 From: Pierre d'Herbemont <pdherbemont@videolan.org> Date: Sun, 6 Jan 2008 20:03:50 +0000 Subject: [PATCH] MacOSX/Framework: Fix my previous commit. --- .../Headers/Internal/VLCVideoCommon.h | 37 ----------- .../MacOSX/Framework/Sources/VLCVideoCommon.m | 63 ------------------- 2 files changed, 100 deletions(-) diff --git a/extras/MacOSX/Framework/Headers/Internal/VLCVideoCommon.h b/extras/MacOSX/Framework/Headers/Internal/VLCVideoCommon.h index b1b06aa1a311..d482ba08e5f4 100644 --- a/extras/MacOSX/Framework/Headers/Internal/VLCVideoCommon.h +++ b/extras/MacOSX/Framework/Headers/Internal/VLCVideoCommon.h @@ -35,40 +35,3 @@ + (id)layoutManager; @end -/***************************************************************************** - * VLCVideoCommon.h: VLC.framework VLCVideoCommon header - ***************************************************************************** - * Copyright (C) 2007 Pierre d'Herbemont - * Copyright (C) 2007 the VideoLAN team - * $Id: VLCVideoCommon.h 23915 2007-12-28 22:20:19Z pdherbemont $ - * - * Authors: Pierre d'Herbemont <pdherbemont # videolan.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. - *****************************************************************************/ - -#import <QuartzCore/QuartzCore.h> - -@interface VLCVideoLayoutManager : NSObject -{ - CGSize originalVideoSize; - BOOL fillScreenEntirely; -} -@property BOOL fillScreenEntirely; -@property CGSize originalVideoSize; - -+ (id)layoutManager; - -@end diff --git a/extras/MacOSX/Framework/Sources/VLCVideoCommon.m b/extras/MacOSX/Framework/Sources/VLCVideoCommon.m index a69299c6f4d2..e3fb8d1fd204 100644 --- a/extras/MacOSX/Framework/Sources/VLCVideoCommon.m +++ b/extras/MacOSX/Framework/Sources/VLCVideoCommon.m @@ -61,66 +61,3 @@ } } @end -/***************************************************************************** - * VLCVideoCommon.m: VLC.framework VLCVideoCommon implementation - ***************************************************************************** - * Copyright (C) 2007 Pierre d'Herbemont - * Copyright (C) 2007 the VideoLAN team - * $Id: VLCVideoCommon.m 23915 2007-12-28 22:20:19Z pdherbemont $ - * - * Authors: Pierre d'Herbemont <pdherbemont # videolan.org> - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA. - *****************************************************************************/ - -#import "VLCVideoCommon.h" - -/****************************************************************************** - * Implementation VLCVideoLayoutManager - * - * Manage the size of the video layer - */ - -@implementation VLCVideoLayoutManager -@synthesize fillScreenEntirely; -@synthesize originalVideoSize; - -+ (id)layoutManager -{ - return [[[self alloc] init] autorelease]; -} - -- (void)layoutSublayersOfLayer:(CALayer *)layer -{ - /* After having done everything normally resize the vlcopengllayer */ - if( [[layer sublayers] count] > 0 && [[[[layer sublayers] objectAtIndex:0] name] isEqualToString:@"vlcopengllayer"]) - { - CALayer * videolayer = [[layer sublayers] objectAtIndex:0]; - CGRect bounds = layer.bounds; - CGRect videoRect = bounds; - - CGFloat xRatio = CGRectGetWidth(bounds)/originalVideoSize.width; - CGFloat yRatio = CGRectGetHeight(bounds)/originalVideoSize.height; - CGFloat ratio = fillScreenEntirely ? MAX(xRatio, yRatio) : MIN(xRatio, yRatio); - - videoRect.size.width = ratio*originalVideoSize.width; - videoRect.size.height = ratio*originalVideoSize.height; - videoRect.origin.x += (CGRectGetWidth(bounds) - CGRectGetWidth(videoRect))/2.0; - videoRect.origin.y += (CGRectGetHeight(bounds) - CGRectGetHeight(videoRect))/2.0; - - videolayer.frame = videoRect; - } -} -@end -- GitLab