anbox-platform-sdk  1.23.0
Anbox Platform SDK API documentation
camera_processor.h
Go to the documentation of this file.
1 /*
2  * This file is part of Anbox Platform SDK
3  *
4  * Copyright 2021 Canonical Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef ANBOX_SDK_CAMERA_PROCESSOR_H_
20 #define ANBOX_SDK_CAMERA_PROCESSOR_H_
21 
23 
24 #include <errno.h>
25 #include <stdint.h>
26 #include <stddef.h>
27 
28 namespace anbox {
35  public:
36  CameraProcessor() = default;
37  virtual ~CameraProcessor() = default;
38  CameraProcessor(const CameraProcessor &) = delete;
40 
48  virtual int get_device_specs(AnboxCameraSpec** specs, size_t *specs_len) {
49  (void)specs;
50  (void)specs_len;
51  return -EINVAL;
52  }
53 
61  virtual int open_device(AnboxCameraSpec spec, AnboxCameraOrientation orientation) {
62  (void)spec;
63  (void)orientation;
64  return -EINVAL;
65  }
66 
71  virtual int close_device() {
72  return -EINVAL;
73  }
74 
92  virtual int read_frame(AnboxVideoFrame* frame, int timeout) {
93  (void) frame;
94  (void) timeout;
95  return -EIO;
96  }
97 
109  virtual int inject_frame(AnboxVideoFrame frame) {
110  (void) frame;
111  return -EIO;
112  }
113 };
114 } // namespace anbox
115 
116 #endif
CameraProcessor allows a plugin to respond to the camera actions triggered from Anobx and post video ...
virtual int close_device()
Close the camera device for not receiving video frames from the platform further.
virtual int get_device_specs(AnboxCameraSpec **specs, size_t *specs_len)
Get camera device specifications of the platform.
virtual int inject_frame(AnboxVideoFrame frame)
Inject a video frame into AnboxPlatform.
CameraProcessor & operator=(const CameraProcessor &)=delete
virtual ~CameraProcessor()=default
virtual int open_device(AnboxCameraSpec spec, AnboxCameraOrientation orientation)
Open the camera device and being ready for posting video frames to Android container.
CameraProcessor(const CameraProcessor &)=delete
virtual int read_frame(AnboxVideoFrame *frame, int timeout)
Read next available video frame.
AnboxCameraSpec represents the camera specification.
Definition: types.h:726
AnboxVideoFrame represents a single complete video frame.
Definition: types.h:742
AnboxCameraOrientation
describes the orientations that Anbox supports in the camea processor
Definition: types.h:706