class ProcessNode
Defined at line 31 of file ../../src/camera/drivers/controller/processing_node.h
A ProcessNode is an abstract base class that represents a logical or physical functional unit
within the camera hardware pipeline. A node owns its output collection but not its input
collection. Derived classes override the various methods based on their need.
Public Methods
void ProcessNode (async_dispatcher_t * dispatcher, NodeType type, BufferAttachments attachments, FrameCallback frame_callback)
Defined at line 23 of file ../../src/camera/drivers/controller/processing_node.cc
void ~ProcessNode ()
Destroys the node instance. The caller must call Shutdown before destroying the instance or
the process will terminate. If the node implementation relies on singleton hardware resources
that cannot be safely accessed concurrently by multiple instances of the class, then the node
must ensure that all such resources are released prior returning from this destructor.
Defined at line 35 of file ../../src/camera/drivers/controller/processing_node.cc
NodeType Type ()
Returns the NodeType specified on creation of the object.
Defined at line 42 of file ../../src/camera/drivers/controller/processing_node.cc
void ProcessFrame (FrameToken token, frame_metadata_t metadata)
Informs the node that it should begin processing the frame specified by the given token and
associated with the given metadata. The node must maintain the token until it is no longer
needed, after which point it can safely be destroyed.
void SetOutputFormat (uint32_t output_format_index, fit::closure callback)
Requests that the node node begin producing frames using the specified format index. As the
node may pipeline frames, it is acceptable to continue producing frames at the previous
format. But the node must invoke the provided callback after the last frame at the previous
format was sent and before the first frame of the new format is sent.
The caller may request multiple format changes without receiving frames. In these cases,
the node must invoke all callbacks in the order received, but it does not need to produce a
frame with each format requested. For example, if the caller requests a change from A to B to
C, it is okay to produce a frame with format A, then invoke callback B followed by C, and then
produce a frame with format C.
void Shutdown (fit::closure callback)
Requests that the node cease processing frames and begin shutting itself down. The node must
perform any flushing required in order to safely return frames that it received via
ProcessFrame calls. The node must ensure all pending ProcessFrame callbacks are appropriately
invoked, and then invoke the callback specified in this method, after which the node must make
no further calls to the frame_callback provided during creation. After requesting shutdown, the
caller will ensure that no further calls are made to the node.
Defined at line 44 of file ../../src/camera/drivers/controller/processing_node.cc
void SetLabel (std::string label)
Assigns a label to the node for logging purposes.
Defined at line 62 of file ../../src/camera/drivers/controller/processing_node.cc
Protected Methods
void SendFrame (uint32_t index, frame_metadata_t metadata, fit::closure release_callback)
Nodes should use this method to invoke the top-level FrameCallback this node was created with.
Defined at line 67 of file ../../src/camera/drivers/controller/processing_node.cc
const fuchsia::sysmem2::BufferCollectionInfo & InputBuffers ()
Provides the node access to the input buffer collection it was created with.
Defined at line 88 of file ../../src/camera/drivers/controller/processing_node.cc
const std::vector<fuchsia::images2::ImageFormat> & InputFormats ()
Provides the node access to the image formats associated with its inputs.
Defined at line 93 of file ../../src/camera/drivers/controller/processing_node.cc
const fuchsia::sysmem2::BufferCollectionInfo & OutputBuffers ()
Provides the node access to the output buffer collection it was created with.
Defined at line 98 of file ../../src/camera/drivers/controller/processing_node.cc
const std::vector<fuchsia::images2::ImageFormat> & OutputFormats ()
Provides the node access to the image formats associated with its outputs.
Defined at line 103 of file ../../src/camera/drivers/controller/processing_node.cc
void HwFrameReady (frame_available_info_t info)
fuchsia.hardware.camerahwaccel.*Callback implementations. The node receives these callbacks
serially on the dispatcher it was created with.
void HwFrameResolutionChanged (frame_available_info_t info)
void HwTaskRemoved (task_remove_status_t status)
void ShutdownImpl (fit::closure callback)
Nodes must implement this method. It is distinct from the non-virtual Shutdown method in order
to allow the base class visibility into the state of the node's shutdown. Refer to the
description of that method for details.
const hw_accel_frame_callback * GetHwFrameReadyCallback (cpp20::source_location location)
Returns c-style callback pointers. When invoked by a consumer, the corresponding Hw* callback
is invoked via the node's dispatcher. The callsite location is used to annotate the callback
logs and trace events.
Defined at line 108 of file ../../src/camera/drivers/controller/processing_node.cc
const hw_accel_res_change_callback * GetHwFrameResolutionChangeCallback (cpp20::source_location location)
Defined at line 114 of file ../../src/camera/drivers/controller/processing_node.cc
const hw_accel_remove_task_callback * GetHwTaskRemovedCallback (cpp20::source_location location)
Defined at line 120 of file ../../src/camera/drivers/controller/processing_node.cc
void PostTask (fit::closure task, cpp20::source_location location)
Convenience method that wraps a call to async::PostTask with trace markers. These produce flow
graph indicators which allow tracing the origin of a callback. By default, the trace events are
annotated with the callsite of this method.
Defined at line 126 of file ../../src/camera/drivers/controller/processing_node.cc
std::string GetLabel ()
Provide subclasses with the ability to use label_ in log messages.
Defined at line 132 of file ../../src/camera/drivers/controller/processing_node.h