Red5Pro IOS Client SDK

 7.3.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 
22 enum R5RecordType{
23  R5RecordTypeLive,
24  R5RecordTypeRecord,
25  R5RecordTypeAppend
26 };
27 
28 enum R5StreamMode{
29  r5_stream_mode_idle,
30  r5_stream_mode_streaming,
31  r5_stream_mode_publishing
32 
33 };
34 
35 extern NSString *const R5RecordVideoBitRateKey;
36 extern NSString *const R5RecordAudioBitRateKey;
37 extern NSString *const R5RecordAlbumName;
38 
42 @interface R5Stream : NSObject{
43 
44 
45 }
46 
51 
52 
56 @property (readonly) R5Connection *connection;
57 
61 @property NSObject<R5StreamDelegate> *delegate;
62 
66 @property NSObject *client;
67 
71 @property BOOL pauseAudio;
72 
76 @property BOOL pauseVideo;
77 
78 // @Deprecated
79 @property CVPixelBufferPoolRef pixelBufferPool;
80 // @Deprecated
81 @property NSDictionary *pixelBufferAuxAttributes;
82 
90 -(id)initWithConnection:(R5Connection *) conn;
91 
97 -(void)play:(NSString *)streamName;
98 
106 - (void)play:(NSString *)streamName withHardwareAcceleration:(BOOL)hw;
107 
114 - (void)play:(NSString *)streamName withForcedRGBDecode:(BOOL)forceRGB;
115 
126 -(void)publish:(NSString *)streamName type:(enum R5RecordType)type;
127 
131 -(void) stop;
132 
136 -(void) emptyPublishQueue;
137 
143 - (AVCaptureVideoPreviewLayer*) getPreviewLayer;
144 
150 -(void) attachAudio:(R5Microphone *)microphone;
151 
157 -(void) attachVideo:(R5VideoSource *)camera;
158 
167 -(enum R5StreamMode) mode;
168 
175 -(void)send:(NSString*)methodName withParam:(NSString*)param;
176 
183 
190 
197 
204 -(CVPixelBufferRef)getStreamPixelBuffer;
205 
211 -(void *)getStreamImageBytes;
212 
218 -(UIImage *) getStreamImage;
219 
227 
231 -(void)updateStreamMeta;
232 
249 -(void)setFrameListener:(void (^)(void *, enum r5_stream_format, int, int, int))listenerBlock;
250 
261 -(void)setPlaybackAudioHandler:(void (^)(uint8_t *, int, double))handlerBlock;
262 
263 -(void)recordWithName:(NSString*)fileName;
264 -(void)recordWithName:(NSString*)fileName withProps:(NSDictionary*)properties;
265 
266 -(void)endLocalRecord;
267 
271 -(void)deactivate_display;
272 -(void)activate_display;
273 
274 - (BOOL)usesHardwareAcceleration;
275 
276 @end
277 
278 
283 @protocol R5StreamDelegate <NSObject>
284 
315 -(void)onR5StreamStatus:(R5Stream *)stream withStatus:(int) statusCode withMessage:(NSString*)msg;
316 
317 @end
void updateStreamMeta()
R5AudioController * audioController
Definition: R5Stream.h:50
void deactivate_display()
R5VideoSource * getVideoSource()
R5Microphone * getMicrophone()
void * getStreamImageBytes()
UIImage * getStreamImage()
R5Microphone encapsulates an AVCaptureDevice and provides data to the R5Stream for publishing...
Definition: R5Camera.h:45
Definition: global.h:227
The main connection class for R5Pro. This establishes the connection to the server. Used by R5Stream as the communication layer.
Definition: R5Connection.h:19
r5_stream_format
Definition: global.h:162
The main stream class of Red5Pro. Utilizes the R5Connection to connect and communicate with a server ...
Definition: R5Stream.h:42
void emptyPublishQueue()
NSObject * client
Definition: R5Stream.h:66
Controller Object for R5Stream and R5Microphones. A shared instance is used unless otherwise defined ...
Definition: R5AudioController.h:28
Delegate for handling R5Stream events.
Definition: R5Stream.h:283
R5Connection * connection
Definition: R5Stream.h:56
enum R5StreamMode mode()
void stop()
NSObject< R5StreamDelegate > * delegate
Definition: R5Stream.h:61
AVCaptureVideoPreviewLayer * getPreviewLayer()
r5_stream_format getStreamFormat()
r5_stats * getDebugStats()
The video source provides all video frames to the encoder for transmission over the socket...
Definition: R5VideoSource.h:23
BOOL pauseVideo
Definition: R5Stream.h:76
BOOL pauseAudio
Definition: R5Stream.h:71
CVPixelBufferRef getStreamPixelBuffer()