Skip to content

Commit

Permalink
Some docs on the Encoder class.
Browse files Browse the repository at this point in the history
  • Loading branch information
dave@netbook committed Mar 5, 2010
1 parent 77b85a5 commit cd4b66f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/enigmamachine/models/encoder.rb
Expand Up @@ -3,6 +3,8 @@
# An encoding profile which can be applied to a video. It has a name and is
# composed of a bunch of EncodingTasks.
#
# The Encoder class can shell out to FFMPeg and trigger the encoding of a Video.
#
class Encoder
include DataMapper::Resource

Expand All @@ -15,17 +17,17 @@ class Encoder
#
has n, :encoding_tasks

# This is a candidate for being moved into the class Encoders::Video (which
# could happily be renamed as something like Encoders::Ffmpeg).
# Kicks off an FFMpeg encode on a given video.
#
def encode(video)
ffmpeg(encoding_tasks.first, video)
end

private

# If the encode method is pulled into another class, this one should go with
# it, obviously.
# Shells out to ffmpeg and hits the given video with the parameters in the
# given task. Will call itself recursively until all tasks in this encoder's
# encoding_tasks are completed.
#
def ffmpeg(task, video)
current_task_index = encoding_tasks.index(task)
Expand Down

0 comments on commit cd4b66f

Please sign in to comment.