diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-11-21 14:29:21 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-11-22 23:59:43 +0100 |
| commit | 33acff363c978914cdcbf21fb8fa3d1c4c6991b7 (patch) | |
| tree | 4bd8de953c0692d816e48e59d036a1625b9d3ff2 /src/lib/j2k_encoder_cpu_backend.cc | |
| parent | 0a49cc2ebbfc3809313f252208a0050a3fce1e97 (diff) | |
Allow J2K encode backends to accept more than one frame at once.
Diffstat (limited to 'src/lib/j2k_encoder_cpu_backend.cc')
| -rw-r--r-- | src/lib/j2k_encoder_cpu_backend.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/j2k_encoder_cpu_backend.cc b/src/lib/j2k_encoder_cpu_backend.cc index 99963c103..1474da1bc 100644 --- a/src/lib/j2k_encoder_cpu_backend.cc +++ b/src/lib/j2k_encoder_cpu_backend.cc @@ -32,15 +32,19 @@ using std::shared_ptr; +using std::vector; using boost::optional; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif -optional<dcp::ArrayData> -J2KEncoderCPUBackend::encode (DCPVideo video) +vector<dcp::ArrayData> +J2KEncoderCPUBackend::encode (vector<DCPVideo> const& all_video) { + DCPOMATIC_ASSERT (all_video.size() == 1); + auto video = all_video.front(); + try { auto const comment = Config::instance()->dcp_j2k_comment(); @@ -63,7 +67,7 @@ J2KEncoderCPUBackend::encode (DCPVideo video) if (enc.size() >= minimum_size) { LOG_GENERAL (N_("Frame %1 encoded size was OK (%2)"), video.index(), enc.size()); - return enc; + return { enc }; } LOG_GENERAL (N_("Frame %1 encoded size was small (%2); adding noise at level %3 with pixel skip %4"), video.index(), enc.size(), noise_amount, pixel_skip); |
