VLCVideoLayer.m 2.37 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*****************************************************************************
 * VLCVideoLayer.m: VLC.framework VLCVideoLayer implementation
 *****************************************************************************
 * Copyright (C) 2007 Pierre d'Herbemont
 * Copyright (C) 2007 the VideoLAN team
 * $Id: VLCVideoView.m 24023 2008-01-02 02:52:35Z 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 "VLCVideoLayer.h"
#import "VLCLibrary.h"
#import "VLCEventManager.h"

/* Libvlc */
#include <vlc/vlc.h>
#include <vlc/libvlc.h>

#import <QuartzCore/QuartzCore.h>

/******************************************************************************
 * VLCVideoView (Private) 
 */

@interface VLCVideoLayer (Private)
/* Method */
- (void)addVoutLayer:(CALayer *)aLayer;
@end

/******************************************************************************
 * Implementation VLCVideoLayer 
 */

@implementation VLCVideoLayer

50
/* Nothing */
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68

@end

/******************************************************************************
 * Implementation VLCVideoLayer  (Private)
 */

@implementation VLCVideoLayer (Private)

/* This is called by the libvlc module 'opengllayer' as soon as there is one 
 * vout available
 */
- (void)addVoutLayer:(CALayer *)aLayer
{
    [CATransaction begin];

    aLayer.name = @"vlcopengllayer";

69
    [aLayer setAutoresizingMask:kCALayerWidthSizable|kCALayerHeightSizable];
70
71
72
73
74
75
76
77
78
79
80
81

    [self insertSublayer:aLayer atIndex:0];

    [aLayer setNeedsLayout];
    [aLayer setNeedsDisplay];
    [self setNeedsDisplay];
    [self layoutIfNeeded];

    [CATransaction commit];
}

@end