Network 版 (精华区)
发信人: zzn (爱你到内伤), 信区: Network
标 题: mms协议英文资料(21)
发信站: 哈工大紫丁香 (2003年08月23日10:55:41 星期六), 站内信件
MMS Pre Headers
Media and header packets are prefixed with mini headers attached at their
start. I will refer to these as MMS pre-headers. This is an 8 byte long
header attached to the start of every streamed media / header packet. This
application protocol level header is used for carrying important packet
information like the packet sequence number, PacketIDType, UDP count / TCP
flags and packet length.
MMS Media and Header Object Packet Pre headers
4 bytes
Sequence number 1 byte
PacketIDtype 1 byte
UDP sequence / TCP flags 2 bytes
Packet length
Sequence Number – 4 bytes
Increments as packets are received. This is an absolute packet number and its
starting value shows from the point at which the stream is started. I.e.
start = 0 for pre-recorded media and start = another value for the live
stream point where you came in.
Packet ID type – 1 byte
This increments for every stop/play action by media player. Every time a new
play session is started, this counts by one. It can be thought of as the
packet type ID or client session number for that session. After an initial
start value as shown below, it then counts up to 0xff and scrolls around to
0x00 and so on. The server effectively echo’s this value back to the player
using the last ID value sent to it.
This value can be preset by :
Client to server command 0x07 (for media type packets)
Client to server command 0x15 (for header type packets).
See command specific data for those commands for more details.
We can pre-set these values when we send commands to a server rather than
increment them. This gives us a handle on header and media packet types if we
wish.
Normal Packet ID initial assignments:
0x04 = start value for media packets
0x02 = start value for header packets
0xff = used for command 20 continue with new header data
UDP sequence / TCP Flag - 1 byte (For UDP streaming only)
This sequence is a relative packet number and always starts from 0 regardless
where you came in to the stream. It increments by 1 for every UDP packet sent
to the client. This sequence is used for UDP sequence checking and error
correction.
After the count limit of 0xff, the value wraps around to 0x00, and so on.
(unsigned char).
UDP sequence / TCP Flag – 1 byte (For TCP streaming only)
This flag has preset values of :
0x00 shows the middle of packet series
0x04 shows the first packet of a packet series
0x08 shows the last packet of a packet series
0x0C shows there is only 1 packet in this series
Packet Length - 2 bytes little endian
The total length in bytes of the packet, up to and including the last packet
byte.
It includes the pre-header field length itself
--
既然选择了远方,就让我们风雨兼程吧
人生最快乐的事 莫过于
有了目标,并为之奋斗!
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.243.49]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.099毫秒