blob: 03ac2d0bbdc9326f1ec8a02e8dd0d8cd98ac05d2 [file] [log] [blame]
// Copyright 2019 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.
library ddk.protocol.isp;
using zx;
using zircon.device.camera;
using zircon.device.sysmem;
using ddk.protocol.camerahwaccel;
enum StreamType : uint8 {
INVALID = 0;
FULL_RESOLUTION = 1;
DOWNSCALED = 2;
SCALAR = 3;
};
[Layout = "ddk-callback"]
protocol IspStreamShutdownCallback {
// This is called by the ISP after completing all cleanup of a stream.
ShutdownComplete(zx.status status);
};
[Layout = "ddk-protocol"]
protocol OutputStream {
// Starts the streaming of frames.
Start() -> (zx.status s);
// Stops the streaming of frames.
Stop() -> (zx.status s);
// Unlocks the specified frame, allowing the driver to reuse the memory.
ReleaseFrame(uint32 buffer_id) -> (zx.status s);
// Shutdown the stream and release all resources that are no longer needed.
// |shutdown_callback| : Informs the caller that all cleanup is complete.
Shutdown(IspStreamShutdownCallback shutdown_callback) -> (zx.status s);
};
[Layout = "ddk-protocol"]
protocol Isp {
// The driver returns the Stream protocol for this particular stream.
// |buffer_collection| : Hold the format and pool of VMOs that the ISP will
// produce
// |image_format| : The format of the image data in the output stream
// |rate| : The desired frame rate for the stream
// |type| : The type of stream to produce
// |frame_callback| : The protocol which calls a function when the ISP is done
// writing to a buffer.
// @Returns: |status| : indicates if the stream was created.
// @Returns: |st| : Protocol over which the flow of frames is controlled.
CreateOutputStream(zircon.device.sysmem.BufferCollectionInfo_2 buffer_collection,
zircon.device.sysmem.ImageFormat_2 image_format,
zircon.device.camera.FrameRate rate, StreamType type,
ddk.protocol.camerahwaccel.HwAccelFrameCallback frame_callback)
-> (zx.status s, OutputStream st);
};