ffmpeg-filter_graph 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +1 -0
- data/lib/ffmpeg/filter_graph/filter.rb +19 -16
- data/lib/ffmpeg/filter_graph/filter_factory.rb +7 -6
- data/lib/ffmpeg/filter_graph/graph.rb +1 -1
- data/lib/ffmpeg/filter_graph/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa0bbf4ed676022a7b35a4aff42b66cf2a5d2988
|
4
|
+
data.tar.gz: ef731984c3cebdbc6bb001459b10e9d97b846b37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03232cd2095f7c22014b427f5427c10bfbf7ffdbc8d6d78f1cb4cfcdbb26c7daad8f39ea9c65672b4dc5e6f8ee16594ce4786dd52b0109d9ec28e786370538ea
|
7
|
+
data.tar.gz: 5e44641498b622704e50f00a44cd138306b2c5282ebe9456b52bbcffe1dd3bfb1ffe532342860ef37957dfa3248bd5ae87474ab7e65236c5817487430cb393fb
|
data/CHANGELOG.md
CHANGED
@@ -1,24 +1,27 @@
|
|
1
1
|
module FFmpeg::FilterGraph
|
2
2
|
class Filter
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
class << self
|
4
|
+
# @param name [String] Sets the filter-name output by this filter
|
5
|
+
def name(name = nil)
|
6
|
+
if name.nil?
|
7
|
+
@name || fail('filter name not set')
|
8
|
+
else
|
9
|
+
@name = name
|
10
|
+
end
|
9
11
|
end
|
10
|
-
end
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
# @param opts [Array<String>] a list of valid options for this filter
|
14
|
+
def option(*opts)
|
15
|
+
@opts ||= []
|
15
16
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
17
|
+
if opts.any?
|
18
|
+
@opts.concat(opts)
|
19
|
+
attr_accessor *opts
|
20
|
+
end
|
20
21
|
|
21
|
-
|
22
|
+
@opts
|
23
|
+
end
|
24
|
+
alias_method :options, :option
|
22
25
|
end
|
23
26
|
|
24
27
|
def to_s
|
@@ -32,7 +35,7 @@ module FFmpeg::FilterGraph
|
|
32
35
|
# @return [String] A string concatenating the set options.
|
33
36
|
# @note May be overridden by atypical filters
|
34
37
|
def options_string
|
35
|
-
join_options(options)
|
38
|
+
join_options(*options.keys)
|
36
39
|
end
|
37
40
|
|
38
41
|
# Set all options to nil
|
@@ -30,6 +30,7 @@ module FFmpeg::FilterGraph
|
|
30
30
|
self.class_name = class_name.to_s
|
31
31
|
self.required = required || []
|
32
32
|
self.optional = optional || []
|
33
|
+
self.editable = editable
|
33
34
|
self.options_string = options_string
|
34
35
|
end
|
35
36
|
|
@@ -41,10 +42,8 @@ module FFmpeg::FilterGraph
|
|
41
42
|
# We need to make these local vars, to work in the Class.new block
|
42
43
|
cn = class_name.to_s
|
43
44
|
|
44
|
-
|
45
|
-
|
46
|
-
if editable
|
47
|
-
end
|
45
|
+
klass = create_class(cn, required, optional, editable, options_string)
|
46
|
+
mod.const_set(cn, klass)
|
48
47
|
|
49
48
|
if helper_module
|
50
49
|
helper_name = underscore(cn)
|
@@ -58,13 +57,15 @@ module FFmpeg::FilterGraph
|
|
58
57
|
|
59
58
|
private
|
60
59
|
|
61
|
-
def create_class(cn, req, opt, opt_str)
|
60
|
+
def create_class(cn, req, opt, editable, opt_str)
|
62
61
|
Class.new(Filter) do
|
63
62
|
const_set('REQUIRED', req.freeze)
|
64
63
|
const_set('OPTIONAL', opt.freeze)
|
65
64
|
|
66
65
|
name(cn.downcase.to_sym)
|
67
|
-
|
66
|
+
|
67
|
+
option(*(const_get('REQUIRED') + const_get('OPTIONAL')))
|
68
|
+
option(:enable) if editable
|
68
69
|
|
69
70
|
def initialize(args = {})
|
70
71
|
self.class.const_get('REQUIRED').each do |o|
|