Class: BMFF::Box::SegmentIndex

Inherits:
Full
  • Object
show all
Defined in:
lib/bmff/box/segment_index.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

#earliest_presentation_time ⇒ Object

Returns the value of attribute earliest_presentation_time.



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

def earliest_presentation_time
  @earliest_presentation_time
end

#first_offset ⇒ Object

Returns the value of attribute first_offset.



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

def first_offset
  @first_offset
end

#reference_count ⇒ Object

Returns the value of attribute reference_count.



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

def reference_count
  @reference_count
end

#reference_id ⇒ Object

Returns the value of attribute reference_id.



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

def reference_id
  @reference_id
end

#reference_type ⇒ Object

Returns the value of attribute reference_type.



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

def reference_type
  @reference_type
end

#referenced_size ⇒ Object

Returns the value of attribute referenced_size.



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

def referenced_size
  @referenced_size
end

#reserved1 ⇒ Object

Returns the value of attribute reserved1.



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

def reserved1
  @reserved1
end

#sap_delta_time ⇒ Object

Returns the value of attribute sap_delta_time.



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

def sap_delta_time
  @sap_delta_time
end

#sap_type ⇒ Object

Returns the value of attribute sap_type.



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

def sap_type
  @sap_type
end

#start_with_sap ⇒ Object

Returns the value of attribute start_with_sap.



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

def start_with_sap
  @start_with_sap
end

#subsegment_duration ⇒ Object

Returns the value of attribute subsegment_duration.



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

def subsegment_duration
  @subsegment_duration
end

#timescale ⇒ Object

Returns the value of attribute timescale.



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

def timescale
  @timescale
end

Instance Method Details

#parse_data ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/bmff/box/segment_index.rb', line 12

def parse_data
  super
  @reference_id = io.get_uint32
  @timescale = io.get_uint32
  if version == 0
    @earliest_presentation_time = io.get_uint32
    @first_offset = io.get_uint32
  else
    @earliest_presentation_time = io.get_uint64
    @first_offset = io.get_uint64
  end
  @reserved1 = io.get_uint16
  @reference_count = io.get_uint16
  @reference_type = []
  @referenced_size = []
  @subsegment_duration = []
  @start_with_sap = []
  @sap_type = []
  @sap_delta_time = []
  @reference_count.times do
    tmp = io.get_uint32
    @reference_type << ((tmp & 0x80000000) > 0)
    @referenced_size << (tmp & 0x7FFFFFFF)
    @subsegment_duration << io.get_uint32
    tmp = io.get_uint32
    @start_with_sap << ((tmp & 0x80000000) > 0)
    @sap_type << ((tmp >> 28) & 0x07)
    @sap_delta_time << (tmp & 0x0FFFFFFF)
  end
end