activevlc 0.0.1 → 0.0.3
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/.travis.yml +6 -0
- data/README.md +81 -26
- data/Rakefile +5 -0
- data/TODO.md +0 -1
- data/activevlc.gemspec +3 -2
- data/examples/basic.rb +14 -0
- data/examples/duplicate.rb +18 -0
- data/examples/duplicate_then_transcode.rb +29 -0
- data/examples/transcode_and_display.rb +25 -0
- data/examples/transcode_and_display_with_options.rb +36 -0
- data/lib/activevlc/cli.rb +25 -6
- data/lib/activevlc/libvlc/api.rb +196 -0
- data/lib/activevlc/libvlc/event_manager.rb +53 -0
- data/lib/activevlc/libvlc/instance.rb +71 -0
- data/lib/activevlc/libvlc/media.rb +32 -0
- data/lib/activevlc/libvlc/media_list.rb +55 -0
- data/lib/activevlc/libvlc/media_list_player.rb +64 -0
- data/lib/activevlc/libvlc/media_player.rb +63 -0
- data/lib/activevlc/libvlc.rb +33 -0
- data/lib/activevlc/pipeline.rb +4 -2
- data/lib/activevlc/pipeline_dump.rb +0 -2
- data/lib/activevlc/runner.rb +71 -0
- data/lib/activevlc/stage/input.rb +1 -0
- data/lib/activevlc/syntactic_sugar.rb +11 -0
- data/lib/activevlc/version.rb +1 -1
- data/lib/activevlc.rb +6 -3
- data/spec/event_manager_spec.rb +81 -0
- data/spec/libvlc_spec.rb +93 -0
- data/spec/pipeline_spec.rb +20 -1
- data/spec/pipes/no_input.rb +20 -0
- data/spec/pipes/transcode_and_display.rb +1 -1
- data/spec/runner_spec.rb +34 -0
- data/spec/samples/click.wav +0 -0
- data/spec/spec_helper.rb +24 -11
- metadata +34 -9
- data/examples/design.rb +0 -84
    
        data/spec/runner_spec.rb
    ADDED
    
    | @@ -0,0 +1,34 @@ | |
| 1 | 
            +
             | 
| 2 | 
            +
            require 'spec_helper'
         | 
| 3 | 
            +
             | 
| 4 | 
            +
            describe ActiveVlc::Runner do
         | 
| 5 | 
            +
              it 'can be created' do
         | 
| 6 | 
            +
                pipe = ActiveVlc.parse('spec/pipes/no_input.rb')
         | 
| 7 | 
            +
                runner = ActiveVlc::Runner.new(pipe, "--play-and-exit")
         | 
| 8 | 
            +
                runner.should be_a_kind_of(ActiveVlc::Runner)
         | 
| 9 | 
            +
              end
         | 
| 10 | 
            +
             | 
| 11 | 
            +
              it 'can be ran' do
         | 
| 12 | 
            +
                out = "output.ogg"
         | 
| 13 | 
            +
                pipe = ActiveVlc.parse('spec/pipes/no_input.rb')
         | 
| 14 | 
            +
                runner = ActiveVlc::Runner.new(pipe)
         | 
| 15 | 
            +
                pipe.input << 'spec/samples/click.wav'
         | 
| 16 | 
            +
             | 
| 17 | 
            +
                `rm -f #{out}`
         | 
| 18 | 
            +
                runner.run
         | 
| 19 | 
            +
                File.exist?(out).should be_true
         | 
| 20 | 
            +
                `rm -f #{out}`
         | 
| 21 | 
            +
              end
         | 
| 22 | 
            +
             | 
| 23 | 
            +
              it 'can be ran in a separate process' do
         | 
| 24 | 
            +
                out = "output.ogg"
         | 
| 25 | 
            +
                pipe = ActiveVlc.parse('spec/pipes/no_input.rb')
         | 
| 26 | 
            +
                runner = ActiveVlc::Runner.new(pipe)
         | 
| 27 | 
            +
                pipe.input << 'spec/samples/click.wav'
         | 
| 28 | 
            +
             | 
| 29 | 
            +
                `rm -f #{out}`
         | 
| 30 | 
            +
                runner.run
         | 
| 31 | 
            +
                File.exist?(out).should be_true
         | 
| 32 | 
            +
                `rm -f #{out}`
         | 
| 33 | 
            +
              end
         | 
| 34 | 
            +
            end
         | 
| Binary file | 
    
        data/spec/spec_helper.rb
    CHANGED
    
    | @@ -9,29 +9,42 @@ | |
| 9 9 | 
             
            ##
         | 
| 10 10 | 
             
            ## Copyright (C) 2013 Lta Akr
         | 
| 11 11 |  | 
| 12 | 
            -
             | 
| 13 | 
            -
             | 
| 14 | 
            -
               | 
| 12 | 
            +
            unless ENV['NO_COVERAGE']
         | 
| 13 | 
            +
              require 'simplecov'
         | 
| 14 | 
            +
              SimpleCov.start do
         | 
| 15 | 
            +
                add_filter '/spec/'
         | 
| 15 16 |  | 
| 16 | 
            -
             | 
| 17 | 
            -
             | 
| 17 | 
            +
                add_group "Stages", '/stage/'
         | 
| 18 | 
            +
                add_group "DSL", '/dsl/'
         | 
| 19 | 
            +
                add_group "LibVlc", '/libvlc/'
         | 
| 20 | 
            +
              end
         | 
| 18 21 | 
             
            end
         | 
| 19 22 |  | 
| 20 23 | 
             
            require 'activevlc'
         | 
| 21 24 |  | 
| 22 25 | 
             
            RSpec.configure do |config|
         | 
| 23 | 
            -
               | 
| 26 | 
            +
              config.order_groups do |groups|
         | 
| 27 | 
            +
                groups.shuffle!
         | 
| 28 | 
            +
                runner = groups.index { |g| g.described_class == ActiveVlc::Runner }
         | 
| 29 | 
            +
                if runner
         | 
| 30 | 
            +
                  runner = groups.delete_at runner
         | 
| 31 | 
            +
                  groups.unshift runner
         | 
| 32 | 
            +
                end
         | 
| 33 | 
            +
                groups
         | 
| 34 | 
            +
              end
         | 
| 24 35 | 
             
              #
         | 
| 25 | 
            -
              #  | 
| 36 | 
            +
              # We force the run order of the specs to ensure runner_specs get executed first.
         | 
| 37 | 
            +
              # This is important because libvlc seems to creates some internal state that
         | 
| 38 | 
            +
              # leads to a deadlock when executed last
         | 
| 26 39 | 
             
              #
         | 
| 27 | 
            -
              # config. | 
| 28 | 
            -
              #  | 
| 29 | 
            -
              #  | 
| 40 | 
            +
              # files = config.instance_variable_get(:@files_to_run)
         | 
| 41 | 
            +
              # puts files
         | 
| 42 | 
            +
              # files.delete ''
         | 
| 30 43 |  | 
| 31 44 | 
             
              # Run specs in random order to surface order dependencies. If you find an
         | 
| 32 45 | 
             
              # order dependency and want to debug it, you can fix the order by providing
         | 
| 33 46 | 
             
              # the seed, which is printed after each run.
         | 
| 34 47 | 
             
              #     --seed 1234
         | 
| 35 | 
            -
              config.order = "random"
         | 
| 48 | 
            +
              #config.order = "random"
         | 
| 36 49 | 
             
            end
         | 
| 37 50 |  | 
    
        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.3
         | 
| 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-27 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: bundler
         | 
| @@ -30,14 +30,14 @@ dependencies: | |
| 30 30 | 
             
                requirements:
         | 
| 31 31 | 
             
                - - ~>
         | 
| 32 32 | 
             
                  - !ruby/object:Gem::Version
         | 
| 33 | 
            -
                    version: '2. | 
| 33 | 
            +
                    version: '2.14'
         | 
| 34 34 | 
             
              type: :development
         | 
| 35 35 | 
             
              prerelease: false
         | 
| 36 36 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 37 37 | 
             
                requirements:
         | 
| 38 38 | 
             
                - - ~>
         | 
| 39 39 | 
             
                  - !ruby/object:Gem::Version
         | 
| 40 | 
            -
                    version: '2. | 
| 40 | 
            +
                    version: '2.14'
         | 
| 41 41 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 42 42 | 
             
              name: simplecov
         | 
| 43 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -67,13 +67,13 @@ dependencies: | |
| 67 67 | 
             
                  - !ruby/object:Gem::Version
         | 
| 68 68 | 
             
                    version: '0'
         | 
| 69 69 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 70 | 
            -
              name:  | 
| 70 | 
            +
              name: thor
         | 
| 71 71 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 72 72 | 
             
                requirements:
         | 
| 73 73 | 
             
                - - '>='
         | 
| 74 74 | 
             
                  - !ruby/object:Gem::Version
         | 
| 75 75 | 
             
                    version: '0'
         | 
| 76 | 
            -
              type: : | 
| 76 | 
            +
              type: :runtime
         | 
| 77 77 | 
             
              prerelease: false
         | 
| 78 78 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 79 79 | 
             
                requirements:
         | 
| @@ -81,7 +81,7 @@ dependencies: | |
| 81 81 | 
             
                  - !ruby/object:Gem::Version
         | 
| 82 82 | 
             
                    version: '0'
         | 
| 83 83 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 84 | 
            -
              name:  | 
| 84 | 
            +
              name: activesupport
         | 
| 85 85 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 86 86 | 
             
                requirements:
         | 
| 87 87 | 
             
                - - '>='
         | 
| @@ -95,7 +95,7 @@ dependencies: | |
| 95 95 | 
             
                  - !ruby/object:Gem::Version
         | 
| 96 96 | 
             
                    version: '0'
         | 
| 97 97 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 98 | 
            -
              name:  | 
| 98 | 
            +
              name: ffi
         | 
| 99 99 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 100 100 | 
             
                requirements:
         | 
| 101 101 | 
             
                - - '>='
         | 
| @@ -119,6 +119,7 @@ extra_rdoc_files: [] | |
| 119 119 | 
             
            files:
         | 
| 120 120 | 
             
            - .gitignore
         | 
| 121 121 | 
             
            - .rspec
         | 
| 122 | 
            +
            - .travis.yml
         | 
| 122 123 | 
             
            - Gemfile
         | 
| 123 124 | 
             
            - LICENSE.txt
         | 
| 124 125 | 
             
            - README.md
         | 
| @@ -126,7 +127,11 @@ files: | |
| 126 127 | 
             
            - TODO.md
         | 
| 127 128 | 
             
            - activevlc.gemspec
         | 
| 128 129 | 
             
            - bin/activevlc
         | 
| 129 | 
            -
            - examples/ | 
| 130 | 
            +
            - examples/basic.rb
         | 
| 131 | 
            +
            - examples/duplicate.rb
         | 
| 132 | 
            +
            - examples/duplicate_then_transcode.rb
         | 
| 133 | 
            +
            - examples/transcode_and_display.rb
         | 
| 134 | 
            +
            - examples/transcode_and_display_with_options.rb
         | 
| 130 135 | 
             
            - lib/activevlc.rb
         | 
| 131 136 | 
             
            - lib/activevlc/cli.rb
         | 
| 132 137 | 
             
            - lib/activevlc/cli/vlc.rb
         | 
| @@ -136,8 +141,17 @@ files: | |
| 136 141 | 
             
            - lib/activevlc/dsl/pipeline.rb
         | 
| 137 142 | 
             
            - lib/activevlc/dsl/stream.rb
         | 
| 138 143 | 
             
            - lib/activevlc/dsl/transcode.rb
         | 
| 144 | 
            +
            - lib/activevlc/libvlc.rb
         | 
| 145 | 
            +
            - lib/activevlc/libvlc/api.rb
         | 
| 146 | 
            +
            - lib/activevlc/libvlc/event_manager.rb
         | 
| 147 | 
            +
            - lib/activevlc/libvlc/instance.rb
         | 
| 148 | 
            +
            - lib/activevlc/libvlc/media.rb
         | 
| 149 | 
            +
            - lib/activevlc/libvlc/media_list.rb
         | 
| 150 | 
            +
            - lib/activevlc/libvlc/media_list_player.rb
         | 
| 151 | 
            +
            - lib/activevlc/libvlc/media_player.rb
         | 
| 139 152 | 
             
            - lib/activevlc/pipeline.rb
         | 
| 140 153 | 
             
            - lib/activevlc/pipeline_dump.rb
         | 
| 154 | 
            +
            - lib/activevlc/runner.rb
         | 
| 141 155 | 
             
            - lib/activevlc/stage.rb
         | 
| 142 156 | 
             
            - lib/activevlc/stage/base.rb
         | 
| 143 157 | 
             
            - lib/activevlc/stage/chain.rb
         | 
| @@ -146,16 +160,22 @@ files: | |
| 146 160 | 
             
            - lib/activevlc/stage/input.rb
         | 
| 147 161 | 
             
            - lib/activevlc/stage/stream.rb
         | 
| 148 162 | 
             
            - lib/activevlc/stage/transcode.rb
         | 
| 163 | 
            +
            - lib/activevlc/syntactic_sugar.rb
         | 
| 149 164 | 
             
            - lib/activevlc/version.rb
         | 
| 150 165 | 
             
            - spec/basic_pipe_spec.rb
         | 
| 151 166 | 
             
            - spec/basic_spec.rb
         | 
| 167 | 
            +
            - spec/event_manager_spec.rb
         | 
| 168 | 
            +
            - spec/libvlc_spec.rb
         | 
| 152 169 | 
             
            - spec/pipeline_dump_spec.rb
         | 
| 153 170 | 
             
            - spec/pipeline_spec.rb
         | 
| 154 171 | 
             
            - spec/pipes/basic.rb
         | 
| 155 172 | 
             
            - spec/pipes/duplicate.rb
         | 
| 156 173 | 
             
            - spec/pipes/duplicate_then_transcode.rb
         | 
| 174 | 
            +
            - spec/pipes/no_input.rb
         | 
| 157 175 | 
             
            - spec/pipes/transcode_and_display.rb
         | 
| 158 176 | 
             
            - spec/pipes/transcode_and_display_with_options.rb
         | 
| 177 | 
            +
            - spec/runner_spec.rb
         | 
| 178 | 
            +
            - spec/samples/click.wav
         | 
| 159 179 | 
             
            - spec/spec_helper.rb
         | 
| 160 180 | 
             
            - spec/stage_spec.rb
         | 
| 161 181 | 
             
            homepage: http://github.com/elthariel/activevlc
         | 
| @@ -185,12 +205,17 @@ summary: DSL for building VLC pipelines | |
| 185 205 | 
             
            test_files:
         | 
| 186 206 | 
             
            - spec/basic_pipe_spec.rb
         | 
| 187 207 | 
             
            - spec/basic_spec.rb
         | 
| 208 | 
            +
            - spec/event_manager_spec.rb
         | 
| 209 | 
            +
            - spec/libvlc_spec.rb
         | 
| 188 210 | 
             
            - spec/pipeline_dump_spec.rb
         | 
| 189 211 | 
             
            - spec/pipeline_spec.rb
         | 
| 190 212 | 
             
            - spec/pipes/basic.rb
         | 
| 191 213 | 
             
            - spec/pipes/duplicate.rb
         | 
| 192 214 | 
             
            - spec/pipes/duplicate_then_transcode.rb
         | 
| 215 | 
            +
            - spec/pipes/no_input.rb
         | 
| 193 216 | 
             
            - spec/pipes/transcode_and_display.rb
         | 
| 194 217 | 
             
            - spec/pipes/transcode_and_display_with_options.rb
         | 
| 218 | 
            +
            - spec/runner_spec.rb
         | 
| 219 | 
            +
            - spec/samples/click.wav
         | 
| 195 220 | 
             
            - spec/spec_helper.rb
         | 
| 196 221 | 
             
            - spec/stage_spec.rb
         | 
    
        data/examples/design.rb
    DELETED
    
    | @@ -1,84 +0,0 @@ | |
| 1 | 
            -
            ##
         | 
| 2 | 
            -
            ## design.rb
         | 
| 3 | 
            -
            ## Login : <lta@still>
         | 
| 4 | 
            -
            ## Started on  Wed Jun 12 01:18:11 2013 Lta Akr
         | 
| 5 | 
            -
            ##
         | 
| 6 | 
            -
            ## Author(s):
         | 
| 7 | 
            -
            ##  - Julien 'Lta' BALLET <contact@lta.io>
         | 
| 8 | 
            -
            ##
         | 
| 9 | 
            -
            ## Copyright (C) 2013 Julien 'Lta' BALLET
         | 
| 10 | 
            -
             | 
| 11 | 
            -
            # This example isn't supposed to work yet. It justs document what it's
         | 
| 12 | 
            -
            # supposed to look like when it's ready
         | 
| 13 | 
            -
             | 
| 14 | 
            -
            pipe_for 'file.mp4' do |pipe|
         | 
| 15 | 
            -
              transcode do
         | 
| 16 | 
            -
                audio do
         | 
| 17 | 
            -
                  codec :aac do
         | 
| 18 | 
            -
                    rc_method :vbr
         | 
| 19 | 
            -
                    psy_model :test1
         | 
| 20 | 
            -
                  end
         | 
| 21 | 
            -
                  bitrate 256
         | 
| 22 | 
            -
                end
         | 
| 23 | 
            -
                video :h264 do
         | 
| 24 | 
            -
                  encoder :qsv
         | 
| 25 | 
            -
                  async_depth 6
         | 
| 26 | 
            -
                  h264_level '5.1'
         | 
| 27 | 
            -
                end
         | 
| 28 | 
            -
              end
         | 
| 29 | 
            -
              deinterlace
         | 
| 30 | 
            -
             | 
| 31 | 
            -
              duplicate do
         | 
| 32 | 
            -
                to :dst do
         | 
| 33 | 
            -
                  caching 300
         | 
| 34 | 
            -
                  muxer 'mp4'
         | 
| 35 | 
            -
                  path '/tmp/test.mp4'
         | 
| 36 | 
            -
                end
         | 
| 37 | 
            -
                to :rtp do
         | 
| 38 | 
            -
                  caching 1500
         | 
| 39 | 
            -
                  muxer :ts
         | 
| 40 | 
            -
                  dst '192.168.0.1:4567'
         | 
| 41 | 
            -
                end
         | 
| 42 | 
            -
                to_display
         | 
| 43 | 
            -
              end
         | 
| 44 | 
            -
            end
         | 
| 45 | 
            -
             | 
| 46 | 
            -
             | 
| 47 | 
            -
             | 
| 48 | 
            -
            #
         | 
| 49 | 
            -
            # Kind of memory representation of the next pipeline
         | 
| 50 | 
            -
            # Pipeline
         | 
| 51 | 
            -
            #   @stages =
         | 
| 52 | 
            -
            #      - Stage (@type = :transcode)
         | 
| 53 | 
            -
            #        @options = {
         | 
| 54 | 
            -
            #          acodec = {
         | 
| 55 | 
            -
            #            _this_: :aac,
         | 
| 56 | 
            -
            #            opt1:   'test',
         | 
| 57 | 
            -
            #            opt1:   'test',
         | 
| 58 | 
            -
            #          }
         | 
| 59 | 
            -
            #        }
         | 
| 60 | 
            -
            #      - DuplicateStage (@type = :duplicate)
         | 
| 61 | 
            -
            #        @substages =
         | 
| 62 | 
            -
            #          - Stage (@type = :standard)
         | 
| 63 | 
            -
            #            @options = {
         | 
| 64 | 
            -
            #              mux: 'mp4'
         | 
| 65 | 
            -
            #              dst: 'output.mp4'
         | 
| 66 | 
            -
            #            }
         | 
| 67 | 
            -
            #
         | 
| 68 | 
            -
            ActiveVlc::pipe_for 'input.mp4' do
         | 
| 69 | 
            -
              transcode do
         | 
| 70 | 
            -
                audio :aac do
         | 
| 71 | 
            -
                  opt1 'test'
         | 
| 72 | 
            -
                  opt2 'caca'
         | 
| 73 | 
            -
                  opt3 42
         | 
| 74 | 
            -
                end
         | 
| 75 | 
            -
                video :h264
         | 
| 76 | 
            -
              end
         | 
| 77 | 
            -
              duplicate do
         | 
| 78 | 
            -
                to :file do
         | 
| 79 | 
            -
                  mux :mp4
         | 
| 80 | 
            -
                  dst 'output.mp4'
         | 
| 81 | 
            -
                end
         | 
| 82 | 
            -
                to :display
         | 
| 83 | 
            -
              end
         | 
| 84 | 
            -
            end
         |