From 2516e3c596c38ccf7559cfce15356971d3f573d7 Mon Sep 17 00:00:00 2001 From: winlin Date: Sun, 6 Jul 2014 20:34:11 +0800 Subject: [PATCH] complete the comments of RTMP protocol. --- trunk/src/rtmp/srs_protocol_rtmp_stack.hpp | 80 +++++++++++++++++++--- 1 file changed, 72 insertions(+), 8 deletions(-) diff --git a/trunk/src/rtmp/srs_protocol_rtmp_stack.hpp b/trunk/src/rtmp/srs_protocol_rtmp_stack.hpp index ba56a7df5..33a3b840f 100644 --- a/trunk/src/rtmp/srs_protocol_rtmp_stack.hpp +++ b/trunk/src/rtmp/srs_protocol_rtmp_stack.hpp @@ -1328,14 +1328,78 @@ protected: // 3.7. User Control message enum SrcPCUCEventType { - // generally, 4bytes event-data - SrcPCUCStreamBegin = 0x00, - SrcPCUCStreamEOF = 0x01, - SrcPCUCStreamDry = 0x02, - SrcPCUCSetBufferLength = 0x03, // 8bytes event-data - SrcPCUCStreamIsRecorded = 0x04, - SrcPCUCPingRequest = 0x06, - SrcPCUCPingResponse = 0x07, + // generally, 4bytes event-data + + /** + * The server sends this event to notify the client + * that a stream has become functional and can be + * used for communication. By default, this event + * is sent on ID 0 after the application connect + * command is successfully received from the + * client. The event data is 4-byte and represents + * the stream ID of the stream that became + * functional. + */ + SrcPCUCStreamBegin = 0x00, + + /** + * The server sends this event to notify the client + * that the playback of data is over as requested + * on this stream. No more data is sent without + * issuing additional commands. The client discards + * the messages received for the stream. The + * 4 bytes of event data represent the ID of the + * stream on which playback has ended. + */ + SrcPCUCStreamEOF = 0x01, + + /** + * The server sends this event to notify the client + * that there is no more data on the stream. If the + * server does not detect any message for a time + * period, it can notify the subscribed clients + * that the stream is dry. The 4 bytes of event + * data represent the stream ID of the dry stream. + */ + SrcPCUCStreamDry = 0x02, + + /** + * The client sends this event to inform the server + * of the buffer size (in milliseconds) that is + * used to buffer any data coming over a stream. + * This event is sent before the server starts + * processing the stream. The first 4 bytes of the + * event data represent the stream ID and the next + * 4 bytes represent the buffer length, in + * milliseconds. + */ + SrcPCUCSetBufferLength = 0x03, // 8bytes event-data + + /** + * The server sends this event to notify the client + * that the stream is a recorded stream. The + * 4 bytes event data represent the stream ID of + * the recorded stream. + */ + SrcPCUCStreamIsRecorded = 0x04, + + /** + * The server sends this event to test whether the + * client is reachable. Event data is a 4-byte + * timestamp, representing the local server time + * when the server dispatched the command. The + * client responds with kMsgPingResponse on + * receiving kMsgPingRequest. + */ + SrcPCUCPingRequest = 0x06, + + /** + * The client sends this event to the server in + * response to the ping request. The event data is + * a 4-byte timestamp, which was received with the + * kMsgPingRequest request. + */ + SrcPCUCPingResponse = 0x07, }; /**