Class: BMFF::Box::SampleDescription

Inherits:
Full
  • Object
show all
Includes:
Container
Defined in:
lib/bmff/box/sample_description.rb

Overview

vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:

Instance Attribute Summary collapse

Attributes included from Container

#children

Attributes inherited from Full

#flags, #version

Attributes inherited from Base

#io, #largesize, #offset, #parent, #size, #type, #usertype

Instance Method Summary collapse

Methods included from Container

#add_child, #container?, #find, #find_all, #parse_children, #select_descendants

Methods inherited from Base

#actual_size, #container?, #eob?, #parse, register_box, register_uuid_box, #remaining_size, #root, #seek_to_end

Instance Attribute Details

#entry_countObject

Returns the value of attribute entry_count.



5
6
7
# File 'lib/bmff/box/sample_description.rb', line 5

def entry_count
  @entry_count
end

Instance Method Details

#parse_dataObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/bmff/box/sample_description.rb', line 9

def parse_data
  super
  @entry_count = io.get_uint32
  if handler = parent.parent.parent.find(BMFF::Box::Handler)
    @entry_count.times do
      case handler.handler_type
      when "soun"
        add_child BMFF::Box.get_box(io, self, BMFF::Box::AudioSampleEntry)
      when "vide"
        add_child BMFF::Box.get_box(io, self, BMFF::Box::VisualSampleEntry)
      when "hint"
        add_child BMFF::Box.get_box(io, self, BMFF::Box::HintSampleEntry)
      when "meta"
        add_child BMFF::Box.get_box(io, self)
      end
    end
  end
end