Class: BMFF::Box::PaddingBits

Inherits:
Full
  • Object
show all
Defined in:
lib/bmff/box/padding_bits.rb

Overview

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

Instance Attribute Summary collapse

Attributes inherited from Full

#flags, #version

Attributes inherited from Base

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

Instance Method Summary collapse

Methods inherited from Base

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

Instance Attribute Details

#pad1Object

Returns the value of attribute pad1.



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

def pad1
  @pad1
end

#pad2Object

Returns the value of attribute pad2.



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

def pad2
  @pad2
end

#reserved1Object

Returns the value of attribute reserved1.



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

def reserved1
  @reserved1
end

#reserved2Object

Returns the value of attribute reserved2.



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

def reserved2
  @reserved2
end

#sample_countObject

Returns the value of attribute sample_count.



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

def sample_count
  @sample_count
end

Instance Method Details

#parse_dataObject



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/bmff/box/padding_bits.rb', line 8

def parse_data
  super
  @sample_count = io.get_uint32
  @reserved1 = []
  @pad1 = []
  @reserved2 = []
  @pad2 = []
  ((@sample_count + 1) / 2).times do
    tmp = io.get_uint8
    @reserved1 << ((tmp & 0x80) > 0)
    @pad1 << ((tmp >> 4) & 0x07)
    @reserved2 << ((tmp & 0x08) > 0)
    @pad2 << (tmp & 0x07)
  end
end