summaryrefslogtreecommitdiff
path: root/src/qcam/assets/feathericons/folder-plus.svg
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2020-07-17 16:18:32 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2020-08-06 15:44:02 +0100
commit6bc652ee1c4a102f3fe3f321afd6dedf7c233e01 (patch)
tree2aedf18cf8dd9e0673c4ef975c5d5cda5f4c5d1c /src/qcam/assets/feathericons/folder-plus.svg
parentf4c65be7b3db0c70e5194614817e7e76b8901c88 (diff)
android: camera_device: Query plane length
Use lseek to query the length of planes where possible rather than leaving the plane.length as zero, which prevents mapping buffers for software processing. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/qcam/assets/feathericons/folder-plus.svg')
0 files changed, 0 insertions, 0 deletions
::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_; }