Class: BMFF::Box::TrackRun

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

#data_offsetObject

Returns the value of attribute data_offset.



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

def data_offset
  @data_offset
end

#first_sample_flagsObject

Returns the value of attribute first_sample_flags.



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

def first_sample_flags
  @first_sample_flags
end

#sample_composition_time_offsetObject

Returns the value of attribute sample_composition_time_offset.



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

def sample_composition_time_offset
  @sample_composition_time_offset
end

#sample_countObject

Returns the value of attribute sample_count.



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

def sample_count
  @sample_count
end

#sample_durationObject

Returns the value of attribute sample_duration.



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

def sample_duration
  @sample_duration
end

#sample_flagsObject

Returns the value of attribute sample_flags.



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

def sample_flags
  @sample_flags
end

#sample_sizeObject

Returns the value of attribute sample_size.



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

def sample_size
  @sample_size
end

Instance Method Details

#parse_dataObject



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

def parse_data
  super
  @sample_count = io.get_uint32
  @data_offset = io.get_int32 if flags & 0x01 > 0
  @first_sample_flags = io.get_uint32 if flags & 0x04 > 0
  @sample_duration = [] if flags & 0x0100 > 0
  @sample_size = [] if flags & 0x0200 > 0
  @sample_flags = [] if flags & 0x0400 > 0
  @sample_composition_time_offset = [] if flags & 0x0800 > 0
  @sample_count.times do
    @sample_duration << io.get_uint32 if flags & 0x0100 > 0
    @sample_size << io.get_uint32 if flags & 0x0200 > 0
    @sample_flags << io.get_uint32 if flags & 0x0400 > 0
    if flags & 0x0800 > 0
      if version == 0
        @sample_composition_time_offset << io.get_uint32
      else
        @sample_composition_time_offset << io.get_int32
      end
    end
  end
end