The main stream class of Red5 Pro. Utilizes the #R5Connection to connect and communicate with a server instance.
More...
|
| R5Stream (R5Connection connection) |
|
void | restrainAudio (boolean restrain) |
|
void | restrainVideo (boolean restrain) |
|
StreamMode | getStreamMode () |
|
void | attachMic (R5Microphone mic) |
|
void | play (final String streamName) |
|
void | play (final String streamName, final boolean useHardwareAcceleration) |
|
void | playWithForcedRGBDecode (final String streamName) |
|
R5Microphone | getAudioSource () |
|
boolean | getNetworkIsReady () |
|
void | publish (String streamName, RecordType recordType) |
|
void | updateStreamMeta () |
|
void | stop () |
|
void | setView (SurfaceView view) |
|
R5VideoSource | getVideoSource () |
|
void | beginLocalRecording (Context context, String fileName) |
|
void | beginLocalRecordingWithProperties (Context context, String fileName, Map< String, Object > props) |
|
void | endLocalRecording () |
|
void | attachCamera (R5VideoSource videosource) |
|
void | setListener (R5ConnectionListener listener) |
|
R5ConnectionListener | getListener () |
|
void | removeListener () |
|
synchronized void | sendBlankAudio (SDPTrack track, long withRTPTime, int type) |
|
synchronized void | write (IDataSource source, byte[] outData, int startPosition, int length, long withRTPTime, int type) |
|
synchronized void | write (IDataSource source, byte[] outData, int startPosition, int length, long withRTPTime, int type, boolean mBit) |
|
void | setFrameListener (R5FrameListener frameListener) |
|
void | setPlaybackAudioHandler (R5PlaybackAudioHandler playbackAudioHandler) |
|
Bitmap | getStreamImage () |
|
R5Stats | getStats () |
|
native void | setLogLevel (int level) |
| Set the logging level for Red5 Pro.
|
|
void | send (String method, Map< Object, Object > parameters) |
|
void | setScaleMode (int _mode) |
|
int | getScaleMode () |
|
native String | getDebugInfo () |
| Return debug information for this stream.
|
|
native double | getBufferedTime () |
|
native double | getBitrateSmoothed () |
|
native double | getStatsBufferedTime () |
|
native int | getOrientationMetadata () |
|
|
static int | LOG_LEVEL_DEBUG = 0 |
|
static int | LOG_LEVEL_INFO = 1 |
|
static int | LOG_LEVEL_WARN = 2 |
|
static int | LOG_LEVEL_ERROR = 3 |
|
static final String | VideoBitrateKey = "R5VideoBitrateLocalRecord" |
|
static final String | AudioBitrateKey = "R5AudioBitrateLocalRecord" |
|
static final String | RecordDirectoryKey = "R5RecordDirectoryLocalRecord" |
|
static final String | RecordMediaScanKey = "R5RecordMediaScanLocalRecord" |
|
|
int | recordTypeToInt (RecordType type) |
|
RecordType | intToRecordType (int type) |
|
void | onSdkLicenseVerificationSubscriber (int status, String streamName) |
|
void | onSdkLicenseVerificationPublisher (int status, String streamName, int recordType) |
|
void | onStreamEvent (int eventCode) |
|
void | onConfigurationStatus (int status, String msg) |
|
void | onRPCCallback (String methodName, String paramMap) |
|
void | onPublisherFlushEmptyCallback (String message) |
|
void | receiveFrameBytes (byte[] bytes, int width, int height) |
|
void | receiveFrameData (Object data, int format, int width, int height) |
|
void | receiveAudioBytes (short[] bytes, int size, double streamTimeMilliseconds) |
|
|
boolean | sdkValidationFailed = false |
|
The main stream class of Red5 Pro. Utilizes the #R5Connection to connect and communicate with a server instance.
◆ R5Stream()
com.red5pro.streaming.R5Stream.R5Stream |
( |
R5Connection |
connection | ) |
|
|
inline |
Create a new R5Stream instance
- Parameters
-
connection | The connection to utilize for the stream |
◆ attachCamera()
void com.red5pro.streaming.R5Stream.attachCamera |
( |
R5VideoSource |
videosource | ) |
|
|
inline |
Attach a video source to be published on the stream
- Parameters
-
videosource | Video source to stream |
◆ attachMic()
void com.red5pro.streaming.R5Stream.attachMic |
( |
R5Microphone |
mic | ) |
|
|
inline |
Attach an Audio Input for this stream
- Parameters
-
mic | The microphone to stream |
◆ beginLocalRecording()
void com.red5pro.streaming.R5Stream.beginLocalRecording |
( |
Context |
context, |
|
|
String |
fileName |
|
) |
| |
|
inline |
Trigger a recording of the stream to be saved to device At API 16 or 17, this recording can only fill half of the available file size. Later apis do not have that restriction.
- Parameters
-
context | The application's context - required to access the file system |
fileName | The name of the file to write |
◆ beginLocalRecordingWithProperties()
void com.red5pro.streaming.R5Stream.beginLocalRecordingWithProperties |
( |
Context |
context, |
|
|
String |
fileName, |
|
|
Map< String, Object > |
props |
|
) |
| |
|
inline |
Trigger a recording of the stream to be saved to device At API 16 or 17, this recording can only fill half of the available file size. Later apis do not have that restriction.
- Parameters
-
context | The application's context - required to access the file system |
fileName | The name of the file to write |
props | A collection of specific properties for recording, currently limited to Video and Audio bit rates |
◆ endLocalRecording()
void com.red5pro.streaming.R5Stream.endLocalRecording |
( |
| ) |
|
|
inline |
Call to stop recording of the stream to the device
◆ getAudioSource()
R5Microphone com.red5pro.streaming.R5Stream.getAudioSource |
( |
| ) |
|
|
inline |
Get the audio source attached to this stream
- Returns
- current attached audio source or NULL
◆ getNetworkIsReady()
boolean com.red5pro.streaming.R5Stream.getNetworkIsReady |
( |
| ) |
|
|
inline |
Get if network connection successfully established
- Returns
- connection is established
◆ getStats()
R5Stats com.red5pro.streaming.R5Stream.getStats |
( |
| ) |
|
|
inline |
Retrieves data about the stream for debugging and health monitoring
- Returns
- An object containing data about the stream
◆ getStreamImage()
Bitmap com.red5pro.streaming.R5Stream.getStreamImage |
( |
| ) |
|
|
inline |
Get a bitmap representation of the current stream
- Returns
- Sampled image of the stream
◆ getStreamMode()
StreamMode com.red5pro.streaming.R5Stream.getStreamMode |
( |
| ) |
|
|
inline |
Get Current mode of the stream
- Returns
- the current StreamMode
◆ getVideoSource()
Get the publishing video source for the stream
- Returns
- The publishing video source
◆ onConfigurationStatus()
void com.red5pro.streaming.R5Stream.onConfigurationStatus |
( |
int |
status, |
|
|
String |
msg |
|
) |
| |
|
inlineprotected |
Configuration event handling
- Parameters
-
status | Status code (R5ConnectionEvent) of the event |
msg | String message of the event |
◆ onPublisherFlushEmptyCallback()
void com.red5pro.streaming.R5Stream.onPublisherFlushEmptyCallback |
( |
String |
message | ) |
|
|
inlineprotected |
Publisher Buffer Flush Empty callback from JNI. This is used to flush all possible queued packets out the connection before disconnect.
◆ onRPCCallback()
void com.red5pro.streaming.R5Stream.onRPCCallback |
( |
String |
methodName, |
|
|
String |
paramMap |
|
) |
| |
|
inlineprotected |
RPC Callback from JNI
- Parameters
-
methodName | Name of method to be called |
paramMap | Parameter map of all paremeters |
◆ play() [1/2]
void com.red5pro.streaming.R5Stream.play |
( |
final String |
streamName | ) |
|
|
inline |
Subscribe to an existing stream
- Parameters
-
streamName | name of the stream to subscribe too. |
◆ play() [2/2]
void com.red5pro.streaming.R5Stream.play |
( |
final String |
streamName, |
|
|
final boolean |
useHardwareAcceleration |
|
) |
| |
|
inline |
Subscribe to an existing stream
- Parameters
-
streamName | name of the stream to subscribe too. |
useHardwareAcceleration | flag to use hardware acceleration in decoding stream. |
◆ playWithForcedRGBDecode()
void com.red5pro.streaming.R5Stream.playWithForcedRGBDecode |
( |
final String |
streamName | ) |
|
|
inline |
Subscribe to an existing stream force non-hardware accelerated RGB scalar to decode.
- Parameters
-
◆ publish()
void com.red5pro.streaming.R5Stream.publish |
( |
String |
streamName, |
|
|
RecordType |
recordType |
|
) |
| |
|
inline |
Publish to a new stream
- Parameters
-
streamName | Unique name for this stream |
recordType | type of publishing
- RecordType.Live - No recording
- RecordType.Record - Record a new file
- RecordType.Append - Append the recording to an existing recording if available
|
◆ receiveFrameBytes()
void com.red5pro.streaming.R5Stream.receiveFrameBytes |
( |
byte[] |
bytes, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
inlineprotected |
@Deprecated
Receives frame data from the GL renderer
- Parameters
-
bytes | The frame data from renderer as RGB byte array |
◆ receiveFrameData()
void com.red5pro.streaming.R5Stream.receiveFrameData |
( |
Object |
data, |
|
|
int |
format, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
inlineprotected |
Receives frame data from the GL renderer
- Parameters
-
data | Object Depending on the requested decode option, describes the current frame that would be output to a view (if present) format(1). Array of RGB data - three bytes per pixel format(2). YUV420p - Array of byte array, length of 3 - Y, Cb (U), Cr (V) format(3). YUV420v - Array of byte array, lenght of 2 - Y, CbCr (UV) |
format | The R5StreamFormat enum value. |
width | The width of the image provided by bytes. |
height | The height of the image provided by bytes. |
◆ removeListener()
void com.red5pro.streaming.R5Stream.removeListener |
( |
| ) |
|
|
inline |
Remove the current R5ConnectionListener to stop handling events
◆ restrainAudio()
void com.red5pro.streaming.R5Stream.restrainAudio |
( |
boolean |
restrain | ) |
|
|
inline |
Set flag to "mute" audio during Publishing session.
- Parameters
-
◆ restrainVideo()
void com.red5pro.streaming.R5Stream.restrainVideo |
( |
boolean |
restrain | ) |
|
|
inline |
Set flag to "mute" video during Publishing session.
- Parameters
-
◆ send()
void com.red5pro.streaming.R5Stream.send |
( |
String |
method, |
|
|
Map< Object, Object > |
parameters |
|
) |
| |
|
inline |
Invoke a method on all subscribing client with a composite string of key-values pairs. Publisher Only.
- Parameters
-
method | The name of the method to invoke on all subscribing clients. |
parameters | The map of key-value pairs that will be concatenated each with '=' and delimited with ';'. e.g., "foo=bar;baz=qux;" |
◆ setFrameListener()
void com.red5pro.streaming.R5Stream.setFrameListener |
( |
R5FrameListener |
frameListener | ) |
|
|
inline |
Sets a listener to receive frame data from the renderer, Use R5VideoView instead where possible
- Parameters
-
frameListener | Object to receive frame data |
R5FrameListener.onBytesReceived has these three paramaters: byte[] bytes - Array of RGB data - three bytes per pixel - which describes the current frame that would be output to a view (if present) int width - The width of the image provided by bytes. int height - The height of the image provided by bytes.
◆ setListener()
Set the connection status listener to handle connection events
- Parameters
-
listener | Listener to handle events |
◆ setPlaybackAudioHandler()
Sets a handler to receive and optionally manipulate the audio stream data coming in for playback before sending to output. Note, this now functions identically to the function of the same name in R5AudioController
- Parameters
-
playbackAudioHandler | Object which will receive the callback containing the outgoing array of audio samples. |
R5PlaybackAudioHandler.processAudioPlayback has these three paramaters: byte[] bytes - 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 int size - The number of samples in the array - analogous to using bytes.length double streamTimeMilliSeconds - The time since the stream began playing audio, in milliseconds
◆ setView()
void com.red5pro.streaming.R5Stream.setView |
( |
SurfaceView |
view | ) |
|
|
inline |
Set the surface to render the publisher preview on
- Parameters
-
view | View to render publisher on |
◆ stop()
void com.red5pro.streaming.R5Stream.stop |
( |
| ) |
|
|
inline |
Stop all publishing and subscribing on this stream
◆ updateStreamMeta()
void com.red5pro.streaming.R5Stream.updateStreamMeta |
( |
| ) |
|
|
inline |
Make call to send out metadata.
◆ write()
synchronized void com.red5pro.streaming.R5Stream.write |
( |
IDataSource |
source, |
|
|
byte[] |
outData, |
|
|
int |
startPosition, |
|
|
int |
length, |
|
|
long |
withRTPTime, |
|
|
int |
type |
|
) |
| |
|
inline |
Write a packet on the stream (for internal use)
- Parameters
-
source | DataSource with full SDP information |
outData | Data to write on the stream |
startPosition | offset to start at |
length | Length of data to write |
withRTPTime | Timestamp (ms) to write on stream |
◆ client
Object com.red5pro.streaming.R5Stream.client |
Client object that will receive all RPC callbacks.
The documentation for this class was generated from the following file:
- /Users/ankitashankhdhar/Documents/Red5/Git/infrared5/red5pro-core-streaming-library/android/src/main/java/com/red5pro/streaming/R5Stream.java