Luke Sorenson | 13e2827 | 2018-11-09 14:43:16 -0500 | [diff] [blame] | 1 | // 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 | |
| 14 | namespace 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. |
| 19 | using SerializedSuccessStatus = std::vector<uint8_t>; |
Luke Sorenson | 1320dfb | 2018-12-04 18:09:15 -0500 | [diff] [blame^] | 20 | using SerializedPipelineState = std::vector<uint8_t>; |
Luke Sorenson | 13e2827 | 2018-11-09 14:43:16 -0500 | [diff] [blame] | 21 | |
| 22 | enum PerceptionInterfaceType { |
| 23 | INTERFACE_TYPE_UNKNOWN, |
| 24 | }; |
| 25 | |
| 26 | class 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 Sorenson | 1320dfb | 2018-12-04 18:09:15 -0500 | [diff] [blame^] | 38 | |
| 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 Sorenson | 13e2827 | 2018-11-09 14:43:16 -0500 | [diff] [blame] | 47 | }; |
| 48 | |
| 49 | } // namespace mri |
| 50 | |
| 51 | #endif // MEDIA_PERCEPTION_RTANALYTICS_H_ |