summaryrefslogtreecommitdiff
path: root/src/lib/grok/context.h
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-09-24 17:23:57 +0200
committerCarl Hetherington <cth@carlh.net>2024-01-28 02:01:57 +0100
commit9aca7d85aa86a9232a2cd83e867d679c30487059 (patch)
tree0161617f7c7a3b3b7164eb8e905d89f7d9bbb009 /src/lib/grok/context.h
parent3b1ee8690b21ddc5ff53ba3b2ba50270e3c9f9bf (diff)
Use boost::filesystem::path for gpu_binary_location().
Diffstat (limited to 'src/lib/grok/context.h')
-rw-r--r--src/lib/grok/context.h55
1 files changed, 34 insertions, 21 deletions
diff --git a/src/lib/grok/context.h b/src/lib/grok/context.h
index 72e62c4fa..3e4144d07 100644
--- a/src/lib/grok/context.h
+++ b/src/lib/grok/context.h
@@ -74,12 +74,22 @@ struct FrameProxy {
};
struct DcpomaticContext {
- DcpomaticContext(std::shared_ptr<const Film> film, Writer& writer,
- EventHistory &history, const std::string &location) :
- film_(film), writer_(writer),
- history_(history), location_(location),
- width_(0), height_(0)
- {}
+ DcpomaticContext(
+ std::shared_ptr<const Film> film,
+ Writer& writer,
+ EventHistory& history,
+ boost::filesystem::path const& location
+ )
+ : film_(film)
+ , writer_(writer)
+ , history_(history)
+ , _location(location)
+ , width_(0)
+ , height_(0)
+ {
+
+ }
+
void setDimensions(uint32_t w, uint32_t h) {
width_ = w;
height_ = h;
@@ -87,7 +97,7 @@ struct DcpomaticContext {
std::shared_ptr<const Film> film_;
Writer& writer_;
EventHistory &history_;
- std::string location_;
+ boost::filesystem::path _location;
uint32_t width_;
uint32_t height_;
};
@@ -100,12 +110,13 @@ public:
launched_(false)
{
if (Config::instance()->enable_gpu ()) {
- boost::filesystem::path folder(dcpomaticContext_.location_);
+ boost::filesystem::path folder(dcpomaticContext_._location);
boost::filesystem::path binaryPath = folder / "grk_compress";
if (!boost::filesystem::exists(binaryPath)) {
- getMessengerLogger()->error("Invalid binary location %s",
- dcpomaticContext_.location_.c_str());
- return;
+ getMessengerLogger()->error(
+ "Invalid binary location %s", dcpomaticContext_._location.c_str()
+ );
+ return;
}
auto proc = [this](const std::string& str) {
try {
@@ -166,16 +177,18 @@ public:
auto s = dcpv.get_size();
dcpomaticContext_.setDimensions(s.width, s.height);
auto config = Config::instance();
- messenger_->launchGrok(dcpomaticContext_.location_,
- dcpomaticContext_.width_,dcpomaticContext_.width_,
- dcpomaticContext_.height_,
- 3, 12, device,
- dcpomaticContext_.film_->resolution() == Resolution::FOUR_K,
- dcpomaticContext_.film_->video_frame_rate(),
- dcpomaticContext_.film_->j2k_bandwidth(),
- config->gpu_license_server(),
- config->gpu_license_port(),
- config->gpu_license());
+ messenger_->launchGrok(
+ dcpomaticContext_._location,
+ dcpomaticContext_.width_,dcpomaticContext_.width_,
+ dcpomaticContext_.height_,
+ 3, 12, device,
+ dcpomaticContext_.film_->resolution() == Resolution::FOUR_K,
+ dcpomaticContext_.film_->video_frame_rate(),
+ dcpomaticContext_.film_->j2k_bandwidth(),
+ config->gpu_license_server(),
+ config->gpu_license_port(),
+ config->gpu_license()
+ );
}
launched_ = messenger_->waitForClientInit();