Skip to content

Commit 237d401

Browse files
committed
rtmp
1 parent dc99402 commit 237d401

File tree

7 files changed

+509
-31
lines changed

7 files changed

+509
-31
lines changed

NetDiag/QNNProtocols.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@
2121

2222
@end
2323

24+
/**
25+
* 中途取消的状态码
26+
*/
27+
extern const NSInteger kQNNRequestStoped;

NetDiag/QNNRtmp.h

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,41 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
#import "QNNProtocols.h"
1011

11-
@interface QNNRtmp : NSObject
12+
@interface QNNRtmpHandshakeResult : NSObject
13+
14+
@property (readonly) NSInteger code;
15+
@property (readonly) NSTimeInterval maxTime;
16+
@property (readonly) NSTimeInterval minTime;
17+
@property (readonly) NSTimeInterval avgTime;
18+
@property (readonly) NSInteger count;
19+
20+
-(NSString*) description;
1221

1322
@end
23+
24+
typedef void (^QNNRtmpHandshakeCompleteHandler)(QNNRtmpHandshakeResult*);
25+
26+
@interface QNNRtmpHandshake : NSObject<QNNStopDelegate>
27+
28+
/**
29+
* default port is 1935
30+
*
31+
* @param host domain or ip
32+
* @param output output logger
33+
* @param complete complete callback, maybe null
34+
*
35+
* @return QNNTcpping instance, could be stop
36+
*/
37+
+(instancetype) start:(NSString*)host
38+
output:(id<QNNOutputDelegate>)output
39+
complete:(QNNRtmpHandshakeCompleteHandler)complete;
40+
41+
+(instancetype) start:(NSString*)host
42+
port:(NSUInteger)port
43+
count:(NSInteger)count
44+
output:(id<QNNOutputDelegate>)output
45+
complete:(QNNRtmpHandshakeCompleteHandler)complete;
46+
47+
@end

0 commit comments

Comments
 (0)