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 ChannelAudio channelprivate intChunk size.private AtomicBooleanWhether or not the chunk size has been sent.private RTMPConnectionConnection objectprivate ChannelData channelstatic final StringConnection consumer class nameprivate static final org.slf4j.Loggerprivate ChannelVideo 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 voidClose all the channelsvoidonOOBControlMessage(IMessageComponent source, IPipe pipe, OOBControlMessage oobCtrlMsg) voidPipe connection event handlervoidpushMessage(IPipe pipe, IMessage message) Pushes message through pipeprivate voidSend 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:
pushMessagein interfaceIPushableConsumer- Parameters:
pipe- Pipemessage- Message
-
onPipeConnectionEvent
Pipe connection event handler- Specified by:
onPipeConnectionEventin interfaceIPipeConnectionListener- Parameters:
event- Pipe connection event
-
onOOBControlMessage
- Specified by:
onOOBControlMessagein 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
-