{
shared_ptr<dcp::OpenJPEGImage> xyz;
- shared_ptr<Image> image = frame->image (note, bind (&PlayerVideo::keep_xyz_or_rgb, _1), true, false);
+ shared_ptr<Image> image = frame->image (bind (&PlayerVideo::keep_xyz_or_rgb, _1), true, false);
if (frame->colour_conversion()) {
xyz = dcp::rgb_to_xyz (
image->data()[0],
FFmpegFileEncoder::video (shared_ptr<PlayerVideo> video, DCPTime time)
{
shared_ptr<Image> image = video->image (
- boost::optional<dcp::NoteHandler>(bind(&Log::dcp_log, _log.get(), _1, _2)),
bind (&force_pixel_format, _1, _pixel_format),
true,
false
}
pair<shared_ptr<Image>, int>
-FFmpegImageProxy::image (optional<dcp::NoteHandler>, optional<dcp::Size>) const
+FFmpegImageProxy::image (optional<dcp::Size>) const
{
boost::mutex::scoped_lock lm (_mutex);
FFmpegImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
std::pair<boost::shared_ptr<Image>, int> image (
- boost::optional<dcp::NoteHandler> note = boost::optional<dcp::NoteHandler> (),
boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
) const;
public:
virtual ~ImageProxy () {}
- /** @param note Handler for any notes that occur.
+ /** @param log Log to write to, or 0.
* @param size Size that the returned image will be scaled to, in case this
* can be used as an optimisation.
* @return Image (which must be aligned) and log2 of any scaling down that has
* of the original, the second part of the return value will be 1.
*/
virtual std::pair<boost::shared_ptr<Image>, int> image (
- boost::optional<dcp::NoteHandler> note = boost::optional<dcp::NoteHandler> (),
boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
) const = 0;
}
pair<shared_ptr<Image>, int>
-J2KImageProxy::image (optional<dcp::NoteHandler>, optional<dcp::Size> target_size) const
+J2KImageProxy::image (optional<dcp::Size> target_size) const
{
int const r = prepare (target_size);
/* I think this is safe without a lock on mutex. _image is guaranteed to be
J2KImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
std::pair<boost::shared_ptr<Image>, int> image (
- boost::optional<dcp::NoteHandler> note = boost::optional<dcp::NoteHandler> (),
boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
) const;
}
/** Create an image for this frame.
- * @param note Handler for any notes that are made during the process.
* @param pixel_format Function which is called to decide what pixel format the output image should be;
* it is passed the pixel format of the input image from the ImageProxy, and should return the desired
* output pixel format. Two functions always_rgb and keep_xyz_or_rgb are provided for use here.
* @param fast true to be fast at the expense of quality.
*/
shared_ptr<Image>
-PlayerVideo::image (optional<dcp::NoteHandler> note, function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const
+PlayerVideo::image (function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const
{
- pair<shared_ptr<Image>, int> prox = _in->image (optional<dcp::NoteHandler> (note), _inter_size);
+ pair<shared_ptr<Image>, int> prox = _in->image (_inter_size);
shared_ptr<Image> im = prox.first;
int const reduce = prox.second;
void set_text (PositionImage);
void prepare ();
- boost::shared_ptr<Image> image (boost::optional<dcp::NoteHandler> note, boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const;
+ boost::shared_ptr<Image> image (boost::function<AVPixelFormat (AVPixelFormat)> pixel_format, bool aligned, bool fast) const;
static AVPixelFormat always_rgb (AVPixelFormat);
static AVPixelFormat keep_xyz_or_rgb (AVPixelFormat);
}
pair<shared_ptr<Image>, int>
-RawImageProxy::image (optional<dcp::NoteHandler>, optional<dcp::Size>) const
+RawImageProxy::image (optional<dcp::Size>) const
{
return make_pair (_image, 0);
}
RawImageProxy (boost::shared_ptr<cxml::Node> xml, boost::shared_ptr<Socket> socket);
std::pair<boost::shared_ptr<Image>, int> image (
- boost::optional<dcp::NoteHandler> note = boost::optional<dcp::NoteHandler> (),
boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
) const;
*/
_frame = _player_video.first->image (
- optional<dcp::NoteHandler>(bind(&Log::dcp_log, _film->log().get(), _1, _2)),
bind (&PlayerVideo::always_rgb, _1),
false, true
);
}
/* assuming DCP is 24fps/48kHz */
butler->get_audio (audio_buffer, 2000);
- p.first->image(optional<dcp::NoteHandler>(), bind(&PlayerVideo::always_rgb, _1), false, true);
+ p.first->image(bind(&PlayerVideo::always_rgb, _1), false, true);
}
delete[] audio_buffer;
}
}
}
-static void
-note_handler (dcp::NoteType, std::string)
-{
-
-}
-
/** Test some seeks towards the start of a DCP with awkward subtitles; see mantis #1085
* and a number of others. I thought this was a player seek bug but in fact it was
* caused by the subtitle starting just after the start of the video frame and hence
butler->seek (t, true);
pair<shared_ptr<PlayerVideo>, DCPTime> video = butler->get_video();
BOOST_CHECK_EQUAL(video.second.get(), t.get());
- write_image(video.first->image(optional<dcp::NoteHandler>(note_handler), PlayerVideo::always_rgb, false, true), String::compose("build/test/player_seek_test_%1.png", i), "RGB");
+ write_image(video.first->image(PlayerVideo::always_rgb, false, true), String::compose("build/test/player_seek_test_%1.png", i), "RGB");
/* This 0.011 is empirically chosen (hopefully) to accept changes in rendering between the reference and a test machine
(17.10 and 16.04 seem to anti-alias a little differently) but to reject gross errors e.g. missing fonts or missing
text altogether.
butler->seek (t, true);
pair<shared_ptr<PlayerVideo>, DCPTime> video = butler->get_video();
BOOST_CHECK_EQUAL(video.second.get(), t.get());
- write_image(video.first->image(optional<dcp::NoteHandler>(note_handler), PlayerVideo::always_rgb, false, true), String::compose("build/test/player_seek_test2_%1.png", i), "RGB");
+ write_image(video.first->image(PlayerVideo::always_rgb, false, true), String::compose("build/test/player_seek_test2_%1.png", i), "RGB");
check_image(String::compose("test/data/player_seek_test2_%1.png", i), String::compose("build/test/player_seek_test2_%1.png", i), 0.011);
}
}