Package org.red5.codec
Interface IAudioStreamCodec
- All Known Implementing Classes:
AACAudio
,AbstractAudio
,AC3Audio
,EAC3Audio
,ExtendedAudio
,FLACAudio
,MP3Audio
,OpusAudio
,SpeexAudio
,ULAWAudio
public interface IAudioStreamCodec
Represents an Audio codec and its associated decoder configuration.
- Author:
- Paul Gregoire (mondain@gmail.com)
-
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, boolean amf) Add audio data with a time stamp and a flag identifying the content as AMF or not.boolean
canHandleData
(org.apache.mina.core.buffer.IoBuffer data) Returns true if the codec knows how to handle the passed stream data.default int
Returns the number of channels for the codec.getCodec()
getCodec.default org.apache.mina.core.buffer.IoBuffer
Returns information used to configure the decoder.default AvMultitrackType
Returns the multitrack type for the codec.getName()
getName.default AudioPacketType
Returns the packet type for the codec.default int
Returns the sample rate for the codec.default int
Returns the sample size in bits for the codec.default int
Returns the track id.default boolean
Returns true if the codec is enhanced.default boolean
isSigned()
Returns whether the codec is signed or not.void
reset()
Reset the codec to its initial state.default void
setTrackId
(int trackId) Sets the track id.
-
Method Details
-
getCodec
AudioCodec getCodec()getCodec.
- Returns:
- the codec type.
-
getName
String getName()getName.
- Returns:
- the name of the audio codec.
-
reset
void reset()Reset the codec to its initial state. -
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 error.
-
addData
boolean addData(org.apache.mina.core.buffer.IoBuffer data, int timestamp, boolean amf) Add audio 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
-
getDecoderConfiguration
default org.apache.mina.core.buffer.IoBuffer getDecoderConfiguration()Returns information used to configure the decoder.- Returns:
- the data for decoder setup.
-
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
-
getPacketType
Returns the packet type for the codec.- Returns:
- the packet type
-
getSampleRate
default int getSampleRate()Returns the sample rate for the codec.- Returns:
- sample rate, default is 48000
-
getSampleSizeInBits
default int getSampleSizeInBits()Returns the sample size in bits for the codec.- Returns:
- sample size in bits, default is 16
-
getChannels
default int getChannels()Returns the number of channels for the codec.- Returns:
- number of channels, default is 2
-
isSigned
default boolean isSigned()Returns whether the codec is signed or not.- Returns:
- true if signed, false otherwise
-
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
-