Class: FLV::Edit::Processor::Debug

Inherits:
Base
  • Object
show all
Defined in:
lib/flv/edit/processor/debug.rb

Constant Summary

Constants inherited from Base

Base::ALL_EVENTS, Base::EVENT_TRIGGER, Base::EVENT_TRIGGER_LIST, Base::MAIN_EVENTS

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary collapse

Methods inherited from Base

#absorb, #dispatch_chunk, #dispatch_chunks, #dispatch_instead, #each, #has_next_file?, #initialize, #process_all, #process_next_file, #rewind, #stdout, #stop

Constructor Details

This class inherits a constructor from FLV::Edit::Processor::Base

Instance Method Details

#on_header(tag) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/flv/edit/processor/debug.rb', line 13

def on_header(tag)
  @range = self.options[:debug] || TimestampRange.new(0, INFINITY)
  @range = @range.widen(0.1) unless @range.is_a? Range
  @last = {}
  @printer = Printer.new(stdout)
  tag.debug(@printer) if @range.include? 0
end

#on_tag(tag) ⇒ Object



21
22
23
24
25
# File 'lib/flv/edit/processor/debug.rb', line 21

def on_tag(tag)
  return unless @range.include? tag.timestamp
  tag.debug(@printer, @last[tag.body.class])
  @last[tag.body.class] = tag
end