Author: mosu
Date: 2004-09-06 14:45:16 +0400 (Mon, 06 Sep 2004)
New Revision: 747
Added:
trunk/RbMatroska/COPYING
trunk/RbMatroska/ebml.rb
trunk/RbMatroska/gen_classes_from_libmatroska
trunk/RbMatroska/matroska.rb
trunk/RbMatroska/mkvinfo.rb
Log:
My first implementation of the EBML parser & Matroska info tool. No, it is NOT fast ;)
Added: trunk/RbMatroska/COPYING
===================================================================
--- trunk/RbMatroska/COPYING 2004-09-06 09:47:20 UTC (rev 746)
+++ trunk/RbMatroska/COPYING 2004-09-06 10:45:16 UTC (rev 747)
@@ -0,0 +1,22 @@
+The MIT License
+
+Copyright (c) 2004 Moritz Bunkus <[email protected]>
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Property changes on: trunk/RbMatroska/COPYING
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/RbMatroska/ebml.rb
===================================================================
--- trunk/RbMatroska/ebml.rb 2004-09-06 09:47:20 UTC (rev 746)
+++ trunk/RbMatroska/ebml.rb 2004-09-06 10:45:16 UTC (rev 747)
@@ -0,0 +1,397 @@
+#!/usr/bin/ruby
+
+module Ebml
+ def coded_size(s)
+ if (s <= 0x0000007f)
+ return 1
+ elsif (s <= 0x00003fff)
+ return 2
+ elsif (s <= 0x001fffff)
+ return 3
+ elsif (s <= 0x0fffffff)
+ return 4
+ elsif (s <= 0x00000007ffffffff)
+ return 5
+ elsif (s <= 0x000003ffffffffff)
+ return 6
+ elsif (s <= 0x0001ffffffffffff)
+ return 7
+ else
+ return 8
+ end
+ end
+
+ class Error < RuntimeError
+ end
+
+ class IdError < Error
+ end
+
+ class DataError < Error
+ end
+
+ class Id
+ attr_accessor :value
+ attr_accessor :size
+
+ def initialize(value, size)
+ @value = value
+ @size = size
+ end
+
+ def ==(id)
+ return false if (id == nil)
+ return ((value == id.value) and (size == id.size))
+ end
+
+ def to_s
+ format = "(0x%0" + (@size * 2).to_s + "x, %d)"
+ return sprintf(format, @value, @size)
+ end
+ end # class Id
+
+ class Element
+ attr_reader :id
+ attr_reader :position
+ attr_reader :data_size
+ attr_reader :element_size
+ attr_reader :size_length
+
+ def initialize(id, position, data_size, size_length)
+ @id = id
+ @position = position
+ @data_size = data_size
+ @size_length = size_length
+ @element_size = @id.size + @size_length + @data_size
+ end
+
+ def Element.global_id
+ @@no_id ||= Id.new(0, 0)
+ return @@no_id
+ end
+
+ def skip(ef)
+ ef.io.seek(@position + @element_size, IO::SEEK_SET)
+ end
+
+ def read(ef)
+ skip(ef)
+ end
+
+ def to_s
+ return sprintf("[%s @ 0x%08x size 0x%08x]", id.to_s, @position,
+ @element_size)
+ end
+ end
+
+ class SInteger < Element
+ def read(ef)
+ byte = ef.io.readchar
+ if ((byte & 0x80) == 0x80)
+ @value = -1 << 8
+ else
+ @value = 0
+ end
+ @value |= byte
+ 2.upto(@data_size) do |i|
+ byte = ef.io.readchar
+ @value = (@value << 8) | byte
+ end
+ end
+
+ def to_i
+ @value ||= 0
+ return @value
+ end
+
+ def to_s
+ return to_i.to_s
+ end
+ end
+
+ class UInteger < Element
+ def read(ef)
+ @value = 0
+ 1.upto(@data_size) do
+ byte = ef.io.readchar
+ @value = (@value << 8) | byte
+ end
+ end
+
+ def to_i
+ @value ||= 0
+ return @value
+ end
+
+ def to_s
+ return to_i.to_s
+ end
+ end
+
+ class String < Element
+ def read(ef)
+ @value = ef.io.read(@data_size)
+ raise DataError if (@value.size < @data_size)
+ end
+
+ def to_s
+ @value ||= ""
+ return @value
+ end
+ end
+
+ class UnicodeString < String
+ def read(ef)
+ @value = ef.io.read(@data_size)
+ raise DataError if (@value.size < @data_size)
+ end
+
+ def to_s
+ @value ||= ""
+ return @value
+ end
+ end
+
+ class Binary < Element
+ def read(ef)
+ @value = ef.io.read(@data_size)
+ raise EOFError if (@value.size < @data_size)
+ end
+
+ def to_s
+ @value ||= Array.new
+ return "[Binary size " + @data_size.to_s + "]"
+ end
+ end
+
+ class Float < Element
+ def read(ef)
+ ins = ef.io.read(@data_size)
+ raise EOFError if (ins.size < @data_size)
+ @value = ins.unpack(@data_size == 4 ? "g" : "G")[0]
+ end
+
+ def to_f
+ @value ||= 0.0
+ return @value
+ end
+
+ def to_s
+ return sprintf("%f", to_f)
+ end
+ end
+
+ class Date < UInteger
+ def to_s
+ @value ||= 0
+ return Time.at(@value / 1000000000).to_s
+ end
+ end
+
+ class Master < Element
+ attr_reader :children
+
+ def initialize(id, position, data_size, size_length)
+ super(id, position, data_size, size_length)
+ @children = Array.new
+ end
+
+ def read(ef)
+ @children = Array.new
+
+ size_left = data_size
+ while (size_left > 0)
+ e = ef.read_element_head
+ if (e.class != NilClass)
+ e.read(ef)
+ @children.push(e)
+ size_left -= e.element_size
+ e.skip(ef)
+ else
+ break
+ end
+ end
+ end
+
+ def to_s
+ s = "{" + self.class.name + " " + super + " "
+ @children.each { |c| s += c.to_s + " " }
+ return s + "}"
+ end
+ end
+
+ class File
+ attr_reader :io
+
+ def initialize(io)
+ @io = io
+ end
+
+ def entity_size?(byte, mask_bits = false)
+ size = 0
+ mask = 0
+ if ((byte & 0x80) == 0x80)
+ size = 1
+ mask = 0x7f
+ elsif ((byte & 0xc0) == 0x40)
+ size = 2
+ mask = 0x3f
+ elsif ((byte & 0xe0) == 0x20)
+ size = 3
+ mask = 0x1f
+ elsif ((byte & 0xf0) == 0x10)
+ size = 4
+ mask = 0x0f
+ elsif ((byte & 0xf8) == 0x08)
+ size = 5
+ mask = 0x07
+ elsif ((byte & 0xfc) == 0x04)
+ size = 6
+ mask = 0x03
+ elsif ((byte & 0xfe) == 0x02)
+ size = 7
+ mask = 0x01
+ elsif (byte == 1)
+ size = 8
+ mask = 0x00
+ else
+ raise DataError
+ end
+ byte = byte & mask if (mask_bits)
+ return [size, byte]
+ end
+
+ def read_id
+ id = 0
+
+ byte = @io.getc
+ return nil if (byte == nil)
+
+ esize = entity_size?(byte)
+ raise IdError if (esize[0] > 4)
+ id = esize[1]
+
+ 1.upto(esize[0] - 1) do |i|
+ byte = @io.readchar
+ id = id * 256 + byte
+ end
+ return Id.new(id, esize[0])
+ end
+
+ def read_size
+ byte = @io.getc
+ return nil if (byte == nil)
+
+ esize = entity_size?(byte, true)
+
+ size = esize[1]
+ 1.upto(esize[0] - 1) do
+ byte = @io.readchar
+ size = size * 256 + byte
+ end
+ return [size, esize[0]]
+ end
+
+ def read_element_head
+ position = @io.pos
+ id = read_id
+ return nil if (id.class == NilClass)
+ size = read_size
+ return nil if (size.class == NilClass)
+ return find_class_for_id(id).new(id, position, size[0], size[1])
+ end
+
+ def map_ids(namespace = nil)
+ @id_mapping = Hash.new
+
+ rebml = Regexp.new("^Ebml::")
+ rns = nil
+ if (namespace != nil)
+ require namespace.downcase
+ rns = Regexp.new("^#{namespace}::")
+ end
+ ObjectSpace.each_object(Class) do |c|
+ if (((rebml =~ c.name) or ((rns != nil) and (rns =~ c.name))) and
+ (c.respond_to?("global_id")))
+ @id_mapping[c.global_id.value] = c
+ end
+ end
+ end
+
+ def find_class_for_id(id)
+ return @id_mapping[id.value] if (@id_mapping.has_key?(id.value))
+ return Element
+ end
+ end # class EFile
+
+
+ class Head < Master
+ def Head.global_id
+ @@id ||= Id.new(0x1a45dfa3, 4)
+ return @@id
+ end
+ end # class Head
+
+ class Version < UInteger
+ def Version.global_id
+ @@id ||= Id.new(0x4286, 2)
+ return @@id
+ end
+ end # class Version
+
+ class ReadVersion < UInteger
+ def ReadVersion.global_id
+ @@id ||= Id.new(0x42f7, 2)
+ return @@id
+ end
+ end # class ReadVersion
+
+ class MaxIdLength < UInteger
+ def MaxIdLength.global_id
+ @@id ||= Id.new(0x42f2, 2)
+ return @@id
+ end
+ end # class MaxIdLength
+
+ class MaxSizeLength < UInteger
+ def MaxSizeLength.global_id
+ @@id ||= Id.new(0x42f3, 2)
+ return @@id
+ end
+ end # class MaxSizeLength
+
+ class DocType < Ebml::String
+ def DocType.global_id
+ @@id ||= Id.new(0x4282, 2)
+ return @@id
+ end
+ end # class DocType
+
+ class DocTypeVersion < UInteger
+ def DocTypeVersion.global_id
+ @@id ||= Id.new(0x4287, 2)
+ return @@id
+ end
+ end # class DocTypeVersion
+
+ class DocTypeReadVersion < UInteger
+ def DocTypeReadVersion.global_id
+ @@id ||= Id.new(0x4285, 2)
+ return @@id
+ end
+ end # class DocTypeVersion
+
+ class CRC32 < Binary
+ def CRC32.global_id
+ @@id ||= Id.new(0xbf, 2)
+ return @@id
+ end # class CRC32
+ end
+
+ class Void < Binary
+ def Void.global_id
+ @@id ||= Id.new(0xec, 2)
+ return @@id
+ end
+ end # class Void
+end
Property changes on: trunk/RbMatroska/ebml.rb
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/RbMatroska/gen_classes_from_libmatroska
===================================================================
--- trunk/RbMatroska/gen_classes_from_libmatroska 2004-09-06 09:47:20 UTC (rev 746)
+++ trunk/RbMatroska/gen_classes_from_libmatroska 2004-09-06 10:45:16 UTC (rev 747)
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+cd ~/prog/video/libmatroska/src
+for CPP in *.cpp ; do
+ BASE=`basename $CPP .cpp`
+ H=../matroska/$BASE.h
+
+ echo " # From ${CPP}"
+
+ egrep '^EbmlId.*TheId' $CPP | (while read LINE; do
+ ID=`echo "$LINE" | sed 's/TheId.*(/ /' | awk '{ print $3 }' | sed s/,// | lower`
+ LENGTH=`echo "$LINE" | sed 's/TheId.*(/ /' | awk '{ print $4 }' | sed 's/);//'`
+ NAME=`echo "$LINE" | sed 's/_TheId.*//' | awk '{ print $2 }' | sed s/Kax//`
+ PARENT=`egrep "class.*Kax${NAME} *:" $H | sed 's/:/ : /g' | awk '{ print $6 }' | sed 's/^Ebml/Ebml::/'`
+ cat <<EOF
+ class ${NAME} < ${PARENT}
+ def ${NAME}.global_id
+ @@id ||= Ebml::Id.new(${ID}, ${LENGTH})
+ return @@id
+ end
+ end
+
+EOF
+
+ done)
+done
Property changes on: trunk/RbMatroska/gen_classes_from_libmatroska
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/RbMatroska/matroska.rb
===================================================================
--- trunk/RbMatroska/matroska.rb 2004-09-06 09:47:20 UTC (rev 746)
+++ trunk/RbMatroska/matroska.rb 2004-09-06 10:45:16 UTC (rev 747)
@@ -0,0 +1,1784 @@
+#!/usr/bin/ruby
+
+require "ebml"
+
+module Matroska
+ # From KaxAttached.cpp
+ class Attached < Ebml::Master
+ def Attached.global_id
+ @@id ||= Ebml::Id.new(0x61a7, 2)
+ return @@id
+ end
+ end
+
+ class FileDescription < Ebml::UnicodeString
+ def FileDescription.global_id
+ @@id ||= Ebml::Id.new(0x467e, 2)
+ return @@id
+ end
+ end
+
+ class FileName < Ebml::UnicodeString
+ def FileName.global_id
+ @@id ||= Ebml::Id.new(0x466e, 2)
+ return @@id
+ end
+ end
+
+ class MimeType < Ebml::String
+ def MimeType.global_id
+ @@id ||= Ebml::Id.new(0x4660, 2)
+ return @@id
+ end
+ end
+
+ class FileData < Ebml::Binary
+ def FileData.global_id
+ @@id ||= Ebml::Id.new(0x465c, 2)
+ return @@id
+ end
+ end
+
+ class FileUID < Ebml::UInteger
+ def FileUID.global_id
+ @@id ||= Ebml::Id.new(0x46ae, 2)
+ return @@id
+ end
+ end
+
+ # From KaxAttachments.cpp
+ class Attachments < Ebml::Master
+ def Attachments.global_id
+ @@id ||= Ebml::Id.new(0x1941a469, 4)
+ return @@id
+ end
+ end
+
+ # From KaxBlock.cpp
+ class BlockGroup < Ebml::Master
+ def BlockGroup.global_id
+ @@id ||= Ebml::Id.new(0xa0, 1)
+ return @@id
+ end
+ end
+
+ class Block < Ebml::Binary
+ def Block.global_id
+ @@id ||= Ebml::Id.new(0xa1, 1)
+ return @@id
+ end
+ end
+
+ class BlockDuration < Ebml::UInteger
+ def BlockDuration.global_id
+ @@id ||= Ebml::Id.new(0x9b, 1)
+ return @@id
+ end
+ end
+
+ class BlockVirtual < Ebml::Binary
+ def BlockVirtual.global_id
+ @@id ||= Ebml::Id.new(0xa2, 1)
+ return @@id
+ end
+ end
+
+ class BlockAdditions < Ebml::Master
+ def BlockAdditions.global_id
+ @@id ||= Ebml::Id.new(0x75a1, 2)
+ return @@id
+ end
+ end
+
+ class BlockMore < Ebml::Master
+ def BlockMore.global_id
+ @@id ||= Ebml::Id.new(0xa6, 1)
+ return @@id
+ end
+ end
+
+ class BlockAddID < Ebml::UInteger
+ def BlockAddID.global_id
+ @@id ||= Ebml::Id.new(0xee, 1)
+ return @@id
+ end
+ end
+
+ class BlockAdditional < Ebml::Binary
+ def BlockAdditional.global_id
+ @@id ||= Ebml::Id.new(0xa5, 1)
+ return @@id
+ end
+ end
+
+ # From KaxBlockData.cpp
+ class ReferencePriority < Ebml::UInteger
+ def ReferencePriority.global_id
+ @@id ||= Ebml::Id.new(0xfa, 1)
+ return @@id
+ end
+ end
+
+ class ReferenceBlock < Ebml::SInteger
+ def ReferenceBlock.global_id
+ @@id ||= Ebml::Id.new(0xfb, 1)
+ return @@id
+ end
+ end
+
+ class Slices < Ebml::Master
+ def Slices.global_id
+ @@id ||= Ebml::Id.new(0x8e, 1)
+ return @@id
+ end
+ end
+
+ class TimeSlice < Ebml::Master
+ def TimeSlice.global_id
+ @@id ||= Ebml::Id.new(0xe8, 1)
+ return @@id
+ end
+ end
+
+ class SliceLaceNumber < Ebml::UInteger
+ def SliceLaceNumber.global_id
+ @@id ||= Ebml::Id.new(0xcc, 1)
+ return @@id
+ end
+ end
+
+ class SliceFrameNumber < Ebml::UInteger
+ def SliceFrameNumber.global_id
+ @@id ||= Ebml::Id.new(0xcd, 1)
+ return @@id
+ end
+ end
+
+ class SliceBlockAddID < Ebml::UInteger
+ def SliceBlockAddID.global_id
+ @@id ||= Ebml::Id.new(0xcb, 1)
+ return @@id
+ end
+ end
+
+ class SliceDelay < Ebml::UInteger
+ def SliceDelay.global_id
+ @@id ||= Ebml::Id.new(0xce, 1)
+ return @@id
+ end
+ end
+
+ class SliceDuration < Ebml::UInteger
+ def SliceDuration.global_id
+ @@id ||= Ebml::Id.new(0xcf, 1)
+ return @@id
+ end
+ end
+
+ class ReferenceVirtual < Ebml::SInteger
+ def ReferenceVirtual.global_id
+ @@id ||= Ebml::Id.new(0xfd, 1)
+ return @@id
+ end
+ end
+
+ # From KaxChapters.cpp
+ class Chapters < Ebml::Master
+ def Chapters.global_id
+ @@id ||= Ebml::Id.new(0x1043a770, 4)
+ return @@id
+ end
+ end
+
+ class EditionEntry < Ebml::Master
+ def EditionEntry.global_id
+ @@id ||= Ebml::Id.new(0x45b9, 2)
+ return @@id
+ end
+ end
+
+ class EditionUID < Ebml::UInteger
+ def EditionUID.global_id
+ @@id ||= Ebml::Id.new(0x45bc, 2)
+ return @@id
+ end
+ end
+
+ class EditionFlagHidden < Ebml::UInteger
+ def EditionFlagHidden.global_id
+ @@id ||= Ebml::Id.new(0x45bd, 2)
+ return @@id
+ end
+ end
+
+ class EditionFlagDefault < Ebml::UInteger
+ def EditionFlagDefault.global_id
+ @@id ||= Ebml::Id.new(0x45db, 2)
+ return @@id
+ end
+ end
+
+ class EditionManaged < Ebml::UInteger
+ def EditionManaged.global_id
+ @@id ||= Ebml::Id.new(0x45dd, 2)
+ return @@id
+ end
+ end
+
+ class EditionManagedPrivate < Ebml::Binary
+ def EditionManagedPrivate.global_id
+ @@id ||= Ebml::Id.new(0x450d, 2)
+ return @@id
+ end
+ end
+
+ class ChapterAtom < Ebml::Master
+ def ChapterAtom.global_id
+ @@id ||= Ebml::Id.new(0xb6, 1)
+ return @@id
+ end
+ end
+
+ class ChapterUID < Ebml::UInteger
+ def ChapterUID.global_id
+ @@id ||= Ebml::Id.new(0x73c4, 2)
+ return @@id
+ end
+ end
+
+ class ChapterTimeStart < Ebml::UInteger
+ def ChapterTimeStart.global_id
+ @@id ||= Ebml::Id.new(0x91, 1)
+ return @@id
+ end
+ end
+
+ class ChapterTimeEnd < Ebml::UInteger
+ def ChapterTimeEnd.global_id
+ @@id ||= Ebml::Id.new(0x92, 1)
+ return @@id
+ end
+ end
+
+ class ChapterFlagHidden < Ebml::UInteger
+ def ChapterFlagHidden.global_id
+ @@id ||= Ebml::Id.new(0x98, 1)
+ return @@id
+ end
+ end
+
+ class ChapterFlagEnabled < Ebml::UInteger
+ def ChapterFlagEnabled.global_id
+ @@id ||= Ebml::Id.new(0x4598, 2)
+ return @@id
+ end
+ end
+
+ class ChapterPhysicalEquiv < Ebml::UInteger
+ def ChapterPhysicalEquiv.global_id
+ @@id ||= Ebml::Id.new(0x63c3, 2)
+ return @@id
+ end
+ end
+
+ class ChapterTrack < Ebml::Master
+ def ChapterTrack.global_id
+ @@id ||= Ebml::Id.new(0x8f, 1)
+ return @@id
+ end
+ end
+
+ class ChapterTrackNumber < Ebml::UInteger
+ def ChapterTrackNumber.global_id
+ @@id ||= Ebml::Id.new(0x89, 1)
+ return @@id
+ end
+ end
+
+ class ChapterDisplay < Ebml::Master
+ def ChapterDisplay.global_id
+ @@id ||= Ebml::Id.new(0x80, 1)
+ return @@id
+ end
+ end
+
+ class ChapterString < Ebml::UnicodeString
+ def ChapterString.global_id
+ @@id ||= Ebml::Id.new(0x85, 1)
+ return @@id
+ end
+ end
+
+ class ChapterLanguage < Ebml::String
+ def ChapterLanguage.global_id
+ @@id ||= Ebml::Id.new(0x437c, 2)
+ return @@id
+ end
+ end
+
+ class ChapterCountry < Ebml::String
+ def ChapterCountry.global_id
+ @@id ||= Ebml::Id.new(0x437e, 2)
+ return @@id
+ end
+ end
+
+ class ChapterProcess < Ebml::Master
+ def ChapterProcess.global_id
+ @@id ||= Ebml::Id.new(0x6944, 2)
+ return @@id
+ end
+ end
+
+ class ChapterProcessTime < Ebml::UInteger
+ def ChapterProcessTime.global_id
+ @@id ||= Ebml::Id.new(0x6922, 2)
+ return @@id
+ end
+ end
+
+ class ChapterProcessCommand < Ebml::Binary
+ def ChapterProcessCommand.global_id
+ @@id ||= Ebml::Id.new(0x6933, 2)
+ return @@id
+ end
+ end
+
+ # From KaxCluster.cpp
+ class Cluster < Ebml::Master
+ def Cluster.global_id
+ @@id ||= Ebml::Id.new(0x1f43b675, 4)
+ return @@id
+ end
+ end
+
+ # From KaxClusterData.cpp
+ class ClusterTimecode < Ebml::UInteger
+ def ClusterTimecode.global_id
+ @@id ||= Ebml::Id.new(0xe7, 1)
+ return @@id
+ end
+ end
+
+ class ClusterPrevSize < Ebml::UInteger
+ def ClusterPrevSize.global_id
+ @@id ||= Ebml::Id.new(0xab, 1)
+ return @@id
+ end
+ end
+
+ class ClusterPosition < Ebml::UInteger
+ def ClusterPosition.global_id
+ @@id ||= Ebml::Id.new(0xa7, 1)
+ return @@id
+ end
+ end
+
+ # From KaxContentEncoding.cpp
+ class ContentEncodings < Ebml::Master
+ def ContentEncodings.global_id
+ @@id ||= Ebml::Id.new(0x6d80, 2)
+ return @@id
+ end
+ end
+
+ class ContentEncoding < Ebml::Master
+ def ContentEncoding.global_id
+ @@id ||= Ebml::Id.new(0x6240, 2)
+ return @@id
+ end
+ end
+
+ class ContentEncodingOrder < Ebml::UInteger
+ def ContentEncodingOrder.global_id
+ @@id ||= Ebml::Id.new(0x5031, 2)
+ return @@id
+ end
+ end
+
+ class ContentEncodingScope < Ebml::UInteger
+ def ContentEncodingScope.global_id
+ @@id ||= Ebml::Id.new(0x5032, 2)
+ return @@id
+ end
+ end
+
+ class ContentEncodingType < Ebml::UInteger
+ def ContentEncodingType.global_id
+ @@id ||= Ebml::Id.new(0x5033, 2)
+ return @@id
+ end
+ end
+
+ class ContentCompression < Ebml::Master
+ def ContentCompression.global_id
+ @@id ||= Ebml::Id.new(0x5034, 2)
+ return @@id
+ end
+ end
+
+ class ContentCompAlgo < Ebml::UInteger
+ def ContentCompAlgo.global_id
+ @@id ||= Ebml::Id.new(0x4254, 2)
+ return @@id
+ end
+ end
+
+ class ContentCompSettings < Ebml::Binary
+ def ContentCompSettings.global_id
+ @@id ||= Ebml::Id.new(0x4255, 2)
+ return @@id
+ end
+ end
+
+ class ContentEncryption < Ebml::Master
+ def ContentEncryption.global_id
+ @@id ||= Ebml::Id.new(0x5035, 2)
+ return @@id
+ end
+ end
+
+ class ContentEncAlgo < Ebml::UInteger
+ def ContentEncAlgo.global_id
+ @@id ||= Ebml::Id.new(0x47e1, 2)
+ return @@id
+ end
+ end
+
+ class ContentEncKeyID < Ebml::Binary
+ def ContentEncKeyID.global_id
+ @@id ||= Ebml::Id.new(0x47e2, 2)
+ return @@id
+ end
+ end
+
+ class ContentSignature < Ebml::Binary
+ def ContentSignature.global_id
+ @@id ||= Ebml::Id.new(0x47e3, 2)
+ return @@id
+ end
+ end
+
+ class ContentSigKeyID < Ebml::Binary
+ def ContentSigKeyID.global_id
+ @@id ||= Ebml::Id.new(0x47e4, 2)
+ return @@id
+ end
+ end
+
+ class ContentSigAlgo < Ebml::UInteger
+ def ContentSigAlgo.global_id
+ @@id ||= Ebml::Id.new(0x47e5, 2)
+ return @@id
+ end
+ end
+
+ class ContentSigHashAlgo < Ebml::UInteger
+ def ContentSigHashAlgo.global_id
+ @@id ||= Ebml::Id.new(0x47e6, 2)
+ return @@id
+ end
+ end
+
+ # From KaxCues.cpp
+ class Cues < Ebml::Master
+ def Cues.global_id
+ @@id ||= Ebml::Id.new(0x1c53bb6b, 4)
+ return @@id
+ end
+ end
+
+ # From KaxCuesData.cpp
+ class CuePoint < Ebml::Master
+ def CuePoint.global_id
+ @@id ||= Ebml::Id.new(0xbb, 1)
+ return @@id
+ end
+ end
+
+ class CueTime < Ebml::UInteger
+ def CueTime.global_id
+ @@id ||= Ebml::Id.new(0xb3, 1)
+ return @@id
+ end
+ end
+
+ class CueTrackPositions < Ebml::Master
+ def CueTrackPositions.global_id
+ @@id ||= Ebml::Id.new(0xb7, 1)
+ return @@id
+ end
+ end
+
+ class CueTrack < Ebml::UInteger
+ def CueTrack.global_id
+ @@id ||= Ebml::Id.new(0xf7, 1)
+ return @@id
+ end
+ end
+
+ class CueClusterPosition < Ebml::UInteger
+ def CueClusterPosition.global_id
+ @@id ||= Ebml::Id.new(0xf1, 1)
+ return @@id
+ end
+ end
+
+ class CueBlockNumber < Ebml::UInteger
+ def CueBlockNumber.global_id
+ @@id ||= Ebml::Id.new(0x5378, 2)
+ return @@id
+ end
+ end
+
+ class CueCodecState < Ebml::UInteger
+ def CueCodecState.global_id
+ @@id ||= Ebml::Id.new(0xea, 1)
+ return @@id
+ end
+ end
+
+ class CueReference < Ebml::Master
+ def CueReference.global_id
+ @@id ||= Ebml::Id.new(0xdb, 1)
+ return @@id
+ end
+ end
+
+ class CueRefTime < Ebml::UInteger
+ def CueRefTime.global_id
+ @@id ||= Ebml::Id.new(0x96, 1)
+ return @@id
+ end
+ end
+
+ class CueRefCluster < Ebml::UInteger
+ def CueRefCluster.global_id
+ @@id ||= Ebml::Id.new(0x97, 1)
+ return @@id
+ end
+ end
+
+ class CueRefNumber < Ebml::UInteger
+ def CueRefNumber.global_id
+ @@id ||= Ebml::Id.new(0x535f, 2)
+ return @@id
+ end
+ end
+
+ class CueRefCodecState < Ebml::UInteger
+ def CueRefCodecState.global_id
+ @@id ||= Ebml::Id.new(0xeb, 1)
+ return @@id
+ end
+ end
+
+ # From KaxInfo.cpp
+ class Info < Ebml::Master
+ def Info.global_id
+ @@id ||= Ebml::Id.new(0x1549a966, 4)
+ return @@id
+ end
+ end
+
+ class MuxingApp < Ebml::UnicodeString
+ def MuxingApp.global_id
+ @@id ||= Ebml::Id.new(0x4d80, 2)
+ return @@id
+ end
+ end
+
+ class WritingApp < Ebml::UnicodeString
+ def WritingApp.global_id
+ @@id ||= Ebml::Id.new(0x5741, 2)
+ return @@id
+ end
+ end
+
+ # From KaxInfoData.cpp
+ class SegmentUID < Ebml::Binary
+ def SegmentUID.global_id
+ @@id ||= Ebml::Id.new(0x73a4, 2)
+ return @@id
+ end
+ end
+
+ class SegmentFilename < Ebml::UnicodeString
+ def SegmentFilename.global_id
+ @@id ||= Ebml::Id.new(0x7384, 2)
+ return @@id
+ end
+ end
+
+ class PrevUID < Ebml::Binary
+ def PrevUID.global_id
+ @@id ||= Ebml::Id.new(0x3cb923, 3)
+ return @@id
+ end
+ end
+
+ class PrevFilename < Ebml::UnicodeString
+ def PrevFilename.global_id
+ @@id ||= Ebml::Id.new(0x3c83ab, 3)
+ return @@id
+ end
+ end
+
+ class NextUID < Ebml::Binary
+ def NextUID.global_id
+ @@id ||= Ebml::Id.new(0x3eb923, 3)
+ return @@id
+ end
+ end
+
+ class NextFilename < Ebml::UnicodeString
+ def NextFilename.global_id
+ @@id ||= Ebml::Id.new(0x3e83bb, 3)
+ return @@id
+ end
+ end
+
+ class TimecodeScale < Ebml::UInteger
+ def TimecodeScale.global_id
+ @@id ||= Ebml::Id.new(0x2ad7b1, 3)
+ return @@id
+ end
+ end
+
+ class Duration < Ebml::Float
+ def Duration.global_id
+ @@id ||= Ebml::Id.new(0x4489, 2)
+ return @@id
+ end
+ end
+
+ class DateUTC < Ebml::Date
+ def DateUTC.global_id
+ @@id ||= Ebml::Id.new(0x4461, 2)
+ return @@id
+ end
+ end
+
+ class Title < Ebml::UnicodeString
+ def Title.global_id
+ @@id ||= Ebml::Id.new(0x7ba9, 2)
+ return @@id
+ end
+ end
+
+ # From KaxSeekHead.cpp
+ class SeekHead < Ebml::Master
+ def SeekHead.global_id
+ @@id ||= Ebml::Id.new(0x114d9b74, 4)
+ return @@id
+ end
+ end
+
+ class Seek < Ebml::Master
+ def Seek.global_id
+ @@id ||= Ebml::Id.new(0x4dbb, 2)
+ return @@id
+ end
+ end
+
+ class SeekID < Ebml::Binary
+ def SeekID.global_id
+ @@id ||= Ebml::Id.new(0x53ab, 2)
+ return @@id
+ end
+ end
+
+ class SeekPosition < Ebml::UInteger
+ def SeekPosition.global_id
+ @@id ||= Ebml::Id.new(0x53ac, 2)
+ return @@id
+ end
+ end
+
+ # From KaxSegment.cpp
+ class Segment < Ebml::Master
+ def Segment.global_id
+ @@id ||= Ebml::Id.new(0x18538067, 4)
+ return @@id
+ end
+ end
+
+ # From KaxTag.cpp
+ class Tag < Ebml::Master
+ def Tag.global_id
+ @@id ||= Ebml::Id.new(0x7373, 2)
+ return @@id
+ end
+ end
+
+ class TagTargets < Ebml::Master
+ def TagTargets.global_id
+ @@id ||= Ebml::Id.new(0x63c0, 2)
+ return @@id
+ end
+ end
+
+ class TagGeneral < Ebml::Master
+ def TagGeneral.global_id
+ @@id ||= Ebml::Id.new(0x67c9, 2)
+ return @@id
+ end
+ end
+
+ class TagGenres < Ebml::Master
+ def TagGenres.global_id
+ @@id ||= Ebml::Id.new(0x6583, 2)
+ return @@id
+ end
+ end
+
+ class TagAudioSpecific < Ebml::Master
+ def TagAudioSpecific.global_id
+ @@id ||= Ebml::Id.new(0x41c5, 2)
+ return @@id
+ end
+ end
+
+ class TagImageSpecific < Ebml::Master
+ def TagImageSpecific.global_id
+ @@id ||= Ebml::Id.new(0x4990, 2)
+ return @@id
+ end
+ end
+
+ class TagBibliography < Ebml::UnicodeString
+ def TagBibliography.global_id
+ @@id ||= Ebml::Id.new(0x4488, 2)
+ return @@id
+ end
+ end
+
+ class TagEncoder < Ebml::UnicodeString
+ def TagEncoder.global_id
+ @@id ||= Ebml::Id.new(0x4431, 2)
+ return @@id
+ end
+ end
+
+ class TagEncodeSettings < Ebml::UnicodeString
+ def TagEncodeSettings.global_id
+ @@id ||= Ebml::Id.new(0x6526, 2)
+ return @@id
+ end
+ end
+
+ class TagLanguage < Ebml::String
+ def TagLanguage.global_id
+ @@id ||= Ebml::Id.new(0x22b59f, 3)
+ return @@id
+ end
+ end
+
+ class TagLength < Ebml::UInteger
+ def TagLength.global_id
+ @@id ||= Ebml::Id.new(0x5243, 2)
+ return @@id
+ end
+ end
+
+ class TagPlaylistDelay < Ebml::UInteger
+ def TagPlaylistDelay.global_id
+ @@id ||= Ebml::Id.new(0x72cc, 2)
+ return @@id
+ end
+ end
+
+ class TagRating < Ebml::Binary
+ def TagRating.global_id
+ @@id ||= Ebml::Id.new(0x52bc, 2)
+ return @@id
+ end
+ end
+
+ class TagSubject < Ebml::UnicodeString
+ def TagSubject.global_id
+ @@id ||= Ebml::Id.new(0x49c1, 2)
+ return @@id
+ end
+ end
+
+ class TagUnsynchronisedText < Ebml::UnicodeString
+ def TagUnsynchronisedText.global_id
+ @@id ||= Ebml::Id.new(0x874b, 2)
+ return @@id
+ end
+ end
+
+ class TagUserDefinedURL < Ebml::String
+ def TagUserDefinedURL.global_id
+ @@id ||= Ebml::Id.new(0x434a, 2)
+ return @@id
+ end
+ end
+
+ class TagTargetTypeValue < Ebml::UInteger
+ def TagTargetTypeValue.global_id
+ @@id ||= Ebml::Id.new(0x68ca, 2)
+ return @@id
+ end
+ end
+
+ class TagTargetType < Ebml::String
+ def TagTargetType.global_id
+ @@id ||= Ebml::Id.new(0x63ca, 2)
+ return @@id
+ end
+ end
+
+ class TagTrackUID < Ebml::UInteger
+ def TagTrackUID.global_id
+ @@id ||= Ebml::Id.new(0x63c5, 2)
+ return @@id
+ end
+ end
+
+ class TagEditionUID < Ebml::UInteger
+ def TagEditionUID.global_id
+ @@id ||= Ebml::Id.new(0x63c9, 2)
+ return @@id
+ end
+ end
+
+ class TagChapterUID < Ebml::UInteger
+ def TagChapterUID.global_id
+ @@id ||= Ebml::Id.new(0x63c4, 2)
+ return @@id
+ end
+ end
+
+ class TagAttachmentUID < Ebml::UInteger
+ def TagAttachmentUID.global_id
+ @@id ||= Ebml::Id.new(0x63c6, 2)
+ return @@id
+ end
+ end
+
+ class TagAudioGenre < Ebml::String
+ def TagAudioGenre.global_id
+ @@id ||= Ebml::Id.new(0x65c2, 2)
+ return @@id
+ end
+ end
+
+ class TagVideoGenre < Ebml::Binary
+ def TagVideoGenre.global_id
+ @@id ||= Ebml::Id.new(0x65a1, 2)
+ return @@id
+ end
+ end
+
+ class TagSubGenre < Ebml::String
+ def TagSubGenre.global_id
+ @@id ||= Ebml::Id.new(0x65ac, 2)
+ return @@id
+ end
+ end
+
+ class TagAudioEncryption < Ebml::Binary
+ def TagAudioEncryption.global_id
+ @@id ||= Ebml::Id.new(0x41b4, 2)
+ return @@id
+ end
+ end
+
+ class TagAudioGain < Ebml::Float
+ def TagAudioGain.global_id
+ @@id ||= Ebml::Id.new(0x4199, 2)
+ return @@id
+ end
+ end
+
+ class TagAudioPeak < Ebml::Float
+ def TagAudioPeak.global_id
+ @@id ||= Ebml::Id.new(0x4189, 2)
+ return @@id
+ end
+ end
+
+ class TagBPM < Ebml::Float
+ def TagBPM.global_id
+ @@id ||= Ebml::Id.new(0x41a1, 2)
+ return @@id
+ end
+ end
+
+ class TagDiscTrack < Ebml::UInteger
+ def TagDiscTrack.global_id
+ @@id ||= Ebml::Id.new(0x41b6, 2)
+ return @@id
+ end
+ end
+
+ class TagSetPart < Ebml::UInteger
+ def TagSetPart.global_id
+ @@id ||= Ebml::Id.new(0x416e, 2)
+ return @@id
+ end
+ end
+
+ class TagEqualisation < Ebml::Binary
+ def TagEqualisation.global_id
+ @@id ||= Ebml::Id.new(0x41b1, 2)
+ return @@id
+ end
+ end
+
+ class TagInitialKey < Ebml::String
+ def TagInitialKey.global_id
+ @@id ||= Ebml::Id.new(0x413a, 2)
+ return @@id
+ end
+ end
+
+ class TagOfficialAudioFileURL < Ebml::String
+ def TagOfficialAudioFileURL.global_id
+ @@id ||= Ebml::Id.new(0x4133, 2)
+ return @@id
+ end
+ end
+
+ class TagOfficialAudioSourceURL < Ebml::String
+ def TagOfficialAudioSourceURL.global_id
+ @@id ||= Ebml::Id.new(0x413e, 2)
+ return @@id
+ end
+ end
+
+ class TagArchivalLocation < Ebml::UnicodeString
+ def TagArchivalLocation.global_id
+ @@id ||= Ebml::Id.new(0x45a4, 2)
+ return @@id
+ end
+ end
+
+ class TagFile < Ebml::UnicodeString
+ def TagFile.global_id
+ @@id ||= Ebml::Id.new(0x454e, 2)
+ return @@id
+ end
+ end
+
+ class TagKeywords < Ebml::UnicodeString
+ def TagKeywords.global_id
+ @@id ||= Ebml::Id.new(0x458c, 2)
+ return @@id
+ end
+ end
+
+ class TagMood < Ebml::UnicodeString
+ def TagMood.global_id
+ @@id ||= Ebml::Id.new(0x45ae, 2)
+ return @@id
+ end
+ end
+
+ class TagRecordLocation < Ebml::String
+ def TagRecordLocation.global_id
+ @@id ||= Ebml::Id.new(0x457e, 2)
+ return @@id
+ end
+ end
+
+ class TagSource < Ebml::UnicodeString
+ def TagSource.global_id
+ @@id ||= Ebml::Id.new(0x458a, 2)
+ return @@id
+ end
+ end
+
+ class TagSourceForm < Ebml::UnicodeString
+ def TagSourceForm.global_id
+ @@id ||= Ebml::Id.new(0x45b5, 2)
+ return @@id
+ end
+ end
+
+ class TagProduct < Ebml::UnicodeString
+ def TagProduct.global_id
+ @@id ||= Ebml::Id.new(0x45e3, 2)
+ return @@id
+ end
+ end
+
+ class TagOriginalMediaType < Ebml::UnicodeString
+ def TagOriginalMediaType.global_id
+ @@id ||= Ebml::Id.new(0x45a7, 2)
+ return @@id
+ end
+ end
+
+ class TagPlayCounter < Ebml::UInteger
+ def TagPlayCounter.global_id
+ @@id ||= Ebml::Id.new(0x4566, 2)
+ return @@id
+ end
+ end
+
+ class TagPopularimeter < Ebml::SInteger
+ def TagPopularimeter.global_id
+ @@id ||= Ebml::Id.new(0x4532, 2)
+ return @@id
+ end
+ end
+
+ class TagCaptureDPI < Ebml::UInteger
+ def TagCaptureDPI.global_id
+ @@id ||= Ebml::Id.new(0x49c7, 2)
+ return @@id
+ end
+ end
+
+ class TagCaptureLightness < Ebml::Binary
+ def TagCaptureLightness.global_id
+ @@id ||= Ebml::Id.new(0x49e1, 2)
+ return @@id
+ end
+ end
+
+ class TagCapturePaletteSetting < Ebml::UInteger
+ def TagCapturePaletteSetting.global_id
+ @@id ||= Ebml::Id.new(0x4934, 2)
+ return @@id
+ end
+ end
+
+ class TagCaptureSharpness < Ebml::Binary
+ def TagCaptureSharpness.global_id
+ @@id ||= Ebml::Id.new(0x4922, 2)
+ return @@id
+ end
+ end
+
+ class TagCropped < Ebml::UnicodeString
+ def TagCropped.global_id
+ @@id ||= Ebml::Id.new(0x4987, 2)
+ return @@id
+ end
+ end
+
+ class TagOriginalDimensions < Ebml::String
+ def TagOriginalDimensions.global_id
+ @@id ||= Ebml::Id.new(0x4933, 2)
+ return @@id
+ end
+ end
+
+ class TagSimple < Ebml::Master
+ def TagSimple.global_id
+ @@id ||= Ebml::Id.new(0x67c8, 2)
+ return @@id
+ end
+ end
+
+ class TagName < Ebml::UnicodeString
+ def TagName.global_id
+ @@id ||= Ebml::Id.new(0x45a3, 2)
+ return @@id
+ end
+ end
+
+ class TagLangue < Ebml::String
+ def TagLangue.global_id
+ @@id ||= Ebml::Id.new(0x447a, 2)
+ return @@id
+ end
+ end
+
+ class TagDefault < Ebml::UInteger
+ def TagDefault.global_id
+ @@id ||= Ebml::Id.new(0x44b4, 2)
+ return @@id
+ end
+ end
+
+ class TagString < Ebml::UnicodeString
+ def TagString.global_id
+ @@id ||= Ebml::Id.new(0x4487, 2)
+ return @@id
+ end
+ end
+
+ class TagBinary < Ebml::Binary
+ def TagBinary.global_id
+ @@id ||= Ebml::Id.new(0x4485, 2)
+ return @@id
+ end
+ end
+
+ # From KaxTagMulti.cpp
+ class TagMultiComment < Ebml::Master
+ def TagMultiComment.global_id
+ @@id ||= Ebml::Id.new(0x5b7b, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiCommentName < Ebml::String
+ def TagMultiCommentName.global_id
+ @@id ||= Ebml::Id.new(0x5f7d, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiCommentComments < Ebml::UnicodeString
+ def TagMultiCommentComments.global_id
+ @@id ||= Ebml::Id.new(0x5f7c, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiCommentLanguage < Ebml::String
+ def TagMultiCommentLanguage.global_id
+ @@id ||= Ebml::Id.new(0x22b59d, 3)
+ return @@id
+ end
+ end
+
+ class TagMultiCommercial < Ebml::Master
+ def TagMultiCommercial.global_id
+ @@id ||= Ebml::Id.new(0x4dc7, 2)
+ return @@id
+ end
+ end
+
+ class TagCommercial < Ebml::Master
+ def TagCommercial.global_id
+ @@id ||= Ebml::Id.new(0x4ec7, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiCommercialType < Ebml::UInteger
+ def TagMultiCommercialType.global_id
+ @@id ||= Ebml::Id.new(0x5bd7, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiCommercialAddress < Ebml::UnicodeString
+ def TagMultiCommercialAddress.global_id
+ @@id ||= Ebml::Id.new(0x5bbb, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiCommercialURL < Ebml::String
+ def TagMultiCommercialURL.global_id
+ @@id ||= Ebml::Id.new(0x5bda, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiCommercialEmail < Ebml::String
+ def TagMultiCommercialEmail.global_id
+ @@id ||= Ebml::Id.new(0x5bc0, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiPrice < Ebml::Master
+ def TagMultiPrice.global_id
+ @@id ||= Ebml::Id.new(0x5bc3, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiPriceCurrency < Ebml::String
+ def TagMultiPriceCurrency.global_id
+ @@id ||= Ebml::Id.new(0x5b6c, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiPriceAmount < Ebml::Float
+ def TagMultiPriceAmount.global_id
+ @@id ||= Ebml::Id.new(0x5b6e, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiPricePriceDate < Ebml::Date
+ def TagMultiPricePriceDate.global_id
+ @@id ||= Ebml::Id.new(0x5b6f, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiDate < Ebml::Master
+ def TagMultiDate.global_id
+ @@id ||= Ebml::Id.new(0x4dc8, 2)
+ return @@id
+ end
+ end
+
+ class TagDate < Ebml::Master
+ def TagDate.global_id
+ @@id ||= Ebml::Id.new(0x4ec8, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiDateType < Ebml::UInteger
+ def TagMultiDateType.global_id
+ @@id ||= Ebml::Id.new(0x5bd8, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiDateDateBegin < Ebml::Date
+ def TagMultiDateDateBegin.global_id
+ @@id ||= Ebml::Id.new(0x4460, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiDateDateEnd < Ebml::Date
+ def TagMultiDateDateEnd.global_id
+ @@id ||= Ebml::Id.new(0x4462, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiEntity < Ebml::Master
+ def TagMultiEntity.global_id
+ @@id ||= Ebml::Id.new(0x4dc9, 2)
+ return @@id
+ end
+ end
+
+ class TagEntity < Ebml::Master
+ def TagEntity.global_id
+ @@id ||= Ebml::Id.new(0x4ec9, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiEntityType < Ebml::UInteger
+ def TagMultiEntityType.global_id
+ @@id ||= Ebml::Id.new(0x5bd9, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiEntityName < Ebml::UnicodeString
+ def TagMultiEntityName.global_id
+ @@id ||= Ebml::Id.new(0x5bed, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiEntityAddress < Ebml::UnicodeString
+ def TagMultiEntityAddress.global_id
+ @@id ||= Ebml::Id.new(0x5bdc, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiEntityURL < Ebml::String
+ def TagMultiEntityURL.global_id
+ @@id ||= Ebml::Id.new(0x5bdb, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiEntityEmail < Ebml::String
+ def TagMultiEntityEmail.global_id
+ @@id ||= Ebml::Id.new(0x5bc1, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiIdentifier < Ebml::Master
+ def TagMultiIdentifier.global_id
+ @@id ||= Ebml::Id.new(0x4dc6, 2)
+ return @@id
+ end
+ end
+
+ class TagIdentifier < Ebml::Master
+ def TagIdentifier.global_id
+ @@id ||= Ebml::Id.new(0x4ec6, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiIdentifierType < Ebml::UInteger
+ def TagMultiIdentifierType.global_id
+ @@id ||= Ebml::Id.new(0x5bad, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiIdentifierBinary < Ebml::Binary
+ def TagMultiIdentifierBinary.global_id
+ @@id ||= Ebml::Id.new(0x6b67, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiIdentifierString < Ebml::UnicodeString
+ def TagMultiIdentifierString.global_id
+ @@id ||= Ebml::Id.new(0x6b68, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiLegal < Ebml::Master
+ def TagMultiLegal.global_id
+ @@id ||= Ebml::Id.new(0x4dc5, 2)
+ return @@id
+ end
+ end
+
+ class TagLegal < Ebml::Master
+ def TagLegal.global_id
+ @@id ||= Ebml::Id.new(0x4ec5, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiLegalType < Ebml::UInteger
+ def TagMultiLegalType.global_id
+ @@id ||= Ebml::Id.new(0x5bbd, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiLegalContent < Ebml::UnicodeString
+ def TagMultiLegalContent.global_id
+ @@id ||= Ebml::Id.new(0x5bb2, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiLegalURL < Ebml::String
+ def TagMultiLegalURL.global_id
+ @@id ||= Ebml::Id.new(0x5b34, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiLegalAddress < Ebml::UnicodeString
+ def TagMultiLegalAddress.global_id
+ @@id ||= Ebml::Id.new(0x5b9b, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitle < Ebml::Master
+ def TagMultiTitle.global_id
+ @@id ||= Ebml::Id.new(0x4dc4, 2)
+ return @@id
+ end
+ end
+
+ class TagTitle < Ebml::Master
+ def TagTitle.global_id
+ @@id ||= Ebml::Id.new(0x4ec4, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitleType < Ebml::UInteger
+ def TagMultiTitleType.global_id
+ @@id ||= Ebml::Id.new(0x5b7d, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitleName < Ebml::UnicodeString
+ def TagMultiTitleName.global_id
+ @@id ||= Ebml::Id.new(0x5bb9, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitleSubTitle < Ebml::UnicodeString
+ def TagMultiTitleSubTitle.global_id
+ @@id ||= Ebml::Id.new(0x5b5b, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitleEdition < Ebml::UnicodeString
+ def TagMultiTitleEdition.global_id
+ @@id ||= Ebml::Id.new(0x5bae, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitleAddress < Ebml::UnicodeString
+ def TagMultiTitleAddress.global_id
+ @@id ||= Ebml::Id.new(0x5b33, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitleURL < Ebml::String
+ def TagMultiTitleURL.global_id
+ @@id ||= Ebml::Id.new(0x5ba9, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitleEmail < Ebml::String
+ def TagMultiTitleEmail.global_id
+ @@id ||= Ebml::Id.new(0x5bc9, 2)
+ return @@id
+ end
+ end
+
+ class TagMultiTitleLanguage < Ebml::String
+ def TagMultiTitleLanguage.global_id
+ @@id ||= Ebml::Id.new(0x22b59e, 3)
+ return @@id
+ end
+ end
+
+ class TagMultiAttachment < Ebml::Master
+ def TagMultiAttachment.global_id
+ @@id ||= Ebml::Id.new(0x4dc3, 2)
+ return @@id
+ end
+ end
+
+ class TagAttachment < Ebml::Master
+ def TagAttachment.global_id
+ @@id ||= Ebml::Id.new(0x4ec3, 2)
+ return @@id
+ end
+ end
+
+ class TagAttachmentID < Ebml::UInteger
+ def TagAttachmentID.global_id
+ @@id ||= Ebml::Id.new(0x5ba0, 2)
+ return @@id
+ end
+ end
+
+ # From KaxTags.cpp
+ class Tags < Ebml::Master
+ def Tags.global_id
+ @@id ||= Ebml::Id.new(0x1254c367, 4)
+ return @@id
+ end
+ end
+
+ # From KaxTrackAudio.cpp
+ class TrackAudio < Ebml::Master
+ def TrackAudio.global_id
+ @@id ||= Ebml::Id.new(0xe1, 1)
+ return @@id
+ end
+ end
+
+ class AudioSamplingFreq < Ebml::Float
+ def AudioSamplingFreq.global_id
+ @@id ||= Ebml::Id.new(0xb5, 1)
+ return @@id
+ end
+ end
+
+ class AudioOutputSamplingFreq < Ebml::Float
+ def AudioOutputSamplingFreq.global_id
+ @@id ||= Ebml::Id.new(0x78b5, 2)
+ return @@id
+ end
+ end
+
+ class AudioChannels < Ebml::UInteger
+ def AudioChannels.global_id
+ @@id ||= Ebml::Id.new(0x9f, 1)
+ return @@id
+ end
+ end
+
+ class AudioBitDepth < Ebml::UInteger
+ def AudioBitDepth.global_id
+ @@id ||= Ebml::Id.new(0x6264, 2)
+ return @@id
+ end
+ end
+
+ class AudioPosition < Ebml::Binary
+ def AudioPosition.global_id
+ @@id ||= Ebml::Id.new(0x7d7b, 2)
+ return @@id
+ end
+ end
+
+ # From KaxTrackEntryData.cpp
+ class TrackNumber < Ebml::UInteger
+ def TrackNumber.global_id
+ @@id ||= Ebml::Id.new(0xd7, 1)
+ return @@id
+ end
+ end
+
+ class TrackUID < Ebml::UInteger
+ def TrackUID.global_id
+ @@id ||= Ebml::Id.new(0x73c5, 2)
+ return @@id
+ end
+ end
+
+ class TrackType < Ebml::UInteger
+ def TrackType.global_id
+ @@id ||= Ebml::Id.new(0x83, 1)
+ return @@id
+ end
+ end
+
+ class TrackFlagDefault < Ebml::UInteger
+ def TrackFlagDefault.global_id
+ @@id ||= Ebml::Id.new(0x88, 1)
+ return @@id
+ end
+ end
+
+ class TrackFlagLacing < Ebml::UInteger
+ def TrackFlagLacing.global_id
+ @@id ||= Ebml::Id.new(0x9c, 1)
+ return @@id
+ end
+ end
+
+ class TrackMinCache < Ebml::UInteger
+ def TrackMinCache.global_id
+ @@id ||= Ebml::Id.new(0x6de7, 2)
+ return @@id
+ end
+ end
+
+ class TrackMaxCache < Ebml::UInteger
+ def TrackMaxCache.global_id
+ @@id ||= Ebml::Id.new(0x6df8, 2)
+ return @@id
+ end
+ end
+
+ class TrackDefaultDuration < Ebml::UInteger
+ def TrackDefaultDuration.global_id
+ @@id ||= Ebml::Id.new(0x23e383, 3)
+ return @@id
+ end
+ end
+
+ class TrackTimecodeScale < Ebml::Float
+ def TrackTimecodeScale.global_id
+ @@id ||= Ebml::Id.new(0x23314f, 3)
+ return @@id
+ end
+ end
+
+ class TrackName < Ebml::UnicodeString
+ def TrackName.global_id
+ @@id ||= Ebml::Id.new(0x536e, 2)
+ return @@id
+ end
+ end
+
+ class TrackLanguage < Ebml::String
+ def TrackLanguage.global_id
+ @@id ||= Ebml::Id.new(0x22b59c, 3)
+ return @@id
+ end
+ end
+
+ class CodecID < Ebml::String
+ def CodecID.global_id
+ @@id ||= Ebml::Id.new(0x86, 1)
+ return @@id
+ end
+ end
+
+ class CodecPrivate < Ebml::Binary
+ def CodecPrivate.global_id
+ @@id ||= Ebml::Id.new(0x63a2, 2)
+ return @@id
+ end
+ end
+
+ class CodecName < Ebml::UnicodeString
+ def CodecName.global_id
+ @@id ||= Ebml::Id.new(0x258688, 3)
+ return @@id
+ end
+ end
+
+ class TrackFlagEnabled < Ebml::UInteger
+ def TrackFlagEnabled.global_id
+ @@id ||= Ebml::Id.new(0xb9, 1)
+ return @@id
+ end
+ end
+
+ class CodecSettings < Ebml::UnicodeString
+ def CodecSettings.global_id
+ @@id ||= Ebml::Id.new(0x3a9697, 3)
+ return @@id
+ end
+ end
+
+ class CodecInfoURL < Ebml::String
+ def CodecInfoURL.global_id
+ @@id ||= Ebml::Id.new(0x3b4040, 3)
+ return @@id
+ end
+ end
+
+ class CodecDownloadURL < Ebml::String
+ def CodecDownloadURL.global_id
+ @@id ||= Ebml::Id.new(0x26b240, 3)
+ return @@id
+ end
+ end
+
+ class CodecDecodeAll < Ebml::UInteger
+ def CodecDecodeAll.global_id
+ @@id ||= Ebml::Id.new(0xaa, 1)
+ return @@id
+ end
+ end
+
+ class TrackOverlay < Ebml::UInteger
+ def TrackOverlay.global_id
+ @@id ||= Ebml::Id.new(0x6fab, 2)
+ return @@id
+ end
+ end
+
+ # From KaxTracks.cpp
+ class Tracks < Ebml::Master
+ def Tracks.global_id
+ @@id ||= Ebml::Id.new(0x1654ae6b, 4)
+ return @@id
+ end
+ end
+
+ class TrackEntry < Ebml::Master
+ def TrackEntry.global_id
+ @@id ||= Ebml::Id.new(0xae, 1)
+ return @@id
+ end
+ end
+
+ # From KaxTrackVideo.cpp
+ class TrackVideo < Ebml::Master
+ def TrackVideo.global_id
+ @@id ||= Ebml::Id.new(0xe0, 1)
+ return @@id
+ end
+ end
+
+ class VideoPixelWidth < Ebml::UInteger
+ def VideoPixelWidth.global_id
+ @@id ||= Ebml::Id.new(0xb0, 1)
+ return @@id
+ end
+ end
+
+ class VideoPixelHeight < Ebml::UInteger
+ def VideoPixelHeight.global_id
+ @@id ||= Ebml::Id.new(0xba, 1)
+ return @@id
+ end
+ end
+
+ class VideoPixelCropBottom < Ebml::UInteger
+ def VideoPixelCropBottom.global_id
+ @@id ||= Ebml::Id.new(0x54aa, 2)
+ return @@id
+ end
+ end
+
+ class VideoPixelCropTop < Ebml::UInteger
+ def VideoPixelCropTop.global_id
+ @@id ||= Ebml::Id.new(0x54bb, 2)
+ return @@id
+ end
+ end
+
+ class VideoPixelCropLeft < Ebml::UInteger
+ def VideoPixelCropLeft.global_id
+ @@id ||= Ebml::Id.new(0x54cc, 2)
+ return @@id
+ end
+ end
+
+ class VideoPixelCropRight < Ebml::UInteger
+ def VideoPixelCropRight.global_id
+ @@id ||= Ebml::Id.new(0x54dd, 2)
+ return @@id
+ end
+ end
+
+ class VideoDisplayWidth < Ebml::UInteger
+ def VideoDisplayWidth.global_id
+ @@id ||= Ebml::Id.new(0x54b0, 2)
+ return @@id
+ end
+ end
+
+ class VideoDisplayHeight < Ebml::UInteger
+ def VideoDisplayHeight.global_id
+ @@id ||= Ebml::Id.new(0x54ba, 2)
+ return @@id
+ end
+ end
+
+ class VideoColourSpace < Ebml::Binary
+ def VideoColourSpace.global_id
+ @@id ||= Ebml::Id.new(0x2eb524, 3)
+ return @@id
+ end
+ end
+
+ class VideoFrameRate < Ebml::Float
+ def VideoFrameRate.global_id
+ @@id ||= Ebml::Id.new(0x2383e3, 3)
+ return @@id
+ end
+ end
+
+ class VideoFlagInterlaced < Ebml::UInteger
+ def VideoFlagInterlaced.global_id
+ @@id ||= Ebml::Id.new(0x9a, 1)
+ return @@id
+ end
+ end
+
+ class VideoStereoMode < Ebml::UInteger
+ def VideoStereoMode.global_id
+ @@id ||= Ebml::Id.new(0x53b9, 2)
+ return @@id
+ end
+ end
+
+ class VideoDisplayUnit < Ebml::UInteger
+ def VideoDisplayUnit.global_id
+ @@id ||= Ebml::Id.new(0x54b2, 2)
+ return @@id
+ end
+ end
+
+ class VideoAspectRatio < Ebml::UInteger
+ def VideoAspectRatio.global_id
+ @@id ||= Ebml::Id.new(0x54b3, 1)
+ return @@id
+ end
+ end
+
+ class VideoGamma < Ebml::Float
+ def VideoGamma.global_id
+ @@id ||= Ebml::Id.new(0x2fb523, 3)
+ return @@id
+ end
+ end
+
+end
Property changes on: trunk/RbMatroska/matroska.rb
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Added: trunk/RbMatroska/mkvinfo.rb
===================================================================
--- trunk/RbMatroska/mkvinfo.rb 2004-09-06 09:47:20 UTC (rev 746)
+++ trunk/RbMatroska/mkvinfo.rb 2004-09-06 10:45:16 UTC (rev 747)
@@ -0,0 +1,56 @@
+#!/usr/bin/ruby
+
+require "ebml"
+
+def dump_rec(element, level = 0)
+ print("|") if (level > 1)
+ 1.upto(level - 1) { print(" ") }
+ print("+ ") if (level > 0)
+ print(element.class.name.gsub(/^Ebml::/, "Ebml").gsub(/^Matroska::/, ""))
+ if (element.class.superclass != Ebml::Master)
+ print(" (" + element.to_s + ")")
+ end
+ puts(" at " + element.position.to_s)
+ if (element.class.superclass == Ebml::Master)
+ element.children.each { |c| dump_rec(c, level + 1) }
+ end
+end
+
+def handle_segment(element, f)
+ dump_rec(element)
+ while (true)
+ element = f.read_element_head
+ return if (element.class == NilClass)
+ element.read(f)
+ dump_rec(element, 1)
+ end
+end
+
+ARGV.each do |name|
+ io = File.new(name)
+ f = Ebml::File.new(io)
+ f.map_ids("Matroska")
+
+ element = f.read_element_head
+ if ((element.class == NilClass) or
+ (element.class.global_id != Ebml::Head.global_id))
+ puts("No EBML file")
+ exit(1)
+ end
+
+ element.read(f)
+ dump_rec(element)
+
+ while (true)
+ element.skip(f)
+ element = f.read_element_head
+ break if (element.class == NilClass)
+ if (element.class == Matroska::Segment)
+ handle_segment(element, f)
+ else
+ dump_rec(element)
+ end
+ end
+
+ io.close
+end
Property changes on: trunk/RbMatroska/mkvinfo.rb
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.