summaryrefslogtreecommitdiff
path: root/src/android/camera_ops.h
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-05-02 03:32:00 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-05-13 17:00:13 +0300
commit33c4221e8700e15db55994e510d86225d6cd9ece (patch)
tree19d611a79ec39e3075b15bf90037f73de6370afa /src/android/camera_ops.h
parent2b21c6ac861c5844f9e4535a43a514f979bfd133 (diff)
utils: raspberrypi: ctt: Fix pycodestyle E305
E305 expected 2 blank lines after class or function definition Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Diffstat (limited to 'src/android/camera_ops.h')
0 files changed, 0 insertions, 0 deletions
s. */ #include "buffer_source.h" #include <iostream> #include <memory> #include "libcamera/internal/device_enumerator.h" #include "test.h" using namespace libcamera; 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 = video->toV4L2PixelFormat(config.pixelFormat); 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_; }