Package org.red5.codec
Interface IVideoStreamCodec
- All Known Subinterfaces:
IEnhancedRTMPVideoCodec
- All Known Implementing Classes:
AbstractVideo
,AV1Video
,AVCVideo
,HEVCVideo
,MPEG1Video
,ScreenVideo
,ScreenVideo2
,SorensonVideo
,VP8Video
,VP9Video
public interface IVideoStreamCodec
Represents a Video codec and its associated decoder configuration.
- Author:
- mondain
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
Holder for video frame data. -
Field Summary
Fields -
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
addData
(org.apache.mina.core.buffer.IoBuffer data, int timestamp, boolean amf) Add video data with a time stamp and a flag identifying the content as AMF or not.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.getCodec()
getCodec.default org.apache.mina.core.buffer.IoBuffer
Returns information used to configure the decoder.default VideoFrameType
Returns the frame type for the codec.getInterframe
(int index) Gets data of interframe with the specified index.org.apache.mina.core.buffer.IoBuffer
Returns keyframe data.Returns all the keyframe data.default AvMultitrackType
Returns the multitrack type for the codec.getName()
getName.int
Returns the number of interframes collected from last keyframe.default VideoPacketType
Returns the packet type for the codec.default int
Returns the track id.default boolean
Returns true if the codec is enhanced.void
reset()
Reset the codec to its initial state.default void
setTrackId
(int trackId) Sets the track id.
-
Field Details
-
FLV_FRAME_KEY
static final byte FLV_FRAME_KEYFLV frame marker constant- See Also:
-
-
Method Details
-
getCodec
VideoCodec getCodec()getCodec.
- Returns:
- the codec type.
-
getName
String getName()getName.
- Returns:
- the name of the video codec.
-
reset
void reset()Reset the codec to its initial state. -
canDropFrames
boolean canDropFrames()Check if the codec supports frame dropping.- Returns:
- if the codec supports frame dropping.
-
canHandleData
boolean canHandleData(org.apache.mina.core.buffer.IoBuffer data) Returns true if the codec knows how to handle the passed stream data.- Parameters:
data
- some sample data to see if this codec can handle it- Returns:
- can this code handle the data.
-
addData
boolean addData(org.apache.mina.core.buffer.IoBuffer data) Update the state of the codec with the passed data.- Parameters:
data
- data to tell the codec we're adding- Returns:
- true for success. false for passing wrong video format or other error.
-
addData
boolean addData(org.apache.mina.core.buffer.IoBuffer data, int timestamp) Update the state of the codec with the passed data.- Parameters:
data
- data to tell the codec we're addingtimestamp
- time associated with the data- Returns:
- true for success. false for passing wrong video format or other error.
-
addData
boolean addData(org.apache.mina.core.buffer.IoBuffer data, int timestamp, boolean amf) Add video data with a time stamp and a flag identifying the content as AMF or not.- Parameters:
data
- aIoBuffer
objecttimestamp
- a intamf
- if true, data is in AMF format otherwise its most likely from non-AMF source like RTP- Returns:
- true if data is added and false otherwise
-
getKeyframe
org.apache.mina.core.buffer.IoBuffer getKeyframe()Returns keyframe data.- Returns:
- the data for a keyframe
-
getKeyframes
IVideoStreamCodec.FrameData[] getKeyframes()Returns all the keyframe data.- Returns:
- array of keyframe data
-
getDecoderConfiguration
default org.apache.mina.core.buffer.IoBuffer getDecoderConfiguration()Returns information used to configure the decoder.- Returns:
- the data for decoder setup
-
getNumInterframes
int getNumInterframes()Returns the number of interframes collected from last keyframe.- Returns:
- number of interframes
-
getInterframe
Gets data of interframe with the specified index.- Parameters:
index
- of interframe- Returns:
- data of the interframe or null if index is not valid
-
isEnhanced
default boolean isEnhanced()Returns true if the codec is enhanced.- Returns:
- true if enhanced and false otherwise
-
getMultitrackType
Returns the multitrack type for the codec.- Returns:
- the multitrack type
-
getFrameType
Returns the frame type for the codec.- Returns:
- the frame type
-
getPacketType
Returns the packet type for the codec.- Returns:
- the packet type
-
setTrackId
default void setTrackId(int trackId) Sets the track id.- Parameters:
trackId
- a int
-
getTrackId
default int getTrackId()Returns the track id.- Returns:
- track id
-