if target.platform == 'osx' and target.arch == 'arm64':
opt += ' --target-macos-arm64 --wx-config=%s/wx-config' % target.bin
+ if target.platform == 'linux' and target.distro == 'ubuntu' and target.version in ['22.04']:
+ opt += ' --enable-grok'
+
return opt
def build(target, options, for_package):
#include "encode_server_finder.h"
#include "film.h"
#include "cpu_j2k_encoder_thread.h"
+#ifdef DCPOMATIC_GROK
#include "grok_j2k_encoder_thread.h"
+#endif
#include "remote_j2k_encoder_thread.h"
#include "j2k_encoder.h"
#include "log.h"
: _film (film)
, _history (200)
, _writer (writer)
+#ifdef DCPOMATIC_GROK
, _dcpomatic_context(film, writer, _history, Config::instance()->gpu_binary_location())
, _context(Config::instance()->enable_gpu() ? new grk_plugin::GrokContext(_dcpomatic_context) : nullptr)
+#endif
{
}
terminate_threads();
+#ifdef DCPOMATIC_GROK
delete _context;
+#endif
}
/* Something might have been thrown during terminate_threads */
rethrow ();
+#ifdef DCPOMATIC_GROK
delete _context;
_context = nullptr;
+#endif
}
return;
}
+#ifdef DCPOMATIC_GROK
_context = new grk_plugin::GrokContext(_dcpomatic_context);
+#endif
servers_list_changed();
}
So just mop up anything left in the queue here.
*/
for (auto & i: _queue) {
+#ifdef DCPOMATIC_GROK
if (Config::instance()->enable_gpu ()) {
if (!_context->scheduleCompress(i)){
LOG_GENERAL (N_("[%1] J2KEncoder thread pushes frame %2 back onto queue after failure"), thread_id(), i.index());
// handle error
}
- }
- else {
+ } else {
+#else
+ {
+#endif
LOG_GENERAL(N_("Encode left-over frame %1"), i.index());
try {
_writer.write(
}
}
+#ifdef DCPOMATIC_GROK
delete _context;
_context = nullptr;
+#endif
}
void
+#ifdef DCPOMATIC_GROK
J2KEncoder::remake_threads(int cpu, int gpu, list<EncodeServerDescription> servers)
+#else
+J2KEncoder::remake_threads(int cpu, int, list<EncodeServerDescription> servers)
+#endif
{
boost::mutex::scoped_lock lm (_threads_mutex);
if (_ending) {
remove_threads(cpu, current_cpu_threads, is_cpu_thread);
-
+#ifdef DCPOMATIC_GROK
/* GPU */
auto const is_grok_thread = [](shared_ptr<J2KEncoderThread> thread) {
}
remove_threads(gpu, current_gpu_threads, is_grok_thread);
-
+#endif
/* Remote */
*/
-#include "grok/context.h"
#include "cross.h"
#include "enum_indexed_vector.h"
#include "event_history.h"
#include "exception_store.h"
+#ifdef DCPOMATIC_GROK
+#include "grok/context.h"
+#endif
#include "j2k_encoder_thread.h"
#include "writer.h"
#include <boost/optional.hpp>
boost::signals2::scoped_connection _server_found_connection;
+#ifdef DCPOMATIC_GROK
grk_plugin::DcpomaticContext _dcpomatic_context;
grk_plugin::GrokContext *_context;
+#endif
bool _ending = false;
};
#include "exception_store.h"
#include "font_id_map.h"
#include "player_text.h"
+#include "text_type.h"
#include "weak_film.h"
#include <dcp/atmos_frame.h>
#include <boost/thread.hpp>
font_id_map.cc
frame_interval_checker.cc
frame_rate_change.cc
- grok_j2k_encoder_thread.cc
guess_crop.cc
hints.cc
internet.cc
if bld.env.TARGET_LINUX:
obj.uselib += ' POLKIT'
+ if bld.env.ENABLE_GROK:
+ obj.source += ' grok_j2k_encoder_thread.cc'
+
if bld.env.TARGET_WINDOWS_64 or bld.env.TARGET_WINDOWS_32:
obj.uselib += ' WINSOCK2 DBGHELP SHLWAPI MSWSOCK BOOST_LOCALE SETUPAPI OLE32 UUID'
obj.source += ' cross_windows.cc'
#include "lib/ffmpeg_encoder.h"
#include "lib/film.h"
#include "lib/font_config.h"
+#ifdef DCPOMATIC_GROK
#include "lib/grok/context.h"
+#endif
#include "lib/hints.h"
#include "lib/job_manager.h"
#include "lib/kdm_with_metadata.h"
notes.ShowModal();
}
+#ifdef DCPOMATIC_GROK
grk_plugin::setMessengerLogger(new grk_plugin::GrokLogger("[GROK] "));
+#endif
}
catch (exception& e)
{
#include "lib/config.h"
#include "lib/dcpomatic_socket.h"
#include "lib/film.h"
+#ifdef DCPOMATIC_GROK
#include "lib/grok/context.h"
+#endif
#include "lib/job.h"
#include "lib/job_manager.h"
#include "lib/make_dcp.h"
}
}
+#ifdef DCPOMATIC_GROK
grk_plugin::setMessengerLogger(new grk_plugin::GrokLogger("[GROK] "));
+#endif
return true;
}
#include "wx/wx_signal_manager.h"
#include "wx/wx_util.h"
#include "lib/config.h"
+#ifdef DCPOMATIC_GROK
#include "lib/grok/context.h"
+#endif
#include "lib/log.h"
#include "lib/signaller.h"
#include "lib/cross.h"
SetExitOnFrameDelete (false);
+#ifdef DCPOMATIC_GROK
grk_plugin::setMessengerLogger(new grk_plugin::GrokLogger("[GROK] "));
+#endif
return true;
}
#include "lib/config.h"
#include "lib/image.h"
#include "lib/file_log.h"
+#ifdef DCPOMATIC_GROK
#include "lib/grok/context.h"
+#endif
#include "lib/null_log.h"
#include "lib/version.h"
#include "lib/encode_server.h"
dcpomatic_log.reset (new FileLog("dcpomatic_server_cli.log"));
}
+#ifdef DCPOMATIC_GROK
setMessengerLogger(new grk_plugin::GrokLogger("[GROK] "));
+#endif
EncodeServer server (verbose, num_threads);
#include "send_test_email_dialog.h"
#include "server_dialog.h"
#include "static_text.h"
+#ifdef DCPOMATIC_GROK
#include "grok/gpu_config_panel.h"
+#endif
#include "wx_util.h"
#include "lib/config.h"
#include "lib/cross.h"
e->AddPage (new SoundPage (ps, border));
e->AddPage (new DefaultsPage (ps, border));
e->AddPage (new EncodingServersPage(ps, border));
+#ifdef DCPOMATIC_GROK
e->AddPage (new GPUPage (ps, border));
+#endif
e->AddPage (new KeysPage (ps, border));
e->AddPage (new TMSPage (ps, border));
e->AddPage (new EmailPage (ps, border));
opt.add_option('--workaround-gssapi', action='store_true', default=False, help='link to gssapi_krb5')
opt.add_option('--use-lld', action='store_true', default=False, help='use lld linker')
opt.add_option('--enable-disk', action='store_true', default=False, help='build dcpomatic2_disk tool; requires Boost process, lwext4 and nanomsg libraries')
+ opt.add_option('--enable-grok', action='store_true', default=False, help='build with support for grok J2K encoder')
opt.add_option('--warnings-are-errors', action='store_true', default=False, help='build with -Werror')
opt.add_option('--wx-config', help='path to wx-config')
conf.env.DEBUG = conf.options.enable_debug
conf.env.STATIC_DCPOMATIC = conf.options.static_dcpomatic
conf.env.ENABLE_DISK = conf.options.enable_disk
+ conf.env.ENABLE_GROK = conf.options.enable_grok
if conf.options.destdir == '':
conf.env.INSTALL_PREFIX = conf.options.prefix
else:
if conf.options.enable_disk:
conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_DISK')
+ if conf.options.enable_grok:
+ conf.env.append_value('CXXFLAGS', '-DDCPOMATIC_GROK')
+
if conf.options.use_lld:
try:
conf.find_program('ld.lld')