summaryrefslogtreecommitdiff
path: root/test/camera/buffer_import.cpp
AgeCommit message (Expand)Author
2020-09-21test: Include specific headers instead of libcamera.hLaurent Pinchart
2020-08-25meson: Remove -Wno-unused-parameterLaurent Pinchart
2020-08-14libcamera: request: Make Stream pointer constNiklas Söderlund
2020-08-14libcamera: request: Declare a using directive for map of buffersNiklas Söderlund
2020-08-05libcamera: pipelines: Use sensor ID as camera nameNiklas Söderlund
2020-05-16libcamera: Move internal headers to include/libcamera/internal/Laurent Pinchart
2020-03-06test: Extract BufferSource class out of camera tests to libtestNiklas Söderlund
2020-03-06test: camera: buffer_import: Fix error messagesNiklas Söderlund
2020-02-18test: camera: buffer_import: Don't include <random>Laurent Pinchart
2020-01-20test: buffer_import: Propagate status code from buffer allocationLaurent Pinchart
2020-01-12libcamera: camera: Remove the prepared stateNiklas Söderlund
2020-01-12libcamera: Switch to FrameBuffer interfaceNiklas Söderlund
2020-01-12test: camera: buffer_import: Update to FrameBuffer restrictionsNiklas Söderlund
2020-01-12libcamera: buffer: Move captured metadata to FrameMetadataNiklas Söderlund
2020-01-12libcamera: request: In addBuffer() do not fetch stream from BufferNiklas Söderlund
2020-01-12libcamera: buffer: Switch from Plane to FrameBuffer::PlaneNiklas Söderlund
2019-11-20test: Extract CameraTest class out of camera tests to libtestLaurent Pinchart
2019-10-28libcamera: Switch PixelFormat to DRM FourCC valuesJacopo Mondi
2019-09-16test: buffer_import: Initialize video_ to nullptrJacopo Mondi
2019-08-19test: camera: Use the CameraManager from the CameraTest base classLaurent Pinchart
2019-08-11libcamera: pipeline: vimc: Switch to using the RGB/YUV Capture video nodeNiklas Söderlund
2019-08-01test: camera: buffer_import: clear video pointerKieran Bingham
2019-07-14test: camera: Add buffer import and mapping testJacopo Mondi
pan>(camera_); StreamConfiguration &cfg = config_->at(0); if (camera_->acquire()) { cout << "Failed to acquire the camera" << endl; return TestFail; } if (camera_->configure(config_.get())) { cout << "Failed to set default configuration" << endl; return TestFail; } stream_ = cfg.stream(); int ret = allocator_->allocate(stream_); if (ret < 0) return TestFail; return TestPass; } void cleanup() override { delete allocator_; } int run() override { const std::unique_ptr<FrameBuffer> &buffer = allocator_->buffers(stream_).front(); std::vector<MappedBuffer> maps; MappedFrameBuffer map(buffer.get(), MappedFrameBuffer::MapFlag::Read); if (!map.isValid()) { cout << "Failed to successfully map buffer" << endl; return TestFail; } /* Make sure we can move it. */ maps.emplace_back(std::move(map)); /* But copying is prevented, it would cause double-unmap. */ // MappedFrameBuffer map_copy = map; /* Local map should be invalid (after move). */ if (map.isValid()) { cout << "Post-move map should not be valid" << endl; return TestFail; } /* Test for multiple successful maps on the same buffer. */ MappedFrameBuffer write_map(buffer.get(), MappedFrameBuffer::MapFlag::Write); if (!write_map.isValid()) { cout << "Failed to map write buffer" << endl; return TestFail; } MappedFrameBuffer rw_map(buffer.get(), MappedFrameBuffer::MapFlag::ReadWrite); if (!rw_map.isValid()) { cout << "Failed to map RW buffer" << endl; return TestFail; } return TestPass; } private: std::unique_ptr<CameraConfiguration> config_; FrameBufferAllocator *allocator_; Stream *stream_; }; } /* namespace */ TEST_REGISTER(MappedBufferTest)