X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=doc%2Fv-comment.html;h=9b9598569e3a91807f6711f9dcb0e1201eee903b;hb=2d7d933302d8fe78c451f42a2ae2e6f0c2de346e;hp=8a0248a242cdd5601af2421f18dd79f54e1a3a52;hpb=63fb1174c3e691fb47725ccba730a860eac59d50;p=platform%2Fupstream%2Flibvorbis.git diff --git a/doc/v-comment.html b/doc/v-comment.html index 8a0248a..9b95985 100644 --- a/doc/v-comment.html +++ b/doc/v-comment.html @@ -1,48 +1,110 @@ -xiph.org: Ogg Vorbis documentation - -

- - -

-Ogg Vorbis I format specification: comment field and header specification -

- -Last update to this document: July 16, 2002

- -

Overview

+ + + + + +Ogg Vorbis Documentation + + + + + + + + + +

Ogg Vorbis I format specification: comment field and header specification

+ +

Overview

The Vorbis text comment header is the second (of three) header packets that begin a Vorbis bitstream. It is meant for short, text comments, not arbitrary metadata; arbitrary metadata belongs in a separate logical bitstream (usually an XML stream type) that provides -greater structure and machine parseability. +greater structure and machine parseability.

The comment field is meant to be used much like someone jotting a quick note on the bottom of a CDR. It should be a little information to remember the disc by and explain it to others; a short, to-the-point text note that need not only be a couple words, but isn't going to be -more than a short paragraph. The essentials, in other words, whatever -they turn out to be, eg: +more than a short paragraph. The essentials, in other words, whatever +they turn out to be, eg:

-
+

"Honest Bob and the Factory-to-Dealer-Incentives, _I'm Still Around_, -opening for Moxy Fruvous, 1997" -

- -

Comment encoding

+opening for Moxy Früvous, 1997" +

+

Comment encoding

-

Structure

+

Structure

-The comment header logically is a list of eight-bit-clean vectors; the +

The comment header logically is a list of eight-bit-clean vectors; the number of vectors is bounded to 2^32-1 and the length of each vector is limited to 2^32-1 bytes. The vector length is encoded; the vector contents themselves are not null terminated. In addition to the vector list, there is a single vector for vendor name (also 8 bit clean, -length encoded in 32 bits). Libvorbis currently sets the vendor string -to "Xiph.Org libVorbis I 20020713".

+length encoded in 32 bits). For example, the 1.0 release of libvorbis +set the vendor string to "Xiph.Org libVorbis I 20020717".

-The comment header is decoded as follows:

+

The comment header is decoded as follows:

   1) [vendor_length] = read an unsigned integer of 32 bits
@@ -56,16 +118,15 @@ The comment header is decoded as follows:

} 7) [framing_bit] = read a single bit as boolean - 8) if ( [framing_bit] unset or end of packet ) then ERROR + 8) if ( [framing_bit] unset or end of packet ) then ERROR 9) done.

+

Content vector format

-

Content vector format

- -The comment vectors are structured similarly to a UNIX environment variable. -That is, comment fields consist of a field name and a field value and -look like: +

The comment vectors are structured similarly to a UNIX environment variable. +That is, comment fields consist of a field name and a corresponding value and +look like:

 comment[0]="ARTIST=me"; 
@@ -76,156 +137,149 @@ comment[1]="TITLE=the sound of Vorbis";
 
  • A case-insensitive field name that may consist of ASCII 0x20 through 0x7D, 0x3D ('=') excluded. ASCII 0x41 through 0x5A inclusive (A-Z) is to be considered equivalent to ASCII 0x61 through 0x7A inclusive -(a-z). - -
  • The field name is immediately followed by ASCII 0x3D ('='); this -equals sign is used to terminate the field name. - -
  • 0x3D is followed by 8 bit clean UTF-8 encoded field contents -to the end of the field. +(a-z).
  • +
  • The field name is immediately followed by ASCII 0x3D ('='); +this equals sign is used to terminate the field name.
  • +
  • 0x3D is followed by the 8 bit clean UTF-8 encoded value of the +field contents to the end of the field.
  • -

    Field names

    +

    Field names

    -Below is a proposed, minimal list of standard filed names with a -description of intended use. No single or group of field names is +

    Below is a proposed, minimal list of standard field names with a +description of intended use. No single or group of field names is mandatory; a comment header may contain one, all or none of the names -in this list.

    +in this list.

    -
    TITLE
    Track/Work name -
    VERSION
    The version field may be used to differentiate multiple -versions of the same track title in a single collection. (e.g. remix info) +
    TITLE
    +
    Track/Work name
    + +
    VERSION
    +
    The version field may be used to differentiate multiple +versions of the same track title in a single collection. +(e.g. remix info)
    -
    ALBUM
    The collection name to which this track belongs +
    ALBUM
    +
    The collection name to which this track belongs
    -
    TRACKNUMBER
    The track number of this piece if part of a specific larger collection or album +
    TRACKNUMBER
    +
    The track number of this piece if part of a specific larger collection or album
    -
    ARTIST
    The artist generally considered responsible for the work. In popular music this is usually the performing band or singer. For classical music it would be the composer. For an audio book it would be the author of the original text. +
    ARTIST
    +
    The artist generally considered responsible for the work. In popular music +this is usually the performing band or singer. For classical music it would be +the composer. For an audio book it would be the author of the original text.
    -
    PERFORMER
    The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists. In an audio book it would be the actor who did the reading. In popular music this is typically the same as the ARTIST and is omitted. +
    PERFORMER
    +
    The artist(s) who performed the work. In classical music this would be the +conductor, orchestra, soloists. In an audio book it would be the actor who did +the reading. In popular music this is typically the same as the ARTIST and +is omitted.
    -
    COPYRIGHT
    Copyright attribution, e.g., '2001 Nobody's Band' or '1999 Jack Moffitt' +
    COPYRIGHT
    +
    Copyright attribution, e.g., '2001 Nobody's Band' or '1999 Jack Moffitt'
    -
    LICENSE
    License information, eg, 'All Rights Reserved', 'Any +
    LICENSE
    +
    License information, eg, 'All Rights Reserved', 'Any Use Permitted', a URL to a license such as a Creative Commons license ("www.creativecommons.org/blahblah/license.html") or the EFF Open Audio License ('distributed under the terms of the Open Audio License. see http://www.eff.org/IP/Open_licenses/eff_oal.html for -details'), etc. +details'), etc.
    -
    ORGANIZATION
    Name of the organization producing the track (i.e. -the 'record label') +
    ORGANIZATION
    +
    Name of the organization producing the track (i.e. +the 'record label')
    -
    DESCRIPTION
    A short text description of the contents +
    DESCRIPTION
    +
    A short text description of the contents
    -
    GENRE
    A short text indication of music genre +
    GENRE
    +
    A short text indication of music genre
    -
    DATE
    Date the track was recorded +
    DATE
    +
    Date the track was recorded
    -
    LOCATION
    Location where track was recorded +
    LOCATION
    +
    Location where track was recorded
    -
    CONTACT
    Contact information for the creators or distributors of the track. This could be a URL, an email address, the physical address of the producing label. +
    CONTACT
    +
    Contact information for the creators or distributors of the track. +This could be a URL, an email address, the physical address of +the producing label.
    -
    ISRC
    ISRC number for the track; see the ISRC intro page for more information on ISRC numbers. +
    ISRC
    +
    ISRC number for the track; see the +ISRC intro page for more information on ISRC numbers.
    -

    Implications

    +

    Implications

    +
    -

    Encoding

    +

    Encoding

    -The comment header comprises the entirety of the second bitstream -header packet. Unlike the first bitstream header packet, it is not +

    The comment header comprises the entirety of the second bitstream +header packet. Unlike the first bitstream header packet, it is not generally the only packet on the second page and may not be restricted -to within the second bitstream page. The length of the comment header -packet is [practically] unbounded. The comment header packet is not +to within the second bitstream page. The length of the comment header +packet is (practically) unbounded. The comment header packet is not optional; it must be present in the bitstream even if it is -effectively empty.

    +effectively empty.

    -The comment header is encoded as follows (as per Ogg's standard +

    The comment header is encoded as follows (as per Ogg's standard bitstream mapping which renders least-significant-bit of the word to be coded into the least significant available bit of the current -bitstream octet first): +bitstream octet first):

      -
    1. -Vendor string length (32 bit unsigned quantity specifying number of octets) - -
    2. -Vendor string ([vendor string length] octets coded from beginning of string to end of string, not null terminated) - -
    3. Number of comment fields (32 bit unsigned quantity specifying number of fields) +
    4. Vendor string length (32 bit unsigned quantity specifying number of octets)
    5. +
    6. Vendor string ([vendor string length] octets coded from beginning of string +to end of string, not null terminated)
    7. +
    8. Number of comment fields (32 bit unsigned quantity specifying number of fields)
    9. +
    10. Comment field 0 length (if [Number of comment fields]>0; 32 bit unsigned +quantity specifying number of octets)
    11. +
    12. Comment field 0 ([Comment field 0 length] octets coded from beginning of +string to end of string, not null terminated)
    13. +
    14. Comment field 1 length (if [Number of comment fields]>1...)...
    15. +
    -
  • Comment field 0 length (if [Number of comment fields]>0; 32 bit unsigned quantity specifying number of octets) +

    This is actually somewhat easier to describe in code; implementation of the above +can be found in vorbis/lib/info.c:_vorbis_pack_comment(),_vorbis_unpack_comment()

    -
  • -Comment field 0 ([Comment field 0 length] octets coded from beginning of string to end of string, not null terminated) - -
  • Comment field 1 length (if [Number of comment fields]>1...)... - + - +