Skip to content

Commit

Permalink
add special type fields
Browse files Browse the repository at this point in the history
  • Loading branch information
mhor committed Dec 14, 2014
1 parent 1325441 commit 0bc8275
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Builder/MediaInfoContainerBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@ private function addAttributes(AbstractType $trackType, $attributes)
*/
private function formatAttribute($attribute)
{
return str_replace(' ', '_', strtolower($attribute));
return trim(str_replace('__', '_', str_replace(' ', '_', strtolower($attribute))), '_');
}
}
2 changes: 1 addition & 1 deletion src/Checker/DateTimeChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public function getMembersFields()
{
return array(
'file_last_modification_date',
'file_last_modification_date__local_'
'file_last_modification_date_local'
);
}
}
7 changes: 6 additions & 1 deletion src/Checker/DurationChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ public function create($durations)
*/
public function getMembersFields()
{
return array('duration');
return array(
'duration',
'delay_relative_to_video',
'video0_delay',
'delay',
);
}
}
15 changes: 15 additions & 0 deletions src/Checker/ModeChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ class ModeChecker extends AbstractAttributeChecker
*/
public function create($rateMode)
{
if (!isset($rateMode[1])) {
$rateMode[1] = $rateMode[0];
}
$mode = new Mode($rateMode[0], $rateMode[1]);
return $mode;
}
Expand All @@ -31,6 +34,18 @@ public function getMembersFields()
'format',
'kind_of_stream',
'writing_library',
'id',
'format_settings_sbr',
'channel_positions',
'default',
'forced',
'delay_origin',
'scan_type',
'interlacement',
'scan_type',
'frame_rate_mode',
'format_settings_cabac',
'unique_id',
);
}
}
12 changes: 11 additions & 1 deletion src/Checker/RateChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,19 @@ public function create($value)
public function getMembersFields()
{
return array(
'channel_s_',
'channel_s',
'bit_rate',
'sampling_rate',
'bit_depth',
'width',
'nominal_bit_rate',
'frame_rate',
'display_aspect_ratio',
'frame_rate',
'format_settings_reframes',
'height',
'resolution',
'original_display_aspect_ratio',
);
}
}

0 comments on commit 0bc8275

Please sign in to comment.