Class: BMFF::Box::MovieHeader

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

#creation_timeObject

Returns the value of attribute creation_time.



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

def creation_time
  @creation_time
end

#durationObject

Returns the value of attribute duration.



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

def duration
  @duration
end

#matrixObject

Returns the value of attribute matrix.



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

def matrix
  @matrix
end

#modification_timeObject

Returns the value of attribute modification_time.



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

def modification_time
  @modification_time
end

#next_track_idObject

Returns the value of attribute next_track_id.



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

def next_track_id
  @next_track_id
end

#pre_definedObject

Returns the value of attribute pre_defined.



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

def pre_defined
  @pre_defined
end

#rateObject

Returns the value of attribute rate.



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

def rate
  @rate
end

#reserved1Object

Returns the value of attribute reserved1.



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

def reserved1
  @reserved1
end

#reserved2Object

Returns the value of attribute reserved2.



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

def reserved2
  @reserved2
end

#timescaleObject

Returns the value of attribute timescale.



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

def timescale
  @timescale
end

#volumeObject

Returns the value of attribute volume.



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

def volume
  @volume
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
31
32
33
34
35
# File 'lib/bmff/box/movie_header.rb', line 9

def parse_data
  super
  if version == 1
    @creation_time = io.get_uint64
    @modification_time = io.get_uint64
    @timescale = io.get_uint32
    @duration = io.get_uint64
  else
    @creation_time = io.get_uint32
    @modification_time = io.get_uint32
    @timescale = io.get_uint32
    @duration = io.get_uint32
  end
  @rate = io.get_int32
  @volume = io.get_int16
  @reserved1 = io.get_byte(2)
  @reserved2 = [io.get_uint32, io.get_uint32]
  @matrix = []
  9.times do
    @matrix << io.get_int32
  end
  @pre_defined = []
  6.times do
    @pre_defined << io.get_byte(4)
  end
  @next_track_id = io.get_uint32
end