anbox-platform-sdk  1.22.0
Anbox Platform SDK API documentation
anbox::CameraProcessor Class Reference

CameraProcessor allows a plugin to respond to the camera actions triggered from Anobx and post video frames to Android container after a camera is open up and display in camera preview for the picture taken ad video recording. More...

#include <camera_processor.h>

+ Collaboration diagram for anbox::CameraProcessor:

Public Member Functions

 CameraProcessor ()=default
 
virtual ~CameraProcessor ()=default
 
 CameraProcessor (const CameraProcessor &)=delete
 
CameraProcessoroperator= (const CameraProcessor &)=delete
 
virtual int get_device_specs (AnboxCameraSpec **specs, size_t *specs_len)
 Get camera device specifications of the platform. More...
 
virtual int open_device (AnboxCameraSpec spec, AnboxCameraOrientation orientation)
 Open the camera device and being ready for posting video frames to Android container. More...
 
virtual int close_device ()
 Close the camera device for not receiving video frames from the platform further. More...
 
virtual int read_frame (AnboxVideoFrame *frame, int timeout)
 Read next available video frame. More...
 
virtual int inject_frame (AnboxVideoFrame frame)
 Inject a video frame into AnboxPlatform. More...
 

Detailed Description

CameraProcessor allows a plugin to respond to the camera actions triggered from Anobx and post video frames to Android container after a camera is open up and display in camera preview for the picture taken ad video recording.

Definition at line 34 of file camera_processor.h.

Constructor & Destructor Documentation

◆ CameraProcessor() [1/2]

anbox::CameraProcessor::CameraProcessor ( )
default

◆ ~CameraProcessor()

virtual anbox::CameraProcessor::~CameraProcessor ( )
virtualdefault

◆ CameraProcessor() [2/2]

anbox::CameraProcessor::CameraProcessor ( const CameraProcessor )
delete

Member Function Documentation

◆ close_device()

virtual int anbox::CameraProcessor::close_device ( )
inlinevirtual

Close the camera device for not receiving video frames from the platform further.

Returns
0 on success, otherwise returns EINVAL on error occurs.

Definition at line 71 of file camera_processor.h.

◆ get_device_specs()

virtual int anbox::CameraProcessor::get_device_specs ( AnboxCameraSpec **  specs,
size_t *  specs_len 
)
inlinevirtual

Get camera device specifications of the platform.

Parameters
specspointer to the list of camera specifications
specs_lenthe length of camera specifications
Returns
0 on success, otherwise returns EINVAL on error occurs.

Definition at line 48 of file camera_processor.h.

◆ inject_frame()

virtual int anbox::CameraProcessor::inject_frame ( AnboxVideoFrame  frame)
inlinevirtual

Inject a video frame into AnboxPlatform.

This function allows injecting a video frame into the platform and letting the CameraProcessor handle the video frame.

Parameters
framea video frame to be pushed into the internal queue.
Returns
0 on success, otherwise returns EINVAL on error occurs.
Note
This function is only used in our test suite to facilitate our automation tests and it is subject to change at any time.

Definition at line 109 of file camera_processor.h.

◆ open_device()

virtual int anbox::CameraProcessor::open_device ( AnboxCameraSpec  spec,
AnboxCameraOrientation  orientation 
)
inlinevirtual

Open the camera device and being ready for posting video frames to Android container.

Parameters
video_resolutionthe resolution of camera video frame
orientationthe currrent camera orientation in Android container
Returns
0 on success, otherwise returns EINVAL on error occurs.

Definition at line 61 of file camera_processor.h.

◆ operator=()

CameraProcessor& anbox::CameraProcessor::operator= ( const CameraProcessor )
delete

◆ read_frame()

virtual int anbox::CameraProcessor::read_frame ( AnboxVideoFrame frame,
int  timeout 
)
inlinevirtual

Read next available video frame.

Anbox will call read_frame() to query the plugin for the next available video frame which is then forwarded to the Android container. If no video frame is available and timeout is set to -1, the function must block until the next video frame is available.

Parameters
framePointer to the available video frame to be sent to the anbox container.
timeoutmaximum number of milliseconds to wait for the next available frame. The following possible values for timeout must be handled:
timeout Behavior
0 Non-blocking mode; return -EIO immediately if no video frame to process.
< 0 Block indefinitely until a video frame is available.
> 0 Wait up to a maximum of timeout milliseconds for a video frame.

Definition at line 92 of file camera_processor.h.


The documentation for this class was generated from the following file: