Class: BMFF::Box::SampleEncryption
- Defined in:
- lib/bmff/box/sample_encryption.rb
Overview
vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:
Defined Under Namespace
Constant Summary collapse
- DEFAULT_IV_SIZE =
8
- @@cached_root_object_id =
nil
- @@cached_track_encryption =
nil
Instance Attribute Summary collapse
-
#algorithm_id ⇒ Object
Returns the value of attribute algorithm_id.
-
#iv_size ⇒ Object
Returns the value of attribute iv_size.
-
#kid ⇒ Object
Returns the value of attribute kid.
-
#sample_count ⇒ Object
Returns the value of attribute sample_count.
-
#samples ⇒ Object
Returns the value of attribute samples.
Attributes inherited from Full
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
#algorithm_id ⇒ Object
Returns the value of attribute algorithm_id.
5 6 7 |
# File 'lib/bmff/box/sample_encryption.rb', line 5 def algorithm_id @algorithm_id end |
#iv_size ⇒ Object
Returns the value of attribute iv_size.
5 6 7 |
# File 'lib/bmff/box/sample_encryption.rb', line 5 def iv_size @iv_size end |
#kid ⇒ Object
Returns the value of attribute kid.
5 6 7 |
# File 'lib/bmff/box/sample_encryption.rb', line 5 def kid @kid end |
#sample_count ⇒ Object
Returns the value of attribute sample_count.
5 6 7 |
# File 'lib/bmff/box/sample_encryption.rb', line 5 def sample_count @sample_count end |
#samples ⇒ Object
Returns the value of attribute samples.
5 6 7 |
# File 'lib/bmff/box/sample_encryption.rb', line 5 def samples @samples end |
Instance Method Details
#parse_data ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/bmff/box/sample_encryption.rb', line 18 def parse_data super if flags & 0x01 > 0 @algorithm_id = io.get_uint24 @iv_size = io.get_uint8 @kid = io.get_uuid end @sample_count = io.get_uint32 @samples = [] @sample_count.times do sample = Sample.new if @iv_size iv_size_to_read = @iv_size else iv_size_to_read = default_iv_size end sample.initialization_vector = io.get_byte(iv_size_to_read) if flags & 0x02 > 0 sample.number_of_entries = io.get_uint16 sample.entries = [] sample.number_of_entries.times do entry = Entry.new entry.bytes_of_clear_data = io.get_uint16 entry.bytes_of_encrypted_data = io.get_uint32 sample.entries << entry end end @samples << sample end end |