Package org.red5.codec
Class AbstractVideo
java.lang.Object
org.red5.codec.AbstractVideo
- All Implemented Interfaces:
IVideoStreamCodec
,IoConstants
- Direct Known Subclasses:
AVCVideo
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.red5.codec.IVideoStreamCodec
IVideoStreamCodec.FrameData
-
Field Summary
Modifier and TypeFieldDescriptionprotected final CopyOnWriteArrayList<IVideoStreamCodec.FrameData>
Storage for key framesprotected int
Current timestamp for the stored keyframeFields inherited from interface org.red5.io.IoConstants
AVC_PACKET_TYPE_END_OF_SEQUENCE, AVC_PACKET_TYPE_NALU, AVC_PACKET_TYPE_SEQUENCE_HEADER, FLAG_CODEC_H263, FLAG_CODEC_SCREEN, FLAG_CODEC_VP6, FLAG_FORMAT_ADPCM, FLAG_FORMAT_MP3, FLAG_FORMAT_NELLYMOSER, FLAG_FORMAT_NELLYMOSER_8_KHZ, FLAG_FORMAT_RAW, FLAG_FRAMETYPE_DISPOSABLE, FLAG_FRAMETYPE_GENERATED_KEYFRAME, FLAG_FRAMETYPE_INFO, FLAG_FRAMETYPE_INTERFRAME, FLAG_FRAMETYPE_KEYFRAME, FLAG_RATE_11_KHZ, FLAG_RATE_22_KHZ, FLAG_RATE_44_KHZ, FLAG_RATE_48_KHZ, FLAG_RATE_5_5_KHZ, FLAG_SIZE_16_BIT, FLAG_SIZE_8_BIT, FLAG_TYPE_MONO, FLAG_TYPE_STEREO, INFO_PACKET_SEEK_END, INFO_PACKET_SEEK_START, MASK_SOUND_FORMAT, MASK_SOUND_RATE, MASK_SOUND_SIZE, MASK_SOUND_TYPE, MASK_VIDEO_CODEC, MASK_VIDEO_FRAMETYPE, TYPE_AUDIO, TYPE_ENCRYPTED, TYPE_ENCRYPTED_AUDIO, TYPE_ENCRYPTED_METADATA, TYPE_ENCRYPTED_VIDEO, TYPE_METADATA, TYPE_VIDEO
Fields inherited from interface org.red5.codec.IVideoStreamCodec
FLV_FRAME_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addData
(org.apache.mina.core.buffer.IoBuffer data) Update the state of the codec with the passed data.boolean
addData
(org.apache.mina.core.buffer.IoBuffer data, int timestamp) Update the state of the codec with the passed data.boolean
Check if the codec supports frame dropping.boolean
canHandleData
(org.apache.mina.core.buffer.IoBuffer data) Returns true if the codec knows how to handle the passed stream data.org.apache.mina.core.buffer.IoBuffer
Returns information used to configure the decoder.getInterframe
(int idx) Gets data of interframe with the specified index.org.apache.mina.core.buffer.IoBuffer
Returns keyframe data.Returns all the keyframe data.getName()
int
Returns the number of interframes collected from last keyframe.void
reset()
Reset the codec to its initial state.
-
Field Details
-
keyframeTimestamp
protected int keyframeTimestampCurrent timestamp for the stored keyframe -
keyframes
Storage for key frames
-
-
Constructor Details
-
AbstractVideo
public AbstractVideo()
-
-
Method Details
-
getName
- Specified by:
getName
in interfaceIVideoStreamCodec
- Returns:
- the name of the video codec.
-
reset
public void reset()Description copied from interface:IVideoStreamCodec
Reset the codec to its initial state.- Specified by:
reset
in interfaceIVideoStreamCodec
-
canDropFrames
public boolean canDropFrames()Description copied from interface:IVideoStreamCodec
Check if the codec supports frame dropping.- Specified by:
canDropFrames
in interfaceIVideoStreamCodec
- Returns:
- if the codec supports frame dropping.
-
canHandleData
public boolean canHandleData(org.apache.mina.core.buffer.IoBuffer data) Description copied from interface:IVideoStreamCodec
Returns true if the codec knows how to handle the passed stream data.- Specified by:
canHandleData
in interfaceIVideoStreamCodec
- Parameters:
data
- some sample data to see if this codec can handle it- Returns:
- can this code handle the data.
-
addData
public boolean addData(org.apache.mina.core.buffer.IoBuffer data) Description copied from interface:IVideoStreamCodec
Update the state of the codec with the passed data.- Specified by:
addData
in interfaceIVideoStreamCodec
- Parameters:
data
- data to tell the codec we're adding- Returns:
- true for success. false for error
-
addData
public boolean addData(org.apache.mina.core.buffer.IoBuffer data, int timestamp) Description copied from interface:IVideoStreamCodec
Update the state of the codec with the passed data.- Specified by:
addData
in interfaceIVideoStreamCodec
- Parameters:
data
- data to tell the codec we're addingtimestamp
- time associated with the data- Returns:
- true for success. false for error
-
getDecoderConfiguration
public org.apache.mina.core.buffer.IoBuffer getDecoderConfiguration()Description copied from interface:IVideoStreamCodec
Returns information used to configure the decoder.- Specified by:
getDecoderConfiguration
in interfaceIVideoStreamCodec
- Returns:
- the data for decoder setup
-
getKeyframe
public org.apache.mina.core.buffer.IoBuffer getKeyframe()Returns keyframe data.- Specified by:
getKeyframe
in interfaceIVideoStreamCodec
- Returns:
- the data for a keyframe
-
getKeyframes
Returns all the keyframe data.- Specified by:
getKeyframes
in interfaceIVideoStreamCodec
- Returns:
- array of keyframe data
-
getNumInterframes
public int getNumInterframes()Description copied from interface:IVideoStreamCodec
Returns the number of interframes collected from last keyframe.- Specified by:
getNumInterframes
in interfaceIVideoStreamCodec
- Returns:
- number of interframes
-
getInterframe
Description copied from interface:IVideoStreamCodec
Gets data of interframe with the specified index.- Specified by:
getInterframe
in interfaceIVideoStreamCodec
- Parameters:
idx
- of interframe- Returns:
- data of the interframe or null if index is not valid
-