#include "util.h"
#include "cross.h"
#include "raw_convert.h"
+#include "jpeg2000_encoder.h"
#include <dcp/colour_matrix.h>
#include <dcp/certificate_chain.h>
#include <libcxml/cxml.h>
_win32_console = false;
#endif
_cinemas_file = path ("cinemas.xml");
+ _encoder = optional<string> ();
_allowed_dcp_frame_rates.clear ();
_allowed_dcp_frame_rates.push_back (24);
f.read_file (_cinemas_file);
read_cinemas (f);
}
+
+ _encoder = f.optional_string_child ("Encoder");
}
/** @return Filename to write configuration to */
}
decryption->add_child("PrivateKey")->add_child_text (_decryption_chain->key().get ());
+ if (_encoder) {
+ root->add_child("Encoder")->add_child_text (_encoder.get ());
+ }
+
for (vector<boost::filesystem::path>::const_iterator i = _history.begin(); i != _history.end(); ++i) {
root->add_child("History")->add_child_text (i->string ());
}
class DCPContentType;
class Ratio;
class Cinema;
+class JPEG2000Encoder;
/** @class Config
* @brief A singleton class holding configuration.
return _win32_console;
}
#endif
+ boost::optional<std::string> encoder () {
+ return _encoder;
+ }
std::vector<boost::filesystem::path> history () const {
return _history;
void set_cinemas_file (boost::filesystem::path file);
+ void set_encoder (std::string id) {
+ if (_encoder && _encoder.get() == id) {
+ return;
+ }
+
+ _encoder = id;
+ changed ();
+ }
+
void clear_history () {
_history.clear ();
changed ();
#ifdef DCPOMATIC_WINDOWS
bool _win32_console;
#endif
+ boost::optional<std::string> _encoder;
std::vector<boost::filesystem::path> _history;
std::vector<dcp::EncryptedKDM> _dkdms;
boost::filesystem::path _cinemas_file;
/*
Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
- Taken from code Copyright (C) 2010-2011 Terrence Meiczinger
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
#include "player_video.h"
#include "raw_convert.h"
#include "compose.hpp"
+#include "jpeg2000_encoder.h"
#include <libcxml/cxml.h>
#include <dcp/openjpeg_image.h>
#include <dcp/rgb_xyz.h>
Data
DCPVideo::encode_locally (dcp::NoteHandler note)
{
- Data enc = compress_j2k (
- convert_to_xyz (_frame, note),
- _j2k_bandwidth,
- _frames_per_second,
- _frame->eyes() == EYES_LEFT || _frame->eyes() == EYES_RIGHT,
- _resolution == RESOLUTION_4K
+ shared_ptr<JPEG2000Encoder> encoder;
+ if (Config::instance()->encoder ()) {
+ encoder = JPEG2000Encoder::from_id (Config::instance()->encoder().get ());
+ }
+
+ if (!encoder) {
+ encoder = JPEG2000Encoder::all().front ();
+ }
+
+ shared_ptr<EncodedData> enc = encoder->encode (
+ xyz, note, _j2k_bandwidth, _frames_per_second, _resolution, _frame->eyes() == EYES_LEFT || _frame->eyes() == EYES_RIGHT
);
switch (_frame->eyes()) {
{
}
+
+JPEG2000EncoderUnavailableException::JPEG2000EncoderUnavailableException (string encoder_name, string message)
+ : StringError (String::compose (_("Encoder %1 unavailable: %2"), encoder_name, message))
+{
+
+}
ProgrammingError (std::string file, int line);
};
+class JPEG2000EncoderUnavailableException : public std::runtime_error
+{
+public:
+ JPEG2000EncoderUnavailableException (std::string encoder_name, std::string message);
+
+ ~JPEG2000EncoderUnavailableException () throw () {}
+
+ std::string encoder_name () const {
+ return _encoder_name;
+ }
+
+ std::string message () const {
+ return _message;
+ }
+
+private:
+ std::string _encoder_name;
+ std::string _message;
+};
+
class TextEncodingError : public std::runtime_error
{
public:
--- /dev/null
+/*
+ Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "jpeg2000_encoder.h"
+#include "poznan_encoder.h"
+#include "openjpeg_encoder.h"
+#include "exceptions.h"
+#include <boost/shared_ptr.hpp>
+#include <boost/foreach.hpp>
+#include <vector>
+
+using std::vector;
+using std::string;
+using boost::shared_ptr;
+
+#define LOG_GENERAL(...) log()->log (String::compose (__VA_ARGS__), Log::TYPE_GENERAL);
+
+vector<boost::shared_ptr<JPEG2000Encoder> > JPEG2000Encoder::_encoders;
+
+void
+JPEG2000Encoder::setup_encoders ()
+{
+ try {
+ _encoders.push_back (shared_ptr<JPEG2000Encoder> (new OpenJPEGEncoder ()));
+ } catch (JPEG2000EncoderUnavailableException &) {
+
+ }
+
+ try {
+ _encoders.push_back (shared_ptr<JPEG2000Encoder> (new PoznanEncoder ()));
+ } catch (JPEG2000EncoderUnavailableException &) {
+
+ }
+}
+
+vector<shared_ptr<JPEG2000Encoder> >
+JPEG2000Encoder::all ()
+{
+ return _encoders;
+}
+
+shared_ptr<JPEG2000Encoder>
+JPEG2000Encoder::from_id (string id)
+{
+ BOOST_FOREACH (shared_ptr<JPEG2000Encoder> i, _encoders) {
+ if (i->id() == id) {
+ return i;
+ }
+ }
+
+ return shared_ptr<JPEG2000Encoder> ();
+}
+
+shared_ptr<EncodedData>
+JPEG2000Encoder::encode (shared_ptr<const dcp::XYZImage> input, dcp::NoteHandler note, int bandwidth, int frame_rate, Resolution resolution, bool threed)
+{
+ if (!_last_bandwidth || _last_bandwidth.get() != bandwidth) {
+ _last_bandwidth = bandwidth;
+ set_bandwidth (bandwidth);
+ }
+
+ if (!_last_frame_rate || _last_frame_rate.get() != frame_rate) {
+ _last_frame_rate = frame_rate;
+ set_frame_rate (frame_rate);
+ }
+
+ if (!_last_resolution || _last_resolution.get() != resolution) {
+ _last_resolution = resolution;
+ set_frame_rate (resolution);
+ }
+
+ if (!_last_threed || _last_threed.get() != threed) {
+ _last_threed = threed;
+ set_frame_rate (threed);
+ }
+
+ return do_encode (input, note);
+}
--- /dev/null
+/*
+ Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#ifndef DCPOMATIC_JPEG2000_ENCODER_H
+#define DCPOMATIC_JPEG2000_ENCODER_H
+
+#include "types.h"
+#include <dcp/types.h>
+#include <boost/shared_ptr.hpp>
+#include <boost/optional.hpp>
+#include <list>
+
+namespace dcp {
+ class XYZImage;
+}
+
+class EncodedData;
+
+class JPEG2000Encoder
+{
+public:
+ virtual ~JPEG2000Encoder () {}
+
+ /** @return Internationalised descriptive name for this encoder */
+ virtual std::string name () const = 0;
+ /** @return Non-internationalised ID for this encoder */
+ virtual std::string id () const = 0;
+
+ /** @param input XYZ input frame.
+ * @param note_handler Handler for notes about the encode.
+
+ * @return Encoded JPEG2000 data.
+ */
+ boost::shared_ptr<EncodedData> encode (
+ boost::shared_ptr<const dcp::XYZImage> input,
+ dcp::NoteHandler note_handler,
+ int bandwidth,
+ int frame_rate,
+ Resolution resolution,
+ bool threed
+ );
+
+ static void setup_encoders ();
+ /** @return Return all available JPEG2000 encoders in order of preference (best first) */
+ static std::vector<boost::shared_ptr<JPEG2000Encoder> > all ();
+ static boost::shared_ptr<JPEG2000Encoder> from_id (std::string id);
+
+protected:
+
+ virtual boost::shared_ptr<EncodedData> do_encode (
+ boost::shared_ptr<const dcp::XYZImage> input,
+ dcp::NoteHandler note_handler
+ ) = 0;
+
+ virtual void set_bandwidth (int bandwidth) = 0;
+ virtual void set_frame_rate (int frame_rate) = 0;
+ virtual void set_resolution (Resolution resolution) = 0;
+ virtual void set_threed (bool threed) = 0;
+
+ boost::optional<int> _last_bandwidth;
+ boost::optional<int> _last_frame_rate;
+ boost::optional<Resolution> _last_resolution;
+ boost::optional<bool> _last_threed;
+
+ static std::vector<boost::shared_ptr<JPEG2000Encoder> > _encoders;
+};
+
+#endif
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+ Adapted from code Copyright (C) 2010-2011 Terrence Meiczinger
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "openjpeg_encoder.h"
+#include "encoded_data.h"
+#include "exceptions.h"
+#include <dcp/xyz_image.h>
+
+#include "i18n.h"
+
+using std::string;
+using boost::shared_ptr;
+
+string
+OpenJPEGEncoder::name () const
+{
+ return _("OpenJPEG library");
+}
+
+shared_ptr<EncodedData>
+OpenJPEGEncoder::do_encode (shared_ptr<const dcp::XYZImage> input, dcp::NoteHandler note)
+{
+ /* Set the max image and component sizes based on frame_rate */
+ int max_cs_len = ((float) _bandwidth) / 8 / _frame_rate;
+ if (_threed) {
+ /* In 3D we have only half the normal bandwidth per eye */
+ max_cs_len /= 2;
+ }
+ int const max_comp_size = max_cs_len / 1.25;
+
+ /* get a J2K compressor handle */
+ opj_cinfo_t* cinfo = opj_create_compress (CODEC_J2K);
+ if (cinfo == 0) {
+ throw EncodeError (N_("could not create JPEG2000 encoder"));
+ }
+
+ /* Set encoding parameters to default values */
+ opj_cparameters_t parameters;
+ opj_set_default_encoder_parameters (¶meters);
+
+ /* Set default cinema parameters */
+ parameters.tile_size_on = false;
+ parameters.cp_tdx = 1;
+ parameters.cp_tdy = 1;
+
+ /* Tile part */
+ parameters.tp_flag = 'C';
+ parameters.tp_on = 1;
+
+ /* Tile and Image shall be at (0,0) */
+ parameters.cp_tx0 = 0;
+ parameters.cp_ty0 = 0;
+ parameters.image_offset_x0 = 0;
+ parameters.image_offset_y0 = 0;
+
+ /* Codeblock size = 32x32 */
+ parameters.cblockw_init = 32;
+ parameters.cblockh_init = 32;
+ parameters.csty |= 0x01;
+
+ /* The progression order shall be CPRL */
+ parameters.prog_order = CPRL;
+
+ /* No ROI */
+ parameters.roi_compno = -1;
+
+ parameters.subsampling_dx = 1;
+ parameters.subsampling_dy = 1;
+
+ /* 9-7 transform */
+ parameters.irreversible = 1;
+
+ parameters.tcp_rates[0] = 0;
+ parameters.tcp_numlayers++;
+ parameters.cp_disto_alloc = 1;
+ parameters.cp_rsiz = _resolution == RESOLUTION_2K ? CINEMA2K : CINEMA4K;
+ if (_resolution == RESOLUTION_4K) {
+ parameters.numpocs = 2;
+ parameters.POC[0].tile = 1;
+ parameters.POC[0].resno0 = 0;
+ parameters.POC[0].compno0 = 0;
+ parameters.POC[0].layno1 = 1;
+ parameters.POC[0].resno1 = parameters.numresolution - 1;
+ parameters.POC[0].compno1 = 3;
+ parameters.POC[0].prg1 = CPRL;
+ parameters.POC[1].tile = 1;
+ parameters.POC[1].resno0 = parameters.numresolution - 1;
+ parameters.POC[1].compno0 = 0;
+ parameters.POC[1].layno1 = 1;
+ parameters.POC[1].resno1 = parameters.numresolution;
+ parameters.POC[1].compno1 = 3;
+ parameters.POC[1].prg1 = CPRL;
+ }
+
+ parameters.cp_comment = strdup (N_("DCP-o-matic"));
+ parameters.cp_cinema = _resolution == RESOLUTION_2K ? CINEMA2K_24 : CINEMA4K_24;
+
+ /* 3 components, so use MCT */
+ parameters.tcp_mct = 1;
+
+ /* set max image */
+ parameters.max_comp_size = max_comp_size;
+ parameters.tcp_rates[0] = ((float) (3 * input->size().width * input->size().height * 12)) / (max_cs_len * 8);
+
+ /* Set event manager to null (openjpeg 1.3 bug) */
+ cinfo->event_mgr = 0;
+
+ /* Setup the encoder parameters using the current image and user parameters */
+ opj_setup_encoder (cinfo, ¶meters, input->opj_image ());
+
+ opj_cio_t* cio = opj_cio_open ((opj_common_ptr) cinfo, 0, 0);
+ if (cio == 0) {
+ opj_destroy_compress (cinfo);
+ throw EncodeError (N_("could not open JPEG2000 stream"));
+ }
+
+ int const r = opj_encode (cinfo, cio, input->opj_image(), 0);
+ if (r == 0) {
+ opj_cio_close (cio);
+ opj_destroy_compress (cinfo);
+ throw EncodeError (N_("JPEG2000 encoding failed"));
+ }
+
+ shared_ptr<EncodedData> enc (new LocallyEncodedData (cio->buffer, cio_tell (cio)));
+
+ opj_cio_close (cio);
+ free (parameters.cp_comment);
+ opj_destroy_compress (cinfo);
+
+ return enc;
+}
+
+
+void
+OpenJPEGEncoder::set_bandwidth (int bandwidth)
+{
+ _bandwidth = bandwidth;
+}
+
+void
+OpenJPEGEncoder::set_frame_rate (int frame_rate)
+{
+ _frame_rate = frame_rate;
+}
+
+void
+OpenJPEGEncoder::set_resolution (Resolution resolution)
+{
+ _resolution = resolution;
+}
+
+void
+OpenJPEGEncoder::set_threed (bool threed)
+{
+ _threed = threed;
+}
--- /dev/null
+/*
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "jpeg2000_encoder.h"
+#include "types.h"
+
+class OpenJPEGEncoder : public JPEG2000Encoder
+{
+public:
+ std::string name () const;
+
+ std::string id () const {
+ return "openjpeg";
+ }
+
+protected:
+ boost::shared_ptr<EncodedData> do_encode (boost::shared_ptr<const dcp::XYZImage> input, dcp::NoteHandler note_handler);
+
+private:
+ void set_bandwidth (int bandwidth);
+ void set_threed (bool threed);
+ void set_resolution (Resolution resolution);
+ void set_frame_rate (int frame_rate);
+
+ int _bandwidth;
+ bool _threed;
+ Resolution _resolution;
+ int _frame_rate;
+};
--- /dev/null
+/*
+ Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "poznan_encoder.h"
+#include "exceptions.h"
+#include "poznan/config/parameters.h"
+#include <dlfcn.h>
+
+#include "i18n.h"
+
+using std::string;
+using boost::shared_ptr;
+
+PoznanEncoder::PoznanEncoder ()
+{
+ /* XXX: need cross-platform implementation of dlopen etc. */
+
+ void* config = dlopen ("libdcpomatic-config.so", RTLD_LAZY | RTLD_GLOBAL);
+ if (!config) {
+ throw JPEG2000EncoderUnavailableException (name(), "could not find libdcpomatic-config.so");
+ }
+
+ void* misc = dlopen ("libdcpomatic-misc.so", RTLD_LAZY | RTLD_GLOBAL);
+ if (!misc) {
+ throw JPEG2000EncoderUnavailableException (name(), "could not find libdcpomatic-misc.so");
+ }
+
+ void (*init_device) (type_parameters *);
+ init_device = (void (*)(type_parameters *)) dlsym (config, "init_device");
+ if (!init_device) {
+ throw JPEG2000EncoderUnavailableException (name(), "missing symbol");
+ }
+
+ type_parameters param;
+
+ /* One tile which covers entire image */
+ param.param_tile_w = -1;
+ param.param_tile_h = -1;
+
+ /* XXX */
+ /*
+ uint8_t param_tile_comp_dlvls;
+ uint8_t param_cblk_exp_w; ///Maximum codeblock size is 2^6 x 2^6 ( 64 x 64 ).
+ uint8_t param_cblk_exp_h; ///Maximum codeblock size is 2^6 x 2^6 ( 64 x 64 ).
+ uint8_t param_wavelet_type; ///Lossy encoding
+ uint8_t param_use_mct;//Multi-component transform
+ */
+ param.param_device = 0;
+ /*
+ uint32_t param_target_size;//Target size of output file
+ float param_bp;//Bits per pixel per component
+ uint8_t param_use_part2_mct; // Multiple component transform as in 15444-2
+ uint8_t param_mct_compression_method; // 0 klt 2 wavelet
+ uint32_t param_mct_klt_iterations; // max number of iterations of Gram-Schmidt algorithm
+ float param_mct_klt_border_eigenvalue; // cut-off for dumping components
+ float param_mct_klt_err; // error sufficient for Gram-Schmit algorithm to end iteration
+ */
+
+ init_device (¶m);
+}
+
+string
+PoznanEncoder::name () const
+{
+ return _("CUDA (GPU) encoder (Poznan Supercomputing and Networking Center)");
+}
+
+void
+PoznanEncoder::set_bandwidth (int bandwidth)
+{
+ /* XXX */
+}
+
+void
+PoznanEncoder::set_frame_rate (int frame_rate)
+{
+ /* XXX */
+}
+
+void
+PoznanEncoder::set_resolution (Resolution resolution)
+{
+ /* XXX */
+}
+
+void
+PoznanEncoder::set_threed (bool threed)
+{
+ /* XXX */
+}
+
+shared_ptr<EncodedData>
+PoznanEncoder::do_encode (shared_ptr<const dcp::XYZImage> input, dcp::NoteHandler note_handler)
+{
+ return shared_ptr<EncodedData> ();
+}
--- /dev/null
+/*
+ Copyright (C) 2015 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "jpeg2000_encoder.h"
+#include <string>
+
+class PoznanEncoder : public JPEG2000Encoder
+{
+public:
+ PoznanEncoder ();
+
+ std::string name () const;
+
+ std::string id () const {
+ return "poznan";
+ }
+
+protected:
+
+ boost::shared_ptr<EncodedData> do_encode (
+ boost::shared_ptr<const dcp::XYZImage> input,
+ dcp::NoteHandler note_handler
+ );
+
+ void set_bandwidth (int bandwidth);
+ void set_frame_rate (int frame_rate);
+ void set_resolution (Resolution resolution);
+ void set_threed (bool threed);
+};
#include "audio_processor.h"
#include "safe_stringstream.h"
#include "compose.hpp"
+#include "jpeg2000_encoder.h"
#include <dcp/util.h>
#include <dcp/picture_asset.h>
#include <dcp/sound_asset.h>
Pango::init ();
dcp::init ();
+ JPEG2000Encoder::setup_encoders ();
Ratio::setup_ratios ();
PresetColourConversion::setup_colour_conversion_presets ();
VideoContentScale::setup_scales ();
j2k_image_proxy.cc
job.cc
job_manager.cc
+ jpeg2000_encoder.cc
json_server.cc
log.cc
log_entry.cc
magick_image_proxy.cc
md5_digester.cc
mid_side_decoder.cc
+ openjpeg_encoder.cc
player.cc
player_subtitles.cc
player_video.cc
playlist.cc
+ poznan_encoder.cc
position_image.cc
ratio.cc
raw_image_proxy.cc
table->Add (bottom_table, wxGBPosition (r, 0), wxGBSpan (2, 2), wxEXPAND);
++r;
- _set_language->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::set_language_changed, this));
- _language->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&GeneralPage::language_changed, this));
+ add_label_to_sizer (table, _panel, _("JPEG2000 encoder"), true);
+ _encoder = new wxChoice (_panel, wxID_ANY);
+ BOOST_FOREACH (shared_ptr<JPEG2000Encoder> i, JPEG2000Encoder::all()) {
+ _encoder->Append (std_to_wx (i->name ()));
+ }
+ table->Add (_encoder, 1);
+
+ _set_language->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&GeneralPage::set_language_changed, this));
+ _language->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&GeneralPage::language_changed, this));
_cinemas_file->Bind (wxEVT_COMMAND_FILEPICKER_CHANGED, boost::bind (&GeneralPage::cinemas_file_changed, this));
_num_local_encoding_threads->SetRange (1, 128);
checked_set (_check_for_test_updates, config->check_for_test_updates ());
checked_set (_issuer, config->dcp_issuer ());
checked_set (_creator, config->dcp_creator ());
+<<<<<<< 0f3c2864599f9e5a5ec001266b4aefb0205d1e1f
checked_set (_cinemas_file, config->cinemas_file());
setup_sensitivity ();
+=======
+
+ if (!config->encoder ()) {
+ checked_set (_encoder, 0);
+ } else {
+ vector<shared_ptr<JPEG2000Encoder> > encoders = JPEG2000Encoder::all ();
+ for (size_t i = 0; i < encoders.size(); ++i) {
+ if (encoders[i]->id() == config->encoder().get ()) {
+ checked_set (_encoder, i);
+ }
+ }
+ }
+>>>>>>> Basic classes for different JPEG2000 encoders; config to choose one.
}
void setup_sensitivity ()
wxCheckBox* _check_for_test_updates;
wxTextCtrl* _issuer;
wxTextCtrl* _creator;
+ wxChoice* _encoder;
};
class DefaultsPage : public StandardPage
conf.find_program('msgfmt', var='MSGFMT')
+ # Check for headers of poznan JPEG2000 encoding library
+ conf.check(header_name="poznan/config/parameters.h")
+
datadir = conf.env.DATADIR
if not datadir:
datadir = os.path.join(conf.env.PREFIX, 'share')