Class: BMFF::Box::CompactSampleSize
- Defined in:
- lib/bmff/box/compact_sample_size.rb
Overview
vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:
Instance Attribute Summary collapse
-
#entry_size ⇒ Object
Returns the value of attribute entry_size.
-
#field_size ⇒ Object
Returns the value of attribute field_size.
-
#reserved1 ⇒ Object
Returns the value of attribute reserved1.
-
#sample_count ⇒ Object
Returns the value of attribute sample_count.
Attributes inherited from Full
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, #remaining_size, #seek_to_end
Instance Attribute Details
#entry_size ⇒ Object
Returns the value of attribute entry_size.
5 6 7 |
# File 'lib/bmff/box/compact_sample_size.rb', line 5 def entry_size @entry_size end |
#field_size ⇒ Object
Returns the value of attribute field_size.
5 6 7 |
# File 'lib/bmff/box/compact_sample_size.rb', line 5 def field_size @field_size end |
#reserved1 ⇒ Object
Returns the value of attribute reserved1.
5 6 7 |
# File 'lib/bmff/box/compact_sample_size.rb', line 5 def reserved1 @reserved1 end |
#sample_count ⇒ Object
Returns the value of attribute sample_count.
5 6 7 |
# File 'lib/bmff/box/compact_sample_size.rb', line 5 def sample_count @sample_count end |
Instance Method Details
#parse_data ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bmff/box/compact_sample_size.rb', line 8 def parse_data super @reserved1 = io.get_uint24 @field_size = io.get_uint8 @sample_count = io.get_uint32 @entry_size = [] i = 0 while i < @sample_count case @field_size when 4 tmp = io.get_uint8 @entry_size << (tmp >> 4) i += 1 @entry_size << (tmp & 0x0F) if i < @sample_count when 8 @entry_size << io.get_uint8 when 16 @entry_size << io.get_uint16 else raise ArgumentError, "Unsupported field_size" end i += 1 end end |