summaryrefslogtreecommitdiff
path: root/test/libtest
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-06-10 15:59:10 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-06-18 13:26:59 +0300
commitee5dc92dc19965f12b950aa52ad231e192086711 (patch)
tree8526461ac4989129123e4bfe3fe9e37dd8cce62f /test/libtest
parent8b7e073e6eab6d62e6d8e8e0b4e120e2e016da3d (diff)
include: linux: Remove drm.h and drm_mode.h
The drm.h and drm_mode.h headers are not used anymore, as drm_fourcc.h isn't included but only parsed by gen-formats.py. Remove them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'test/libtest')
0 files changed, 0 insertions, 0 deletions
hl com"> */ #include "buffer_source.h" #include <iostream> #include <memory> #include "libcamera/internal/device_enumerator.h" #include "test.h" BufferSource::BufferSource() { } BufferSource::~BufferSource() { if (media_) media_->release(); } int BufferSource::allocate(const StreamConfiguration &config) { /* Locate and open the video device. */ std::string videoDeviceName = "vivid-000-vid-out"; std::unique_ptr<DeviceEnumerator> enumerator = DeviceEnumerator::create(); if (!enumerator) { std::cout << "Failed to create device enumerator" << std::endl; return TestFail; } if (enumerator->enumerate()) { std::cout << "Failed to enumerate media devices" << std::endl; return TestFail; } DeviceMatch dm("vivid"); dm.add(videoDeviceName); media_ = enumerator->search(dm); if (!media_) { std::cout << "No vivid output device available" << std::endl; return TestSkip; } std::unique_ptr<V4L2VideoDevice> video{ V4L2VideoDevice::fromEntityName(media_.get(), videoDeviceName) }; if (!video) { std::cout << "Failed to get video device from entity " << videoDeviceName << std::endl; return TestFail; } if (video->open()) { std::cout << "Unable to open " << videoDeviceName << std::endl; return TestFail; } /* Configure the format. */ V4L2DeviceFormat format; if (video->getFormat(&format)) { std::cout << "Failed to get format on output device" << std::endl; return TestFail; } format.size = config.size; format.fourcc = V4L2PixelFormat::fromPixelFormat(config.pixelFormat, false); if (video->setFormat(&format)) { std::cout << "Failed to set format on output device" << std::endl; return TestFail; } if (video->allocateBuffers(config.bufferCount, &buffers_) < 0) { std::cout << "Failed to allocate buffers" << std::endl; return TestFail; } video->close(); return TestPass; } const std::vector<std::unique_ptr<FrameBuffer>> &BufferSource::buffers() { return buffers_; }