Class: Mediakit::Initializers::FFmpeg::FormatInitializer
- Inherits:
-
Base
- Object
- Base
- Mediakit::Initializers::FFmpeg::FormatInitializer
show all
- Defined in:
- lib/mediakit/initializers/ffmpeg.rb
Constant Summary
collapse
- DELIMITER_FOR_FORMATS =
"\n --\n".freeze
- SUPPORT_PATTERN =
/(?<support>(?<demuxing>[D.\s])(?<muxing>[E.\s]))/.freeze
- PATTERN =
/\A\s*#{SUPPORT_PATTERN}\s+(?<name>\w+)\s+(?<desc>.+)\z/.freeze
Instance Attribute Summary
Attributes inherited from Base
#items
Instance Method Summary
collapse
Methods inherited from Base
#call, #initialize, #parse_items
Instance Method Details
#create_item(line) ⇒ Object
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/mediakit/initializers/ffmpeg.rb', line 67
def create_item(line)
match = line.match(PATTERN)
if match
attributes = {
name: match[:name],
desc: match[:desc],
demuxing: match[:demuxing] == 'D',
muxing: match[:muxing] == 'E'
}
Mediakit::FFmpeg::Format.create_constant(
"FORMAT_#{attributes[:name].underscore.upcase}", attributes
)
end
end
|
#item_type ⇒ Object
56
57
58
|
# File 'lib/mediakit/initializers/ffmpeg.rb', line 56
def item_type
'formats'
end
|