IJKFFMoviePlayerController.h
5.55 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*
* IJKFFMoviePlayerController.h
*
* Copyright (c) 2013 Bilibili
* Copyright (c) 2013 Zhang Rui <bbcallen@gmail.com>
*
* This file is part of ijkPlayer.
*
* ijkPlayer is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* ijkPlayer 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with ijkPlayer; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#import "IJKMediaPlayback.h"
#import "IJKFFMonitor.h"
#import "IJKFFOptions.h"
#import "IJKSDLGLViewProtocol.h"
// media meta
#define k_IJKM_KEY_FORMAT @"format"
#define k_IJKM_KEY_DURATION_US @"duration_us"
#define k_IJKM_KEY_START_US @"start_us"
#define k_IJKM_KEY_BITRATE @"bitrate"
// stream meta
#define k_IJKM_KEY_TYPE @"type"
#define k_IJKM_VAL_TYPE__VIDEO @"video"
#define k_IJKM_VAL_TYPE__AUDIO @"audio"
#define k_IJKM_VAL_TYPE__UNKNOWN @"unknown"
#define k_IJKM_KEY_CODEC_NAME @"codec_name"
#define k_IJKM_KEY_CODEC_PROFILE @"codec_profile"
#define k_IJKM_KEY_CODEC_LONG_NAME @"codec_long_name"
// stream: video
#define k_IJKM_KEY_WIDTH @"width"
#define k_IJKM_KEY_HEIGHT @"height"
#define k_IJKM_KEY_FPS_NUM @"fps_num"
#define k_IJKM_KEY_FPS_DEN @"fps_den"
#define k_IJKM_KEY_TBR_NUM @"tbr_num"
#define k_IJKM_KEY_TBR_DEN @"tbr_den"
#define k_IJKM_KEY_SAR_NUM @"sar_num"
#define k_IJKM_KEY_SAR_DEN @"sar_den"
// stream: audio
#define k_IJKM_KEY_SAMPLE_RATE @"sample_rate"
#define k_IJKM_KEY_CHANNEL_LAYOUT @"channel_layout"
#define kk_IJKM_KEY_STREAMS @"streams"
typedef enum IJKLogLevel {
k_IJK_LOG_UNKNOWN = 0,
k_IJK_LOG_DEFAULT = 1,
k_IJK_LOG_VERBOSE = 2,
k_IJK_LOG_DEBUG = 3,
k_IJK_LOG_INFO = 4,
k_IJK_LOG_WARN = 5,
k_IJK_LOG_ERROR = 6,
k_IJK_LOG_FATAL = 7,
k_IJK_LOG_SILENT = 8,
} IJKLogLevel;
@interface IJKFFMoviePlayerController : NSObject <IJKMediaPlayback>
- (id)initWithContentURL:(NSURL *)aUrl
withOptions:(IJKFFOptions *)options;
- (id)initWithContentURLString:(NSString *)aUrlString
withOptions:(IJKFFOptions *)options;
- (id)initWithMoreContent:(NSURL *)aUrl
withOptions:(IJKFFOptions *)options
withGLView:(UIView<IJKSDLGLViewProtocol> *)glView;
- (id)initWithMoreContentString:(NSString *)aUrlString
withOptions:(IJKFFOptions *)options
withGLView:(UIView<IJKSDLGLViewProtocol> *)glView;
- (void)prepareToPlay;
- (void)play;
- (void)pause;
- (void)stop;
- (BOOL)isPlaying;
- (int64_t)trafficStatistic;
- (float)dropFrameRate;
- (void)setPauseInBackground:(BOOL)pause;
- (BOOL)isVideoToolboxOpen;
- (void)setHudValue:(NSString *)value forKey:(NSString *)key;
+ (void)setLogReport:(BOOL)preferLogReport;
+ (void)setLogLevel:(IJKLogLevel)logLevel;
+ (BOOL)checkIfFFmpegVersionMatch:(BOOL)showAlert;
+ (BOOL)checkIfPlayerVersionMatch:(BOOL)showAlert
version:(NSString *)version;
@property(nonatomic, readonly) CGFloat fpsInMeta;
@property(nonatomic, readonly) CGFloat fpsAtOutput;
@property(nonatomic) BOOL shouldShowHudView;
- (void)setOptionValue:(NSString *)value
forKey:(NSString *)key
ofCategory:(IJKFFOptionCategory)category;
- (void)setOptionIntValue:(int64_t)value
forKey:(NSString *)key
ofCategory:(IJKFFOptionCategory)category;
- (void)setFormatOptionValue: (NSString *)value forKey:(NSString *)key;
- (void)setCodecOptionValue: (NSString *)value forKey:(NSString *)key;
- (void)setSwsOptionValue: (NSString *)value forKey:(NSString *)key;
- (void)setPlayerOptionValue: (NSString *)value forKey:(NSString *)key;
- (void)setFormatOptionIntValue: (int64_t)value forKey:(NSString *)key;
- (void)setCodecOptionIntValue: (int64_t)value forKey:(NSString *)key;
- (void)setSwsOptionIntValue: (int64_t)value forKey:(NSString *)key;
- (void)setPlayerOptionIntValue: (int64_t)value forKey:(NSString *)key;
@property (nonatomic, retain) id<IJKMediaUrlOpenDelegate> segmentOpenDelegate;
@property (nonatomic, retain) id<IJKMediaUrlOpenDelegate> tcpOpenDelegate;
@property (nonatomic, retain) id<IJKMediaUrlOpenDelegate> httpOpenDelegate;
@property (nonatomic, retain) id<IJKMediaUrlOpenDelegate> liveOpenDelegate;
@property (nonatomic, retain) id<IJKMediaNativeInvokeDelegate> nativeInvokeDelegate;
- (void)didShutdown;
#pragma mark KVO properties
@property (nonatomic, readonly) IJKFFMonitor *monitor;
@end
#define IJK_FF_IO_TYPE_READ (1)
void IJKFFIOStatDebugCallback(const char *url, int type, int bytes);
void IJKFFIOStatRegister(void (*cb)(const char *url, int type, int bytes));
void IJKFFIOStatCompleteDebugCallback(const char *url,
int64_t read_bytes, int64_t total_size,
int64_t elpased_time, int64_t total_duration);
void IJKFFIOStatCompleteRegister(void (*cb)(const char *url,
int64_t read_bytes, int64_t total_size,
int64_t elpased_time, int64_t total_duration));