java.lang.Object | ||
↳ | org.opencdnunion.media.streamer.encoder.Encoder<I, O> | |
↳ | org.opencdnunion.media.streamer.encoder.VideoBufEncoderBase |
Base class of video encoder with ImgBufFrame as input.
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | VIDEO_CACHE_ITEM_SIZE | ||||||||||
int | VIDEO_CACHE_NUM |
[Expand]
Inherited Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected boolean | mFirstFrame | ||||||||||
protected FrameBufferCache | mFrameBufferCache | ||||||||||
protected VideoEncodeConfig | mOutConfig | ||||||||||
protected VideoEncodeConfig | mVideoEncodeConfig |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
VideoBufEncoderBase() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int |
getEncoderType()
Implement by child class, to define what type of encoder this instance is.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
abstract int |
doEncode(ImgBufFrame frame)
Encode an video frame.
| ||||||||||
void | doFormatChanged(Object format) | ||||||||||
int | doFrameAvailable(ImgBufFrame frame) | ||||||||||
void | doFrameDropped(ImgBufFrame frame) | ||||||||||
int | doStart(Object encodeConfig) | ||||||||||
abstract int |
doStart(VideoEncodeConfig config)
Start video encoder in encoding thread.
| ||||||||||
boolean |
onFrameAvailable(ImgBufFrame frame)
Give child class a chance to handle onFrameAvailable
| ||||||||||
void | sendEncodedPacket(ByteBuffer data, long dts, long pts, int flags) | ||||||||||
boolean |
updateEncodeFormat(Object src, Object dst)
Update encode format with input frame format.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Implement by child class, to define what type of encoder this instance is.
Encode an video frame.
frame | video frame to be encoded. |
---|
Start video encoder in encoding thread.
config | video encode configuration. |
---|
Give child class a chance to handle onFrameAvailable
frame | frame |
---|
Update encode format with input frame format.
src | input frame format |
---|---|
dst | encode format to be updated |