Class: MP4::Layout::Free

Inherits:
Atom
  • Object
show all
Defined in:
lib/mp4/layout/free.rb

Instance Attribute Summary

Attributes inherited from Atom

#cache, #media_cache, #track_id

Instance Method Summary collapse

Methods inherited from Atom

generate, #generate

Constructor Details

#initialize(_cache, _media_cache, opts = {}) ⇒ Free

Returns a new instance of Free.



4
5
6
# File 'lib/mp4/layout/free.rb', line 4

def initialize(_cache, _media_cache, opts = {})
  @size = opts.fetch(:size)
end

Instance Method Details

#binary_contentObject



12
13
14
# File 'lib/mp4/layout/free.rb', line 12

def binary_content
  @binary_content ||= Array.new(50 - @size - MP4::Constants::GENERIC_HEADER_SIZE) { "\x00" }.join
end

#memoized_ftypObject



16
17
18
# File 'lib/mp4/layout/free.rb', line 16

def memoized_ftyp
  @memoized_ftyp ||= @cache.ftyp
end

#nameObject



8
9
10
# File 'lib/mp4/layout/free.rb', line 8

def name
  'free'
end