diff options
| author | Carl Hetherington <cth@carlh.net> | 2020-08-23 22:50:28 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2020-08-23 22:50:34 +0200 |
| commit | 180b1d27d0186526b87852709d1f70c7d2c949f4 (patch) | |
| tree | 0694ec3cb2b29d78ca823714a66a5cd21ca5cb9d | |
| parent | ff5b37ec9f996ded3620c2896e3f19af0532ac0f (diff) | |
Fix up rebase and add timer.
| -rw-r--r-- | src/lib/gpu_j2k_encode_worker.cc | 3 | ||||
| -rw-r--r-- | src/lib/j2k_encoder.cc | 5 | ||||
| -rw-r--r-- | test/gpu_test.cc | 4 |
3 files changed, 7 insertions, 5 deletions
diff --git a/src/lib/gpu_j2k_encode_worker.cc b/src/lib/gpu_j2k_encode_worker.cc index a875c23d7..ba0b2036c 100644 --- a/src/lib/gpu_j2k_encode_worker.cc +++ b/src/lib/gpu_j2k_encode_worker.cc @@ -21,6 +21,7 @@ #include "gpu_j2k_encode_worker.h" #include "dcp_video.h" #include "cross.h" +#include "timer.h" #include "dcpomatic_log.h" #include <dcp/openjpeg_image.h> extern "C" { @@ -79,6 +80,8 @@ GPUJ2KEncodeWorker::encode (shared_ptr<DCPVideo> vf) init_tiles (&img, width, height, 5, 5); type_tile* tile = &(img.tile[0]); + PeriodTimer encode("poz-encode"); + // XXX: it's a big shame about this int -> float conversion for (int i = 0; i < 3; ++i) { type_tile_comp* c = &tile->tile_comp[i]; diff --git a/src/lib/j2k_encoder.cc b/src/lib/j2k_encoder.cc index ac6dd296c..1e5c206fc 100644 --- a/src/lib/j2k_encoder.cc +++ b/src/lib/j2k_encoder.cc @@ -382,13 +382,12 @@ J2KEncoder::servers_list_changed () shared_ptr<RemoteJ2KEncodeWorker> w (new RemoteJ2KEncodeWorker(i)); _workers.push_back (w); _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, w)); - _threads.push_back (new boost::thread(boost::bind(&J2KEncoder::encoder_thread, this, w))); } } shared_ptr<GPUJ2KEncodeWorker> w (new GPUJ2KEncodeWorker()); _workers.push_back (w); - _threads.push_back (new boost::thread(boost::bind(&J2KEncoder::encoder_thread, this, w))); + _threads->create_thread(boost::bind(&J2KEncoder::encoder_thread, this, w)); - _writer->set_encoder_threads (_threads.size()); + _writer->set_encoder_threads (_threads->size()); } diff --git a/test/gpu_test.cc b/test/gpu_test.cc index 26c5821e5..4fc8bc95e 100644 --- a/test/gpu_test.cc +++ b/test/gpu_test.cc @@ -32,11 +32,11 @@ using boost::weak_ptr; BOOST_AUTO_TEST_CASE (gpu_test) { GPUJ2KEncodeWorker w; - shared_ptr<ImageProxy> ip (new FFmpegImageProxy(private_data / "card.png")); + shared_ptr<ImageProxy> ip (new FFmpegImageProxy(TestPaths::private_data / "card.png")); shared_ptr<PlayerVideo> pv ( new PlayerVideo( ip, Crop(), optional<double>(), dcp::Size(1998, 1080), dcp::Size(1998, 1080), - EYES_BOTH, PART_WHOLE, optional<ColourConversion>(), weak_ptr<Content>(), optional<Frame>() + EYES_BOTH, PART_WHOLE, optional<ColourConversion>(), VIDEO_RANGE_FULL, weak_ptr<Content>(), optional<Frame>(), false ) ); shared_ptr<DCPVideo> vf (new DCPVideo(pv, 0, 24, 100000000, RESOLUTION_2K)); |
