The main stream class of Red5Pro. Utilizes the R5Connection to connect and communicate with a server instance.
More...
#import <R5Stream.h>
Inherits NSObject.
The main stream class of Red5Pro. Utilizes the R5Connection to connect and communicate with a server instance.
◆ attachAudio:
Attach an audio input to this stream for publishing
- Parameters
-
microphone | The microphone to stream |
◆ attachVideo:
Attach a video input to this stream for publishing
- Parameters
-
camera | The video source to stream |
◆ deactivate_display
- (void) deactivate_display |
|
|
|
Pauses processing of video frames
◆ emptyPublishQueue
- (void) emptyPublishQueue |
|
|
|
Request to empty any queued packets for broadcast.
◆ getDebugStats
Get the current running stats for this stream
- Returns
- an r5_stats object for this stream
◆ getMicrophone
Get the currently attached audio source
- Returns
- the attached audio source or nil
◆ getPreviewLayer
- (AVCaptureVideoPreviewLayer *) getPreviewLayer |
|
|
|
Get the video preview layer for publising
- Returns
- the video preview layer if it exists
◆ getStreamFormat
Returns the format that the subscriber stream has been decoded to. *Use this APi in conjunction with getStreamImageBytes
to determine format of bytes.
- Returns
- The format from the enumerated r5_stream_format.
◆ getStreamImage
- (UIImage *) getStreamImage |
|
|
|
Get an image of the current stream
- Returns
- a UIImage containing the stream input/output
◆ getStreamImageBytes
- (void *) getStreamImageBytes |
|
|
|
Returns the raw image bytes of a subscriber stream.
- Returns
- The raw image bytes.
◆ getStreamPixelBuffer
- (CVPixelBufferRef) getStreamPixelBuffer |
|
|
|
Returns CVPixelBufferRef accessible upon hardware accelerated decoding. *Only returned for subscriber if specified playback as hardware accelerated.
- Returns
- CVPixelBufferRef
◆ getVideoSource
Get the currently attached video stream
- Returns
- the attached video source or nil
◆ initWithConnection:
Initialize the stream. The connection is not established.
- Parameters
-
conn | The connection to utilize for the stream |
- Returns
- a new Stream
◆ mode
- (enum R5StreamMode) mode |
|
|
|
Get the current streaming mode of the stream
- Returns
- an R5Stream mode that will be one of the following:
- r5_stream_mode_idle
- r5_stream_mode_streaming
- r5_stream_mode_publishing
◆ play:
- (void) play: |
|
(NSString *) |
streamName |
|
Subscribe to an existing stream
- Parameters
-
streamName | name of the stream to subscribe to |
◆ play:withForcedRGBDecode:
- (void) play: |
|
(NSString *) |
streamName |
withForcedRGBDecode: |
|
(BOOL) |
forceRGB |
|
|
| |
Subscribe to an existing stream and force RGB Software Scalar in decode.
- Parameters
-
streamName | name of the stream to subscribe too |
forceRGB | flag to turn on software decoding frames to RGB pixel format (if false - default - decodes to YUV planar). |
◆ play:withHardwareAcceleration:
- (void) play: |
|
(NSString *) |
streamName |
withHardwareAcceleration: |
|
(BOOL) |
hw |
|
|
| |
Subscribe to an existing stream and request hardware acceleration in decode. Decodes frame to CVPixelBuffer.
- Parameters
-
streamName | name of the stream to subscribe too |
hw | flag to turn on hardware acceleration in decode process |
◆ publish:type:
- (void) publish: |
|
(NSString *) |
streamName |
type: |
|
(enum R5RecordType) |
type |
|
|
| |
Publish to a new stream
- Parameters
-
streamName | Unique name for this stream |
type | R5RecordType type of publishing
- R5RecordTypeLive - No recording
- R5RecordTypeRecord - Record a new file
- R5RecordTypeAppend - Append the recording to an existing recording if available
|
◆ send:withParam:
- (void) send: |
|
(NSString *) |
methodName |
withParam: |
|
(NSString *) |
param |
|
|
| |
Send a stream RPC to the server. Only available to publishing streams.
- Parameters
-
methodName | name of the method to invoke on the server |
param | parameter to pass to the server for this message. |
◆ setFrameListener:
- (void) setFrameListener: |
|
(void(^)(void *, enum r5_stream_format, int, int, int)) |
listenerBlock |
|
Sets a block to receive frame data from the renderer, Use R5VideoView instead where possible
- Parameters
-
listenerBlock | The block of code to recieve the frame data |
The parameters that the block receives are: void* A pointer to an array of color data. Note, this pointer is managed by the SDK, freeing it will likely cause problems. Depending on the format, you will need to handle the data appropriately: enum r5_stream_format The pixel format of the data. (1) r5_stream_format_rgb: RGB format - three values per pixel. (2) r5_stream_format_yuv_planar: YUV420p, 3 planes - returned data is an array of 3. (3) r5_stream_format_yuv_biplanar: YUV420v, 2 planes - returned data is CVPixelBuffer. int The size of the image data. int The width of the image described by the array. int The height of the image described by the array.
◆ setPlaybackAudioHandler:
- (void) setPlaybackAudioHandler: |
|
(void(^)(uint8_t *, int, double)) |
handlerBlock |
|
Sets a handler to receive and optionally manipulate the audio stream data coming in for playback before sending to output.
- Parameters
-
handlerBlock | The block of code to recieve the audio data |
The parameters that the block receives are: uint8_t* A pointer to an array of samples of raw audio. This serves as both input and output, any modification to the array will modify the audio sent to the speakers. Note, this pointer is managed by the SDK, freeing it will likely cause problems. int The number of samples in the array - each sample is a single uint8 value. double The time since the stream began playing audio, in milliseconds.
◆ stop
Stop all publishing and subscribing on this stream
◆ updateStreamMeta
- (void) updateStreamMeta |
|
|
|
Send updated stream meta information
◆ audioController
Audio Controller for Stream playback. Defaults to shared instance.
◆ client
Client object that will receive all RPC callbacks.
◆ connection
The connection that the stream is communicating with.
◆ delegate
The stream delegate to receive events for this connection.
◆ pauseAudio
Flag to "mute" audio for Publishing.
◆ pauseVideo
Flag to "mute" video for Publishing.
The documentation for this class was generated from the following file:
- /Users/ankitashankhdhar/Documents/Red5/Git/infrared5/red5pro-core-streaming-library/red5streaming/src/R5Stream.h