summaryrefslogtreecommitdiff
path: root/src/lib/black_decoder.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-05-19 21:35:46 +0200
committerCarl Hetherington <cth@carlh.net>2022-05-19 21:35:46 +0200
commit8d67ad2e74b6d2c88b52a397a2c2823254ec09fb (patch)
treec5901380449dcd83ea8f5eaeafd775d8f40e6c29 /src/lib/black_decoder.cc
parente08d1ce718493a869e429be3a6f811575f2c8dd1 (diff)
wip: black pieces; sad part is that Shuffler can't cope with content that doesn't start at the same time.2253-3d-empty
Diffstat (limited to 'src/lib/black_decoder.cc')
-rw-r--r--src/lib/black_decoder.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/lib/black_decoder.cc b/src/lib/black_decoder.cc
new file mode 100644
index 000000000..f316767bf
--- /dev/null
+++ b/src/lib/black_decoder.cc
@@ -0,0 +1,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;
+}
+