Encoder::Encoder (std::shared_ptr<const Film> film, std::weak_ptr<Job> job)
: _film (film)
, _job (job)
- , _player (new Player(film))
+ , _player (new Player(film, true))
{
}
video = make_shared<VideoDecoder>(this, c);
_pts_offset = pts_offset (c->ffmpeg_audio_streams(), c->first_video(), c->active_video_frame_rate(film));
/* It doesn't matter what size or pixel format this is, it just needs to be black */
- _black_image.reset (new Image (AV_PIX_FMT_RGB24, dcp::Size (128, 128), true));
+ _black_image = make_shared<Image>(AV_PIX_FMT_RGB24, dcp::Size (128, 128), true);
_black_image->make_black ();
} else {
_pts_offset = {};
ImageProxy::Result
-FFmpegImageProxy::image (optional<dcp::Size>) const
+FFmpegImageProxy::image (bool aligned, optional<dcp::Size>) const
{
auto constexpr name_for_errors = "FFmpegImageProxy::image";
throw DecodeError (N_("avcodec_receive_frame"), name_for_errors, r, *_path);
}
- _image = make_shared<Image>(frame);
+ _image = make_shared<Image>(frame, aligned);
av_packet_unref (&packet);
av_frame_free (&frame);
FFmpegImageProxy (std::shared_ptr<Socket> socket);
Result image (
+ bool aligned,
boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
) const;
emit (bind(boost::ref(Progress), _("Examining audio, subtitles and closed captions")));
}
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
player->set_ignore_video ();
if (check_loudness_done) {
/* We don't need to analyse audio because we already loaded a suitable analysis */
}
}
-Image::Image (AVFrame const * frame)
+Image::Image (AVFrame const * frame, bool aligned)
: _size (frame->width, frame->height)
, _pixel_format (static_cast<AVPixelFormat>(frame->format))
- , _aligned (true)
+ , _aligned (aligned)
{
DCPOMATIC_ASSERT (_pixel_format != AV_PIX_FMT_NONE);
PositionImage
-merge (list<PositionImage> images)
+merge (list<PositionImage> images, bool aligned)
{
if (images.empty ()) {
return {};
all.extend (dcpomatic::Rect<int>(i.position, i.image->size().width, i.image->size().height));
}
- auto merged = make_shared<Image>(images.front().image->pixel_format(), dcp::Size(all.width, all.height), false);
+ auto merged = make_shared<Image>(images.front().image->pixel_format(), dcp::Size(all.width, all.height), aligned);
merged->make_transparent ();
for (auto const& i: images) {
merged->alpha_blend (i.image, i.position - all.position());
}
}
+
shared_ptr<const Image>
-Image::ensure_aligned (shared_ptr<const Image> image)
+Image::ensure_aligned (shared_ptr<const Image> image, bool aligned)
{
- if (image->aligned()) {
+ if (image->aligned() == aligned) {
return image;
}
- return make_shared<Image>(image, true);
+ return make_shared<Image>(image, aligned);
}
+
size_t
Image::memory_used () const
{
{
public:
Image (AVPixelFormat p, dcp::Size s, bool aligned);
- explicit Image (AVFrame const *);
+ explicit Image (AVFrame const *, bool aligned);
explicit Image (Image const &);
Image (std::shared_ptr<const Image>, bool);
Image& operator= (Image const &);
void png_error (char const * message);
- static std::shared_ptr<const Image> ensure_aligned (std::shared_ptr<const Image> image);
+ static std::shared_ptr<const Image> ensure_aligned (std::shared_ptr<const Image> image, bool aligned);
private:
friend struct pixel_formats_test;
bool _aligned;
};
-extern PositionImage merge (std::list<PositionImage> images);
+extern PositionImage merge (std::list<PositionImage> images, bool aligned);
extern bool operator== (Image const & a, Image const & b);
#endif
delete[] buffer;
} else {
FFmpegImageProxy proxy(content->path(0));
- _video_size = proxy.image().image->size();
+ _video_size = proxy.image(false).image->size();
}
if (content->still ()) {
* can be used as an optimisation.
*/
virtual Result image (
+ bool aligned,
boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
) const = 0;
* This method may be called in a different thread to image().
* @return log2 of any scaling down that will be applied to the image.
*/
- virtual int prepare (boost::optional<dcp::Size> = boost::optional<dcp::Size>()) const { return 0; }
+ virtual int prepare (bool, boost::optional<dcp::Size> = boost::optional<dcp::Size>()) const { return 0; }
virtual size_t memory_used () const = 0;
};
if (xml->optional_number_child<int>("Eye")) {
_eye = static_cast<dcp::Eye>(xml->number_child<int>("Eye"));
}
- shared_ptr<ArrayData> data(new ArrayData(xml->number_child<int>("Size")));
+ auto data = make_shared<ArrayData>(xml->number_child<int>("Size"));
/* This only matters when we are using J2KImageProxy for the preview, which
will never use this constructor (which is only used for passing data to
encode servers). So we can put anything in here. It's a bit of a hack.
int
-J2KImageProxy::prepare (optional<dcp::Size> target_size) const
+J2KImageProxy::prepare (bool aligned, optional<dcp::Size> target_size) const
{
boost::mutex::scoped_lock lm (_mutex);
try {
/* XXX: should check that potentially trashing _data here doesn't matter */
auto decompressed = dcp::decompress_j2k (const_cast<uint8_t*>(_data->data()), _data->size(), reduce);
- _image.reset (new Image (_pixel_format, decompressed->size(), false));
+ _image = make_shared<Image>(_pixel_format, decompressed->size(), aligned);
int const shift = 16 - decompressed->precision (0);
}
}
} catch (dcp::J2KDecompressionError& e) {
- _image = make_shared<Image>(_pixel_format, _size, true);
+ _image = make_shared<Image>(_pixel_format, _size, aligned);
_image->make_black ();
_error = true;
}
ImageProxy::Result
-J2KImageProxy::image (optional<dcp::Size> target_size) const
+J2KImageProxy::image (bool aligned, optional<dcp::Size> target_size) const
{
- int const r = prepare (target_size);
+ int const r = prepare (aligned, target_size);
/* I think this is safe without a lock on mutex. _image is guaranteed to be
set up when prepare() has happened.
J2KImageProxy (dcp::ArrayData data, dcp::Size size, AVPixelFormat pixel_format);
Result image (
+ bool aligned,
boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
) const;
void write_to_socket (std::shared_ptr<Socket>) const;
/** @return true if our image is definitely the same as another, false if it is probably not */
bool same (std::shared_ptr<const ImageProxy>) const;
- int prepare (boost::optional<dcp::Size> = boost::optional<dcp::Size>()) const;
+ int prepare (bool aligned, boost::optional<dcp::Size> = boost::optional<dcp::Size>()) const;
std::shared_ptr<const dcp::Data> j2k () const {
return _data;
int const PlayerProperty::PLAYBACK_LENGTH = 705;
-Player::Player (shared_ptr<const Film> film)
+Player::Player (shared_ptr<const Film> film, bool aligned)
: _film (film)
, _suspended (0)
, _tolerant (film->tolerant())
, _audio_merger (_film->audio_frame_rate())
+ , _aligned_subtitles (aligned)
{
construct ();
}
return {};
}
- return merge (captions);
+ return merge (captions, _aligned_subtitles);
}
class Player : public std::enable_shared_from_this<Player>
{
public:
- Player (std::shared_ptr<const Film>);
+ Player (std::shared_ptr<const Film>, bool aligned_subtitles);
Player (std::shared_ptr<const Film>, std::shared_ptr<const Playlist> playlist);
Player (Player const& Player) = delete;
dcpomatic::DCPTime _playback_length;
+ /** aligned flag for subtitle images that we create */
+ bool _aligned_subtitles = true;
+
boost::signals2::scoped_connection _film_changed_connection;
boost::signals2::scoped_connection _playlist_change_connection;
boost::signals2::scoped_connection _playlist_content_change_connection;
}
-shared_ptr<Image>
+shared_ptr<const Image>
PlayerVideo::raw_image () const
{
- return _in->image(_inter_size).image;
+ return _in->image(false, _inter_size).image;
}
_image_out_size = _out_size;
_image_fade = _fade;
- auto prox = _in->image (_inter_size);
+ auto prox = _in->image (true, _inter_size);
_error = prox.error;
auto total_crop = _crop;
);
if (_text) {
- _image->alpha_blend (Image::ensure_aligned (_text->image), _text->position);
+ _image->alpha_blend (Image::ensure_aligned(_text->image, true), _text->position);
}
if (_fade) {
void
PlayerVideo::prepare (function<AVPixelFormat (AVPixelFormat)> pixel_format, VideoRange video_range, bool aligned, bool fast, bool proxy_only)
{
- _in->prepare (_inter_size);
+ _in->prepare (aligned, _inter_size);
boost::mutex::scoped_lock lm (_mutex);
if (!_image && !proxy_only) {
make_image (pixel_format, video_range, aligned, fast);
ImageProxy::Result
-RawImageProxy::image (optional<dcp::Size>) const
+RawImageProxy::image (bool aligned, optional<dcp::Size>) const
{
- return Result (_image, 0);
+ /* This ensure_aligned could be wasteful */
+ return Result (Image::ensure_aligned(_image, aligned), 0);
}
return false;
}
- return (*_image.get()) == (*rp->image().image.get());
+ return (*_image.get()) == (*rp->image(_image->aligned()).image.get());
}
RawImageProxy (std::shared_ptr<cxml::Node> xml, std::shared_ptr<Socket> socket);
Result image (
+ bool aligned,
boost::optional<dcp::Size> size = boost::optional<dcp::Size> ()
) const;
{
/* XXX: this is rather inefficient; decoding the image just to get its size */
FFmpegImageProxy proxy (sub.png_image());
- auto image = proxy.image().image;
+ auto image = proxy.image(false).image;
/* set up rect with height and width */
dcpomatic::Rect<double> rect(0, 0, image->size().width / double(size.width), image->size().height / double(size.height));
list<pair<shared_ptr<Image>, int64_t>> images;
if (_copy) {
- images.push_back (make_pair(make_shared<Image>(frame), frame->best_effort_timestamp));
+ images.push_back (make_pair(make_shared<Image>(frame, true), frame->best_effort_timestamp));
} else {
int r = av_buffersrc_write_frame (_buffer_src_context, frame);
if (r < 0) {
break;
}
- images.push_back (make_pair(make_shared<Image>(_frame), frame->best_effort_timestamp));
+ images.push_back (make_pair(make_shared<Image>(_frame, true), frame->best_effort_timestamp));
av_frame_unref (_frame);
}
}
film = make_shared<Film>(film_dir);
film->read_metadata ();
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
player->Video.connect (bind(&process_video, _1));
while (!player->pass ()) {}
} catch (std::exception& e) {
}
try {
- _player = make_shared<Player>(_film);
+ _player = make_shared<Player>(_film, !_optimise_for_j2k);
_player->set_fast ();
if (_dcp_decode_reduction) {
_player->set_dcp_decode_reduction (_dcp_decode_reduction);
_audio_channels,
bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24),
VideoRange::FULL,
- false,
+ !_optimise_for_j2k,
true,
dynamic_pointer_cast<GLVideoView>(_video_view) && _optimise_for_j2k
);
void
GLVideoView::set_image (shared_ptr<const PlayerVideo> pv)
{
- auto video = _optimise_for_j2k ? pv->raw_image() : pv->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true);
+ shared_ptr<const Image> video = _optimise_for_j2k ? pv->raw_image() : pv->image(bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true);
- DCPOMATIC_ASSERT (!video->aligned());
+ /* Only the player's black frames should be aligned at this stage, so this should
+ * almost always have no work to do.
+ */
+ video = Image::ensure_aligned (video, false);
/** If _optimise_for_j2k is true we render a XYZ image, doing the colourspace
* conversion, scaling and video range conversion in the GL shader.
map.set (i, i, 1);
}
- Butler butler (film, make_shared<Player>(film), map, 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, false, false);
+ Butler butler (film, make_shared<Player>(film, false), map, 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, false, false);
BOOST_CHECK (butler.get_video(true, 0).second == DCPTime());
BOOST_CHECK (butler.get_video(true, 0).second == DCPTime::from_frames(1, 24));
ov_content = make_shared<DCPContent>(ov->dir(ov->dcp_name(false)));
test->examine_and_add_content (ov_content);
BOOST_REQUIRE (!wait_for_jobs());
- auto player = make_shared<Player>(test);
+ auto player = make_shared<Player>(test, false);
auto decoder = std::dynamic_pointer_cast<DCPDecoder>(player->_pieces.front()->decoder);
BOOST_REQUIRE (decoder);
auto vf_content = make_shared<DCPContent>(vf->dir(vf->dcp_name(false)));
test->examine_and_add_content (vf_content);
BOOST_REQUIRE (!wait_for_jobs());
- player.reset (new Player(test));
+ player = make_shared<Player>(test, false);
decoder = std::dynamic_pointer_cast<DCPDecoder>(player->_pieces.front()->decoder);
BOOST_REQUIRE (decoder);
auto encrypted_content = make_shared<DCPContent>(encrypted->dir(encrypted->dcp_name(false)));
test->examine_and_add_content (encrypted_content);
BOOST_REQUIRE (!wait_for_jobs());
- player = make_shared<Player>(test);
+ player = make_shared<Player>(test, false);
decoder = std::dynamic_pointer_cast<DCPDecoder>(player->_pieces.front()->decoder);
BOOST_REQUIRE (decoder);
using std::make_shared;
-using std::pair;
-using std::shared_ptr;
-using boost::optional;
+using std::make_shared;
#if BOOST_VERSION >= 106100
using namespace boost::placeholders;
#endif
auto butler = std::make_shared<Butler>(
film,
- shared_ptr<Player>(new Player(film)),
+ make_shared<Player>(film, false),
AudioMapping(6, 6),
6,
bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24),
ref_buffer_size = info.samplerate * info.channels;
ref_buffer = new float[ref_buffer_size];
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
player->Audio.connect (bind (&audio, _1, info.channels));
while (!player->pass ()) {}
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs ());
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
while (!player->pass ()) {}
}
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs ());
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
player->set_fast ();
while (!player->pass ()) {}
}
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs ());
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
player->set_fast ();
BOOST_CHECK_NO_THROW (while (!player->pass()) {});
}
film->examine_and_add_content (content);
BOOST_REQUIRE (!wait_for_jobs());
film->write_metadata ();
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
BOOST_REQUIRE (content->video_frame_rate());
BOOST_CHECK_CLOSE (content->video_frame_rate().get(), fps, 0.01);
alpha_blend_test_one (AVPixelFormat format, string suffix)
{
auto proxy = make_shared<FFmpegImageProxy>(TestPaths::private_data() / "prophet_frame.tiff");
- auto raw = proxy->image().image;
+ auto raw = proxy->image(false).image;
auto background = raw->convert_pixel_format (dcp::YUVToRGB::REC709, format, true, false);
auto overlay = make_shared<Image>(AV_PIX_FMT_BGRA, dcp::Size(431, 891), true);
list<PositionImage> all;
all.push_back (PositionImage (A, Position<int>(0, 0)));
- auto merged = merge (all);
+ auto merged = merge (all, false);
BOOST_CHECK (merged.position == Position<int>(0, 0));
BOOST_CHECK_EQUAL (memcmp (merged.image->data()[0], A->data()[0], stride * 48), 0);
list<PositionImage> all;
all.push_back (PositionImage(A, Position<int>(0, 0)));
all.push_back (PositionImage(B, Position<int>(0, 0)));
- auto merged = merge (all);
+ auto merged = merge (all, false);
BOOST_CHECK (merged.position == Position<int>(0, 0));
BOOST_AUTO_TEST_CASE (crop_scale_window_test)
{
auto proxy = make_shared<FFmpegImageProxy>("test/data/flat_red.png");
- auto raw = proxy->image().image;
+ auto raw = proxy->image(false).image;
auto out = raw->crop_scale_window(
Crop(), dcp::Size(1998, 836), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VideoRange::FULL, AV_PIX_FMT_YUV420P, VideoRange::FULL, true, false
);
BOOST_AUTO_TEST_CASE (crop_scale_window_test3)
{
auto proxy = make_shared<FFmpegImageProxy>(TestPaths::private_data() / "player_seek_test_0.png");
- auto xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, true, false);
+ auto xyz = proxy->image(false).image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, true, false);
auto cropped = xyz->crop_scale_window(
Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VideoRange::FULL, AV_PIX_FMT_RGB24, VideoRange::FULL, false, false
);
BOOST_AUTO_TEST_CASE (crop_scale_window_test4)
{
auto proxy = make_shared<FFmpegImageProxy>(TestPaths::private_data() / "player_seek_test_0.png");
- auto xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, true, false);
+ auto xyz = proxy->image(false).image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGB24, true, false);
auto cropped = xyz->crop_scale_window(
Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VideoRange::FULL, AV_PIX_FMT_XYZ12LE, VideoRange::FULL, false, false
);
BOOST_AUTO_TEST_CASE (crop_scale_window_test5)
{
auto proxy = make_shared<FFmpegImageProxy>(TestPaths::private_data() / "player_seek_test_0.png");
- auto xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_XYZ12LE, true, false);
+ auto xyz = proxy->image(false).image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_XYZ12LE, true, false);
auto cropped = xyz->crop_scale_window(
Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VideoRange::FULL, AV_PIX_FMT_RGB24, VideoRange::FULL, false, false
);
BOOST_AUTO_TEST_CASE (crop_scale_window_test6)
{
auto proxy = make_shared<FFmpegImageProxy>(TestPaths::private_data() / "player_seek_test_0.png");
- auto xyz = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_XYZ12LE, true, false);
+ auto xyz = proxy->image(false).image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_XYZ12LE, true, false);
auto cropped = xyz->crop_scale_window(
Crop(512, 0, 0, 0), dcp::Size(1486, 1080), dcp::Size(1998, 1080), dcp::YUVToRGB::REC709, VideoRange::FULL, AV_PIX_FMT_XYZ12LE, VideoRange::FULL, false, false
);
using namespace boost::filesystem;
for (int left_crop = 0; left_crop < 8; ++left_crop) {
auto proxy = make_shared<FFmpegImageProxy>("test/data/rgb_grey_testcard.png");
- auto yuv = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_YUV420P, true, false);
+ auto yuv = proxy->image(false).image->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_YUV420P, true, false);
int rounded = left_crop - (left_crop % 2);
auto cropped = yuv->crop_scale_window(
Crop(left_crop, 0, 0, 0),
BOOST_AUTO_TEST_CASE (as_png_test)
{
auto proxy = make_shared<FFmpegImageProxy>("test/data/3d_test/000001.png");
- auto image_rgb = proxy->image().image;
+ auto image_rgb = proxy->image(false).image;
auto image_bgr = image_rgb->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_BGRA, true, false);
image_rgb->as_png().write ("build/test/as_png_rgb.png");
image_bgr->as_png().write ("build/test/as_png_bgr.png");
fade_test_format_red (AVPixelFormat f, float amount, string name)
{
auto proxy = make_shared<FFmpegImageProxy>("test/data/flat_red.png");
- auto red = proxy->image().image->convert_pixel_format(dcp::YUVToRGB::REC709, f, true, false);
+ auto red = proxy->image(false).image->convert_pixel_format(dcp::YUVToRGB::REC709, f, true, false);
red->fade (amount);
string const filename = "fade_test_red_" + name + ".png";
red->convert_pixel_format(dcp::YUVToRGB::REC709, AV_PIX_FMT_RGBA, true, false)->as_png().write("build/test/" + filename);
BOOST_AUTO_TEST_CASE (make_part_black_test)
{
auto proxy = make_shared<FFmpegImageProxy>("test/data/flat_red.png");
- auto original = proxy->image().image;
+ auto original = proxy->image(false).image;
list<AVPixelFormat> pix_fmts = {
AV_PIX_FMT_RGB24,
B->video->set_length (24);
B->set_position (film, dcpomatic::DCPTime::from_seconds(1));
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
auto pieces = player->_pieces;
BOOST_REQUIRE_EQUAL (pieces.size(), 2U);
BOOST_CHECK_EQUAL (pieces.front()->content, A);
f->height = 480;
f->format = static_cast<int> (i.format);
av_frame_get_buffer (f, true);
- Image t (f);
+ Image t (f, false);
BOOST_CHECK_EQUAL(t.planes(), i.planes);
BOOST_CHECK_EQUAL(t.sample_size(0).height, i.lines[0]);
BOOST_CHECK_EQUAL(t.sample_size(1).height, i.lines[1]);
accumulated = std::make_shared<AudioBuffers>(film->audio_channels(), 0);
- auto player = std::make_shared<Player>(film);
+ auto player = std::make_shared<Player>(film, false);
player->Audio.connect (bind (&accumulate, _1, _2));
while (!player->pass ()) {}
BOOST_REQUIRE (accumulated->frames() >= 48000);
/* Length should be rounded up from B's length to the next video frame */
BOOST_CHECK (film->length() == DCPTime::from_frames(3 * 24 + 1, 24));
- auto player = std::make_shared<Player>(film);
+ auto player = std::make_shared<Player>(film, false);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_black._periods.size(), 1U);
BOOST_CHECK (player->_black._periods.front() == DCPTimePeriod(DCPTime::from_frames(3 * 24, 24), DCPTime::from_frames(3 * 24 + 1, 24)));
film->examine_and_add_content (s);
BOOST_REQUIRE (!wait_for_jobs ());
- auto player = std::make_shared<Player>(film);
+ auto player = std::make_shared<Player>(film, false);
player->Video.connect (bind (&video, _1, _2));
player->Audio.connect (bind (&audio, _1, _2));
video_frames = audio_frames = 0;
BOOST_REQUIRE (!wait_for_jobs ());
dcp->only_text()->set_use (true);
- auto player = std::make_shared<Player>(film);
+ auto player = std::make_shared<Player>(film, false);
player->set_fast ();
player->set_always_burn_open_subtitles ();
player->set_play_referenced ();
BOOST_REQUIRE (!wait_for_jobs ());
dcp->only_text()->set_use (true);
- auto player = std::make_shared<Player>(film);
+ auto player = std::make_shared<Player>(film, false);
player->set_fast ();
player->set_always_burn_open_subtitles ();
player->set_play_referenced ();
text->only_text()->set_type (TextType::CLOSED_CAPTION);
text->only_text()->set_use (true);
- auto player = std::make_shared<Player>(film);
+ auto player = std::make_shared<Player>(film, false);
player->set_ignore_video ();
player->set_ignore_audio ();
film->examine_and_add_content (boon);
BOOST_REQUIRE (!wait_for_jobs());
- auto player = std::make_shared<Player>(film);
+ auto player = std::make_shared<Player>(film, false);
player->set_fast ();
auto butler = std::make_shared<Butler>(film, player, AudioMapping(), 6, bind(&PlayerVideo::force, _1, AV_PIX_FMT_RGB24), VideoRange::FULL, false, true, false);
rms_error (boost::filesystem::path ref, boost::filesystem::path check)
{
FFmpegImageProxy ref_proxy (ref);
- auto ref_image = ref_proxy.image().image;
+ auto ref_image = ref_proxy.image(false).image;
FFmpegImageProxy check_proxy (check);
- auto check_image = check_proxy.image().image;
+ auto check_image = check_proxy.image(false).image;
BOOST_REQUIRE_EQUAL (ref_image->pixel_format(), check_image->pixel_format());
AVPixelFormat const format = ref_image->pixel_format();
film->set_sequence (false);
film->add_content (content);
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
/* Position 0, no trim, content rate = DCP rate */
content->set_position (film, DCPTime());
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
- shared_ptr<Piece> piece = player->_pieces.front ();
+ auto piece = player->_pieces.front();
BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime ()), 0);
BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (0.5)), 12);
BOOST_CHECK_EQUAL (player->dcp_to_content_video (piece, DCPTime::from_seconds (3.0)), 72);
film->set_sequence (false);
film->add_content (content);
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
/* Position 0, no trim, content rate = DCP rate */
content->set_position (film, DCPTime());
film->set_video_frame_rate (24);
player->setup_pieces ();
BOOST_REQUIRE_EQUAL (player->_pieces.size(), 1U);
- shared_ptr<Piece> piece = player->_pieces.front ();
+ auto piece = player->_pieces.front ();
BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 0).get(), 0);
BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 12).get(), DCPTime::from_seconds(0.5).get());
BOOST_CHECK_EQUAL (player->content_video_to_dcp (piece, 72).get(), DCPTime::from_seconds(3.0).get());
film->set_sequence (false);
film->add_content (content);
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
/* Position 0, no trim, video/audio content rate = video/audio DCP rate */
content->set_position (film, DCPTime());
Ls = sf_open ("build/test/upmixer_a_test/Ls.wav", SFM_WRITE, &info);
Rs = sf_open ("build/test/upmixer_a_test/Rs.wav", SFM_WRITE, &info);
- auto player = make_shared<Player>(film);
+ auto player = make_shared<Player>(film, false);
player->Audio.connect (bind (&write, _1, _2));
while (!player->pass()) {}
make_and_verify_dcp (vf, {dcp::VerificationNote::Code::EXTERNAL_ASSET});
/* Check that the selected reel assets are right */
- auto player = make_shared<Player>(vf);
+ auto player = make_shared<Player>(vf, false);
auto a = player->get_reel_assets();
BOOST_REQUIRE_EQUAL (a.size(), 4U);
auto i = a.begin();
write_image (grey_image(size, grey_pixel), file);
FFmpegImageProxy proxy (file);
- ImageProxy::Result result = proxy.image ();
+ ImageProxy::Result result = proxy.image (false);
BOOST_REQUIRE (!result.error);
for (int y = 0; y < size.height; ++y) {
BOOST_REQUIRE (!decoder->pass());
}
- return pixel_range (content_video->image->image().image);
+ return pixel_range (content_video->image->image(false).image);
}