activevlc 0.0.3 → 0.0.4
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.
- checksums.yaml +4 -4
- data/lib/activevlc/cli.rb +8 -21
- data/lib/activevlc/libvlc/event_manager.rb +1 -1
- data/lib/activevlc/runner.rb +2 -1
- data/lib/activevlc/version.rb +2 -1
- data/spec/runner_spec.rb +6 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56e04816c9e72596198ffd78ca019173741da370
|
4
|
+
data.tar.gz: bcd7e86c5d4434d25424147cb6cfdf6d05aa554c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d927d352f1d6fe1e667eec163dd48d11a4deff7a8dbe5fd4772b5978c7e2d1c06cc2c72a9664b8a3b937b3e6cab168d54bd15779b0119cff4e2200ad91e441e
|
7
|
+
data.tar.gz: 2828541e9c4416d50bab649b5f7d330a6098df884bccf4b65d280eca9b431a838d4371695e038afa038e1f046c5716acf01997ee263555caef8c6fde736f3119
|
data/lib/activevlc/cli.rb
CHANGED
@@ -44,39 +44,26 @@ module ActiveVlc
|
|
44
44
|
end
|
45
45
|
|
46
46
|
desc 'exec path [input_file_1 [input_file_2] [...]]', 'Launch vlc executable to run the pipeline described in path file'
|
47
|
+
option :cmd, type: :boolean, default: false
|
47
48
|
def exec(path, *inputs)
|
48
49
|
if File.readable?(path)
|
49
50
|
begin
|
50
51
|
pipe = ActiveVlc::parse(path)
|
51
|
-
pipe.
|
52
|
+
pipe.input << inputs
|
52
53
|
fragment = pipe.fragment
|
53
54
|
rescue
|
54
|
-
puts "Error while parsing pipe file"
|
55
|
+
puts "Error while parsing pipe file: #{$!}"
|
55
56
|
exit 43
|
56
57
|
end
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
exit $?.exitstatus
|
62
|
-
end
|
63
|
-
|
64
|
-
desc 'run path [input_file_1 [input_file_2] [...]]', 'Run the path pipeline using LibVlc (usually better than exec)'
|
65
|
-
def run(path, *inputs)
|
66
|
-
if File.readable?(path)
|
67
|
-
begin
|
68
|
-
pipe = ActiveVlc::parse(path)
|
69
|
-
pipe.inputs << inputs
|
70
|
-
fragment = pipe.fragment
|
71
|
-
rescue
|
72
|
-
puts "Error while parsing pipe file"
|
73
|
-
exit 43
|
58
|
+
if options[:cmd]
|
59
|
+
Kernel.exec "vlc -I dummy -vvv --play-and-exit #{fragment}"
|
60
|
+
else
|
61
|
+
ActiveVlc::Runner.new(pipe).run
|
74
62
|
end
|
75
|
-
ActiveVlc::Runner.new(pipe).run
|
76
63
|
else
|
77
64
|
puts "Error: file [#{path}] doesn't exist or reading permission denied."
|
78
65
|
end
|
79
|
-
|
66
|
+
exit $?.exitstatus
|
80
67
|
end
|
81
68
|
|
82
69
|
desc 'dump path', 'Dump the internal representation of the pipeline defined in the file path'
|
@@ -44,7 +44,7 @@ module ActiveVlc::LibVlc
|
|
44
44
|
|
45
45
|
@events_received += 1;
|
46
46
|
|
47
|
-
puts "Received event (#{@events_received}): #{EventType[event[:type]]}"
|
47
|
+
# puts "Received event (#{@events_received}): #{EventType[event[:type]]}"
|
48
48
|
|
49
49
|
return unless @callbacks[event[:type]].is_a? Array
|
50
50
|
@callbacks[event[:type]].each { |proc| proc.call(type) }
|
data/lib/activevlc/runner.rb
CHANGED
@@ -37,7 +37,8 @@ module ActiveVlc
|
|
37
37
|
player = @api.create_player
|
38
38
|
events = player.event_manager
|
39
39
|
|
40
|
-
sout.gsub!('\'', '')
|
40
|
+
sout.gsub!('\'', '')
|
41
|
+
sout.gsub!('"', '')
|
41
42
|
|
42
43
|
# Building the medias with the right options
|
43
44
|
medias = @pipeline.input.inputs.map do |input|
|
data/lib/activevlc/version.rb
CHANGED
data/spec/runner_spec.rb
CHANGED
@@ -20,7 +20,7 @@ describe ActiveVlc::Runner do
|
|
20
20
|
`rm -f #{out}`
|
21
21
|
end
|
22
22
|
|
23
|
-
it 'can be ran in a separate
|
23
|
+
it 'can be ran in a separate proces' do
|
24
24
|
out = "output.ogg"
|
25
25
|
pipe = ActiveVlc.parse('spec/pipes/no_input.rb')
|
26
26
|
runner = ActiveVlc::Runner.new(pipe)
|
@@ -31,4 +31,9 @@ describe ActiveVlc::Runner do
|
|
31
31
|
File.exist?(out).should be_true
|
32
32
|
`rm -f #{out}`
|
33
33
|
end
|
34
|
+
|
35
|
+
it 'can be ran using the cmd line' do
|
36
|
+
`bundle exec activevlc exec spec/pipes/basic.rb`
|
37
|
+
$?.exitstatus.should eq(0)
|
38
|
+
end
|
34
39
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activevlc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien 'Lta' BALLET
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-09-
|
11
|
+
date: 2013-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|