Package org.red5.server.stream.consumer
Class ConnectionConsumer
java.lang.Object
org.red5.server.stream.consumer.ConnectionConsumer
- All Implemented Interfaces:
IConsumer
,IMessageComponent
,IPipeConnectionListener
,IPushableConsumer
public class ConnectionConsumer
extends Object
implements IPushableConsumer, IPipeConnectionListener
RTMP connection consumer.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Channel
Audio channelprivate int
Chunk size.private AtomicBoolean
Whether or not the chunk size has been sent.private RTMPConnection
Connection objectprivate Channel
Data channelstatic final String
Connection consumer class nameprivate static final org.slf4j.Logger
private Channel
Video channel -
Constructor Summary
ConstructorsConstructorDescriptionConnectionConsumer
(Channel videoChannel, Channel audioChannel, Channel dataChannel) Create connection consumer without an RTMP connection.ConnectionConsumer
(RTMPConnection conn, Channel videoChannel, Channel audioChannel, Channel dataChannel) Create RTMP connection consumer for given connection and channels. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
Close all the channelsvoid
onOOBControlMessage
(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) void
Pipe connection event handlervoid
pushMessage
(IPipe pipe, IMessage message) Pushes message through pipeprivate void
Send the chunk size
-
Field Details
-
log
private static final org.slf4j.Logger log -
KEY
Connection consumer class name -
conn
Connection object -
video
Video channel -
audio
Audio channel -
data
Data channel -
chunkSize
private int chunkSizeChunk size. Packets are sent chunk-by-chunk. -
chunkSizeSent
Whether or not the chunk size has been sent. This seems to be required for h264.
-
-
Constructor Details
-
ConnectionConsumer
public ConnectionConsumer(RTMPConnection conn, Channel videoChannel, Channel audioChannel, Channel dataChannel) Create RTMP connection consumer for given connection and channels.- Parameters:
conn
- RTMP connectionvideoChannel
- Video channelaudioChannel
- Audio channeldataChannel
- Data channel
-
ConnectionConsumer
Create connection consumer without an RTMP connection.- Parameters:
videoChannel
- video channelaudioChannel
- audio channeldataChannel
- data channel
-
-
Method Details
-
pushMessage
Pushes message through pipe- Specified by:
pushMessage
in interfaceIPushableConsumer
- Parameters:
pipe
- Pipemessage
- Message
-
onPipeConnectionEvent
Pipe connection event handler- Specified by:
onPipeConnectionEvent
in interfaceIPipeConnectionListener
- Parameters:
event
- Pipe connection event
-
onOOBControlMessage
- Specified by:
onOOBControlMessage
in interfaceIMessageComponent
- Parameters:
source
- Message component sourcepipe
- Connection pipeoobCtrlMsg
- Out-of-band control message
-
sendChunkSize
private void sendChunkSize()Send the chunk size -
closeChannels
private void closeChannels()Close all the channels
-