Network 版 (精华区)
发信人: zzn (爱你到内伤), 信区: Network
标 题: mms协议英文资料(27)
发信站: 哈工大紫丁香 (2003年08月23日10:56:43 星期六), 站内信件
ASF header update when finished downloading
Another important point is the ASF header itself must be re-written with new
download size and total playing time data for live streams. Of course, this
can only be done when the download has finished otherwise we would not know
the length of the file or its playing time. In a live stream, the header is
sent from the server at the point where the viewer came in. And because we
could be anywhere in the stream and the length of the stream is unknown (its
live) data in the asf header like Total File Time and Play Time Duration are
not set. Values like 0x00000000 are sent in the header instead, total packets
would be 0xffffffff or 0x00. Once we have finished downloading a broadcast,
either by the user stopping a download or maybe the broadcast ends then we
must use the data we have to re-write these now known values back into the
header we already saved on disk. This means the asf file header (see file
object and data objects in the ASF 1.0 document) is updated with new file
play time and file total time values to allow the media player to understand
the saved file and its time scales. The result is, on playing the downloaded
file, t = 0 always at the start of the file and so the file plays from the
start where we came in and for the correct length of time. Other values are
also updated in the header like number of packets, total file size in bytes,
the data chunk length in bytes and the FILE / LIVE flag is set to FILE.
ASF File Finishing - Summary
1) While downloading a pre-recorded file, we do not need to make any
modifications to either the media packets time code or the asf header.
Packets are written straight to disk with header object.
2) While downloading Live broadcasts, we need to modify all time codes of
media packets and times of the objects within them to relative time, i.e. t =
0 at start of file.
We also need to update the asf header (only after a completed LIVE download)
with new time related data like, total time of file, play time as well as
other data like total file size, number of packets and the broadcast flags
are set to allow seeking (Pre-recorded = true).
Note: video seeking only works on Media Player v6. Not v7! To make local
files seek enabled with player 7.0 or later, you must include an index
seeking object at the very end of the ASF file. One index object for every
stream in the media must be included. Read the ASF specification for more
details about the index-seeking object.
IEEE 754-1985 double precision values
This is a 64 bit double precision value. In MMS, it is usually used as a very
accurate time value and can be seen in many MMS commands. They also appear in
MMS command headers and probably used for network timing detection.
Most major versions of C++ language compiler can convert straight to this
format using the ‘double’ type as a time point value. As long as the
compiler is IEEE 754 double precision compliant, then this conversion is very
simple and values can be manipulated very easily. However, below shows how
these values are constructed for those interested.
Total length = char[8] or 64 bits
Bit 0 = LSB
Bit 63 = MSB
Where:
bits 0 – 51 represent the mantissa value eg. 3.1415
bits 52 – 62 are the exponent value eg x10-6
bit 63 is the sign flag where 1 = negative, 0 = positive
Actually, it’s slightly more complicated than this, so if you need a better
description, there are of course internet documents readily available with
reference to IEEE 754-1985.
A 32 bit version also exists, called a ‘Single precision’ value which
follows similar rules but has less bytes in its field length.
--
既然选择了远方,就让我们风雨兼程吧
人生最快乐的事 莫过于
有了目标,并为之奋斗!
※ 来源:·哈工大紫丁香 bbs.hit.edu.cn·[FROM: 202.118.243.49]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
页面执行时间:3.313毫秒