blob: 376f894548c5c78a868d3e73ca6447f20cf9e160 [file] [log] [blame]
Luke Sorenson13e28272018-11-09 14:43:16 -05001// Copyright 2018 The Chromium OS Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef MEDIA_PERCEPTION_RTANALYTICS_H_
6#define MEDIA_PERCEPTION_RTANALYTICS_H_
7
8// This header needs to be buildable from both Google3 and outside, so it cannot
9// rely on Google3 dependencies.
10
11#include <string>
12#include <vector>
13
14namespace mri {
15
16// Typdefs for readability. Serialized protos are passed back and forth across
17// the boundary between platform2 code and librtanalytics.so.
18// Note that this alias is guaranteed to always have this type.
19using SerializedSuccessStatus = std::vector<uint8_t>;
Luke Sorenson1320dfb2018-12-04 18:09:15 -050020using SerializedPipelineState = std::vector<uint8_t>;
Luke Sorenson13e28272018-11-09 14:43:16 -050021
22enum PerceptionInterfaceType {
23 INTERFACE_TYPE_UNKNOWN,
24};
25
26class Rtanalytics {
27 public:
28 virtual ~Rtanalytics() = default;
29
30 // Asks the library to setup a particular configuration. Success status is
31 // filled in by the library side. The return value is the current list of
32 // perception interface types that are fulfilled by the current configuration
33 // set. This function can be called multiple times to setup multiple
34 // configurations. |success_status| cannot be null.
35 virtual std::vector<PerceptionInterfaceType> SetupConfiguration(
36 const std::string& configuration_name,
37 SerializedSuccessStatus* success_status) = 0;
Luke Sorenson1320dfb2018-12-04 18:09:15 -050038
39 // Returns the pipeline state of the given configuation.
40 virtual SerializedPipelineState GetPipelineState(
41 const std::string& configuration_name) const = 0;
42
43 // Sets the pipeline to the desired state and returns the new state.
44 virtual SerializedPipelineState SetPipelineState(
45 const std::string& configuration_name,
46 const SerializedPipelineState* desired_state) = 0;
Luke Sorenson13e28272018-11-09 14:43:16 -050047};
48
49} // namespace mri
50
51#endif // MEDIA_PERCEPTION_RTANALYTICS_H_