|
| R5Camera (Camera camera, int preferedWidth, int preferedHeight) |
|
int | ALIGN (int number, int size) |
|
void | onPreviewFrame (byte[] data, Camera camera) |
|
void | setPreviewDisplay (SurfaceHolder holder) |
|
void | startEncoding () |
|
void | stopEncoding () |
|
Camera | getCamera () |
|
void | setCamera (Camera camera) |
|
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 Camera.Size | getBestPreviewSize (final int width, final int height, Camera.Parameters parameters) |
|
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) |
|
R5Camera / R5VideoSource class hierarchy demonstrates how Red5 Professional enables rapid streaming development.
. The baseclass handles the preparation of the hardware encoder, and the subclass provides the source images used for streaming.
Extenders of Red5VideoSource must provide YV12 image data in byte buffers. You can also override the size used in the 'open' method.
initSource(){
setFrameType(ImageFormat.YV12);
width=320;
height=240;
}
At runtime, acquire the YV12 image data, and convert it to the required MediaCodec frame type.
prepareFrame(inptYV12, output);
To send a frame, encode it.
encode(output, nanoTime, false);//if the frame size changes, reset must be true.
- Author
- Andy Shaules