summaryrefslogtreecommitdiff
path: root/include/meson.build
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund@ragnatech.se>2019-11-26 00:04:53 +0100
committerNiklas Söderlund <niklas.soderlund@ragnatech.se>2020-01-12 16:10:37 +0100
commitae9a05847cead7ddedba0ae150e538562afbb13f (patch)
tree0a73fab59990c825235e31075676717dfede16d5 /include/meson.build
parent007517618c8440d09cfd39db5dbf451e87ef703a (diff)
libcamera: buffer: Switch from Plane to FrameBuffer::Plane
It is not libcamera's responsibility to handle memory mappings. Switch from the soon to be removed Plane class which deals with memory mappings to FrameBuffer::Plane which just describes it. This makes the transition to the full FrameBuffer easier. As the full FrameBuffer interface has not yet spread to all parts of libcamera core it is hard to create efficient caching of memory mappings in the qcam application. This will be fixed in a later patch, for now the dmabuf is mapped and unmapped each time it is seen by the application. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'include/meson.build')
0 files changed, 0 insertions, 0 deletions
hl opt">; using namespace libcamera; LOG_DEFINE_CATEGORY(LogAPITest) class LogAPITest : public Test { protected: void doLogging() { logSetLevel("LogAPITest", "DEBUG"); LOG(LogAPITest, Info) << "good 1"; logSetLevel("LogAPITest", "WARN"); LOG(LogAPITest, Info) << "bad"; logSetLevel("LogAPITest", "ERROR"); LOG(LogAPITest, Error) << "good 3"; LOG(LogAPITest, Info) << "bad"; logSetLevel("LogAPITest", "WARN"); LOG(LogAPITest, Warning) << "good 5"; LOG(LogAPITest, Info) << "bad"; } int verifyOutput(istream &is) { list<int> goodList = { 1, 3, 5 }; string line; while (getline(is, line)) { if (goodList.empty()) { cout << "Too many log lines" << endl; return TestFail; } unsigned int digit = line.back() - '0'; unsigned int expect = goodList.front(); goodList.pop_front(); if (digit != expect) { cout << "Incorrect log line" << endl; return TestFail; } } if (!goodList.empty()) { cout << "Too few log lines" << endl; return TestFail; } return TestPass; } int testFile() { int fd = open("/tmp", O_TMPFILE | O_RDWR, S_IRUSR | S_IWUSR); if (fd < 0) { cerr << "Failed to open tmp log file" << endl; return TestFail; } char path[32]; snprintf(path, sizeof(path), "/proc/self/fd/%u", fd); if (logSetFile(path) < 0) { cerr << "Failed to set log file" << endl; close(fd); return TestFail; } doLogging(); char buf[1000]; memset(buf, 0, sizeof(buf)); lseek(fd, 0, SEEK_SET); if (read(fd, buf, sizeof(buf)) < 0) { cerr << "Failed to read tmp log file" << endl; close(fd); return TestFail; } close(fd); istringstream iss(buf); return verifyOutput(iss); } int testStream() { stringstream log; /* Never fails, so no need to check return value */ logSetStream(&log); doLogging(); return verifyOutput(log); } int testTarget() { logSetTarget(LoggingTargetNone); logSetLevel("LogAPITest", "DEBUG"); LOG(LogAPITest, Info) << "don't crash please"; if (!logSetTarget(LoggingTargetFile)) return TestFail; if (!logSetTarget(LoggingTargetStream)) return TestFail; return TestPass; } int run() override { int ret = testFile(); if (ret != TestPass) return TestFail; ret = testStream(); if (ret != TestPass) return TestFail; ret = testTarget(); if (ret != TestPass) return TestFail; return TestPass; } }; TEST_REGISTER(LogAPITest)