blob: f316767bf0000e9ade3de692483d3ef5c3263aa9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#include "black_content.h"
#include "black_decoder.h"
#include "image.h"
#include "raw_image_proxy.h"
#include "video_decoder.h"
using std::make_shared;
using std::shared_ptr;
using namespace dcpomatic;
BlackDecoder::BlackDecoder (shared_ptr<const Film> film, shared_ptr<const BlackContent> content)
: Decoder(film)
, _content(content)
, _video_frame_rate(film->video_frame_rate())
{
video = make_shared<VideoDecoder>(this, content);
_image = make_shared<Image>(AV_PIX_FMT_RGB24, dcp::Size(128, 128), Image::Alignment::PADDED);
_image->make_black ();
_proxy = make_shared<const RawImageProxy>(_image);
}
void
BlackDecoder::seek (ContentTime time, bool)
{
_position = DCPTime(time.get());
}
bool
BlackDecoder::pass ()
{
if (_position >= _content->end(film())) {
return true;
}
video->emit(film(), _proxy, _position.frames_round(_video_frame_rate));
_position += DCPTime::from_frames(1, _video_frame_rate);
return false;
}
|