Red5Pro Android Client SDK

 6.0.0
Core SDK for Android
com.red5pro.streaming.source.R5VideoSource Class Referenceabstract

Inherits IDataSource.

Inherited by com.red5pro.streaming.source.R5Camera, and com.red5pro.streaming.source.R5Camera2.

Public Member Functions

void close ()
 
boolean isMuted ()
 
void setMuted (boolean isMuted)
 
void setOrientation (int rotation)
 
void InitSubSource (int localBitrate)
 
synchronized void encode (byte[] input, long time, boolean reset)
 
boolean drain ()
 
long getLastEncodeTime ()
 
void RequestKeyFrame ()
 
void setFrameType (int frameType)
 
void prepareFrame (byte[] input, byte[] output)
 
int getFrameSize ()
 
IDataSink getClient ()
 
void setClient (IDataSink client)
 
void setSDPTrack (SDPTrack track)
 
SDPTrack getSDPTrack ()
 
String getName ()
 
int getFramerate ()
 
void setFramerate (int framerate)
 
int getKeyFramerate ()
 
void setKeyFramerate (int keyFramerate)
 
int getBitrate ()
 
void setBitrate (int bitrate)
 
int getWidth ()
 
int getHeight ()
 
float getDisplayAspect ()
 
int getOrientation ()
 
void setWidth (int width)
 
void setHeight (int height)
 
void setFrameListener (R5FrameListener listener)
 
abstract void setPreviewDisplay (SurfaceHolder holder)
 
abstract void startEncoding ()
 
abstract void stopEncoding ()
 

Static Public Member Functions

static byte[] YV12toYUV420Planar (byte[] input, byte[] output, int width, int height)
 
static byte[] SwapYV12toI420 (byte[] input, byte[] output, int width, int height)
 
static byte[] YV12ToSemiPlanar (byte[] input, byte[] output, int width, int height)
 
static byte[] YV12toNV21 (final byte[] input, final byte[] output, final int width, final int height)
 
static byte[] YV12toYUV420PackedSemiPlanar (final byte[] input, final byte[] output, final int width, final int height)
 

Protected Attributes

boolean customFrameHandled = false
 

Detailed Description

Video

Member Function Documentation

void com.red5pro.streaming.source.R5VideoSource.close ( )
inline

Release the media codec.

boolean com.red5pro.streaming.source.R5VideoSource.drain ( )
inline

We call drain before calling encode to free up delayed frames from the hardware.

Returns
synchronized void com.red5pro.streaming.source.R5VideoSource.encode ( byte[]  input,
long  time,
boolean  reset 
)
inline

After preparing a frame, encode it and send it to the network.

Parameters
input
timetimestamp, in microseconds
resettrue if Video size has changed since last call to encode. Reset is not needed in the very first call. It is used to change sizes mid-stream.
void com.red5pro.streaming.source.R5VideoSource.prepareFrame ( byte[]  input,
byte[]  output 
)
inline

Prepare the input image for the media codec. Before calling this, the frame type of the input color space must be set,yv12,yuv420p, etc.. Initial support for YV12 only.
setFrameType(ImageFormat.YV12);
prepareFrame(input, output);
encode(output, time, doReset);

Parameters
input
output
void com.red5pro.streaming.source.R5VideoSource.RequestKeyFrame ( )
inline

Request a keyframe from the device. API level 19+

void com.red5pro.streaming.source.R5VideoSource.setClient ( IDataSink  client)
inline

A publishing data sink to send packets through

Parameters
clientObject to drain into
void com.red5pro.streaming.source.R5VideoSource.setFrameType ( int  frameType)
inline
Parameters
ImageFormatframeType
setFrameType(ImageFormat.YV12);
Initial support for YV12 only.
void com.red5pro.streaming.source.R5VideoSource.setOrientation ( int  rotation)
inline

Set the display angle of rotation into the stream meta data for players to respond.

Parameters
rotation

The documentation for this class was generated from the following file: