mediainfo 0.6.2 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,45 +3,46 @@ require "mediainfo/string"
3
3
 
4
4
  class Mediainfo
5
5
  module AttrReaders
6
- def supported_attributes
7
- @supported_attributes ||= []
8
- end
9
-
10
- def mediainfo_attr_reader(name, mediainfo_key = nil)
11
- supported_attributes << name
12
- attr_name = "#{name}_before_type_cast"
6
+ def mediainfo_attr_reader(method_name, mediainfo_key = nil)
7
+ # NOTE explicit self necessary here until we rename local var 'name'
8
+ stream_class_type = name[/::([^:]+)Stream$/, 1]
9
+
10
+ before_type_cast_method_name = "#{method_name}_before_type_cast"
13
11
  mediainfo_key = mediainfo_key.gsub(/\W+/, "_").downcase if mediainfo_key
14
12
 
15
- define_method attr_name do
16
- if v = instance_variable_get("@#{attr_name}")
13
+ if m = stream_class_type.match(/^#{Regexp.union *Mediainfo::NON_GENERAL_SECTIONS.map { |x| x.to_s.capitalize }}$/)
14
+ k1 = stream_class_type.downcase.to_sym
15
+ else
16
+ k1 = :general
17
+ end
18
+
19
+ define_method before_type_cast_method_name do
20
+ if v = instance_variable_get("@#{before_type_cast_method_name}")
17
21
  v
18
22
  else
19
- v = if md = name.to_s.match(/^(#{SECTIONS.map { |x| x.underscore } * "|"})_(.+)$/)
20
- k = mediainfo_key ? mediainfo_key : md[2]
21
- if subsection = @parsed_response[md[1]]
22
- subsection[k]
23
- end
24
- else
25
- k = mediainfo_key ? mediainfo_key : name.to_s
26
- @parsed_response[k]
27
- end
23
+ k2 = mediainfo_key ? mediainfo_key : method_name.to_s
24
+ v = @parsed_response[k1][k2]
28
25
 
29
- instance_variable_set "@#{attr_name}", v
30
- v
26
+ instance_variable_set "@#{before_type_cast_method_name}", v
27
+ instance_variable_get "@#{before_type_cast_method_name}"
31
28
  end
32
29
  end
33
30
 
34
- define_method name do
35
- if v = instance_variable_get("@#{name}")
31
+ define_method method_name do
32
+ if v = instance_variable_get("@#{method_name}")
36
33
  v
37
34
  else
38
- v = send "#{name}_before_type_cast"
35
+ v = send(before_type_cast_method_name)
39
36
  v = yield v if v and block_given?
40
37
 
41
- instance_variable_set "@#{name}", v
42
- v
38
+ instance_variable_set "@#{method_name}", v
39
+ instance_variable_get "@#{method_name}"
43
40
  end
44
41
  end
42
+
43
+ supported_attribute = method_name
44
+ supported_attribute = "#{stream_class_type.downcase}_#{method_name}".to_sym unless k1 == :general
45
+ Mediainfo.supported_attributes << supported_attribute
45
46
  end
46
47
 
47
48
  def mediainfo_duration_reader(*a)
@@ -70,9 +71,5 @@ module AttrReaders
70
71
  def mediainfo_int_reader(*a)
71
72
  mediainfo_attr_reader(*a) { |v| v.gsub(/\D+/, "").to_i }
72
73
  end
73
-
74
- def mediainfo_section_query(name)
75
- define_method("#{name}?") { @parsed_response.key? name.to_s }
76
- end
77
74
  end
78
75
  end
data/mediainfo.gemspec CHANGED
@@ -2,22 +2,22 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{mediainfo}
5
- s.version = "0.6.2"
5
+ s.version = "0.7.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Seth Thomas Rasmussen"]
9
- s.date = %q{2009-11-25}
9
+ s.date = %q{2010-04-05}
10
10
  s.description = %q{Mediainfo is a class wrapping the mediainfo CLI (http://mediainfo.sourceforge.net)}
11
11
  s.email = %q{sethrasmussen@gmail.com}
12
12
  s.extra_rdoc_files = ["LICENSE", "README.markdown", "lib/mediainfo.rb", "lib/mediainfo/attr_readers.rb", "lib/mediainfo/string.rb"]
13
- s.files = ["Changelog", "LICENSE", "Manifest", "README.markdown", "Rakefile", "lib/mediainfo.rb", "lib/mediainfo/attr_readers.rb", "lib/mediainfo/string.rb", "mediainfo.gemspec", "test/mediainfo_awaywego_test.rb", "test/mediainfo_broken_embraces_test.rb", "test/mediainfo_dinner_test.rb", "test/mediainfo_hats_test.rb", "test/mediainfo_omen_image_test.rb", "test/mediainfo_string_test.rb", "test/mediainfo_test.rb", "test/mediainfo_vimeo_test.rb", "test/test_helper.rb"]
13
+ s.files = ["Changelog", "LICENSE", "Manifest", "README.markdown", "Rakefile", "index.html.template", "lib/mediainfo.rb", "lib/mediainfo/attr_readers.rb", "lib/mediainfo/string.rb", "mediainfo.gemspec", "test/mediainfo_awaywego_test.rb", "test/mediainfo_broken_embraces_test.rb", "test/mediainfo_dinner_test.rb", "test/mediainfo_hats_test.rb", "test/mediainfo_multiple_streams_test.rb", "test/mediainfo_omen_image_test.rb", "test/mediainfo_string_test.rb", "test/mediainfo_test.rb", "test/mediainfo_vimeo_test.rb", "test/test_helper.rb"]
14
14
  s.homepage = %q{http://greatseth.github.com/mediainfo}
15
15
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Mediainfo", "--main", "README.markdown"]
16
16
  s.require_paths = ["lib"]
17
17
  s.rubyforge_project = %q{mediainfo}
18
- s.rubygems_version = %q{1.3.5}
18
+ s.rubygems_version = %q{1.3.6}
19
19
  s.summary = %q{Mediainfo is a class wrapping the mediainfo CLI (http://mediainfo.sourceforge.net)}
20
- s.test_files = ["test/mediainfo_awaywego_test.rb", "test/mediainfo_broken_embraces_test.rb", "test/mediainfo_dinner_test.rb", "test/mediainfo_hats_test.rb", "test/mediainfo_omen_image_test.rb", "test/mediainfo_string_test.rb", "test/mediainfo_test.rb", "test/mediainfo_vimeo_test.rb", "test/test_helper.rb"]
20
+ s.test_files = ["test/mediainfo_awaywego_test.rb", "test/mediainfo_broken_embraces_test.rb", "test/mediainfo_dinner_test.rb", "test/mediainfo_hats_test.rb", "test/mediainfo_multiple_streams_test.rb", "test/mediainfo_omen_image_test.rb", "test/mediainfo_string_test.rb", "test/mediainfo_test.rb", "test/mediainfo_vimeo_test.rb", "test/test_helper.rb"]
21
21
 
22
22
  if s.respond_to? :specification_version then
23
23
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -60,225 +60,222 @@ class MediainfoAwaywegoTest < ActiveSupport::TestCase
60
60
  ### VIDEO
61
61
 
62
62
  test "video stream id" do
63
- assert_equal "2", @info.video_stream_id
63
+ assert_equal "2", @info.video.stream_id
64
64
  end
65
65
 
66
66
  test "video Format" do
67
- assert_equal "AVC", @info.video_format
67
+ assert_equal "AVC", @info.video.format
68
68
  end
69
69
 
70
70
  test "video format profile" do
71
- assert_equal "Main@L4.1", @info.video_format_profile
71
+ assert_equal "Main@L4.1", @info.video.format_profile
72
72
  end
73
73
 
74
74
  test "video format version" do
75
- assert_nil @info.video_format_version
75
+ assert_nil @info.video.format_version
76
76
  end
77
77
 
78
78
  test "video format settings Matrix" do
79
- assert_nil @info.video_format_settings_matrix
79
+ assert_nil @info.video.format_settings_matrix
80
80
  end
81
81
 
82
82
  test "video format settings CABAC" do
83
- assert_equal "No", @info.video_format_settings_cabac
83
+ assert_equal "No", @info.video.format_settings_cabac
84
84
  end
85
85
 
86
86
  test "video format settings ReFrames" do
87
- assert_equal "2 frames", @info.video_format_settings_reframes
87
+ assert_equal "2 frames", @info.video.format_settings_reframes
88
88
  end
89
89
 
90
90
  test "video Codec ID" do
91
- assert_equal "avc1", @info.video_codec_id
91
+ assert_equal "avc1", @info.video.codec_id
92
92
  end
93
93
 
94
94
  test "video codec info" do
95
- assert_equal "Advanced Video Coding", @info.video_codec_info
95
+ assert_equal "Advanced Video Coding", @info.video.codec_info
96
96
  end
97
97
 
98
98
  test "video Duration" do
99
- assert_equal 36286, @info.video_duration
100
- assert_equal "36s 286ms", @info.video_duration_before_type_cast
99
+ assert_equal 36286, @info.video.duration
100
+ assert_equal "36s 286ms", @info.video.duration_before_type_cast
101
101
  end
102
102
 
103
103
  test "video bit rate mode" do
104
- assert_equal "Variable", @info.video_bit_rate_mode
105
- assert @info.vbr?
106
- assert !@info.cbr?
104
+ assert_equal "Variable", @info.video.bit_rate_mode
105
+ assert @info.video.vbr?
106
+ assert !@info.video.cbr?
107
107
  end
108
108
 
109
109
  test "video Bit rate" do
110
- assert_equal "41.2 Mbps", @info.video_bit_rate
110
+ assert_equal "41.2 Mbps", @info.video.bit_rate
111
111
  end
112
112
 
113
113
  test "video nominal bit rate" do
114
- assert_nil @info.video_nominal_bit_rate
114
+ assert_nil @info.video.nominal_bit_rate
115
115
  end
116
116
 
117
- test "resolution" do
118
- assert_equal "1920x840", @info.resolution
117
+ test "frame size" do
118
+ assert_equal "1920x840", @info.video.frame_size
119
119
  end
120
120
 
121
121
  test "video Width" do
122
- assert_equal 1920, @info.video_width
123
- assert_equal 1920, @info.width
122
+ assert_equal 1920, @info.video.width
124
123
  end
125
124
 
126
125
  test "video Height" do
127
- assert_equal 840, @info.video_height
128
- assert_equal 840, @info.height
126
+ assert_equal 840, @info.video.height
129
127
  end
130
128
 
131
129
  test "video Display aspect ratio" do
132
- assert_equal "2.25:1", @info.video_display_aspect_ratio
133
- assert_equal "2.25:1", @info.display_aspect_ratio
130
+ assert_equal "2.25:1", @info.video.display_aspect_ratio
134
131
  end
135
132
 
136
133
  test "video frame rate" do
137
- assert_equal "23.976 fps", @info.video_frame_rate
138
- assert_equal 23.976, @info.fps
139
- assert_equal 23.976, @info.framerate
134
+ assert_equal "23.976 fps", @info.video.frame_rate
135
+ assert_equal 23.976, @info.video.fps
136
+ assert_equal 23.976, @info.video.framerate
140
137
  end
141
138
 
142
139
  test "video frame rate mode" do
143
- assert_equal "Constant", @info.video_frame_rate_mode
140
+ assert_equal "Constant", @info.video.frame_rate_mode
144
141
  end
145
142
 
146
143
  test "video Resolution" do
147
- assert_equal 24, @info.video_resolution
148
- assert_equal "24 bits", @info.video_resolution_before_type_cast
144
+ assert_equal 24, @info.video.resolution
145
+ assert_equal "24 bits", @info.video.resolution_before_type_cast
149
146
  end
150
147
 
151
148
  test "video colorimetry" do
152
- assert_equal "4:2:0", @info.video_colorimetry
153
- assert_equal "4:2:0", @info.video_colorspace
149
+ assert_equal "4:2:0", @info.video.colorimetry
150
+ assert_equal "4:2:0", @info.video.colorspace
154
151
  end
155
152
 
156
153
  test "video Scan type" do
157
- assert_equal "Progressive", @info.video_scan_type
158
- assert !@info.interlaced?
159
- assert @info.progressive?
154
+ assert_equal "Progressive", @info.video.scan_type
155
+ assert !@info.video.interlaced?
156
+ assert @info.video.progressive?
160
157
  end
161
158
 
162
159
  test "video scan order" do
163
- assert_nil @info.video_scan_order
160
+ assert_nil @info.video.scan_order
164
161
  end
165
162
 
166
163
  test "video Bits/(Pixel*Frame)" do
167
- assert_equal "1.065", @info.video_bits_pixel_frame
164
+ assert_equal "1.065", @info.video.bits_pixel_frame
168
165
  end
169
166
 
170
167
  test "video Stream size" do
171
- assert_equal "178 MiB (96%)", @info.video_stream_size
168
+ assert_equal "178 MiB (96%)", @info.video.stream_size
172
169
  end
173
170
 
174
171
  test "video encoded date" do
175
- assert_kind_of Time, @info.video_encoded_date
172
+ assert_kind_of Time, @info.video.encoded_date
176
173
  end
177
174
 
178
175
  test "video tagged date" do
179
- assert_kind_of Time, @info.video_tagged_date
176
+ assert_kind_of Time, @info.video.tagged_date
180
177
  end
181
178
 
182
179
  test "video color primaries" do
183
180
  assert_equal \
184
181
  "BT.709-5, BT.1361, IEC 61966-2-4, SMPTE RP177",
185
- @info.video_color_primaries
182
+ @info.video.color_primaries
186
183
  end
187
184
 
188
185
  test "video transfer characteristics" do
189
- assert_equal "BT.709-5, BT.1361", @info.video_transfer_characteristics
186
+ assert_equal "BT.709-5, BT.1361", @info.video.transfer_characteristics
190
187
  end
191
188
 
192
189
  test "video matrix coefficients" do
193
190
  assert_equal \
194
191
  "BT.709-5, BT.1361, IEC 61966-2-4 709, SMPTE RP177",
195
- @info.video_matrix_coefficients
192
+ @info.video.matrix_coefficients
196
193
  end
197
194
 
198
195
  ### AUDIO
199
196
 
200
197
  test "audio stream id" do
201
- assert_equal "1", @info.audio_stream_id
198
+ assert_equal "1", @info.audio.stream_id
202
199
  end
203
200
 
204
201
  test "audio Format" do
205
- assert_equal "PCM", @info.audio_format
202
+ assert_equal "PCM", @info.audio.format
206
203
  end
207
204
 
208
205
  test "audio format info" do
209
- assert_nil @info.audio_format_info
206
+ assert_nil @info.audio.format_info
210
207
  end
211
208
 
212
209
  test "audio Format settings, Endianness" do
213
- assert_equal "Little", @info.audio_format_settings_endianness
210
+ assert_equal "Little", @info.audio.format_settings_endianness
214
211
  end
215
212
 
216
213
  test "audio Format settings, Sign" do
217
- assert_equal "Signed", @info.audio_format_settings_sign
214
+ assert_equal "Signed", @info.audio.format_settings_sign
218
215
  end
219
216
 
220
217
  test "audio Codec ID" do
221
- assert_equal "sowt", @info.audio_codec_id
218
+ assert_equal "sowt", @info.audio.codec_id
222
219
  end
223
220
 
224
221
  test "audio Codec ID/Info" do
225
- assert_nil @info.audio_codec_info
222
+ assert_nil @info.audio.codec_info
226
223
  end
227
224
 
228
225
  test "audio Duration" do
229
- assert_equal 36286, @info.audio_duration
230
- assert_equal "36s 286ms", @info.audio_duration_before_type_cast
226
+ assert_equal 36286, @info.audio.duration
227
+ assert_equal "36s 286ms", @info.audio.duration_before_type_cast
231
228
  end
232
229
 
233
230
  test "audio Bit rate mode" do
234
- assert_equal "Constant", @info.audio_bit_rate_mode
231
+ assert_equal "Constant", @info.audio.bit_rate_mode
235
232
  end
236
233
 
237
234
  test "audio Bit rate" do
238
- assert_equal "1 536 Kbps", @info.audio_bit_rate
235
+ assert_equal "1 536 Kbps", @info.audio.bit_rate
239
236
  end
240
237
 
241
238
  test "audio Channel(s)" do
242
- assert_equal 2, @info.audio_channels
239
+ assert_equal 2, @info.audio.channels
243
240
  end
244
241
 
245
242
  test "audio channel positions" do
246
- assert_nil @info.audio_channel_positions
243
+ assert_nil @info.audio.channel_positions
247
244
  end
248
245
 
249
246
  test "stereo?" do
250
- assert @info.stereo?
247
+ assert @info.audio.stereo?
251
248
  end
252
249
 
253
250
  test "mono?" do
254
- assert !@info.mono?
251
+ assert !@info.audio.mono?
255
252
  end
256
253
 
257
254
  test "audio Sampling rate" do
258
- assert_equal 48000, @info.audio_sample_rate
259
- assert_equal 48000, @info.audio_sampling_rate
260
- assert_equal "48.0 KHz", @info.audio_sampling_rate_before_type_cast
255
+ assert_equal 48000, @info.audio.sample_rate
256
+ assert_equal 48000, @info.audio.sampling_rate
257
+ assert_equal "48.0 KHz", @info.audio.sampling_rate_before_type_cast
261
258
  end
262
259
 
263
260
  test "audio resolution" do
264
- assert_equal 16, @info.audio_resolution
265
- assert_equal "16 bits", @info.audio_resolution_before_type_cast
261
+ assert_equal 16, @info.audio.resolution
262
+ assert_equal "16 bits", @info.audio.resolution_before_type_cast
266
263
  end
267
264
 
268
265
  test "audio Stream size" do
269
- assert_equal "6.64 MiB (4%)", @info.audio_stream_size
266
+ assert_equal "6.64 MiB (4%)", @info.audio.stream_size
270
267
  end
271
268
 
272
269
  test "audio Interleave, duration" do
273
- assert_nil @info.audio_interleave_duration
270
+ assert_nil @info.audio.interleave_duration
274
271
  end
275
272
 
276
273
  test "audio encoded date" do
277
- assert_kind_of Time, @info.audio_encoded_date
274
+ assert_kind_of Time, @info.audio.encoded_date
278
275
  end
279
276
 
280
277
  test "audio tagged date" do
281
- assert_kind_of Time, @info.audio_tagged_date
278
+ assert_kind_of Time, @info.audio.tagged_date
282
279
  end
283
280
 
284
281
  ### IMAGE
@@ -58,207 +58,204 @@ class MediainfoBrokenEmbracesTest < ActiveSupport::TestCase
58
58
  ### VIDEO
59
59
 
60
60
  test "video stream id" do
61
- assert_equal "1", @info.video_stream_id
61
+ assert_equal "1", @info.video.stream_id
62
62
  end
63
63
 
64
64
  test "video Format" do
65
- assert_equal "AVC", @info.video_format
65
+ assert_equal "AVC", @info.video.format
66
66
  end
67
67
 
68
68
  test "video format version" do
69
- assert_nil @info.video_format_version
69
+ assert_nil @info.video.format_version
70
70
  end
71
71
 
72
72
  test "video format settings Matrix" do
73
- assert_nil @info.video_format_settings_matrix
73
+ assert_nil @info.video.format_settings_matrix
74
74
  end
75
75
 
76
76
  test "video format profile" do
77
- assert_equal "High@L3.0", @info.video_format_profile
77
+ assert_equal "High@L3.0", @info.video.format_profile
78
78
  end
79
79
 
80
80
  test "video format settings CABAC" do
81
- assert_equal "Yes", @info.video_format_settings_cabac
81
+ assert_equal "Yes", @info.video.format_settings_cabac
82
82
  end
83
83
 
84
84
  test "video format settings ReFrames" do
85
- assert_equal "4 frames", @info.video_format_settings_reframes
85
+ assert_equal "4 frames", @info.video.format_settings_reframes
86
86
  end
87
87
 
88
88
  test "video Codec ID" do
89
- assert_equal "avc1", @info.video_codec_id
89
+ assert_equal "avc1", @info.video.codec_id
90
90
  end
91
91
 
92
92
  test "video codec info" do
93
- assert_equal "Advanced Video Coding", @info.video_codec_info
93
+ assert_equal "Advanced Video Coding", @info.video.codec_info
94
94
  end
95
95
 
96
96
  test "video Duration" do
97
- assert_equal 106000, @info.video_duration
98
- assert_equal "1mn 46s", @info.video_duration_before_type_cast
97
+ assert_equal 106000, @info.video.duration
98
+ assert_equal "1mn 46s", @info.video.duration_before_type_cast
99
99
  end
100
100
 
101
101
  test "video bit rate mode" do
102
- assert_equal "Variable", @info.video_bit_rate_mode
103
- assert @info.vbr?
104
- assert !@info.cbr?
102
+ assert_equal "Variable", @info.video.bit_rate_mode
103
+ assert @info.video.vbr?
104
+ assert !@info.video.cbr?
105
105
  end
106
106
 
107
107
  test "video Bit rate" do
108
- assert_equal "780 Kbps", @info.video_bit_rate
108
+ assert_equal "780 Kbps", @info.video.bit_rate
109
109
  end
110
110
 
111
111
  test "video nominal bit rate" do
112
- assert_nil @info.video_nominal_bit_rate
112
+ assert_nil @info.video.nominal_bit_rate
113
113
  end
114
114
 
115
- test "resolution" do
116
- assert_equal "576x432", @info.resolution
115
+ test "frame size" do
116
+ assert_equal "576x432", @info.video.frame_size
117
117
  end
118
118
 
119
119
  test "video Width" do
120
- assert_equal 576, @info.video_width
121
- assert_equal 576, @info.width
120
+ assert_equal 576, @info.video.width
122
121
  end
123
122
 
124
123
  test "video Height" do
125
- assert_equal 432, @info.video_height
126
- assert_equal 432, @info.height
124
+ assert_equal 432, @info.video.height
127
125
  end
128
126
 
129
127
  test "video Display aspect ratio" do
130
- assert_equal "4:3", @info.video_display_aspect_ratio
131
- assert_equal "4:3", @info.display_aspect_ratio
128
+ assert_equal "4:3", @info.video.display_aspect_ratio
132
129
  end
133
130
 
134
131
  test "video Frame rate" do
135
- assert_equal "23.976 fps", @info.video_frame_rate
136
- assert_equal 23.976, @info.fps
137
- assert_equal 23.976, @info.framerate
132
+ assert_equal "23.976 fps", @info.video.frame_rate
133
+ assert_equal 23.976, @info.video.fps
134
+ assert_equal 23.976, @info.video.framerate
138
135
  end
139
136
 
140
137
  test "video frame rate mode" do
141
- assert_equal "Variable", @info.video_frame_rate_mode
138
+ assert_equal "Variable", @info.video.frame_rate_mode
142
139
  end
143
140
 
144
141
  test "video Resolution" do
145
- assert_equal 24, @info.video_resolution
142
+ assert_equal 24, @info.video.resolution
146
143
  end
147
144
 
148
145
  test "video colorimetry" do
149
- assert_equal "4:2:0", @info.video_colorimetry
150
- assert_equal "4:2:0", @info.video_colorspace
146
+ assert_equal "4:2:0", @info.video.colorimetry
147
+ assert_equal "4:2:0", @info.video.colorspace
151
148
  end
152
149
 
153
150
  test "video Scan type" do
154
- assert_equal "Progressive", @info.video_scan_type
155
- assert !@info.interlaced?
156
- assert @info.progressive?
151
+ assert_equal "Progressive", @info.video.scan_type
152
+ assert !@info.video.interlaced?
153
+ assert @info.video.progressive?
157
154
  end
158
155
 
159
156
  test "video scan order" do
160
- assert_nil @info.video_scan_order
157
+ assert_nil @info.video.scan_order
161
158
  end
162
159
 
163
160
  test "video Bits/(Pixel*Frame)" do
164
- assert_equal "0.131", @info.video_bits_pixel_frame
161
+ assert_equal "0.131", @info.video.bits_pixel_frame
165
162
  end
166
163
 
167
164
  test "video Stream size" do
168
- assert_equal "9.84 MiB (85%)", @info.video_stream_size
165
+ assert_equal "9.84 MiB (85%)", @info.video.stream_size
169
166
  end
170
167
 
171
168
  test "video encoded date" do
172
- assert_nil @info.video_encoded_date
169
+ assert_nil @info.video.encoded_date
173
170
  end
174
171
 
175
172
  test "video tagged date" do
176
- assert_nil @info.video_tagged_date
173
+ assert_nil @info.video.tagged_date
177
174
  end
178
175
 
179
176
  ### AUDIO
180
177
 
181
178
  test "audio stream id" do
182
- assert_equal "2", @info.audio_stream_id
179
+ assert_equal "2", @info.audio.stream_id
183
180
  end
184
181
 
185
182
  test "audio Format" do
186
- assert_equal "AAC", @info.audio_format
183
+ assert_equal "AAC", @info.audio.format
187
184
  end
188
185
 
189
186
  test "audio format info" do
190
- assert_equal "Advanced Audio Codec", @info.audio_format_info
187
+ assert_equal "Advanced Audio Codec", @info.audio.format_info
191
188
  end
192
189
 
193
190
  test "audio Format settings, Endianness" do
194
- assert_nil @info.audio_format_settings_endianness
191
+ assert_nil @info.audio.format_settings_endianness
195
192
  end
196
193
 
197
194
  test "audio Format settings, Sign" do
198
- assert_nil @info.audio_format_settings_sign
195
+ assert_nil @info.audio.format_settings_sign
199
196
  end
200
197
 
201
198
  test "audio Codec ID" do
202
- assert_equal "40", @info.audio_codec_id
199
+ assert_equal "40", @info.audio.codec_id
203
200
  end
204
201
 
205
202
  test "audio Codec ID/Info" do
206
- assert_nil @info.audio_codec_info
203
+ assert_nil @info.audio.codec_info
207
204
  end
208
205
 
209
206
  test "audio Duration" do
210
- assert_equal 106000, @info.audio_duration
211
- assert_equal "1mn 46s", @info.audio_duration_before_type_cast
207
+ assert_equal 106000, @info.audio.duration
208
+ assert_equal "1mn 46s", @info.audio.duration_before_type_cast
212
209
  end
213
210
 
214
211
  test "audio Bit rate mode" do
215
- assert_equal "Variable", @info.audio_bit_rate_mode
212
+ assert_equal "Variable", @info.audio.bit_rate_mode
216
213
  end
217
214
 
218
215
  test "audio Bit rate" do
219
- assert_equal "128 Kbps", @info.audio_bit_rate
216
+ assert_equal "128 Kbps", @info.audio.bit_rate
220
217
  end
221
218
 
222
219
  test "audio Channel(s)" do
223
- assert_equal 2, @info.audio_channels
220
+ assert_equal 2, @info.audio.channels
224
221
  end
225
222
 
226
223
  test "audio channel positions" do
227
- assert_equal "L R", @info.audio_channel_positions
224
+ assert_equal "L R", @info.audio.channel_positions
228
225
  end
229
226
 
230
227
  test "stereo?" do
231
- assert @info.stereo?
228
+ assert @info.audio.stereo?
232
229
  end
233
230
 
234
231
  test "mono?" do
235
- assert !@info.mono?
232
+ assert !@info.audio.mono?
236
233
  end
237
234
 
238
235
  test "audio Sampling rate" do
239
- assert_equal 44100, @info.audio_sample_rate
240
- assert_equal 44100, @info.audio_sampling_rate
241
- assert_equal "44.1 KHz", @info.audio_sampling_rate_before_type_cast
236
+ assert_equal 44100, @info.audio.sample_rate
237
+ assert_equal 44100, @info.audio.sampling_rate
238
+ assert_equal "44.1 KHz", @info.audio.sampling_rate_before_type_cast
242
239
  end
243
240
 
244
241
  test "audio Resolution" do
245
- assert_equal 16, @info.audio_resolution
242
+ assert_equal 16, @info.audio.resolution
246
243
  end
247
244
 
248
245
  test "audio Stream size" do
249
- assert_equal "1.62 MiB (14%)", @info.audio_stream_size
246
+ assert_equal "1.62 MiB (14%)", @info.audio.stream_size
250
247
  end
251
248
 
252
249
  test "audio Interleave, duration" do
253
- assert_nil @info.audio_interleave_duration
250
+ assert_nil @info.audio.interleave_duration
254
251
  end
255
252
 
256
253
  test "audio encoded date" do
257
- assert_nil @info.audio_encoded_date
254
+ assert_nil @info.audio.encoded_date
258
255
  end
259
256
 
260
257
  test "audio tagged date" do
261
- assert_nil @info.audio_tagged_date
258
+ assert_nil @info.audio.tagged_date
262
259
  end
263
260
 
264
261
  ### IMAGE