blob: bbee31989e312aafcb32db70198d2edaeeb9e620 [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <fuchsia/camera3/cpp/fidl.h>
#include <fuchsia/sysmem/cpp/fidl.h>
#include <lib/fpromise/result.h>
namespace camera {
// This class implements a fully configured software-based camera.
class VirtualCamera {
virtual ~VirtualCamera() = default;
// Create a virtual camera using the provided sysmem allocator service handle.
static fpromise::result<std::unique_ptr<VirtualCamera>, zx_status_t> Create(
fidl::InterfaceHandle<fuchsia::sysmem::Allocator> allocator);
// Returns a request handler for the Device interface.
virtual fidl::InterfaceRequestHandler<fuchsia::camera3::Device> GetHandler() = 0;
// Checks the provided buffer for consistency with the provided frame info, returning a
// descriptive error string on failure.
virtual fpromise::result<void, std::string> CheckFrame(
const void* data, size_t size, const fuchsia::camera3::FrameInfo& info) = 0;
} // namespace camera