*/
Encoder::Encoder (shared_ptr<Film> f)
: _film (f)
- , _just_skipped (false)
, _video_frames_in (0)
, _video_frames_out (0)
#ifdef HAVE_SWRESAMPLE
return _history_size / (seconds (now) - seconds (_time_history.back ()));
}
-/** @return true if the last frame to be processed was skipped as it already existed */
-bool
-Encoder::skipping () const
-{
- boost::mutex::scoped_lock (_history_mutex);
- return _just_skipped;
-}
-
/** @return Number of video frames that have been sent out */
int
Encoder::video_frames_out () const
Encoder::frame_done ()
{
boost::mutex::scoped_lock lock (_history_mutex);
- _just_skipped = false;
struct timeval tv;
gettimeofday (&tv, 0);
}
}
-/** Called by a subclass when it has just skipped the processing
- of a frame because it has already been done.
-*/
-void
-Encoder::frame_skipped ()
-{
- boost::mutex::scoped_lock lock (_history_mutex);
- _just_skipped = true;
-}
-
void
Encoder::process_video (shared_ptr<Image> image, bool same, boost::shared_ptr<Subtitle> sub)
{
return;
}
- /* Only do the processing if we don't already have a file for this frame */
- if (boost::filesystem::exists (_film->frame_out_path (_video_frames_out, false))) {
- frame_skipped ();
- return;
- }
-
if (same && _have_a_real_frame) {
/* Use the last frame that we encoded. */
_writer->repeat (_video_frames_out);