Class: VCSRuby::Capturer

Inherits:
Object
  • Object
show all
Defined in:
lib/capturer.rb

Direct Known Subclasses

FFmpeg, LibAV, MPlayer, MockCapturer

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.createObject



17
18
19
20
21
22
23
24
25
# File 'lib/capturer.rb', line 17

def self.create
  capturers = []

  capturers << LibAV.new(video)
  capturers << MPlayer.new(video)
  capturers << FFmpeg.new(video)

  return capturers.first
end

.initialize_capturers(video) ⇒ Object



13
14
15
# File 'lib/capturer.rb', line 13

def self.initialize_capturers video
  puts "Available capturers: #{available_capturers.map{ |c| c.to_s }.join(', ')}" if Tools.verbose?
end

Instance Method Details

#available?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'lib/capturer.rb', line 9

def available?
  false
end

#formatObject



27
28
29
# File 'lib/capturer.rb', line 27

def format
  @format || available_formats.first
end

#format=(format) ⇒ Object



35
36
37
38
39
40
41
# File 'lib/capturer.rb', line 35

def format= format
  if available_formats.include? format
    @format = format
  else
    raise "Capturer '#{name}' does not support format: '#{format}'"
  end
end

#format_extensionObject



31
32
33
# File 'lib/capturer.rb', line 31

def format_extension
  $formats[format]
end