class GrokContext
{
public:
- explicit GrokContext(DcpomaticContext const& dcpomatic_context)
+ explicit GrokContext(DcpomaticContext* dcpomatic_context)
: _dcpomatic_context(dcpomatic_context)
, messenger_(nullptr)
, launched_(false)
{
if (Config::instance()->enable_gpu ()) {
- boost::filesystem::path folder(_dcpomatic_context._location);
+ boost::filesystem::path folder(_dcpomatic_context->_location);
boost::filesystem::path binaryPath = folder / "grk_compress";
if (!boost::filesystem::exists(binaryPath)) {
getMessengerLogger()->error(
- "Invalid binary location %s", _dcpomatic_context._location.c_str()
+ "Invalid binary location %s", _dcpomatic_context->_location.c_str()
);
return;
}
[this](FrameProxy srcFrame, uint8_t* compressed, uint32_t compressedFrameLength)
{
auto compressed_data = std::make_shared<dcp::ArrayData>(compressed, compressedFrameLength);
- _dcpomatic_context.writer_.write(compressed_data, srcFrame.index(), srcFrame.eyes());
+ _dcpomatic_context->writer_.write(compressed_data, srcFrame.index(), srcFrame.eyes());
frame_done ();
};
int const minimum_size = 16384;
}
auto encoded = std::make_shared<dcp::ArrayData>(fp->vf.encode_locally());
- _dcpomatic_context.writer_.write(encoded, fp->vf.index(), fp->vf.eyes());
+ _dcpomatic_context->writer_.write(encoded, fp->vf.index(), fp->vf.eyes());
frame_done ();
}
}
return true;
if (MessengerInit::firstLaunch(true)) {
auto s = dcpv.get_size();
- _dcpomatic_context.setDimensions(s.width, s.height);
+ _dcpomatic_context->setDimensions(s.width, s.height);
auto config = Config::instance();
messenger_->launchGrok(
- _dcpomatic_context._location,
- _dcpomatic_context.width_,_dcpomatic_context.width_,
- _dcpomatic_context.height_,
+ _dcpomatic_context->_location,
+ _dcpomatic_context->width_,_dcpomatic_context->width_,
+ _dcpomatic_context->height_,
3, 12, device,
- _dcpomatic_context.film_->resolution() == Resolution::FOUR_K,
- _dcpomatic_context.film_->video_frame_rate(),
- _dcpomatic_context.film_->j2k_bandwidth(),
+ _dcpomatic_context->film_->resolution() == Resolution::FOUR_K,
+ _dcpomatic_context->film_->video_frame_rate(),
+ _dcpomatic_context->film_->j2k_bandwidth(),
config->gpu_license_server(),
config->gpu_license_port(),
config->gpu_license()
messenger_ = nullptr;
}
void frame_done () {
- _dcpomatic_context.history_.event();
+ _dcpomatic_context->history_.event();
}
private:
- DcpomaticContext _dcpomatic_context;
+ DcpomaticContext* _dcpomatic_context;
ScheduledMessenger<FrameProxy> *messenger_;
bool launched_;
};