mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
add comments for all RTMP packets.
This commit is contained in:
parent
8c493e9896
commit
c457eea692
2 changed files with 31 additions and 12 deletions
|
@ -1172,15 +1172,19 @@ class SrsSampleAccessPacket : public SrsPacket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
*
|
* Name of command. Set to "|RtmpSampleAccess".
|
||||||
*/
|
*/
|
||||||
std::string command_name;
|
std::string command_name;
|
||||||
/**
|
/**
|
||||||
*
|
* whether allow access the sample of video.
|
||||||
|
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/49
|
||||||
|
* @see: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#videoSampleAccess
|
||||||
*/
|
*/
|
||||||
bool video_sample_access;
|
bool video_sample_access;
|
||||||
/**
|
/**
|
||||||
*
|
* whether allow access the sample of audio.
|
||||||
|
* @see: https://github.com/winlinvip/simple-rtmp-server/issues/49
|
||||||
|
* @see: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/NetStream.html#audioSampleAccess
|
||||||
*/
|
*/
|
||||||
bool audio_sample_access;
|
bool audio_sample_access;
|
||||||
public:
|
public:
|
||||||
|
@ -1203,7 +1207,13 @@ protected:
|
||||||
class SrsOnMetaDataPacket : public SrsPacket
|
class SrsOnMetaDataPacket : public SrsPacket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* Name of metadata. Set to "onMetaData"
|
||||||
|
*/
|
||||||
std::string name;
|
std::string name;
|
||||||
|
/**
|
||||||
|
* Metadata of stream.
|
||||||
|
*/
|
||||||
SrsAmf0Object* metadata;
|
SrsAmf0Object* metadata;
|
||||||
public:
|
public:
|
||||||
SrsOnMetaDataPacket();
|
SrsOnMetaDataPacket();
|
||||||
|
@ -1273,6 +1283,10 @@ protected:
|
||||||
class SrsSetChunkSizePacket : public SrsPacket
|
class SrsSetChunkSizePacket : public SrsPacket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
/**
|
||||||
|
* The maximum chunk size can be 65536 bytes. The chunk size is
|
||||||
|
* maintained independently for each direction.
|
||||||
|
*/
|
||||||
int32_t chunk_size;
|
int32_t chunk_size;
|
||||||
public:
|
public:
|
||||||
SrsSetChunkSizePacket();
|
SrsSetChunkSizePacket();
|
||||||
|
@ -1325,14 +1339,16 @@ enum SrcPCUCEventType
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 5.4. User Control Message (4)
|
||||||
|
*
|
||||||
* for the EventData is 4bytes.
|
* for the EventData is 4bytes.
|
||||||
* Stream Begin(=0) 4-bytes stream ID
|
* Stream Begin(=0) 4-bytes stream ID
|
||||||
* Stream EOF(=1) 4-bytes stream ID
|
* Stream EOF(=1) 4-bytes stream ID
|
||||||
* StreamDry(=2) 4-bytes stream ID
|
* StreamDry(=2) 4-bytes stream ID
|
||||||
* SetBufferLength(=3) 8-bytes 4bytes stream ID, 4bytes buffer length.
|
* SetBufferLength(=3) 8-bytes 4bytes stream ID, 4bytes buffer length.
|
||||||
* StreamIsRecorded(=4) 4-bytes stream ID
|
* StreamIsRecorded(=4) 4-bytes stream ID
|
||||||
* PingRequest(=6) 4-bytes timestamp local server time
|
* PingRequest(=6) 4-bytes timestamp local server time
|
||||||
* PingResponse(=7) 4-bytes timestamp received ping request.
|
* PingResponse(=7) 4-bytes timestamp received ping request.
|
||||||
*
|
*
|
||||||
* 3.7. User Control message
|
* 3.7. User Control message
|
||||||
* +------------------------------+-------------------------
|
* +------------------------------+-------------------------
|
||||||
|
@ -1343,7 +1359,10 @@ enum SrcPCUCEventType
|
||||||
class SrsUserControlPacket : public SrsPacket
|
class SrsUserControlPacket : public SrsPacket
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
// @see: SrcPCUCEventType
|
/**
|
||||||
|
* Event type is followed by Event data.
|
||||||
|
* @see: SrcPCUCEventType
|
||||||
|
*/
|
||||||
int16_t event_type;
|
int16_t event_type;
|
||||||
int32_t event_data;
|
int32_t event_data;
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -72,7 +72,7 @@ int MockSrsFileWriter::write(void* buf, size_t count, ssize_t* pnwrite)
|
||||||
{
|
{
|
||||||
int ret = ERROR_SUCCESS;
|
int ret = ERROR_SUCCESS;
|
||||||
|
|
||||||
int size = srs_min(MAX_MOCK_DATA_SIZE - offset, count);
|
int size = srs_min(MAX_MOCK_DATA_SIZE - offset, (int)count);
|
||||||
|
|
||||||
memcpy(data + offset, buf, size);
|
memcpy(data + offset, buf, size);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue