2 Copyright (C) 2013 Carl Hetherington <cth@carlh.net>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #include "black_decoder.h"
22 #include "null_content.h"
24 using boost::shared_ptr;
26 BlackDecoder::BlackDecoder (shared_ptr<const Film> f, shared_ptr<NullContent> c)
37 _image.reset (new SimpleImage (AV_PIX_FMT_RGB24, video_size(), true));
38 _image->make_black ();
39 video (_image, false, _next_video);
41 video (_image, true, _next_video);
46 BlackDecoder::video_frame_rate () const
48 boost::shared_ptr<const Film> f = _film.lock ();
53 return f->dcp_video_frame_rate ();
57 BlackDecoder::video_length () const
59 return _video_content->length() * video_frame_rate() / TIME_HZ;
63 BlackDecoder::position () const
69 BlackDecoder::seek (Time t)
75 BlackDecoder::seek_back ()
77 boost::shared_ptr<const Film> f = _film.lock ();
82 _next_video -= f->video_frames_to_time (2);
86 BlackDecoder::seek_forward ()
88 boost::shared_ptr<const Film> f = _film.lock ();
93 _next_video += f->video_frames_to_time (1);
97 BlackDecoder::done () const