Red5Pro IOS Client SDK

 10.0.0
Core SDK for IOS
R5Stream.h
1//
2// R5Stream.h
3// Red5Pro
4//
5// Created by Andy Zupko on 9/16/14.
6// Copyright (c) 2014 Infrared5. All rights reserved.
7//
8
9#import <Foundation/Foundation.h>
10#import "global.h"
11#import "R5Connection.h"
12#import "R5Camera.h"
13#import "R5Configuration.h"
14#import "R5AudioController.h"
15#include <AVFoundation/AVFoundation.h>
16
17@protocol R5StreamDelegate;
18
22enum R5RecordType{
23 R5RecordTypeLive,
24 R5RecordTypeRecord,
25 R5RecordTypeAppend
26};
27
28enum R5StreamMode{
29 r5_stream_mode_idle,
30 r5_stream_mode_streaming,
31 r5_stream_mode_publishing
32
33};
34
35extern NSString *const R5RecordVideoBitRateKey;
36extern NSString *const R5RecordAudioBitRateKey;
37extern NSString *const R5RecordAlbumName;
38extern NSString *const R5RecordToCameraRoll;
39
43@interface R5Stream : NSObject{
44
45
46}
47
52
53
57@property (readonly) R5Connection *connection;
58
62@property NSObject<R5StreamDelegate> *delegate;
63
67@property NSObject *client;
68
72@property BOOL pauseAudio;
73
77@property BOOL pauseVideo;
78
79// @Deprecated
80@property CVPixelBufferPoolRef pixelBufferPool;
81// @Deprecated
82@property NSDictionary *pixelBufferAuxAttributes;
83
91-(id)initWithConnection:(R5Connection *) conn;
92
98-(void)play:(NSString *)streamName;
99
107- (void)play:(NSString *)streamName withHardwareAcceleration:(BOOL)hw;
108
115- (void)play:(NSString *)streamName withForcedRGBDecode:(BOOL)forceRGB;
116
127-(void)publish:(NSString *)streamName type:(enum R5RecordType)type;
128
132-(void) stop;
133
137-(void) emptyPublishQueue;
138
144- (AVCaptureVideoPreviewLayer*) getPreviewLayer;
145
151-(void) attachAudio:(R5Microphone *)microphone;
152
158-(void) attachVideo:(R5VideoSource *)camera;
159
168-(enum R5StreamMode) mode;
169
176-(void)send:(NSString*)methodName withParam:(NSString*)param;
177
183-(r5_stats*) getDebugStats;
184
190-(R5VideoSource *) getVideoSource;
191
197-(R5Microphone*) getMicrophone;
198
205-(CVPixelBufferRef)getStreamPixelBuffer;
206
212-(void *)getStreamImageBytes;
213
219-(UIImage *) getStreamImage;
220
227- (r5_stream_format)getStreamFormat;
228
232-(void)updateStreamMeta;
233
250-(void)setFrameListener:(void (^)(void *, enum r5_stream_format, int, int, int))listenerBlock;
251
262-(void)setPlaybackAudioHandler:(void (^)(uint8_t *, int, double))handlerBlock;
263
264-(void)recordWithName:(NSString*)fileName;
265-(void)recordWithName:(NSString*)fileName withProps:(NSDictionary*)properties;
266
267-(void)endLocalRecord;
268
272-(void)deactivate_display;
273-(void)activate_display;
274
275- (BOOL)usesHardwareAcceleration;
276
277@end
278
279
284@protocol R5StreamDelegate <NSObject>
285
316-(void)onR5StreamStatus:(R5Stream *)stream withStatus:(int) statusCode withMessage:(NSString*)msg;
317
318@end
r5_stream_format
Definition: global.h:162
Controller Object for R5Stream and R5Microphones. A shared instance is used unless otherwise defined ...
Definition: R5AudioController.h:28
The main connection class for R5Pro. This establishes the connection to the server....
Definition: R5Connection.h:20
R5Microphone encapsulates an AVCaptureDevice and provides data to the R5Stream for publishing.
Definition: R5Camera.h:46
The main stream class of Red5Pro. Utilizes the R5Connection to connect and communicate with a server ...
Definition: R5Stream.h:43
BOOL pauseAudio
Definition: R5Stream.h:72
R5AudioController * audioController
Definition: R5Stream.h:51
NSObject * client
Definition: R5Stream.h:67
BOOL pauseVideo
Definition: R5Stream.h:77
NSObject< R5StreamDelegate > * delegate
Definition: R5Stream.h:62
The video source provides all video frames to the encoder for transmission over the socket.
Definition: R5VideoSource.h:24
Delegate for handling R5Stream events.
Definition: R5Stream.h:284
Definition: global.h:227