bmff 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (99) hide show
  1. checksums.yaml +7 -0
  2. data/.coveralls.yml +1 -0
  3. data/.travis.yml +5 -3
  4. data/README.md +12 -3
  5. data/bmff.gemspec +4 -2
  6. data/lib/bmff/box/protection_system_specific_header.rb +1 -0
  7. data/lib/bmff/box/segment_index.rb +42 -0
  8. data/lib/bmff/box/segment_type.rb +6 -0
  9. data/lib/bmff/box/subsegment_index.rb +30 -0
  10. data/lib/bmff/box/track_encryption.rb +3 -0
  11. data/lib/bmff/box.rb +3 -0
  12. data/lib/bmff/version.rb +1 -1
  13. data/test/bmff/box/test_audio_sample_entry.rb +1 -1
  14. data/test/bmff/box/test_base.rb +1 -1
  15. data/test/bmff/box/test_bit_rate.rb +1 -1
  16. data/test/bmff/box/test_chunk_large_offset.rb +1 -1
  17. data/test/bmff/box/test_chunk_offset.rb +1 -1
  18. data/test/bmff/box/test_clean_aperture.rb +1 -1
  19. data/test/bmff/box/test_colour_information.rb +1 -1
  20. data/test/bmff/box/test_compact_sample_size.rb +1 -1
  21. data/test/bmff/box/test_composition_offset.rb +1 -1
  22. data/test/bmff/box/test_composition_to_decode.rb +1 -1
  23. data/test/bmff/box/test_copyright.rb +1 -1
  24. data/test/bmff/box/test_data_entry_url.rb +1 -1
  25. data/test/bmff/box/test_data_entry_urn.rb +1 -1
  26. data/test/bmff/box/test_data_information.rb +1 -1
  27. data/test/bmff/box/test_data_reference.rb +1 -1
  28. data/test/bmff/box/test_degradation_priority.rb +1 -1
  29. data/test/bmff/box/test_edit.rb +1 -1
  30. data/test/bmff/box/test_edit_list.rb +1 -1
  31. data/test/bmff/box/test_file_type.rb +1 -1
  32. data/test/bmff/box/test_free_space.rb +1 -1
  33. data/test/bmff/box/test_handler.rb +1 -1
  34. data/test/bmff/box/test_hint_media_header.rb +1 -1
  35. data/test/bmff/box/test_hint_sample_entry.rb +1 -1
  36. data/test/bmff/box/test_level_assignment.rb +1 -1
  37. data/test/bmff/box/test_media.rb +1 -1
  38. data/test/bmff/box/test_media_data.rb +1 -1
  39. data/test/bmff/box/test_media_header.rb +1 -1
  40. data/test/bmff/box/test_media_information.rb +1 -1
  41. data/test/bmff/box/test_movie.rb +1 -1
  42. data/test/bmff/box/test_movie_extends.rb +1 -1
  43. data/test/bmff/box/test_movie_extends_header.rb +1 -1
  44. data/test/bmff/box/test_movie_fragment.rb +1 -1
  45. data/test/bmff/box/test_movie_fragment_header.rb +1 -1
  46. data/test/bmff/box/test_movie_fragment_random_access.rb +1 -1
  47. data/test/bmff/box/test_movie_fragment_random_access_offset.rb +1 -1
  48. data/test/bmff/box/test_movie_header.rb +1 -1
  49. data/test/bmff/box/test_null_media_header.rb +1 -1
  50. data/test/bmff/box/test_original_format.rb +1 -1
  51. data/test/bmff/box/test_padding_bits.rb +1 -1
  52. data/test/bmff/box/test_pixel_aspect_ratio.rb +1 -1
  53. data/test/bmff/box/test_progressive_download_info.rb +1 -1
  54. data/test/bmff/box/test_protection_sheme_info.rb +1 -1
  55. data/test/bmff/box/test_protection_system_specific_header.rb +29 -1
  56. data/test/bmff/box/test_sample_auxiliary_information_offsets.rb +1 -1
  57. data/test/bmff/box/test_sample_auxiliary_information_sizes.rb +1 -1
  58. data/test/bmff/box/test_sample_dependency_type.rb +1 -1
  59. data/test/bmff/box/test_sample_description.rb +1 -1
  60. data/test/bmff/box/test_sample_encryption.rb +1 -1
  61. data/test/bmff/box/test_sample_size.rb +1 -1
  62. data/test/bmff/box/test_sample_table.rb +1 -1
  63. data/test/bmff/box/test_sample_to_chunk.rb +1 -1
  64. data/test/bmff/box/test_segment_index.rb +110 -0
  65. data/test/bmff/box/test_segment_type.rb +30 -0
  66. data/test/bmff/box/test_shadow_sync_sample.rb +1 -1
  67. data/test/bmff/box/test_sheme_information.rb +1 -1
  68. data/test/bmff/box/test_sheme_type.rb +1 -1
  69. data/test/bmff/box/test_sound_media_header.rb +1 -1
  70. data/test/bmff/box/test_sub_sample_information.rb +1 -1
  71. data/test/bmff/box/test_subsegment_index.rb +43 -0
  72. data/test/bmff/box/test_sync_sample.rb +1 -1
  73. data/test/bmff/box/test_text_meta_data_sample_entry.rb +1 -1
  74. data/test/bmff/box/test_time_to_sample.rb +1 -1
  75. data/test/bmff/box/test_track.rb +1 -1
  76. data/test/bmff/box/test_track_encryption.rb +29 -1
  77. data/test/bmff/box/test_track_extends.rb +1 -1
  78. data/test/bmff/box/test_track_fragment.rb +1 -1
  79. data/test/bmff/box/test_track_fragment_base_media_decode_time.rb +1 -1
  80. data/test/bmff/box/test_track_fragment_header.rb +1 -1
  81. data/test/bmff/box/test_track_fragment_random_access.rb +1 -1
  82. data/test/bmff/box/test_track_group.rb +1 -1
  83. data/test/bmff/box/test_track_group_type.rb +1 -1
  84. data/test/bmff/box/test_track_header.rb +1 -1
  85. data/test/bmff/box/test_track_reference.rb +1 -1
  86. data/test/bmff/box/test_track_reference_type.rb +2 -2
  87. data/test/bmff/box/test_track_run.rb +1 -1
  88. data/test/bmff/box/test_track_selection.rb +1 -1
  89. data/test/bmff/box/test_uri.rb +1 -1
  90. data/test/bmff/box/test_uri_init.rb +1 -1
  91. data/test/bmff/box/test_uri_meta_sample_entry.rb +1 -1
  92. data/test/bmff/box/test_user_data.rb +1 -1
  93. data/test/bmff/box/test_video_media_header.rb +1 -1
  94. data/test/bmff/box/test_visual_sample_entry.rb +1 -1
  95. data/test/bmff/box/test_xml_meta_data_sample_entry.rb +1 -1
  96. data/test/bmff/test_binary_accessor.rb +1 -1
  97. data/test/bmff/test_file_container.rb +42 -1
  98. data/test/minitest_helper.rb +3 -0
  99. metadata +52 -25
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxProtectionSystemSpecificHeader < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxProtectionSystemSpecificHeader < Minitest::Test
9
9
  def test_parse_playready
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -35,4 +35,32 @@ class TestBMFFBoxProtectionSystemSpecificHeader < MiniTest::Unit::TestCase
35
35
  assert_equal(16, box.data_size)
36
36
  assert_equal("datadatadatadata", box.data)
37
37
  end
38
+
39
+ def test_parse_pssh_box
40
+ io = StringIO.new("", "r+:ascii-8bit")
41
+ io.extend(BMFF::BinaryAccessor)
42
+ io.write_uint32(0)
43
+ io.write_ascii("pssh")
44
+ io.write_uint8(0) # version
45
+ io.write_uint24(0) # flags
46
+
47
+ io.write_uuid("5e629af5-38da-4063-8977-97ffbd9902d4") # system_id (Marlin)
48
+ io.write_uint32(16) # data_size
49
+ io.write_byte("datadatadatadata") # data
50
+
51
+ size = io.pos
52
+ io.pos = 0
53
+ io.write_uint32(size)
54
+ io.pos = 0
55
+
56
+ box = BMFF::Box.get_box(io, nil)
57
+ assert_instance_of(BMFF::Box::ProtectionSystemSpecificHeader, box)
58
+ assert_equal(size, box.actual_size)
59
+ assert_equal("pssh", box.type)
60
+ assert_equal(0, box.version)
61
+ assert_equal(0, box.flags)
62
+ assert_equal("5e629af5-38da-4063-8977-97ffbd9902d4", box.system_id.to_s)
63
+ assert_equal(16, box.data_size)
64
+ assert_equal("datadatadatadata", box.data)
65
+ end
38
66
  end
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSampleAuxiliaryInformationOffsets < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSampleAuxiliaryInformationOffsets < Minitest::Test
9
9
  def test_parse_v0_flags_0
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSampleAuxiliaryInformationSizes < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSampleAuxiliaryInformationSizes < Minitest::Test
9
9
  def test_parse_flags_0
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSampleDependencyType < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSampleDependencyType < Minitest::Test
9
9
  class DummyBox
10
10
  attr_accessor :box
11
11
  def find(type)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSampleDescription < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSampleDescription < Minitest::Test
9
9
  class DummyBox
10
10
  attr_accessor :parent, :box
11
11
  def find(type)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSampleEncryption < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSampleEncryption < Minitest::Test
9
9
  def get_dummy_parent
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSampleSize < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSampleSize < Minitest::Test
9
9
  def test_parse_size_0
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSampleTable < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSampleTable < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSampleToChunk < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSampleToChunk < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -0,0 +1,110 @@
1
+ # coding: utf-8
2
+ # vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:
3
+
4
+ require_relative '../../minitest_helper'
5
+ require 'bmff/box'
6
+ require 'stringio'
7
+
8
+ class TestBMFFSegmentIndex < Minitest::Test
9
+ def test_parse_v0
10
+ io = StringIO.new("", "r+:ascii-8bit")
11
+ io.extend(BMFF::BinaryAccessor)
12
+ io.write_uint32(0)
13
+ io.write_ascii("sidx")
14
+ io.write_uint8(0) # version
15
+ io.write_uint24(0) # flags
16
+ io.write_uint32(1) # reference_id
17
+ io.write_uint32(30000) # timescale
18
+ io.write_uint32(1) # earliest_presentation_time
19
+ io.write_uint32(2) # first_offset
20
+ io.write_uint16(0) # reserved1
21
+ io.write_uint16(3) # reference_count
22
+ # reference
23
+ io.write_uint32(1 << 31 | 1) # reference_type(1) + referenced_size(31)
24
+ io.write_uint32(10) # subsegment_duration
25
+ io.write_uint32(1 << 31 | 1 << 28 | 11) # starts_with_sap(1) + sap_type(3) + sap_delta_time(28)
26
+
27
+ io.write_uint32(2) # reference_type(1) + referenced_size(31)
28
+ io.write_uint32(20) # subsegment_duration
29
+ io.write_uint32(1 << 29 | 22) # starts_with_sap(1) + sap_type(3) + sap_delta_time(28)
30
+
31
+ io.write_uint32(1 << 31 | 3) # reference_type(1) + referenced_size(31)
32
+ io.write_uint32(30) # subsegment_duration
33
+ io.write_uint32(1 << 31 | 1 << 30 | 33) # starts_with_sap(1) + sap_type(3) + sap_delta_time(28)
34
+
35
+ size = io.pos
36
+ io.pos = 0
37
+ io.write_uint32(size)
38
+ io.pos = 0
39
+
40
+ box = BMFF::Box.get_box(io, nil)
41
+ assert_instance_of(BMFF::Box::SegmentIndex, box)
42
+ assert_equal(size, box.actual_size)
43
+ assert_equal("sidx", box.type)
44
+ assert_equal(0, box.version)
45
+ assert_equal(0, box.flags)
46
+ assert_equal(1, box.reference_id)
47
+ assert_equal(30000, box.timescale)
48
+ assert_equal(1, box.earliest_presentation_time)
49
+ assert_equal(2, box.first_offset)
50
+ assert_equal(0, box.reserved1)
51
+ assert_equal(3, box.reference_count)
52
+ assert_equal([true, false, true], box.reference_type)
53
+ assert_equal([1, 2, 3], box.referenced_size)
54
+ assert_equal([10, 20, 30], box.subsegment_duration)
55
+ assert_equal([true, false, true], box.start_with_sap)
56
+ assert_equal([1, 2, 4], box.sap_type)
57
+ assert_equal([11, 22, 33], box.sap_delta_time)
58
+ end
59
+
60
+ def test_parse_v1
61
+ io = StringIO.new("", "r+:ascii-8bit")
62
+ io.extend(BMFF::BinaryAccessor)
63
+ io.write_uint32(0)
64
+ io.write_ascii("sidx")
65
+ io.write_uint8(1) # version
66
+ io.write_uint24(0) # flags
67
+ io.write_uint32(1) # reference_id
68
+ io.write_uint32(30000) # timescale
69
+ io.write_uint64(1) # earliest_presentation_time
70
+ io.write_uint64(2) # first_offset
71
+ io.write_uint16(0) # reserved1
72
+ io.write_uint16(3) # reference_count
73
+ # reference
74
+ io.write_uint32(1 << 31 | 1) # reference_type(1) + referenced_size(31)
75
+ io.write_uint32(10) # subsegment_duration
76
+ io.write_uint32(1 << 31 | 1 << 28 | 11) # starts_with_sap(1) + sap_type(3) + sap_delta_time(28)
77
+
78
+ io.write_uint32(2) # reference_type(1) + referenced_size(31)
79
+ io.write_uint32(20) # subsegment_duration
80
+ io.write_uint32(1 << 29 | 22) # starts_with_sap(1) + sap_type(3) + sap_delta_time(28)
81
+
82
+ io.write_uint32(1 << 31 | 3) # reference_type(1) + referenced_size(31)
83
+ io.write_uint32(30) # subsegment_duration
84
+ io.write_uint32(1 << 31 | 1 << 30 | 33) # starts_with_sap(1) + sap_type(3) + sap_delta_time(28)
85
+
86
+ size = io.pos
87
+ io.pos = 0
88
+ io.write_uint32(size)
89
+ io.pos = 0
90
+
91
+ box = BMFF::Box.get_box(io, nil)
92
+ assert_instance_of(BMFF::Box::SegmentIndex, box)
93
+ assert_equal(size, box.actual_size)
94
+ assert_equal("sidx", box.type)
95
+ assert_equal(1, box.version)
96
+ assert_equal(0, box.flags)
97
+ assert_equal(1, box.reference_id)
98
+ assert_equal(30000, box.timescale)
99
+ assert_equal(1, box.earliest_presentation_time)
100
+ assert_equal(2, box.first_offset)
101
+ assert_equal(0, box.reserved1)
102
+ assert_equal(3, box.reference_count)
103
+ assert_equal([true, false, true], box.reference_type)
104
+ assert_equal([1, 2, 3], box.referenced_size)
105
+ assert_equal([10, 20, 30], box.subsegment_duration)
106
+ assert_equal([true, false, true], box.start_with_sap)
107
+ assert_equal([1, 2, 4], box.sap_type)
108
+ assert_equal([11, 22, 33], box.sap_delta_time)
109
+ end
110
+ end
@@ -0,0 +1,30 @@
1
+ # coding: utf-8
2
+ # vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:
3
+
4
+ require_relative '../../minitest_helper'
5
+ require 'bmff/box'
6
+ require 'stringio'
7
+
8
+ class TestBMFFBoxSegmentType < Minitest::Test
9
+ def test_parse
10
+ io = StringIO.new("", "r+:ascii-8bit")
11
+ io.extend(BMFF::BinaryAccessor)
12
+ io.write_uint32(0)
13
+ io.write_ascii("styp")
14
+ io.write_ascii("msdh") # major_brand
15
+ io.write_uint32(0) # minor_version
16
+ io.write_ascii("msdhmsix") # compatible_brands
17
+ size = io.pos
18
+ io.pos = 0
19
+ io.write_uint32(size)
20
+ io.pos = 0
21
+
22
+ box = BMFF::Box.get_box(io, nil)
23
+ assert_instance_of(BMFF::Box::SegmentType, box)
24
+ assert_equal(size, box.actual_size)
25
+ assert_equal("styp", box.type)
26
+ assert_equal("msdh", box.major_brand)
27
+ assert_equal(0, box.minor_version)
28
+ assert_equal(%w(msdh msix), box.compatible_brands)
29
+ end
30
+ end
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxShadowSyncSample < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxShadowSyncSample < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSchemeInformation < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSchemeInformation < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSchemeType < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSchemeType < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSoundMediaHeader < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSoundMediaHeader < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSubSampleInformation < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSubSampleInformation < Minitest::Test
9
9
  def test_parse_v0
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -0,0 +1,43 @@
1
+ # coding: utf-8
2
+ # vim: set expandtab tabstop=2 shiftwidth=2 softtabstop=2 autoindent:
3
+
4
+ require_relative '../../minitest_helper'
5
+ require 'bmff/box'
6
+ require 'stringio'
7
+
8
+ class TestBMFFSubsegmentIndex < Minitest::Test
9
+ def test_parse
10
+ io = StringIO.new("", "r+:ascii-8bit")
11
+ io.extend(BMFF::BinaryAccessor)
12
+ io.write_uint32(0)
13
+ io.write_ascii("ssix")
14
+ io.write_uint8(0) # version
15
+ io.write_uint24(0) # flags
16
+ io.write_uint32(2) # subsegment_count
17
+ 2.times do |i|
18
+ io.write_uint32(i + 1) # range_count
19
+ (i + 1).times do |j|
20
+ io.write_uint8(j) # level
21
+ io.write_uint24(j + 1) # range_size
22
+ end
23
+ end
24
+ size = io.pos
25
+ io.pos = 0
26
+ io.write_uint32(size)
27
+ io.pos = 0
28
+
29
+ box = BMFF::Box.get_box(io, nil)
30
+ assert_instance_of(BMFF::Box::SubsegmentIndex, box)
31
+ assert_equal(size, box.actual_size)
32
+ assert_equal("ssix", box.type)
33
+ assert_equal(0, box.version)
34
+ assert_equal(0, box.flags)
35
+ assert_equal(2, box.subsegment_count)
36
+ assert_equal([1, 2], box.range_count)
37
+ assert_equal(2, box.ranges.count)
38
+ assert_equal([0], box.ranges[0].level)
39
+ assert_equal([1], box.ranges[0].range_size)
40
+ assert_equal([0, 1], box.ranges[1].level)
41
+ assert_equal([1, 2], box.ranges[1].range_size)
42
+ end
43
+ end
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxSyncSample < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxSyncSample < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTextMetaDataSampleEntry < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTextMetaDataSampleEntry < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTimeToSample < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTimeToSample < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrack < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrack < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackEncryption < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackEncryption < Minitest::Test
9
9
  def test_parse_flags_0
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -35,4 +35,32 @@ class TestBMFFBoxTrackEncryption < MiniTest::Unit::TestCase
35
35
  assert_equal(8, box.default_iv_size)
36
36
  assert_equal("00010203-0405-0607-0809-0a0b0c0d0e0f", box.default_kid.to_s)
37
37
  end
38
+
39
+ def test_parse_tenc_box
40
+ io = StringIO.new("", "r+:ascii-8bit")
41
+ io.extend(BMFF::BinaryAccessor)
42
+ io.write_uint32(0)
43
+ io.write_ascii("tenc")
44
+ io.write_uint8(0) # version
45
+ io.write_uint24(0) # flags
46
+
47
+ io.write_uint24(1) # default_is_encrypted
48
+ io.write_uint8(8) # default_iv_size
49
+ io.write_uuid("00010203-0405-0607-0809-0a0b0c0d0e0f") # default_kid
50
+
51
+ size = io.pos
52
+ io.pos = 0
53
+ io.write_uint32(size)
54
+ io.pos = 0
55
+
56
+ box = BMFF::Box.get_box(io, nil)
57
+ assert_instance_of(BMFF::Box::TrackEncryption, box)
58
+ assert_equal(size, box.actual_size)
59
+ assert_equal("tenc", box.type)
60
+ assert_equal(0, box.version)
61
+ assert_equal(0, box.flags)
62
+ assert_equal(1, box.default_is_encrypted)
63
+ assert_equal(8, box.default_iv_size)
64
+ assert_equal("00010203-0405-0607-0809-0a0b0c0d0e0f", box.default_kid.to_s)
65
+ end
38
66
  end
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackExtends < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackExtends < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackFragment < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackFragment < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackFragmentBaseMediaDecodeTime < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackFragmentBaseMediaDecodeTime < Minitest::Test
9
9
  def test_parse_v0
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackFragmentHeader < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackFragmentHeader < Minitest::Test
9
9
  def test_parse_flags_full_present
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackFragmentRandomAccess < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackFragmentRandomAccess < Minitest::Test
9
9
  def test_parse_v0
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackGroup < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackGroup < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackGroupType < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackGroupType < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackHeader < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackHeader < Minitest::Test
9
9
  def test_parse_v0
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackReference < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackReference < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackReferenceType < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackReferenceType < Minitest::Test
9
9
  def test_parse_hint
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -80,7 +80,7 @@ class TestBMFFBoxTrackReferenceType < MiniTest::Unit::TestCase
80
80
  assert_equal([1], box.track_ids)
81
81
  end
82
82
 
83
- def test_parse_cdsc
83
+ def test_parse_vplx
84
84
  io = StringIO.new("", "r+:ascii-8bit")
85
85
  io.extend(BMFF::BinaryAccessor)
86
86
  io.write_uint32(0)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackRun < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackRun < Minitest::Test
9
9
  def test_parse_v0_flags_full_present
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxTrackSelection < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxTrackSelection < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxURI < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxURI < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxURIInit < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxURIInit < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxURIMetaSampleEntry < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxURIMetaSampleEntry < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxUserData < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxUserData < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxVideoMediaHeader < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxVideoMediaHeader < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxVisualSampleEntry < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxVisualSampleEntry < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)
@@ -5,7 +5,7 @@ require_relative '../../minitest_helper'
5
5
  require 'bmff/box'
6
6
  require 'stringio'
7
7
 
8
- class TestBMFFBoxXMLMetaDataSampleEntry < MiniTest::Unit::TestCase
8
+ class TestBMFFBoxXMLMetaDataSampleEntry < Minitest::Test
9
9
  def test_parse
10
10
  io = StringIO.new("", "r+:ascii-8bit")
11
11
  io.extend(BMFF::BinaryAccessor)