1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef I_ANIMATOR_SCENE_DATA_PROCESSOR_H 16 #define I_ANIMATOR_SCENE_DATA_PROCESSOR_H 17 18 #include <string> 19 #include "XperfEvt.h" 20 21 const int32_t ANIMATOR_MAX_POINTS = 2; 22 23 class IAnimatorSceneDataProcessor { 24 public: 25 struct AnimatorPoint { 26 BasicInfo basicInfo; 27 CommonInfo commonInfo; 28 }; 29 30 struct AnimatorRecord { 31 int64_t startTime {0}; 32 int32_t allReceviedPoint {ANIMATOR_MAX_POINTS}; 33 int32_t receviedPoint {0}; 34 bool hasStartPoint {false}; 35 AnimatorPoint animatorPoints[ANIMATOR_MAX_POINTS]; 36 }; 37 38 struct AnimatorMetrics { 39 BasicInfo basicInfo; 40 CommonInfo appInfo; 41 CommonInfo rsInfo; 42 bool focus; 43 }; 44 45 class MetricReporter { 46 public: 47 virtual void ReportMetrics(const AnimatorMetrics& metrics) = 0; 48 virtual ~MetricReporter() = default; 49 }; 50 51 virtual void ProcessSceneData(std::shared_ptr<XperfEvt> evt) = 0; 52 virtual void CreateRecord(std::shared_ptr<XperfEvt> evt, int32_t indexPoint) = 0; 53 virtual void DeleteRecord(const int32_t uniqueId) = 0; 54 virtual ~IAnimatorSceneDataProcessor() = default; 55 }; 56 #endif 57