summaryrefslogtreecommitdiff
path: root/test/gpu_test.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-02-27 00:54:30 +0000
committerCarl Hetherington <cth@carlh.net>2020-08-23 20:33:37 +0200
commit10a0c758dc59b1fb9e2f961485240e80f118eb9d (patch)
tree4d9b975c3882c9627a53d197e6d0413079023d7d /test/gpu_test.cc
parent1d0b111ac9692dedfd4a23c268f362e522105bcf (diff)
Basics of poznan library integration; colour manipulations are wrong.
Diffstat (limited to 'test/gpu_test.cc')
-rw-r--r--test/gpu_test.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/test/gpu_test.cc b/test/gpu_test.cc
new file mode 100644
index 000000000..26c5821e5
--- /dev/null
+++ b/test/gpu_test.cc
@@ -0,0 +1,47 @@
+/*
+ Copyright (C) 2019 Carl Hetherington <cth@carlh.net>
+
+ This file is part of DCP-o-matic.
+
+ DCP-o-matic 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.
+
+ DCP-o-matic 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 DCP-o-matic. If not, see <http://www.gnu.org/licenses/>.
+
+*/
+
+#include "lib/gpu_j2k_encode_worker.h"
+#include "lib/ffmpeg_image_proxy.h"
+#include "lib/player_video.h"
+#include "lib/dcp_video.h"
+#include "test.h"
+#include <boost/test/unit_test.hpp>
+
+using boost::shared_ptr;
+using boost::optional;
+using boost::weak_ptr;
+
+BOOST_AUTO_TEST_CASE (gpu_test)
+{
+ GPUJ2KEncodeWorker w;
+ shared_ptr<ImageProxy> ip (new FFmpegImageProxy(private_data / "card.png"));
+ shared_ptr<PlayerVideo> pv (
+ new PlayerVideo(
+ ip, Crop(), optional<double>(), dcp::Size(1998, 1080), dcp::Size(1998, 1080),
+ EYES_BOTH, PART_WHOLE, optional<ColourConversion>(), weak_ptr<Content>(), optional<Frame>()
+ )
+ );
+ shared_ptr<DCPVideo> vf (new DCPVideo(pv, 0, 24, 100000000, RESOLUTION_2K));
+ optional<dcp::Data> encoded = w.encode (vf);
+ FILE* f = fopen("titz.j2k", "wb");
+ fwrite(encoded->data().get(), encoded->size(), 1, f);
+ fclose(f);
+}