Class: MP4::Layout::Atom
- Inherits:
-
Object
- Object
- MP4::Layout::Atom
- Defined in:
- lib/mp4/layout/atom.rb
Direct Known Subclasses
Ctts, Dinf, Elst, Free, Ftyp, Hdlr, Mdat, Mdhd, Mvhd, Stco, Stsc, Stsd, Stss, Stsz, Stts, Tkhd, VSmhd
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#media_cache ⇒ Object
Returns the value of attribute media_cache.
-
#track_id ⇒ Object
Returns the value of attribute track_id.
Class Method Summary collapse
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(cache, media_cache, opts = {}) ⇒ Atom
constructor
A new instance of Atom.
Constructor Details
#initialize(cache, media_cache, opts = {}) ⇒ Atom
Returns a new instance of Atom.
9 10 11 12 13 |
# File 'lib/mp4/layout/atom.rb', line 9 def initialize(cache, media_cache, opts = {}) @cache = cache @media_cache = media_cache @track_id = opts.fetch(:track_id, nil) end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
3 4 5 |
# File 'lib/mp4/layout/atom.rb', line 3 def cache @cache end |
#media_cache ⇒ Object
Returns the value of attribute media_cache.
3 4 5 |
# File 'lib/mp4/layout/atom.rb', line 3 def media_cache @media_cache end |
#track_id ⇒ Object
Returns the value of attribute track_id.
3 4 5 |
# File 'lib/mp4/layout/atom.rb', line 3 def track_id @track_id end |
Class Method Details
.generate(cache, media_cache, opts = {}) ⇒ Object
5 6 7 |
# File 'lib/mp4/layout/atom.rb', line 5 def self.generate(cache, media_cache, opts = {}) new(cache, media_cache, opts).generate end |
Instance Method Details
#generate ⇒ Object
15 16 17 18 19 20 |
# File 'lib/mp4/layout/atom.rb', line 15 def generate [ *header, binary_content, ].join end |