-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathVideoScreen.h
76 lines (69 loc) · 2.15 KB
/
VideoScreen.h
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
// PEAGLView.h
// FFmpegPlayTest
//
// Created by Jack on 11/1/12.
// Copyright (c) 2012 Jack. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
#import "Controllable.h"
#import "TimingProtocols.h"
#import "PictureQueue.h"
//enum {
// kScreenStateON,
// kVideoScreenStateOFF,
// kVideoScreenStateLinked,
// kVideoScreenStateUnlinked
//};
enum {
kScreenStateUnknown, //= 0,
kScreenStateStopped, //= 1 << 0,
kScreenStateRunning, //= 1 << 2,
kScreenStatePaused //= 1 << 3
};
typedef NSInteger VideoScreenState;
@class VideoScreen;
@protocol VideoScreenDelegate <NSObject>
- (void) screenWillShow: (VideoScreen*) screen;
- (void) screenDidShow:(VideoScreen*) screen;
@end
@class VideoScreen;
//---------------------------------------------------------------------
/**
This protocol define interface a class should comply to feed video to
VideoScreen object
*/
@protocol VideoScreenSource <NSObject>
@required
- (CGSize) videoFrameSize;
- (int) pixelFormat;
- (VideoPicture*) getPictureForScreen: (VideoScreen*) screen
screenClock: (NSTimeInterval) scrPts;
- (void) finishFrameForScreen: (VideoScreen*) screen;
@optional
@end
#pragma mark -
//---------------------------------------------------------------------
@protocol VideoScreen <NSObject>
@required
- (id<EAGLDrawable>) viewPort;
- (NSInteger) scalingMode;
@end
#pragma mark - VideoScreen
/**
Video public interface
*/
@interface VideoScreen : UIView <Controllable, VideoScreen, Clock>
@property (nonatomic) NSInteger frameInterval; // default 1
@property (nonatomic, readonly) VideoScreenState state;
@property (nonatomic, readonly) BOOL supportDisplayLink;
@property (nonatomic, assign) id<VideoScreenSource> source;
@property (nonatomic) NSInteger scalingMode;
@property (nonatomic, assign) id<VideoScreenDelegate> delegate;
- (id) initWithSource: (id<VideoScreenSource>) source
delegate: (id<VideoScreenDelegate>) delegate;
- (id) initWithSource: (id<VideoScreenSource>) source
delegate: (id<VideoScreenDelegate>) delegate
scalingMode: (NSInteger) scalingMode;
@end