Class: FLV::Edit::Processor::Cut
- Includes:
- Filter
- Defined in:
- lib/flvedit/processor/cut.rb
Overview
Cut is a Processor class (see Base and desc)
Instance Method Summary collapse
Methods included from Filter
Methods included from Base
#getters, included, #is?, #size, #to_hash
Instance Method Details
#before_filter ⇒ Object
13 14 15 16 17 |
# File 'lib/flvedit/processor/cut.rb', line 13 def before_filter @from, @to = [:cut].begin, [:cut].end @wait_for_keyframe = [:keyframe_mode] @first_timestamp = nil end |
#filter(tag) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/flvedit/processor/cut.rb', line 19 def filter(tag) return if tag.is_a? Header if tag. > @to stop elsif (tag. < @from) || (@wait_for_keyframe &&= !tag.body.is?(:keyframe)) :skip else @first_timestamp ||= tag. tag. -= @first_timestamp end end |