On 13/09/2007, Ralph Giles <giles@xiph.org> wrote:> On Tue, Sep 11, 2007 at 09:33:43AM +0900, Conrad Parker wrote:
>
> > For CMML, we first tried just using raw XML from byte 0 but later
opted for
> > using a binary header with magic identifier in the first (bos) packet
> > for these reasons.
>
> Can you give a little more on why you made this decision? I see it goes
> back a long way, but couldn't find a discussion about it.
>
> I always thought it would be better to start with raw XML, since it's
> fairly recognizable (especially if you require an initial
<!DOCTYPE...>
> or <?xml...?>) and let the XML parser sort it out. With the prepended
> magic, you need a mapping spec for every variety of XML you want to
> embed in Ogg.
>
> Of course, you could just define '<?xml' as the magic for a
generic xml
> stream...
Hi,
some reasons from memory:
* XML is often generated by libraries, making it difficult for
applications to control exact byte positions
* applications which need to be able to seek on a stream need to be
able to find information about the granulepos->time mapping for a
bitstream. Requiring an XML parser just to get this information is a
bit of overkill, compared to simply reading a few bytes from a known
location (for something like a stream cutter which has no intention of
decoding the various bitstreams).
Although this mapping is one of the things that may be given by Ogg
Skeleton, we wanted CMML's Ogg mapping to be independent of that (ie.
either CMML, or Skeleton, or both, can be used in Ogg).
* in the demux stage of players, it should be as easy as possible to
identify a track and route it to the correct decoder. Having a magic
identifier, with a binary versioning field, makes this task somewhat
easier.
cheers,
Conrad.